From: Yann E. MORIN Date: Tue, 1 Aug 2017 22:52:21 +0000 (+0200) Subject: system: separate sysv and systemd parts of the skeleton X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=76fc9275f14ec295b0125910464969bfa7441b85;p=buildroot.git system: separate sysv and systemd parts of the skeleton For systemd, we create a simple /etc/fstab with only an entry for /, as systemd otherwise automatically mounts what it needs where it needs it. systemd does not like that the content of /var be symlinks to /tmp, especially journald that starts before /tmp is mounted, and thus the journal files are hidden from view, which causes quite a bit of fuss... Instead, move the current /var to a sysv-only skeleton. systemd at install time will create the /var content it needs, so we just create an empty /var for systemd. systemd would create /home and /srv at runtime if they are missing, but it is better to create them right now, to simplify supporting systemd on a RO filesystem in the (near) future. Signed-off-by: "Yann E. MORIN" Cc: Maxime Hadjinlian Reviewed-by: Arnout Vandecappelle (Essensium/Mind) Signed-off-by: Arnout Vandecappelle (Essensium/Mind) Signed-off-by: Thomas Petazzoni --- diff --git a/package/skeleton-systemd/skeleton-systemd.mk b/package/skeleton-systemd/skeleton-systemd.mk index cec6359007..384715e1c9 100644 --- a/package/skeleton-systemd/skeleton-systemd.mk +++ b/package/skeleton-systemd/skeleton-systemd.mk @@ -15,4 +15,11 @@ SKELETON_SYSTEMD_DEPENDENCIES = skeleton-common SKELETON_SYSTEMD_PROVIDES = skeleton +define SKELETON_SYSTEMD_INSTALL_TARGET_CMDS + mkdir -p $(TARGET_DIR)/home + mkdir -p $(TARGET_DIR)/srv + mkdir -p $(TARGET_DIR)/var + echo "/dev/root / auto rw 0 1" >$(TARGET_DIR)/etc/fstab +endef + $(eval $(generic-package)) diff --git a/package/skeleton-sysv/skeleton-sysv.mk b/package/skeleton-sysv/skeleton-sysv.mk index b0c2b6bac1..b5fa396ac2 100644 --- a/package/skeleton-sysv/skeleton-sysv.mk +++ b/package/skeleton-sysv/skeleton-sysv.mk @@ -15,4 +15,8 @@ SKELETON_SYSV_DEPENDENCIES = skeleton-common SKELETON_SYSV_PROVIDES = skeleton +define SKELETON_SYSV_INSTALL_TARGET_CMDS + $(call SYSTEM_RSYNC,$(SKELETON_SYSV_PKGDIR)/skeleton,$(TARGET_DIR)) +endef + $(eval $(generic-package)) diff --git a/package/skeleton-sysv/skeleton/dev/log b/package/skeleton-sysv/skeleton/dev/log new file mode 120000 index 0000000000..d96b3b1cb8 --- /dev/null +++ b/package/skeleton-sysv/skeleton/dev/log @@ -0,0 +1 @@ +../tmp/log \ No newline at end of file diff --git a/package/skeleton-sysv/skeleton/dev/pts/.empty b/package/skeleton-sysv/skeleton/dev/pts/.empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/package/skeleton-sysv/skeleton/dev/shm/.empty b/package/skeleton-sysv/skeleton/dev/shm/.empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/package/skeleton-sysv/skeleton/etc/fstab b/package/skeleton-sysv/skeleton/etc/fstab new file mode 100644 index 0000000000..169054b74f --- /dev/null +++ b/package/skeleton-sysv/skeleton/etc/fstab @@ -0,0 +1,8 @@ +# +/dev/root / ext2 rw,noauto 0 1 +proc /proc proc defaults 0 0 +devpts /dev/pts devpts defaults,gid=5,mode=620,ptmxmode=0666 0 0 +tmpfs /dev/shm tmpfs mode=0777 0 0 +tmpfs /tmp tmpfs mode=1777 0 0 +tmpfs /run tmpfs mode=0755,nosuid,nodev 0 0 +sysfs /sys sysfs defaults 0 0 diff --git a/package/skeleton-sysv/skeleton/var/cache b/package/skeleton-sysv/skeleton/var/cache new file mode 120000 index 0000000000..1431b0e432 --- /dev/null +++ b/package/skeleton-sysv/skeleton/var/cache @@ -0,0 +1 @@ +../tmp \ No newline at end of file diff --git a/package/skeleton-sysv/skeleton/var/lib/misc b/package/skeleton-sysv/skeleton/var/lib/misc new file mode 120000 index 0000000000..f1fde8c107 --- /dev/null +++ b/package/skeleton-sysv/skeleton/var/lib/misc @@ -0,0 +1 @@ +../../tmp \ No newline at end of file diff --git a/package/skeleton-sysv/skeleton/var/lock b/package/skeleton-sysv/skeleton/var/lock new file mode 120000 index 0000000000..1431b0e432 --- /dev/null +++ b/package/skeleton-sysv/skeleton/var/lock @@ -0,0 +1 @@ +../tmp \ No newline at end of file diff --git a/package/skeleton-sysv/skeleton/var/log b/package/skeleton-sysv/skeleton/var/log new file mode 120000 index 0000000000..1431b0e432 --- /dev/null +++ b/package/skeleton-sysv/skeleton/var/log @@ -0,0 +1 @@ +../tmp \ No newline at end of file diff --git a/package/skeleton-sysv/skeleton/var/run b/package/skeleton-sysv/skeleton/var/run new file mode 120000 index 0000000000..84ba55b912 --- /dev/null +++ b/package/skeleton-sysv/skeleton/var/run @@ -0,0 +1 @@ +../run \ No newline at end of file diff --git a/package/skeleton-sysv/skeleton/var/spool b/package/skeleton-sysv/skeleton/var/spool new file mode 120000 index 0000000000..1431b0e432 --- /dev/null +++ b/package/skeleton-sysv/skeleton/var/spool @@ -0,0 +1 @@ +../tmp \ No newline at end of file diff --git a/package/skeleton-sysv/skeleton/var/tmp b/package/skeleton-sysv/skeleton/var/tmp new file mode 120000 index 0000000000..1431b0e432 --- /dev/null +++ b/package/skeleton-sysv/skeleton/var/tmp @@ -0,0 +1 @@ +../tmp \ No newline at end of file diff --git a/system/skeleton/dev/.empty b/system/skeleton/dev/.empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/system/skeleton/dev/log b/system/skeleton/dev/log deleted file mode 120000 index d96b3b1cb8..0000000000 --- a/system/skeleton/dev/log +++ /dev/null @@ -1 +0,0 @@ -../tmp/log \ No newline at end of file diff --git a/system/skeleton/dev/pts/.empty b/system/skeleton/dev/pts/.empty deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/system/skeleton/dev/shm/.empty b/system/skeleton/dev/shm/.empty deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/system/skeleton/etc/fstab b/system/skeleton/etc/fstab deleted file mode 100644 index 169054b74f..0000000000 --- a/system/skeleton/etc/fstab +++ /dev/null @@ -1,8 +0,0 @@ -# -/dev/root / ext2 rw,noauto 0 1 -proc /proc proc defaults 0 0 -devpts /dev/pts devpts defaults,gid=5,mode=620,ptmxmode=0666 0 0 -tmpfs /dev/shm tmpfs mode=0777 0 0 -tmpfs /tmp tmpfs mode=1777 0 0 -tmpfs /run tmpfs mode=0755,nosuid,nodev 0 0 -sysfs /sys sysfs defaults 0 0 diff --git a/system/skeleton/var/cache b/system/skeleton/var/cache deleted file mode 120000 index 1431b0e432..0000000000 --- a/system/skeleton/var/cache +++ /dev/null @@ -1 +0,0 @@ -../tmp \ No newline at end of file diff --git a/system/skeleton/var/lib/misc b/system/skeleton/var/lib/misc deleted file mode 120000 index f1fde8c107..0000000000 --- a/system/skeleton/var/lib/misc +++ /dev/null @@ -1 +0,0 @@ -../../tmp \ No newline at end of file diff --git a/system/skeleton/var/lock b/system/skeleton/var/lock deleted file mode 120000 index 1431b0e432..0000000000 --- a/system/skeleton/var/lock +++ /dev/null @@ -1 +0,0 @@ -../tmp \ No newline at end of file diff --git a/system/skeleton/var/log b/system/skeleton/var/log deleted file mode 120000 index 1431b0e432..0000000000 --- a/system/skeleton/var/log +++ /dev/null @@ -1 +0,0 @@ -../tmp \ No newline at end of file diff --git a/system/skeleton/var/run b/system/skeleton/var/run deleted file mode 120000 index 84ba55b912..0000000000 --- a/system/skeleton/var/run +++ /dev/null @@ -1 +0,0 @@ -../run \ No newline at end of file diff --git a/system/skeleton/var/spool b/system/skeleton/var/spool deleted file mode 120000 index 1431b0e432..0000000000 --- a/system/skeleton/var/spool +++ /dev/null @@ -1 +0,0 @@ -../tmp \ No newline at end of file diff --git a/system/skeleton/var/tmp b/system/skeleton/var/tmp deleted file mode 120000 index 1431b0e432..0000000000 --- a/system/skeleton/var/tmp +++ /dev/null @@ -1 +0,0 @@ -../tmp \ No newline at end of file