mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
Take @ssgelm's advice in #155 and copy the mount table
df warnings no more :-)
This commit is contained in:
parent
80ac206fb4
commit
4ad1d51624
2 changed files with 25 additions and 0 deletions
|
@ -74,6 +74,8 @@ boot_partition_group = [filesystem.CreateBootMountDir,
|
||||||
mounting_group = [filesystem.CreateMountDir,
|
mounting_group = [filesystem.CreateMountDir,
|
||||||
filesystem.MountRoot,
|
filesystem.MountRoot,
|
||||||
filesystem.MountSpecials,
|
filesystem.MountSpecials,
|
||||||
|
filesystem.CopyMountTable,
|
||||||
|
filesystem.RemoveMountTable,
|
||||||
filesystem.UnmountRoot,
|
filesystem.UnmountRoot,
|
||||||
filesystem.DeleteMountDir,
|
filesystem.DeleteMountDir,
|
||||||
]
|
]
|
||||||
|
|
|
@ -115,6 +115,18 @@ class MountSpecials(Task):
|
||||||
root.add_mount('none', 'dev/pts', ['--types', 'devpts'])
|
root.add_mount('none', 'dev/pts', ['--types', 'devpts'])
|
||||||
|
|
||||||
|
|
||||||
|
class CopyMountTable(Task):
|
||||||
|
description = 'Copying mtab from host system'
|
||||||
|
phase = phases.os_installation
|
||||||
|
predecessors = [MountSpecials]
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def run(cls, info):
|
||||||
|
import shutil
|
||||||
|
import os.path
|
||||||
|
shutil.copy('/proc/mounts', os.path.join(info.root, 'etc/mtab'))
|
||||||
|
|
||||||
|
|
||||||
class UnmountRoot(Task):
|
class UnmountRoot(Task):
|
||||||
description = 'Unmounting the bootstrap volume'
|
description = 'Unmounting the bootstrap volume'
|
||||||
phase = phases.volume_unmounting
|
phase = phases.volume_unmounting
|
||||||
|
@ -125,6 +137,17 @@ class UnmountRoot(Task):
|
||||||
info.volume.partition_map.root.unmount()
|
info.volume.partition_map.root.unmount()
|
||||||
|
|
||||||
|
|
||||||
|
class RemoveMountTable(Task):
|
||||||
|
description = 'Removing mtab'
|
||||||
|
phase = phases.volume_unmounting
|
||||||
|
successors = [UnmountRoot]
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def run(cls, info):
|
||||||
|
import os
|
||||||
|
os.remove(os.path.join(info.root, 'etc/mtab'))
|
||||||
|
|
||||||
|
|
||||||
class DeleteMountDir(Task):
|
class DeleteMountDir(Task):
|
||||||
description = 'Deleting mountpoint for the bootstrap volume'
|
description = 'Deleting mountpoint for the bootstrap volume'
|
||||||
phase = phases.volume_unmounting
|
phase = phases.volume_unmounting
|
||||||
|
|
Loading…
Add table
Reference in a new issue