Browse Source

Move contents of devfs.sh script into service file

Conditionals can be eliminated, since we know exactely what the
situation looks like on Linux.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
master
David Oberhollenzer 2 years ago
parent
commit
628adf2e03
  1. 1
      .gitignore
  2. 1
      configure.ac
  3. 2
      scripts/Makemodule.am
  4. 21
      scripts/devfs.sh.in
  5. 18
      services/devfs.in

1
.gitignore

@ -8,7 +8,6 @@ configure
install-sh
missing
reboot
scripts/devfs.sh
scripts/ifrename.sh
scripts/modules_load.sh
services/devfs

1
configure.ac

@ -36,7 +36,6 @@ AC_CONFIG_FILES([services/sshd_keygen])
AC_CONFIG_FILES([services/mountusr])
AC_CONFIG_FILES([services/tmpfsvar])
AC_CONFIG_FILES([services/dhcpcd])
AC_CONFIG_FILES([scripts/devfs.sh])
AC_CONFIG_FILES([scripts/ifrename.sh])
AC_CONFIG_FILES([scripts/modules_load.sh])

2
scripts/Makemodule.am

@ -1,4 +1,4 @@
helper_SCRIPTS += scripts/devfs.sh scripts/trymount.sh scripts/ifrename.sh
helper_SCRIPTS += scripts/trymount.sh scripts/ifrename.sh
helper_SCRIPTS += scripts/ifdown.sh scripts/modules_load.sh
helper_SCRIPTS += scripts/setntpdate.sh scripts/overlay.sh

21
scripts/devfs.sh.in

@ -1,21 +0,0 @@
#!/bin/sh
mount -t devtmpfs none /dev
[ -c /dev/console ] || mknod -m 600 /dev/console c 5 1
[ -c /dev/tty ] || mknod -m 666 /dev/tty c 5 0
[ -c /dev/null ] || mknod -m 666 /dev/null c 1 3
[ -c /dev/kmsg ] || mknod -m 660 /dev/kmsg c 1 11
[ -e /dev/fd ] || ln -snf /proc/self/fd /dev/fd
[ -e /dev/stdin ] || ln -snf /proc/self/fd/0 /dev/stdin
[ -e /dev/stdout ] || ln -snf /proc/self/fd/1 /dev/stdout
[ -e /dev/stderr ] || ln -snf /proc/self/fd/2 /dev/stderr
[ -e /proc/kcore ] && ln -snf /proc/kcore /dev/core
mkdir -p /dev/mqueue -m 1777
mkdir -p /dev/pts -m 0755
mkdir -p /dev/shm -m 1777
@SCRIPTDIR@/trymount.sh "/dev/mqueue" "mqueue" "noexec,nosuid,nodev"
@SCRIPTDIR@/trymount.sh "/dev/pts" "devpts" "noexec,nosuid,gid=5,mode=0620"
@SCRIPTDIR@/trymount.sh "/dev/shm" "tmpfs" "noexec,nosuid,nodev,mode=1777"

18
services/devfs.in

@ -3,4 +3,20 @@ type wait
target boot
after procfs sysfs
before vfs
exec "@SCRIPTDIR@/devfs.sh"
exec {
mount -t devtmpfs none /dev
ln -snf /proc/self/fd /dev/fd
ln -snf /proc/self/fd/0 /dev/stdin
ln -snf /proc/self/fd/1 /dev/stdout
ln -snf /proc/self/fd/2 /dev/stderr
ln -snf /proc/kcore /dev/core
mkdir -p /dev/mqueue -m 1777
mkdir -p /dev/pts -m 0755
mkdir -p /dev/shm -m 1777
"@SCRIPTDIR@/trymount.sh" /dev/mqueue mqueue noexec,nosuid,nodev
"@SCRIPTDIR@/trymount.sh" /dev/pts devpts noexec,nosuid,gid=5,mode=0620
"@SCRIPTDIR@/trymount.sh" /dev/shm tmpfs noexec,nosuid,nodev,mode=1777
}

Loading…
Cancel
Save