summaryrefslogtreecommitdiffstats
path: root/recipes-sota/ostree-initrd/files/init.sh
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-sota/ostree-initrd/files/init.sh')
-rw-r--r--recipes-sota/ostree-initrd/files/init.sh22
1 files changed, 4 insertions, 18 deletions
diff --git a/recipes-sota/ostree-initrd/files/init.sh b/recipes-sota/ostree-initrd/files/init.sh
index d7e0429..4818a07 100644
--- a/recipes-sota/ostree-initrd/files/init.sh
+++ b/recipes-sota/ostree-initrd/files/init.sh
@@ -41,7 +41,6 @@ do_mount_fs sysfs /sys
41do_mount_fs devtmpfs /dev 41do_mount_fs devtmpfs /dev
42do_mount_fs devpts /dev/pts 42do_mount_fs devpts /dev/pts
43do_mount_fs tmpfs /dev/shm 43do_mount_fs tmpfs /dev/shm
44do_mount_fs tmpfs /tmp
45do_mount_fs tmpfs /run 44do_mount_fs tmpfs /run
46 45
47# check if smack is active (and if so, mount smackfs) 46# check if smack is active (and if so, mount smackfs)
@@ -63,23 +62,10 @@ mount "$ostree_sysroot" /sysroot || {
63 sleep 5 62 sleep 5
64 mount "$ostree_sysroot" /sysroot || bail_out "Unable to mount $ostree_sysroot as physical sysroot" 63 mount "$ostree_sysroot" /sysroot || bail_out "Unable to mount $ostree_sysroot as physical sysroot"
65} 64}
66ostree-prepare-root /sysroot
67
68# move mounted devices to new root
69cd /sysroot
70for x in dev proc run; do
71 log_info "Moving /$x to new rootfs"
72 mount -o move "/$x" "$x"
73done
74
75# switch to new rootfs
76log_info "Switching to new rootfs"
77mkdir -p run/initramfs
78 65
79pivot_root . run/initramfs || bail_out "pivot_root failed." 66ostree-prepare-root /sysroot
80
81log_info "Launching target init"
82 67
83exec chroot . sh -c 'umount /run/initramfs; exec /sbin/init' \ 68log_info "Switching to rootfs"
84 <dev/console >dev/console 2>&1 69exec switch_root /sysroot /sbin/init
85 70
71bail_out "Failed to switch_root to $ostree_sysroot"