fifteen: move /var/run to /run.
authorArne Fitzenreiter <arne_f@ipfire.org>
Sun, 12 Jan 2014 11:15:44 +0000 (12:15 +0100)
committerArne Fitzenreiter <arne_f@ipfire.org>
Sun, 12 Jan 2014 11:15:44 +0000 (12:15 +0100)
config/rootfiles/common/cyrus-sasl
config/rootfiles/common/stage2
config/rootfiles/core/76/update.sh
lfs/Config
lfs/dracut
lfs/stage2
src/initscripts/init.d/mountkernfs
src/install+setup/install/main.c
src/patches/dracut-006_add_run_dir.patch [moved from src/patches/dracut-006_add_run_symlink.patch with 90% similarity]

index 287ef378cb4f67cdac907d72744dda1e788c80d3..08a732182b60f04d9793a8602bf391d412380313 100644 (file)
@@ -87,4 +87,3 @@ usr/sbin/saslpasswd2
 #usr/share/man/man8/sasldblistusers2.8
 #usr/share/man/man8/saslpasswd2.8
 var/lib/sasl
-var/run/saslauthd
index 114592a8e4d0d201a6202bc7231cfa15e8b40f30..4286cec995660a72e0a1b92728a17d1cb738c03f 100644 (file)
@@ -152,7 +152,6 @@ var/log/wtmp
 var/mail
 #var/opt
 var/run
-var/run/utmp
 #var/spool
 var/tmp
 dev/console
index f41f5f39d86c41b1d6d6d51275481c66b167361d..8d55152486da009b056ab3274337090c256ed365 100644 (file)
@@ -179,6 +179,19 @@ for i in $(find /etc/modprobe.d/* | grep -v ".conf"); do
        mv $i $i.conf
 done
 
+# Move /var/run to /run.
+if [ -L "/run" ]; then
+       rm -f /run
+fi
+
+mkdir -p /run
+if mountpoint /var/run; then
+       mount --move /var/run /run
+       rm -rf /var/run
+fi
+
+ln -svf ../run /var/run
+
 #
 #Extract files
 tar xavf /opt/pakfire/tmp/files* --no-overwrite-dir -p --numeric-owner -C /
index b9c0fb68aa816f26aac6f6ad6cbe02a8ceed787e..fb0f2e9a2f92c2f2238e14e8b0e9b10164db1396 100644 (file)
@@ -68,7 +68,7 @@ KGCC = gcc
 #
 define FIND_FILES
        cd $(ROOT)/ && find -mount \
-       -not -path './tools*' -not -path './tmp*' -not -path './usr/src*' \
+       -not -path './tools*' -not -path './tmp*' -not -path './usr/src*' -not -path './run/*' \
        -not -path './dev*' -not -path './proc*' -not -path './install*' | sort
 endef
 
index 7b0cd8a60588a9b5ea220794f89b830d33ddda95..aacf7474f69da3408d0a334c99a245d0615bd3ee 100644 (file)
@@ -73,7 +73,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
 
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/dracut-006_lzma.patch
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/dracut-006_remove_cdrom_wait.patch
-       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/dracut-006_add_run_symlink.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/dracut-006_add_run_dir.patch
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/dracut-006_remove_scsi_wait.patch
 
        cd $(DIR_APP) && cp -vf $(DIR_SRC)/src/dracut/switch_root.c .
index 3c4a8e4482857c3c74aa9b9bc44aa651438e9ad7..3d64f6839970ac82b223f5fbdc34ca16927afe64 100644 (file)
@@ -49,7 +49,7 @@ $(TARGET) :
        @$(PREBUILD)
 
        # Create directories
-       -mkdir -pv /{bin,boot,etc/opt,etc/modprobe.d,home,lib,mnt,opt}
+       -mkdir -pv /{bin,boot,etc/opt,etc/modprobe.d,home,lib,mnt,opt,run}
        -mkdir -pv /{media/{floppy,cdrom,usbkey},sbin,srv,var}
        -install -dv -m 0750 /root
        -install -dv -m 1777 /tmp /var/tmp
@@ -60,6 +60,9 @@ $(TARGET) :
        #-for dir in /usr /usr/local; do \
        #  ln -sv share/{man,doc,info} $$dir; \
        #done
+
+       # Symlink /var/run -> /run.
+       ln -svf ../run /var/run
        
        # Symlinks
        # for this reason, stage2 rebuild will broke the iso:perl, grubbatch
@@ -103,16 +106,13 @@ $(TARGET) :
        chown -R nobody:nobody /home/nobody
 
        # Create /var dirs and files
-       -mkdir -v /var/{lock,log,mail,run,spool,empty}
+       -mkdir -v /var/{lock,log,mail,spool,empty}
        -mkdir -pv /var/{opt,cache,lib/{misc,locate},local}
        -mkdir -pv /var/log/{counter,calamaris}
        chown nobody.nobody /var/log/calamaris
-       touch /var/run/utmp /var/log/{btmp,lastlog,wtmp,net-traffic.log}
-       chgrp -v utmp /var/run/utmp /var/log/lastlog
-       chmod -v 664 /var/run/utmp /var/log/lastlog
-
-       # Create /run symlink
-       ln -s /var/run /run
+       touch /var/log/{btmp,lastlog,wtmp,net-traffic.log}
+       chgrp -v utmp /var/log/lastlog
+       chmod -v 664 /var/log/lastlog
 
        # Permissions
        chmod 0711 /var/empty
index 9cbceb4d065e97e26d806a9da7e0adc9546d349e..6ea2d188f51914633f239da6c38c86351d526a85 100644 (file)
@@ -29,6 +29,11 @@ case "${1}" in
                        mount -n -t sysfs /sys /sys || failed=1
                fi
 
+               if ! mountpoint /run &> /dev/null; then
+                       boot_mesg -n " /run" ${NORMAL}
+                       mount -n -t tmpfs,nosuid,nodev,mode=755 /run /run || failed=1
+               fi
+
                boot_mesg "" ${NORMAL}
 
                (exit ${failed})
index 6bd2e222857e8df2272d822bd220cd3623d5ab44..52b5c8ceae0b5096ebd551143b723eb7bb7d3088 100644 (file)
@@ -433,8 +433,7 @@ int main(int argc, char *argv[])
        mkdir("/harddisk/boot", S_IRWXU|S_IRWXG|S_IRWXO);
        mkdir("/harddisk/var", S_IRWXU|S_IRWXG|S_IRWXO);
        mkdir("/harddisk/var/log", S_IRWXU|S_IRWXG|S_IRWXO);
-       mkdir("/harddisk/var/run", S_IRWXU|S_IRWXG|S_IRWXO);
-       
+
        snprintf(commandstring, STRING_SIZE, "/bin/mount %s1 /harddisk/boot", hdparams.devnode_part);
        if (runcommandwithstatus(commandstring, ctr[TR_MOUNTING_BOOT_FILESYSTEM]))
        {
similarity index 90%
rename from src/patches/dracut-006_add_run_symlink.patch
rename to src/patches/dracut-006_add_run_dir.patch
index abe029fcc0b2e134a433219ca61f29da7d8c10dd..08063f8abc9c50ae4c3fbd9286a2cc5c2d2452cd 100644 (file)
@@ -5,8 +5,8 @@ diff -Naur dracut-006.org/modules.d/99base/init dracut-006/modules.d/99base/init
  
  ln -s /proc/self/fd /dev/fd >/dev/null 2>&1
  
-+# Add run symlink
-+ln -s /var/run /run
++# create run dir
++mkdir run
 +
  if getarg rdinitdebug; then
      getarg quiet && DRACUT_QUIET="yes"