base-files: add /run directory from FHS 3 draft specification
PATCH v4 1/1 base-files: add /run directory from FHS 3 draft specification
This adds the /run directory from the Filesystem Hierarchy Standard 3.0 Draft [1] and refactors the filesystem as follows:
- Remove creation of /var/volatile/run
- Remove creation of /var/volatile/lock
- Remove symbolic link from /var/run to /var/volatile/run
- Remove symbolic link from /var/lock to /var/volatile/lock
- Add symbolic link from /var/run to /run
- Add symbolic link from /var/lock -> /run/lock
- Add /run to /etc/fstab for sysvinit compatibility
The systemd init script has been modified as follows:
- Do not create /var/volatile/run
- Do not create symbolic link from /run to /var/run if /run doesn't exist
A few things have also been cleaned up:
- Remove udev workaround to ensure /run exists
- Remove clearing of /var/run as it points to a tmpfs anyway
- Remove permissions workaround for /var/run/utmp as systemd-update-utmp-runlevel.service starts correctly without it
[1] http://www.linuxbase.org/betaspecs/fhs/fhs.html#runRuntimeVariableData
--- meta/files/fs-perms.txt | 5 ++--- meta/recipes-core/base-files/base-files/fstab | 1 + meta/recipes-core/base-files/base-files_3.0.14.bb | 10 +++++----- meta/recipes-core/initscripts/initscripts-1.0/volatiles | 7 +++---- meta/recipes-core/systemd/systemd/00-create-volatile.conf | 2 -- meta/recipes-core/systemd/systemd/init | 4 ---- meta/recipes-core/systemd/systemd/var-run.conf | 4 ---- meta/recipes-core/systemd/systemd_204.bb | 3 --- meta/recipes-core/udev/udev.inc | 6 +----- meta/recipes-core/udev/udev/init | 1 - meta/recipes-core/udev/udev/volatiles | 1 - 11 files changed, 12 insertions(+), 32 deletions(-) delete mode 100644 meta/recipes-core/systemd/systemd/var-run.conf delete mode 100644 meta/recipes-core/udev/udev/volatiles
meta/files/fs-perms.txt +2 -3
@@ -45,15 +45,14 @@ ${oldincludedir} 0755 root root true 0644 root root # Items from base-files # Links -${localstatedir}/run link volatile/run +${localstatedir}/run link /run ${localstatedir}/log link volatile/log -${localstatedir}/lock link volatile/lock +${localstatedir}/lock link /run/lock ${localstatedir}/tmp link volatile/tmp # Special permissions from base-files # Set 1777 /tmp 01777 root root false - - - -${localstatedir}/volatile/lock 01777 root root false - - - ${localstatedir}/volatile/tmp 01777 root root false - - - # Set 2775
meta/recipes-core/base-files/base-files/fstab +1 -0
@@ -4,6 +4,7 @@ rootfs / auto defaults 1 1 proc /proc proc defaults 0 0 devpts /dev/pts devpts mode=0620,gid=5 0 0 usbdevfs /proc/bus/usb usbdevfs noauto 0 0 +tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0 tmpfs /var/volatile tmpfs defaults 0 0 tmpfs /media/ram tmpfs defaults 0 0
meta/recipes-core/base-files/base-files_3.0.14.bb +5 -5
@@ -31,10 +31,10 @@ S = "${WORKDIR}" INHIBIT_DEFAULT_DEPS = "1" docdir_append = "/${P}" -dirs1777 = "/tmp ${localstatedir}/volatile/lock ${localstatedir}/volatile/tmp" +dirs1777 = "/tmp ${localstatedir}/volatile/tmp" dirs2775 = "/home ${prefix}/src ${localstatedir}/local" dirs755 = "/bin /boot /dev ${sysconfdir} ${sysconfdir}/default \ - ${sysconfdir}/skel /lib /mnt /proc ${ROOT_HOME} /sbin \ + ${sysconfdir}/skel /lib /mnt /proc ${ROOT_HOME} /run /sbin \ ${prefix} ${bindir} ${docdir} /usr/games ${includedir} \ ${libdir} ${sbindir} ${datadir} \ ${datadir}/common-licenses ${datadir}/dict ${infodir} \
@@ -42,9 +42,7 @@ dirs755 = "/bin /boot /dev ${sysconfdir} ${sysconfdir}/default \ ${localstatedir}/backups ${localstatedir}/lib \ /sys ${localstatedir}/lib/misc ${localstatedir}/spool \ ${localstatedir}/volatile \ - ${localstatedir}/volatile/lock/subsys \ ${localstatedir}/volatile/log \ - ${localstatedir}/volatile/run \ /mnt /media /media/card /media/cf /media/net /media/ram \ /media/union /media/realroot /media/hdd \ /media/mmc1"
@@ -54,7 +52,7 @@ dirs3755 = "/srv \ ${prefix}/local/share ${prefix}/local/src" dirs4775 = "/var/mail" -volatiles = "run log lock tmp" +volatiles = "log tmp" conffiles = "${sysconfdir}/debian_version ${sysconfdir}/host.conf \ ${sysconfdir}/inputrc ${sysconfdir}/issue /${sysconfdir}/issue.net \ ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile \
@@ -83,6 +81,8 @@ do_install () { for d in card cf net ram; do ln -sf /media/$d ${D}/mnt/$d done + ln -sf /run ${D}${localstatedir}/run + ln -sf /run/lock ${D}${localstatedir}/lock ${BASEFILESISSUEINSTALL}
meta/recipes-core/initscripts/initscripts-1.0/volatiles +3 -4
@@ -21,13 +21,12 @@ # This explains the order of "link before object" as in the example above, where # a link will be created at /var/test pointing to /tmp/testfile and due to this # link the file defined as /var/test will actually be created as /tmp/testfile. -d root root 1777 /var/volatile/lock none +d root root 1777 /run/lock none d root root 0755 /var/volatile/log none -d root root 0755 /var/volatile/run none d root root 1777 /var/volatile/tmp none -l root root 1777 /var/lock /var/volatile/lock +l root root 1777 /var/lock /run/lock l root root 0755 /var/log /var/volatile/log -l root root 0755 /var/run /var/volatile/run +l root root 0755 /var/run /run l root root 1777 /var/tmp /var/volatile/tmp l root root 1777 /tmp /var/tmp d root root 0755 /var/lock/subsys none
meta/recipes-core/systemd/systemd/00-create-volatile.conf +0 -2
@@ -4,6 +4,4 @@ d /var/volatile/log - - - - -d /var/volatile/lock - - - - -d /var/volatile/run - - - - d /var/volatile/tmp - - - -
meta/recipes-core/systemd/systemd/init +0 -4
@@ -42,10 +42,6 @@ case "$1" in [ -e /dev/pts ] || mkdir -m 0755 /dev/pts [ -e /dev/shm ] || mkdir -m 1777 /dev/shm mount -a -t tmpfs 2>/dev/null - mkdir -p /var/volatile/run - if [ ! -e /run ]; then - ln -s /var/run /run - fi # cache handling if [ "$DEVCACHE" != "" ]; then
meta/recipes-core/systemd/systemd/var-run.conf deleted +0 -4
@@ -1,4 +0,0 @@ -# empty /var/run -R /var/run/* - - - - - -# systemd-update-utmp-runlevel.service fails to start without this -f /var/run/utmp 0644 root root - -
meta/recipes-core/systemd/systemd_204.bb +0 -3
@@ -20,7 +20,6 @@ inherit gtk-doc useradd pkgconfig autotools perlnative update-rc.d update-altern SRC_URI = "http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz \ file://touchscreen.rules \ file://modprobe.rules \ - file://var-run.conf \ ${UCLIBCPATCHES} \ file://0001-utmp-turn-systemd-update-utmp-shutdown.service-into-.patch \ file://00-create-volatile.conf \
@@ -105,8 +104,6 @@ do_install() { install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/ - install -m 0644 ${WORKDIR}/var-run.conf ${D}${sysconfdir}/tmpfiles.d/ - install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/ if ${@base_contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
meta/recipes-core/udev/udev.inc +1 -5
@@ -26,8 +26,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \ file://local.rules \ file://udev-cache \ file://udev-cache.default \ - file://init \ - file://volatiles" + file://init" inherit autotools pkgconfig update-rc.d
@@ -85,9 +84,6 @@ do_install_append () { install -d ${D}${sysconfdir}/default install -m 0755 ${WORKDIR}/udev-cache.default ${D}${sysconfdir}/default/udev-cache - install -d ${D}${sysconfdir}/default/volatiles - install -m 0644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/00_udev - touch ${D}${sysconfdir}/udev/cache.data install -d ${D}${sysconfdir}/udev/rules.d/
meta/recipes-core/udev/udev/init +0 -1
@@ -50,7 +50,6 @@ case "$1" in [ -e /dev/pts ] || mkdir -m 0755 /dev/pts [ -e /dev/shm ] || mkdir -m 1777 /dev/shm mount -a -t tmpfs 2>/dev/null - mkdir -p /var/volatile/run mkdir -p /var/volatile/tmp # cache handling
meta/recipes-core/udev/udev/volatiles deleted +0 -1
@@ -1 +0,0 @@ -l root root 0755 /run /var/run
Signature · 1 line
1.8.2.3
Note that I have rebased the patch so it depends on:
- [PATCH v4] systemd: update to 204
Regards,
Jonathan
Quoted 277 lines · Jonathan Liu
This adds the /run directory from the Filesystem Hierarchy Standard 3.0 Draft [1] and refactors the filesystem as follows:
- Remove creation of/var/volatile/run
- Remove creation of/var/volatile/lock
- Remove symbolic link from/var/runto/var/volatile/run
- Remove symbolic link from/var/lockto/var/volatile/lock
- Add symbolic link from/var/runto /run
- Add symbolic link from/var/lock->/run/lock
- Add /run to/etc/fstabfor sysvinit compatibilityThe systemd init script has been modified as follows:
- Do not create/var/volatile/run
- Do not create symbolic link from /run to/var/runif /run doesn't existA few things have also been cleaned up:
- Remove udev workaround to ensure /run exists
- Remove clearing of/var/runas it points to a tmpfs anyway
- Remove permissions workaround for/var/run/utmpas systemd-update-utmp-runlevel.service starts correctly without it[1] http://www.linuxbase.org/betaspecs/fhs/fhs.html#runRuntimeVariableData
Signed-off-by Jonathan Liu <[email protected]>--- meta/files/fs-perms.txt | 5 ++--- meta/recipes-core/base-files/base-files/fstab | 1 + meta/recipes-core/base-files/base-files_3.0.14.bb | 10 +++++----- meta/recipes-core/initscripts/initscripts-1.0/volatiles | 7 +++---- meta/recipes-core/systemd/systemd/00-create-volatile.conf | 2 -- meta/recipes-core/systemd/systemd/init | 4 ---- meta/recipes-core/systemd/systemd/var-run.conf | 4 ---- meta/recipes-core/systemd/systemd_204.bb | 3 --- meta/recipes-core/udev/udev.inc | 6 +----- meta/recipes-core/udev/udev/init | 1 - meta/recipes-core/udev/udev/volatiles | 1 - 11 files changed, 12 insertions(+), 32 deletions(-) delete mode 100644 meta/recipes-core/systemd/systemd/var-run.conf delete mode 100644 meta/recipes-core/udev/udev/volatilesmeta/files/fs-perms.txt +2
-3@@ -45,15 +45,14 @@ ${oldincludedir} 0755 root root true 0644 root root # Items from base-files # Links -${localstatedir}/run link volatile/run +${localstatedir}/run link /run ${localstatedir}/log link volatile/log -${localstatedir}/lock link volatile/lock +${localstatedir}/lock link /run/lock ${localstatedir}/tmp link volatile/tmp # Special permissions from base-files # Set 1777 /tmp 01777 root root false - - - -${localstatedir}/volatile/lock 01777 root root false - - - ${localstatedir}/volatile/tmp 01777 root root false - - -# Set 2775
meta/recipes-core/base-files/base-files/fstab +0
-0@@ -4,6 +4,7 @@ rootfs / autodefaults 1 1
proc /proc proc defaults
0 0
devpts/dev/ptsdevpts mode=0620,gid=5
0 0
usbdevfs/proc/bus/usbusbdevfs noauto
0 0meta/recipes-core/base-files/base-files/fstab +1
-0+tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0 tmpfs /var/volatile tmpfs defaults 0 0 tmpfs /media/ram tmpfs defaults 0 0(quoted diff) +0
-0base-files_3.0.14.bb
index a56450d..60185e1 100644meta/recipes-core/base-files/base-files_3.0.14.bb +0
-1@@ -31,10 +31,10 @@ S = "${WORKDIR}" INHIBIT_DEFAULT_DEPS = "1" docdir_append = "/${P}" -dirs1777 = "/tmp ${localstatedir}/volatile/lock${localstatedir}/volatile/tmp"
meta/recipes-core/base-files/base-files_3.0.14.bb +2
-3+dirs1777 = "/tmp ${localstatedir}/volatile/tmp" dirs2775 = "/home ${prefix}/src ${localstatedir}/local" dirs755 = "/bin /boot /dev ${sysconfdir} ${sysconfdir}/default \ - ${sysconfdir}/skel /lib /mnt /proc ${ROOT_HOME} /sbin \ + ${sysconfdir}/skel /lib /mnt /proc ${ROOT_HOME} /run /sbin \ ${prefix} ${bindir} ${docdir} /usr/games ${includedir} \ ${libdir} ${sbindir} ${datadir} \ ${datadir}/common-licenses ${datadir}/dict ${infodir} \@@ -42,9 +42,7 @@ dirs755 = "/bin /boot /dev ${sysconfdir} ${sysconfdir}/default \ ${localstatedir}/backups ${localstatedir}/lib \ /sys ${localstatedir}/lib/misc ${localstatedir}/spool \ ${localstatedir}/volatile \ - ${localstatedir}/volatile/lock/subsys \ ${localstatedir}/volatile/log \ - ${localstatedir}/volatile/run \ /mnt /media /media/card /media/cf /media/net /media/ram \ /media/union /media/realroot /media/hdd \/media/mmc1"meta/recipes-core/base-files/base-files_3.0.14.bb +1
-1@@ -54,7 +52,7 @@ dirs3755 = "/srv \ ${prefix}/local/share ${prefix}/local/src" dirs4775 = "/var/mail" -volatiles = "run log lock tmp" +volatiles = "log tmp" conffiles = "${sysconfdir}/debian_version ${sysconfdir}/host.conf \ ${sysconfdir}/inputrc ${sysconfdir}/issue /${sysconfdir}/ issue.net \${sysconfdir}/nsswitch.conf ${sysconfdir}/profile \meta/recipes-core/base-files/base-files_3.0.14.bb +2
-0@@ -83,6 +81,8 @@ do_install () { for d in card cf net ram; do ln -sf /media/$d ${D}/mnt/$d done + ln -sf /run ${D}${localstatedir}/run + ln -sf /run/lock ${D}${localstatedir}/lock ${BASEFILESISSUEINSTALL}meta/recipes-core/initscripts/initscripts-1.0/volatiles +0
-0@@ -21,13 +21,12 @@ # This explains the order of "link before object" as in the exampleabove, where
# a link will be created at /var/test pointing to /tmp/testfile and due to this # link the file defined as /var/test will actually be created as /tmp/testfile.meta/recipes-core/initscripts/initscripts-1.0/volatiles +3
-4-d root root 1777 /var/volatile/lock none +d root root 1777 /run/lock none d root root 0755 /var/volatile/log none -d root root 0755 /var/volatile/run none d root root 1777 /var/volatile/tmp none -l root root 1777 /var/lock /var/volatile/lock +l root root 1777 /var/lock /run/lock l root root 0755 /var/log /var/volatile/log -l root root 0755 /var/run /var/volatile/run +l root root 0755 /var/run /run l root root 1777 /var/tmp /var/volatile/tmp l root root 1777 /tmp /var/tmp d root root 0755 /var/lock/subsys nonemeta/recipes-core/systemd/systemd/00-create-volatile.conf +0
-2@@ -4,6 +4,4 @@ d /var/volatile/log - - - - -d /var/volatile/lock - - - - -d /var/volatile/run - - - - d /var/volatile/tmp - - - -meta/recipes-core/systemd/systemd/init +0
-4@@ -42,10 +42,6 @@ case "$1" in [ -e /dev/pts ] || mkdir -m 0755 /dev/pts [ -e /dev/shm ] || mkdir -m 1777 /dev/shm mount -a -t tmpfs 2>/dev/null - mkdir -p /var/volatile/run - if [ ! -e /run ]; then - ln -s /var/run /run - fi # cache handling if [ "$DEVCACHE" != "" ]; thenmeta/recipes-core/systemd/systemd/var-run.conf deleted +0
-4@@ -1,4 +0,0 @@ -# empty /var/run -R /var/run/* - - - - - -# systemd-update-utmp-runlevel.service fails to start without this -f /var/run/utmp 0644 root root - -(quoted diff) +0
-0systemd_204.bb
index 8536b2b..74cd3c8 100644meta/recipes-core/systemd/systemd_204.bb +0
-0@@ -20,7 +20,6 @@ inherit gtk-doc useradd pkgconfig autotools perlnativeupdate-rc.d update-altern
SRC_URI= "http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz \ file://touchscreen.rules \ file://modprobe.rules \ - file://var-run.conf \ ${UCLIBCPATCHES} \file://0001-utmp-turn-systemd-update-utmp-shutdown.service-into-.patch \ file://00-create-volatile.conf \meta/recipes-core/systemd/systemd_204.bb +0
-1@@ -105,8 +104,6 @@ do_install() { install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/ - install -m 0644 ${WORKDIR}/var-run.conf${D}${sysconfdir}/tmpfiles.d/
-install -m 0644 ${WORKDIR}/00-create-volatile.conf${D}${sysconfdir}/tmpfiles.d/
if
${@base_contains('DISTRO_FEATURES','sysvinit','true','false',d)}; thenmeta/recipes-core/udev/udev.inc +1
-2@@ -26,8 +26,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \ file://local.rules \ file://udev-cache \ file://udev-cache.default \ - file://init \ - file://volatiles" + file://init" inherit autotools pkgconfig update-rc.d@@ -85,9 +84,6 @@ do_install_append () { install -d ${D}${sysconfdir}/default install -m 0755 ${WORKDIR}/udev-cache.default${D}${sysconfdir}/default/udev-cache
meta/recipes-core/udev/udev.inc +0
-2- install -d ${D}${sysconfdir}/default/volatiles - install -m 0644 ${WORKDIR}/volatiles${D}${sysconfdir}/default/volatiles/00_udev
meta/recipes-core/udev/udev.inc +0
-1- touch ${D}${sysconfdir}/udev/cache.data install -d ${D}${sysconfdir}/udev/rules.d/meta/recipes-core/udev/udev/init +0
-1@@ -50,7 +50,6 @@ case "$1" in [ -e /dev/pts ] || mkdir -m 0755 /dev/pts [ -e /dev/shm ] || mkdir -m 1777 /dev/shm mount -a -t tmpfs 2>/dev/null - mkdir -p /var/volatile/run mkdir -p /var/volatile/tmp # cache handlingmeta/recipes-core/udev/udev/volatiles deleted +0
-2@@ -1 +0,0 @@ -l root root 0755 /run /var/run --1.8.2.3
Quoted 15 lines · Jonathan Liu
This adds the /run directory from the Filesystem Hierarchy Standard 3.0 Draft [1] and refactors the filesystem as follows:
- Remove creation of/var/volatile/run
- Remove creation of/var/volatile/lock
- Remove symbolic link from/var/runto/var/volatile/run
- Remove symbolic link from/var/lockto/var/volatile/lock
- Add symbolic link from/var/runto /run
- Add symbolic link from/var/lock->/run/lock
- Add /run to/etc/fstabfor sysvinit compatibilityThe systemd init script has been modified as follows:
- Do not create/var/volatile/run
- Do not create symbolic link from /run to/var/runif /run doesn't exist
Quoted 8 lines
A few things have also been cleaned up:
- Remove udev workaround to ensure /run exists
- Remove clearing of/var/runas it points to a tmpfs anyway
- Remove permissions workaround for/var/run/utmpas systemd-update-utmp-runlevel.service starts correctly without it[1] http://www.linuxbase.org/betaspecs/fhs/fhs.html#runRuntimeVariableData
Not quite done yet, Ross requested that you break this into smaller patches since this contains un-related changes, their kind of related but seperatable.
I also noticed a few installed not shipped warnings pop up for consolekit, bind and cups, all having to do with /run, these may need additional patching.
Please build a world with this changes to possibly see these warnings.
Sau!
Quoted 218 lines
Signed-off-by Jonathan Liu <[email protected]>--- meta/files/fs-perms.txt | 5 ++--- meta/recipes-core/base-files/base-files/fstab | 1 + meta/recipes-core/base-files/base-files_3.0.14.bb | 10 +++++----- meta/recipes-core/initscripts/initscripts-1.0/volatiles | 7 +++---- meta/recipes-core/systemd/systemd/00-create-volatile.conf | 2 -- meta/recipes-core/systemd/systemd/init | 4 ---- meta/recipes-core/systemd/systemd/var-run.conf | 4 ---- meta/recipes-core/systemd/systemd_204.bb | 3 --- meta/recipes-core/udev/udev.inc | 6 +----- meta/recipes-core/udev/udev/init | 1 - meta/recipes-core/udev/udev/volatiles | 1 - 11 files changed, 12 insertions(+), 32 deletions(-)delete mode 100644
meta/recipes-core/systemd/systemd/var-run.confdelete mode 100644 meta/recipes-core/udev/udev/volatilesmeta/files/fs-perms.txt +2
-3@@ -45,15 +45,14 @@ ${oldincludedir} 0755 root root true 0644 root root # Items from base-files # Links -${localstatedir}/run link volatile/run +${localstatedir}/run link /run ${localstatedir}/log link volatile/log -${localstatedir}/lock link volatile/lock +${localstatedir}/lock link /run/lock ${localstatedir}/tmp link volatile/tmp # Special permissions from base-files # Set 1777 /tmp 01777 root root false - - - -${localstatedir}/volatile/lock 01777 root root false - - - ${localstatedir}/volatile/tmp 01777 root root false - - - # Set 2775meta/recipes-core/base-files/base-files/fstab +1
-0@@ -4,6 +4,7 @@ rootfs / auto defaults 1 1 proc /proc proc defaults 0 0 devpts /dev/pts devpts mode=0620,gid=5 0 0 usbdevfs /proc/bus/usb usbdevfs noauto 0 0 +tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0 tmpfs /var/volatile tmpfs defaults 0 0 tmpfs /media/ram tmpfs defaults 0 0meta/recipes-core/base-files/base-files_3.0.14.bb +5
-5@@ -31,10 +31,10 @@ S = "${WORKDIR}" INHIBIT_DEFAULT_DEPS = "1" docdir_append = "/${P}" -dirs1777 = "/tmp ${localstatedir}/volatile/lock ${localstatedir}/volatile/tmp" +dirs1777 = "/tmp ${localstatedir}/volatile/tmp" dirs2775 = "/home ${prefix}/src ${localstatedir}/local" dirs755 = "/bin /boot /dev ${sysconfdir} ${sysconfdir}/default \ - ${sysconfdir}/skel /lib /mnt /proc ${ROOT_HOME} /sbin \ + ${sysconfdir}/skel /lib /mnt /proc ${ROOT_HOME} /run /sbin \ ${prefix} ${bindir} ${docdir} /usr/games ${includedir} \ ${libdir} ${sbindir} ${datadir} \ ${datadir}/common-licenses ${datadir}/dict ${infodir} \@@ -42,9 +42,7 @@ dirs755 = "/bin /boot /dev ${sysconfdir} ${sysconfdir}/default \ ${localstatedir}/backups ${localstatedir}/lib \ /sys ${localstatedir}/lib/misc ${localstatedir}/spool \ ${localstatedir}/volatile \ - ${localstatedir}/volatile/lock/subsys \ ${localstatedir}/volatile/log \ - ${localstatedir}/volatile/run \ /mnt /media /media/card /media/cf /media/net /media/ram \ /media/union /media/realroot /media/hdd \ /media/mmc1"@@ -54,7 +52,7 @@ dirs3755 = "/srv \ ${prefix}/local/share ${prefix}/local/src" dirs4775 = "/var/mail" -volatiles = "run log lock tmp" +volatiles = "log tmp" conffiles = "${sysconfdir}/debian_version ${sysconfdir}/host.conf \ ${sysconfdir}/inputrc ${sysconfdir}/issue /${sysconfdir}/issue.net \ ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile \@@ -83,6 +81,8 @@ do_install () { for d in card cf net ram; do ln -sf /media/$d ${D}/mnt/$d done + ln -sf /run ${D}${localstatedir}/run + ln -sf /run/lock ${D}${localstatedir}/lock ${BASEFILESISSUEINSTALL}meta/recipes-core/initscripts/initscripts-1.0/volatiles +3
-4@@ -21,13 +21,12 @@ # This explains the order of "link before object" as in the example above, where # a link will be created at /var/test pointing to /tmp/testfile and due to this # link the file defined as /var/test will actually be created as /tmp/testfile. -d root root 1777 /var/volatile/lock none +d root root 1777 /run/lock none d root root 0755 /var/volatile/log none -d root root 0755 /var/volatile/run none d root root 1777 /var/volatile/tmp none -l root root 1777 /var/lock /var/volatile/lock +l root root 1777 /var/lock /run/lock l root root 0755 /var/log /var/volatile/log -l root root 0755 /var/run /var/volatile/run +l root root 0755 /var/run /run l root root 1777 /var/tmp /var/volatile/tmp l root root 1777 /tmp /var/tmp d root root 0755 /var/lock/subsys nonemeta/recipes-core/systemd/systemd/00-create-volatile.conf +0
-2@@ -4,6 +4,4 @@ d /var/volatile/log - - - - -d /var/volatile/lock - - - - -d /var/volatile/run - - - - d /var/volatile/tmp - - - -meta/recipes-core/systemd/systemd/init +0
-4@@ -42,10 +42,6 @@ case "$1" in [ -e /dev/pts ] || mkdir -m 0755 /dev/pts [ -e /dev/shm ] || mkdir -m 1777 /dev/shm mount -a -t tmpfs 2>/dev/null - mkdir -p /var/volatile/run - if [ ! -e /run ]; then - ln -s /var/run /run - fi # cache handling if [ "$DEVCACHE" != "" ]; thenmeta/recipes-core/systemd/systemd/var-run.conf deleted +0
-4@@ -1,4 +0,0 @@ -# empty /var/run -R /var/run/* - - - - - -# systemd-update-utmp-runlevel.service fails to start without this -f /var/run/utmp 0644 root root - -meta/recipes-core/systemd/systemd_204.bb +0
-3@@ -20,7 +20,6 @@ inherit gtk-doc useradd pkgconfig autotools perlnative update-rc.d update-altern SRC_URI = "http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz \ file://touchscreen.rules \ file://modprobe.rules \ - file://var-run.conf \ ${UCLIBCPATCHES} \ file://0001-utmp-turn-systemd-update-utmp-shutdown.service-into-.patch \ file://00-create-volatile.conf \@@ -105,8 +104,6 @@ do_install() { install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/ - install -m 0644 ${WORKDIR}/var-run.conf ${D}${sysconfdir}/tmpfiles.d/ - install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/ if ${@base_contains('DISTRO_FEATURES','sysvinit','true','false',d)}; thenmeta/recipes-core/udev/udev.inc +1
-5@@ -26,8 +26,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \ file://local.rules \ file://udev-cache \ file://udev-cache.default \ - file://init \ - file://volatiles" + file://init" inherit autotools pkgconfig update-rc.d@@ -85,9 +84,6 @@ do_install_append () { install -d ${D}${sysconfdir}/default install -m 0755 ${WORKDIR}/udev-cache.default ${D}${sysconfdir}/default/udev-cache - install -d ${D}${sysconfdir}/default/volatiles - install -m 0644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/00_udev - touch ${D}${sysconfdir}/udev/cache.data install -d ${D}${sysconfdir}/udev/rules.d/meta/recipes-core/udev/udev/init +0
-1@@ -50,7 +50,6 @@ case "$1" in [ -e /dev/pts ] || mkdir -m 0755 /dev/pts [ -e /dev/shm ] || mkdir -m 1777 /dev/shm mount -a -t tmpfs 2>/dev/null - mkdir -p /var/volatile/run mkdir -p /var/volatile/tmp # cache handlingmeta/recipes-core/udev/udev/volatiles deleted +0
-1@@ -1 +0,0 @@ -l root root 0755 /run /var/run
Quoted 25 lines · Saul Wold
Quoted 15 lines · Jonathan Liu
This adds the /run directory from the Filesystem Hierarchy Standard 3.0 Draft [1] and refactors the filesystem as follows:
- Remove creation of/var/volatile/run
- Remove creation of/var/volatile/lock
- Remove symbolic link from/var/runto/var/volatile/run
- Remove symbolic link from/var/lockto/var/volatile/lock
- Add symbolic link from/var/runto /run
- Add symbolic link from/var/lock->/run/lock
- Add /run to/etc/fstabfor sysvinit compatibilityThe systemd init script has been modified as follows:
- Do not create/var/volatile/run
- Do not create symbolic link from /run to/var/runif /run doesn't existQuoted 8 lines
A few things have also been cleaned up:
- Remove udev workaround to ensure /run exists
- Remove clearing of/var/runas it points to a tmpfs anyway
- Remove permissions workaround for/var/run/utmpas systemd-update-utmp-runlevel.service starts correctly without it[1] http://www.linuxbase.org/betaspecs/fhs/fhs.html#runRuntimeVariableData
Quoted 7 lines
Not quite done yet, Ross requested that you break this into smaller patches since this contains un-related changes, their kind of related but seperatable.
I also noticed a few installed not shipped warnings pop up for consolekit, bind and cups, all having to do with /run, these may need additional patching.
Please build a world with this changes to possibly see these warnings.
Sau!
All done.
Regards,
Jonathan
Quoted 243 lines
Quoted 243 lines
Signed-off-by Jonathan Liu <[email protected]>--- meta/files/fs-perms.txt | 5 ++--- meta/recipes-core/base-files/base-files/fstab | 1 + meta/recipes-core/base-files/base-files_3.0.14.bb | 10 +++++----- meta/recipes-core/initscripts/initscripts-1.0/volatiles | 7 +++---- meta/recipes-core/systemd/systemd/00-create-volatile.conf | 2 -- meta/recipes-core/systemd/systemd/init | 4 ---- meta/recipes-core/systemd/systemd/var-run.conf | 4 ---- meta/recipes-core/systemd/systemd_204.bb | 3 --- meta/recipes-core/udev/udev.inc | 6 +----- meta/recipes-core/udev/udev/init | 1 - meta/recipes-core/udev/udev/volatiles | 1 - 11 files changed, 12 insertions(+), 32 deletions(-)delete mode 100644
meta/recipes-core/systemd/systemd/var-run.confdelete mode 100644 meta/recipes-core/udev/udev/volatilesmeta/files/fs-perms.txt +0
-0@@ -45,15 +45,14 @@ ${oldincludedir} 0755 root root true0644 root root
# Items from base-files
# Links-${localstatedir}/run link volatile/run +${localstatedir}/run link /run ${localstatedir}/log link volatile/log -${localstatedir}/lock link volatile/lock +${localstatedir}/lock link /run/lock ${localstatedir}/tmp link volatile/tmp# Special permissions from base-files
# Set 1777
/tmp 01777 root root false - - --${localstatedir}/volatile/lock 01777 root root false - - - ${localstatedir}/volatile/tmp 01777 root root false - - -# Set 2775
meta/recipes-core/base-files/base-files/fstab +0
-0@@ -4,6 +4,7 @@ rootfs / autodefaults 1 1
proc /proc proc
defaults 0 0
devpts/dev/ptsdevpts
mode=0620,gid=5 0 0
usbdevfs/proc/bus/usbusbdevfs
noauto 0 0
+tmpfs /run tmpfs
mode=0755,nodev,nosuid,strictatime 0 0
tmpfs/var/volatiletmpfs
defaults 0 0
tmpfs /media/ram tmpfs
defaults 0 0meta/recipes-core/base-files/base-files_3.0.14.bb +0
-1@@ -31,10 +31,10 @@ S = "${WORKDIR}" INHIBIT_DEFAULT_DEPS = "1" docdir_append = "/${P}" -dirs1777 = "/tmp ${localstatedir}/volatile/lock${localstatedir}/volatile/tmp"
meta/recipes-core/base-files/base-files_3.0.14.bb +2
-3+dirs1777 = "/tmp ${localstatedir}/volatile/tmp" dirs2775 = "/home ${prefix}/src ${localstatedir}/local" dirs755 = "/bin /boot /dev ${sysconfdir} ${sysconfdir}/default \ - ${sysconfdir}/skel /lib /mnt /proc ${ROOT_HOME} /sbin \ + ${sysconfdir}/skel /lib /mnt /proc ${ROOT_HOME} /run /sbin \ ${prefix} ${bindir} ${docdir} /usr/games ${includedir} \ ${libdir} ${sbindir} ${datadir} \ ${datadir}/common-licenses ${datadir}/dict ${infodir} \@@ -42,9 +42,7 @@ dirs755 = "/bin /boot /dev ${sysconfdir} ${sysconfdir}/default \ ${localstatedir}/backups ${localstatedir}/lib \ /sys ${localstatedir}/lib/misc ${localstatedir}/spool \ ${localstatedir}/volatile \ - ${localstatedir}/volatile/lock/subsys \ ${localstatedir}/volatile/log \ - ${localstatedir}/volatile/run \ /mnt /media /media/card /media/cf /media/net /media/ram \ /media/union /media/realroot /media/hdd \/media/mmc1"meta/recipes-core/base-files/base-files_3.0.14.bb +1
-1@@ -54,7 +52,7 @@ dirs3755 = "/srv \ ${prefix}/local/share ${prefix}/local/src" dirs4775 = "/var/mail" -volatiles = "run log lock tmp" +volatiles = "log tmp" conffiles = "${sysconfdir}/debian_version ${sysconfdir}/host.conf \ ${sysconfdir}/inputrc ${sysconfdir}/issue /${sysconfdir}/issue.net \${sysconfdir}/nsswitch.conf ${sysconfdir}/profile \meta/recipes-core/base-files/base-files_3.0.14.bb +2
-0@@ -83,6 +81,8 @@ do_install () { for d in card cf net ram; do ln -sf /media/$d ${D}/mnt/$d done + ln -sf /run ${D}${localstatedir}/run + ln -sf /run/lock ${D}${localstatedir}/lock ${BASEFILESISSUEINSTALL}meta/recipes-core/initscripts/initscripts-1.0/volatiles +0
-0@@ -21,13 +21,12 @@ # This explains the order of "link before object" as in the exampleabove, where
# a link will be created at /var/test pointing to /tmp/testfile and due to this # link the file defined as /var/test will actually be created as /tmp/testfile.meta/recipes-core/initscripts/initscripts-1.0/volatiles +3
-4-d root root 1777 /var/volatile/lock none +d root root 1777 /run/lock none d root root 0755 /var/volatile/log none -d root root 0755 /var/volatile/run none d root root 1777 /var/volatile/tmp none -l root root 1777 /var/lock /var/volatile/lock +l root root 1777 /var/lock /run/lock l root root 0755 /var/log /var/volatile/log -l root root 0755 /var/run /var/volatile/run +l root root 0755 /var/run /run l root root 1777 /var/tmp /var/volatile/tmp l root root 1777 /tmp /var/tmp d root root 0755 /var/lock/subsys nonemeta/recipes-core/systemd/systemd/00-create-volatile.conf +0
-2@@ -4,6 +4,4 @@ d /var/volatile/log - - - - -d /var/volatile/lock - - - - -d /var/volatile/run - - - - d /var/volatile/tmp - - - -meta/recipes-core/systemd/systemd/init +0
-4@@ -42,10 +42,6 @@ case "$1" in [ -e /dev/pts ] || mkdir -m 0755 /dev/pts [ -e /dev/shm ] || mkdir -m 1777 /dev/shm mount -a -t tmpfs 2>/dev/null - mkdir -p /var/volatile/run - if [ ! -e /run ]; then - ln -s /var/run /run - fi # cache handling if [ "$DEVCACHE" != "" ]; thenmeta/recipes-core/systemd/systemd/var-run.conf deleted +0
-4@@ -1,4 +0,0 @@ -# empty /var/run -R /var/run/* - - - - - -# systemd-update-utmp-runlevel.service fails to start without this -f /var/run/utmp 0644 root root - -meta/recipes-core/systemd/systemd_204.bb +0
-0@@ -20,7 +20,6 @@ inherit gtk-doc useradd pkgconfig autotoolsperlnative update-rc.d update-altern
SRC_URI="http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz \ file://touchscreen.rules \ file://modprobe.rules \ - file://var-run.conf \ ${UCLIBCPATCHES} \ file://0001-utmp-turn-systemd-update-utmp-shutdown.service-into-.patch \ file://00-create-volatile.conf \meta/recipes-core/systemd/systemd_204.bb +0
-1@@ -105,8 +104,6 @@ do_install() { install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/ - install -m 0644 ${WORKDIR}/var-run.conf${D}${sysconfdir}/tmpfiles.d/
-install -m 0644 ${WORKDIR}/00-create-volatile.conf${D}${sysconfdir}/tmpfiles.d/
if
${@base_contains('DISTRO_FEATURES','sysvinit','true','false',d)}; thenmeta/recipes-core/udev/udev.inc +1
-2@@ -26,8 +26,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \ file://local.rules \ file://udev-cache \ file://udev-cache.default \ - file://init \ - file://volatiles" + file://init" inherit autotools pkgconfig update-rc.d@@ -85,9 +84,6 @@ do_install_append () { install -d ${D}${sysconfdir}/default install -m 0755 ${WORKDIR}/udev-cache.default${D}${sysconfdir}/default/udev-cache
meta/recipes-core/udev/udev.inc +0
-2- install -d ${D}${sysconfdir}/default/volatiles - install -m 0644 ${WORKDIR}/volatiles${D}${sysconfdir}/default/volatiles/00_udev
meta/recipes-core/udev/udev.inc +0
-1- touch ${D}${sysconfdir}/udev/cache.data install -d ${D}${sysconfdir}/udev/rules.d/meta/recipes-core/udev/udev/init +0
-1@@ -50,7 +50,6 @@ case "$1" in [ -e /dev/pts ] || mkdir -m 0755 /dev/pts [ -e /dev/shm ] || mkdir -m 1777 /dev/shm mount -a -t tmpfs 2>/dev/null - mkdir -p /var/volatile/run mkdir -p /var/volatile/tmp # cache handlingmeta/recipes-core/udev/udev/volatiles deleted +0
-1@@ -1 +0,0 @@ -l root root 0755 /run /var/run