main/postmarketos-initramfs: switch_root with /dev (MR 3230) (MR 4204)
Mount /dev (and /run) in initramfs so util-linux switch_root can move the mounts over to the new sysroot before changing root. BusyBox switch_root doesn't even attempt to move anything so use util-linux's switch_root for this. Explicitly disable tests too...
This commit is contained in:
parent
146c6b0f1c
commit
5f820deefc
5 changed files with 6 additions and 7 deletions
|
@ -4,6 +4,7 @@
|
|||
/etc
|
||||
/lib
|
||||
/proc
|
||||
/run
|
||||
/sbin
|
||||
/sys
|
||||
/sysroot
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
/sbin/btrfs
|
||||
/sbin/dmsetup
|
||||
/sbin/e2fsck
|
||||
/sbin/switch_root
|
||||
/usr/sbin/parted
|
||||
/usr/sbin/resize2fs
|
||||
/usr/sbin/resize.f2fs
|
||||
|
|
|
@ -5,6 +5,7 @@ pkgver=1.4.0
|
|||
pkgrel=0
|
||||
pkgdesc="Base files for the postmarketOS initramfs / initramfs-extra"
|
||||
url="https://postmarketos.org"
|
||||
options="!check" # no tests
|
||||
depends="
|
||||
btrfs-progs
|
||||
busybox-extras
|
||||
|
@ -21,6 +22,7 @@ depends="
|
|||
postmarketos-fde-unlocker
|
||||
postmarketos-mkinitfs
|
||||
unudhcpd
|
||||
util-linux-misc
|
||||
xz
|
||||
"
|
||||
source="
|
||||
|
|
|
@ -53,10 +53,6 @@ setup_bootchart2
|
|||
|
||||
# Switch root
|
||||
killall telnetd mdev udevd msm-fb-refresher 2>/dev/null
|
||||
umount /proc
|
||||
umount /sys
|
||||
umount /dev/pts
|
||||
umount /dev
|
||||
|
||||
# shellcheck disable=SC2093
|
||||
exec switch_root /sysroot "$init"
|
||||
|
|
|
@ -25,6 +25,8 @@ mount_proc_sys_dev() {
|
|||
# mdev
|
||||
mount -t proc -o nodev,noexec,nosuid proc /proc || echo "Couldn't mount /proc"
|
||||
mount -t sysfs -o nodev,noexec,nosuid sysfs /sys || echo "Couldn't mount /sys"
|
||||
mount -t devtmpfs -o mode=0755,nosuid dev /dev || echo "Couldn't mount /dev"
|
||||
mount -t tmpfs -o nosuid,nodev,mode=0755 run /run || echo "Couldn't mount /run"
|
||||
|
||||
mkdir /config
|
||||
mount -t configfs -o nodev,noexec,nosuid configfs /config
|
||||
|
@ -32,9 +34,6 @@ mount_proc_sys_dev() {
|
|||
# /dev/pts (needed for telnet)
|
||||
mkdir -p /dev/pts
|
||||
mount -t devpts devpts /dev/pts
|
||||
|
||||
# /run (needed for cryptsetup)
|
||||
mkdir /run
|
||||
}
|
||||
|
||||
create_device_nodes() {
|
||||
|
|
Loading…
Reference in a new issue