diff --git a/lib/initcpio/install/arch_base b/lib/initcpio/install/arch_base index 09a073298..d93567ec9 100644 --- a/lib/initcpio/install/arch_base +++ b/lib/initcpio/install/arch_base @@ -19,6 +19,7 @@ install () add_dir "/var/log" add_dir "/addons" add_dir "/home" + add_dir "/run" add_device "/dev/null" c 1 3 add_device "/dev/zero" c 1 5 add_device "/dev/console" c 5 1 diff --git a/usr/share/archboot/base/init b/usr/share/archboot/base/init index 56fc201c4..7af042a5a 100755 --- a/usr/share/archboot/base/init +++ b/usr/share/archboot/base/init @@ -4,7 +4,6 @@ ln -s /bin/bash /bin/sh ln -s /sbin/modprobe /bin/modprobe -msg ":: Loading Initramfs" /bin/mount -t proc proc /proc -o nosuid,noexec,nodev /bin/mount -t sysfs sys /sys -o nosuid,noexec,nodev @@ -19,8 +18,7 @@ else # /dev/mem is needed if we want to load uvesafb before triggering uevents /bin/mknod /dev/mem c 1 1 fi - -read CMDLINE /proc/sys/kernel/modprobe # set default mount handler mount_handler="default_mount_handler" +# parse the kernel command line +parse_cmdline + # if available, start udevd at this stage if [ -x /sbin/udevd ]; then msg ":: Starting udevd..." @@ -40,28 +41,6 @@ else udevd_running=0 fi -for cmd in ${CMDLINE}; do - case "${cmd}" in - \#*) break ;; # ignore everything after a # in the commandline - # The kernel passes those to the kernel on its own - [0123456Ss]) ;; - [0-9]*) ;; - single) ;; - rw) readwrite="yes" ;; - ro) readwrite="no" ;; - # only export stuff that does work :) - *=*) rhs="$(echo "${cmd}" | cut -d= -f2-)" - cmd="$(echo "${cmd}" | cut -d= -f1 | sed 's|\.|_|g')" - cmd="$(echo "${cmd}" | sed 's|-|_|g')=${rhs}" - (echo "${cmd}" | grep -qe '^[0-9]') || eval "${cmd}" - ;; - *) cmd="$(echo "${cmd}" | sed 's|\.|_|g')" - cmd="$(echo "${cmd}" | sed 's|-|_|g')" - (echo "${cmd}" | grep -qe '^[0-9]') || eval "${cmd}=y" - ;; - esac -done - if [ -n "${disablehooks}" ]; then for d in $(echo "${disablehooks}" | sed 's|,| |g'); do eval "hook_${d}=disabled" @@ -156,8 +135,12 @@ else done fi - mount --move /proc /new_root/proc - mount --move /sys /new_root/sys - mount --move /dev /new_root/dev + for d in proc sys dev run; do + if [ -d /new_root/${d} ]; then + /bin/mount --move /${d} /new_root/${d} + else + /bin/umount /${d} + fi + done exec /sbin/switch_root -c /dev/console /new_root ${init} "$@" fi \ No newline at end of file