From 64e47b3b9bf216c90d528f74879963a136176507 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sat, 12 Mar 2022 16:04:58 -0600 Subject: [PATCH] initramfs: Mount proc et al. earlier The `/proc` filesystem has to be mounted before the kernel command line arguments can be parsed. --- initramfs/overlay/sbin/init | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/initramfs/overlay/sbin/init b/initramfs/overlay/sbin/init index 639d15b..a92de0b 100755 --- a/initramfs/overlay/sbin/init +++ b/initramfs/overlay/sbin/init @@ -2,6 +2,11 @@ export PATH=/usr/sbin:/usr/bin:/sbin:/bin +mkdir -p /proc /run /sys +mount -t sysfs sysfs /sys +mount -t proc proc /proc +mount -t tmpfs tmpfs /run + # shellcheck disable=SC2046 set -- $(cat /proc/cmdline) while [ $# -ge 1 ]; do @@ -15,11 +20,6 @@ while [ $# -ge 1 ]; do shift done -mkdir -p /proc /run /sys -mount -t sysfs sysfs /sys -mount -t proc proc /proc -mount -t tmpfs tmpfs /run - for path in /sys/class/net/*; do [ -e "${path}" ] || continue ip link set "${path##*/}" up