# HG changeset patch # User Pascal Bellard # Date 1338640276 -7200 # Node ID 14dc38448adfdd3b3929e5131997086a684bf58a # Parent 6b2d11ed8718798eb49159ac7b19b9f38365b6fd /etc/init.d/rcS, /init: use /run diff -r 6b2d11ed8718 -r 14dc38448adf etc/init.d/rcS --- a/etc/init.d/rcS Sat Jun 02 14:12:23 2012 +0200 +++ b/etc/init.d/rcS Sat Jun 02 14:31:16 2012 +0200 @@ -24,11 +24,6 @@ echo -n "Mounting proc filesystem on /proc" mount proc && status -# Mount /run as tmpfs runtime data are not written to disk -echo -n "Mounting tmpfs filesystem on: /run" -mount -t tmpfs tmpfs /run -status - # Trigger Udev and handle hotplug events if [ "$UDEV" == "yes" ]; then echo -n "Mounting devtmpfs filesystem on: /dev" @@ -210,17 +205,17 @@ *) # --> readonly --> readwrite - if [ ! -s /tmp/boot.log ]; then - mount -t tmpfs tmpfs /tmp + if [ ! -s /run/boot.log ]; then + # Mount /run as tmpfs runtime data are not written to disk + mount -t tmpfs tmpfs /run fi - /etc/init.d/rcS readonly 2>&1 | tee -a /tmp/boot.log + /etc/init.d/rcS readonly 2>&1 | tee -a /run/boot.log # Logrotate boot.log last=.9 for i in .8 .7 .6 .5 .4 .3 .2 .1 .0 '' ; do mv -f /var/log/boot.log${i} /var/log/boot.log${last} 2>/dev/null last=$i done - mv -f /tmp/boot.log /var/log/boot.log - umount /tmp + mv -f /run/boot.log /var/log/boot.log /etc/init.d/rcS readwrite 2>&1 | tee -a /var/log/boot.log ;; esac diff -r 6b2d11ed8718 -r 14dc38448adf init --- a/init Sat Jun 02 14:12:23 2012 +0200 +++ b/init Sat Jun 02 14:31:16 2012 +0200 @@ -2,7 +2,7 @@ success() { - cat > /tmp/init + cat > /run/init [ -d /proc/sys ] && umount /proc echo -e "\\033[70G[ \\033[1;32mOK\\033[0;39m ]" exit @@ -10,7 +10,7 @@ launch_init() { - mount --move /tmp /mnt/tmp + mount --move /run /mnt/run success <&1 | tee /tmp/boot.log - . /tmp/init + mount -t tmpfs tmpfs /run + /init logged 2>&1 | tee /run/boot.log + . /run/init else mount -t proc proc /proc mount -t sysfs sysfs /sys @@ -157,13 +157,13 @@ subroot="/$(sed 's/.*subroot=\([^ ]*\).*/\1/' < /proc/cmdline)" && echo -n "Chrooting to $subroot..." mount --move /dev/pts /mnt$subroot/dev/pts - tmp=$subroot/tmp - mount --move /tmp /mnt$tmp + run=$subroot/run + mount --move /run /mnt$run cp $(LD_TRACE_LOADED_OBJECTS=1 /lib/ld*.so /usr/sbin/chroot | sed \ - 's|.*=> \(/lib/l[^ ]*\).*|\1|;/^\//!d') /usr/sbin/chroot /mnt$tmp + 's|.*=> \(/lib/l[^ ]*\).*|\1|;/^\//!d') /usr/sbin/chroot /mnt$run success < /tmp/init +echo "exec /sbin/init" > /run/init if [ $free -lt 100 ] || ! mount -t tmpfs $size tmpfs /mnt; then echo -e "\\033[70G[ \\033[1;33mSkipped\\033[0;39m]" exit