diff options
author | Nicolás Reynolds <apoyosis@correo.inta.gob.ar> | 2012-02-02 11:20:19 -0300 |
---|---|---|
committer | Nicolás Reynolds <apoyosis@correo.inta.gob.ar> | 2012-02-02 11:20:19 -0300 |
commit | 9ad92500fdf09bad8be7fa5b68e9c45414f77819 (patch) | |
tree | 31aa0d2454145f98aaba196b5561714fcff7ce8b /rc.sysinit | |
parent | 4b1f5945f1d544b5e25ef9a86ebc3d28515c233a (diff) | |
parent | f31bbefc876aadbd9eee3750a1a1a606a2053028 (diff) |
Merge git://projects.archlinux.org/initscripts
Diffstat (limited to 'rc.sysinit')
-rwxr-xr-x | rc.sysinit | 65 |
1 files changed, 31 insertions, 34 deletions
@@ -13,23 +13,22 @@ printhl "You're booting into a /libre/ version of Archlinux" printsep # mount /proc, /sys, /run, /dev, /run/lock, /dev/pts, /dev/shm (the api filesystems) -mountpoint -q /proc || mount -n -t proc proc /proc -o nosuid,noexec,nodev -mountpoint -q /sys || mount -n -t sysfs sys /sys -o nosuid,noexec,nodev -mountpoint -q /run || mount -n -t tmpfs run /run -o mode=0755,nosuid,nodev -mountpoint -q /dev || mount -n -t devtmpfs udev /dev -o mode=0755,nosuid || - mount -n -t tmpfs udev /dev -o mode=0755,nosuid +mountpoint -q /proc || mount -t proc proc /proc -o nosuid,noexec,nodev +mountpoint -q /sys || mount -t sysfs sys /sys -o nosuid,noexec,nodev +mountpoint -q /run || mount -t tmpfs run /run -o mode=0755,nosuid,nodev +mountpoint -q /dev || mount -t devtmpfs dev /dev -o mode=0755,nosuid mkdir -p -m 1777 /run/lock mkdir -p /dev/{pts,shm} -mountpoint -q /dev/pts || mount -n /dev/pts &>/dev/null || +mountpoint -q /dev/pts || mount /dev/pts &>/dev/null || mount -n -t devpts devpts /dev/pts -o mode=0620,gid=5,nosuid,noexec -mountpoint -q /dev/shm || mount -n /dev/shm &>/dev/null || +mountpoint -q /dev/shm || mount /dev/shm &>/dev/null || mount -n -t tmpfs shm /dev/shm -o mode=1777,nosuid,nodev if [[ ! -e /run/initramfs/fsck-root ]]; then # remount root ro to allow for fsck later on, we remount now to # make sure nothing can open files rw on root which would block a remount findmnt / --options ro &>/dev/null || - status "Mounting Root Read-Only" mount -n -o remount,ro / + status "Mounting Root Read-Only" mount -o remount,ro / fi run_hook sysinit_start @@ -41,6 +40,10 @@ if [[ ! -a /usr/lib ]] ; then printf "${C_FAIL}/usr is not mounted. This is not supported.${C_OTHER}\n" fi +if [[ ! $(grep devtmpfs /proc/filesystems) ]] ; then + printf "${C_FAIL}Your kernel does not have devtmpfs support. This is not supported.${C_OTHER}\n" +fi + HWCLOCK_PARAMS="--systz" case $HARDWARECLOCK in "") ;; @@ -53,18 +56,9 @@ if [[ $HWCLOCK_PARAMS ]]; then stat_busy "Adjusting system time and setting kernel timezone" # enable rtc access modprobe -q -a rtc-cmos rtc genrtc - # If devtmpfs is used, the required RTC device already exists now - # Otherwise, create whatever device is available - if ! [[ -c /dev/rtc || -c /dev/rtc0 ]]; then - for dev in /sys/class/rtc/rtc0/dev /sys/class/misc/rtc/dev; do - [[ -e $dev ]] || continue - IFS=: read -r major minor < "$dev" - mknod /dev/rtc c $major $minor - done - fi # Adjust the system time for timezone offset if rtc is not in UTC - # 1. Make creation time on udev nodes sane (FS#8665) + # 1. Make creation time on device nodes sane (FS#8665) # 2. Filesystem checks can depend on system time # 3. This also sets the kernel time zone, used by e.g. vfat # If TIMEZONE is not set in rc.conf, the timezone stored in /etc/localtime @@ -182,25 +176,25 @@ fi # Check filesystems [[ -f /forcefsck ]] || in_array forcefsck $(< /proc/cmdline) && FORCEFSCK="-- -f" declare -r FORCEFSCK -run_hook sysinit_prefsck -if [[ -x $(type -P fsck) ]]; then - stat_busy "Checking Filesystems" - fsck_all >|"${FSCK_OUT:-/dev/stdout}" 2>|"${FSCK_ERR:-/dev/stdout}" - declare -r fsckret=$? - (( fsckret <= 1 )) && stat_done || stat_fail -else - declare -r fsckret=0 -fi -run_hook sysinit_postfsck -# Single-user login and/or automatic reboot if needed -fsck_reboot $fsckret +if [[ -n $FORCEFSCK ]] || { [[ ! -f /fastboot ]] && ! in_array fastboot $(< /proc/cmdline); }; then + run_hook sysinit_prefsck + if [[ -x $(type -P fsck) ]]; then + stat_busy "Checking Filesystems" + fsck_all >|"${FSCK_OUT:-/dev/stdout}" 2>|"${FSCK_ERR:-/dev/stdout}" + declare -r fsckret=$? + (( fsckret <= 1 )) && stat_done || stat_fail + else + declare -r fsckret=0 + fi + run_hook sysinit_postfsck + + # Single-user login and/or automatic reboot if needed + fsck_reboot $fsckret +fi status "Remounting Root" \ - mount -n -o remount / - -# force linkage of /etc/mtab to the kernel -[[ -L /etc/mtab ]] || ln -sf /proc/self/mounts /etc/mtab + mount -o remount / # now mount all the local filesystems run_hook sysinit_premount @@ -225,6 +219,9 @@ RANDOM_SEED=/var/lib/misc/random-seed # Remove leftover files remove_leftover +if [[ -s /etc/hostname ]]; then + HOSTNAME=$(< /etc/hostname) +fi if [[ $HOSTNAME ]]; then stat_busy "Setting Hostname: $HOSTNAME" echo "$HOSTNAME" >| /proc/sys/kernel/hostname && stat_done || stat_fail |