[arch-projects] [mkinitcpio] [RFC 0/2] Introduce /run
This patchset introduces /run into mkinitcpio. The size and mode options of the tmpfs should be the same in mkinitcpio and initscripts. Please comment.
- Loop over dev, sys, proc instead of repeating the same command. - If the target directory does not exist, umount instead of moving. --- init | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/init b/init index f242dc1..d030f5f 100644 --- a/init +++ b/init @@ -151,7 +151,11 @@ if [ -n "${udevpid}" ]; then 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; 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} "$@" -- 1.7.4.2
Mount /run as a 10MB tmpfs with 1777 permissions early. Move it to /new_root when switching. --- init | 3 ++- install/base | 1 + 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/init b/init index d030f5f..a772e7f 100644 --- a/init +++ b/init @@ -18,6 +18,7 @@ else # /dev/mem is needed if we want to load uvesafb before triggering uevents /bin/mknod /dev/mem c 1 1 fi +/bin/mount -t tmpfs run /run -o nosuid,noexec,nodev,mode=1777,size=10M read CMDLINE </proc/cmdline @@ -151,7 +152,7 @@ if [ -n "${udevpid}" ]; then done fi -for d in proc sys dev; do +for d in proc sys dev run; do if [ -d /new_root/${d} ]; then /bin/mount --move /${d} /new_root/${d} else diff --git a/install/base b/install/base index d1aa176..4a0ff14 100644 --- a/install/base +++ b/install/base @@ -12,6 +12,7 @@ install () add_dir "/usr/bin" add_dir "/usr/lib" add_dir "/usr/sbin" + add_dir "/run" add_device "/dev/null" c 1 3 add_device "/dev/zero" c 1 5 -- 1.7.4.2
On 2011/4/8 Thomas Bächler <thomas@archlinux.org> wrote:
This patchset introduces /run into mkinitcpio. The size and mode options of the tmpfs should be the same in mkinitcpio and initscripts. Please comment.
Hello, I don't run understand why there is a need for /run in mkinitcpio. Shouldn't this be in /etc/fstab like any other userland filesystem? Rémy.
On Fri, Apr 08, 2011 at 08:00:44PM +0200, Rémy Oudompheng wrote:
On 2011/4/8 Thomas Bächler <thomas@archlinux.org> wrote:
This patchset introduces /run into mkinitcpio. The size and mode options of the tmpfs should be the same in mkinitcpio and initscripts. Please comment.
Hello,
I don't run understand why there is a need for /run in mkinitcpio. Shouldn't this be in /etc/fstab like any other userland filesystem?
Rémy.
as of udev 167, udev's database will use /run/udev if its available. dave
Am 08.04.2011 20:00, schrieb Rémy Oudompheng:
On 2011/4/8 Thomas Bächler <thomas@archlinux.org> wrote:
This patchset introduces /run into mkinitcpio. The size and mode options of the tmpfs should be the same in mkinitcpio and initscripts. Please comment.
Hello,
I don't run understand why there is a need for /run in mkinitcpio. Shouldn't this be in /etc/fstab like any other userland filesystem?
Programs that run in early userspace can leave permanent information behind, like udev, mdadm. I don't know if this is very helpful right now, but if I understand this right, it will become de-facto standard.
participants (3)
-
Dave Reisner
-
Rémy Oudompheng
-
Thomas Bächler