]> git.proxmox.com Git - pve-installer.git/commitdiff
mount /run as tmpfs in chroot and bindmount to target root
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 22 May 2019 08:11:55 +0000 (10:11 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 22 May 2019 08:11:56 +0000 (10:11 +0200)
ensures things like LVM can work fine

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
proxinstall
unconfigured.sh

index 57bc8bf39dc2d5d078337555a1a0227783596ff3..2c44567f4dc9d6eee437d5e8223fc36733ab4031 100755 (executable)
@@ -1289,6 +1289,11 @@ sub extract_data {
            }
        }
 
+       mkdir "$targetdir/mnt";
+       mkdir "$targetdir/mnt/hostrun";
+       syscmd("mount --bind /run $targetdir/mnt/hostrun") == 0 ||
+           die "unable to bindmount run on $targetdir/mnt/hostrun\n";
+
        update_progress(1, 0.05, $maxper, "extracting base system");
 
        my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size) = stat ($basefile);
@@ -1318,6 +1323,8 @@ sub extract_data {
            die "unable to mount proc on $targetdir/proc\n";
        syscmd("mount -n -t sysfs sysfs $targetdir/sys") == 0 ||
            die "unable to mount sysfs on $targetdir/sys\n";
+       syscmd("chroot $targetdir mount --bind /mnt/hostrun /run") == 0 ||
+           die "unable to re-bindmount hostrun on /run in chroot\n";
 
        update_progress(1, $maxper, 0.5, "configuring base system");
 
@@ -1675,6 +1682,8 @@ _EOD
        syscmd("chroot $targetdir /usr/bin/dpkg-query -W --showformat='\${package}\n'> final.pkglist");
     }
 
+    syscmd("umount $targetdir/run");
+    syscmd("umount $targetdir/mnt/hostrun");
     syscmd("umount $targetdir/tmp");
     syscmd("umount $targetdir/proc");
     syscmd("umount $targetdir/sys");
index fbf9d45575b6ca06e6cc14e9b028e693b2ce9ba5..674605f66259b62f7e9e0e7292bef065558b6930 100755 (executable)
@@ -40,6 +40,7 @@ real_reboot() {
 
     umount -l -n /target >/dev/null 2>&1
     umount -l -n /dev
+    umount -l -n /run
     umount -l -n /sys
     umount -l -n /proc
 
@@ -62,6 +63,7 @@ export SYSTEMD_IGNORE_CHROOT=1
 
 mount -n -t proc proc /proc
 mount -n -t sysfs sysfs /sys
+mount -n -t tmpfs tmpfs /run
 
 parse_cmdline