2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 17:23:08 +00:00

mount devfs in rootimg during genimage

This commit is contained in:
immarvin 2016-03-08 00:46:37 -05:00
parent bd918e47e8
commit 7211213d4c

View File

@ -1969,12 +1969,14 @@ sub mount_chroot {
my $kerneldir = shift;
#postinstall script of package installation
#might access the /proc, /sys filesystem
#might access the /proc, /sys and /dev filesystem
#mount them from host read-only
system("mkdir -p $rootimage_dir/proc");
system("mount proc $rootimage_dir/proc -t proc -o ro");
system("mkdir -p $rootimage_dir/sys");
system("mount sysfs $rootimage_dir/sys -t sysfs -o ro");
system("mkdir -p $rootimage_dir/dev");
system("mount sysfs $rootimage_dir/dev -t devfs -o ro");
if ($pkgdir) {
if (-d $pkgdir) {
@ -2009,6 +2011,7 @@ sub umount_chroot {
system("umount $rootimage_dir/proc");
system("umount $rootimage_dir/sys");
system("umount $rootimage_dir/dev");
system("umount $rootimage_dir/mnt/pkgdir");
rmdir("$rootimage_dir/mnt/pkgdir");