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 287ef37..08a7321 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 114592a..4286cec 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 f41f5f3..8d55152 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 b9c0fb6..fb0f2e9 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 7b0cd8a..aacf747 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 3c4a8e4..3d64f68 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 9cbceb4..6ea2d18 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 6bd2e22..52b5c8c 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 abe029f..08063f8 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"