Take @ssgelm's advice in #155 and copy the mount table

df warnings no more :-)
This commit is contained in:
Anders Ingemann 2015-04-08 21:53:31 +02:00
parent 80ac206fb4
commit 4ad1d51624
2 changed files with 25 additions and 0 deletions

View file

@ -74,6 +74,8 @@ boot_partition_group = [filesystem.CreateBootMountDir,
mounting_group = [filesystem.CreateMountDir,
filesystem.MountRoot,
filesystem.MountSpecials,
filesystem.CopyMountTable,
filesystem.RemoveMountTable,
filesystem.UnmountRoot,
filesystem.DeleteMountDir,
]

View file

@ -115,6 +115,18 @@ class MountSpecials(Task):
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):
description = 'Unmounting the bootstrap volume'
phase = phases.volume_unmounting
@ -125,6 +137,17 @@ class UnmountRoot(Task):
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):
description = 'Deleting mountpoint for the bootstrap volume'
phase = phases.volume_unmounting