From: Cam Hutchison Date: Sun, 13 Aug 2017 21:21:10 +0000 (+1000) Subject: skeleton: Rename skeleton-systemd to skeleton-init-systemd X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ecbe2bef76e6c7890bb57bbde843c2c71030ae74;p=buildroot.git skeleton: Rename skeleton-systemd to skeleton-init-systemd The skeletons are based on the selection of BR2_INIT_*, so add init- to the package name to make this clearer. While skeleton-systemd is relatively clear, skeleton-common and skeleton-none are less clear on their relationship to BR2_INIT_*. So rename skeleton-systemd to conform to clearer pattern. Signed-off-by: Cam Hutchison Acked-by: "Yann E. MORIN" Signed-off-by: Thomas Petazzoni --- diff --git a/package/Config.in b/package/Config.in index b48eac65ca..4bdfeeaedd 100644 --- a/package/Config.in +++ b/package/Config.in @@ -5,7 +5,7 @@ menu "Target packages" source "package/skeleton-common/Config.in" source "package/skeleton-custom/Config.in" source "package/skeleton-init-none/Config.in" - source "package/skeleton-systemd/Config.in" + source "package/skeleton-init-systemd/Config.in" source "package/skeleton-sysv/Config.in" menu "Audio and video applications" diff --git a/package/skeleton-init-systemd/Config.in b/package/skeleton-init-systemd/Config.in new file mode 100644 index 0000000000..2d8845c281 --- /dev/null +++ b/package/skeleton-init-systemd/Config.in @@ -0,0 +1,7 @@ +config BR2_PACKAGE_SKELETON_INIT_SYSTEMD + bool + select BR2_PACKAGE_HAS_SKELETON + select BR2_PACKAGE_SKELETON_COMMON + +config BR2_PACKAGE_PROVIDES_SKELETON + default "skeleton-init-systemd" if BR2_PACKAGE_SKELETON_INIT_SYSTEMD diff --git a/package/skeleton-init-systemd/skeleton-init-systemd.mk b/package/skeleton-init-systemd/skeleton-init-systemd.mk new file mode 100644 index 0000000000..b2a6e266b4 --- /dev/null +++ b/package/skeleton-init-systemd/skeleton-init-systemd.mk @@ -0,0 +1,71 @@ +################################################################################ +# +# skeleton-init-systemd +# +################################################################################ + +# The skeleton can't depend on the toolchain, since all packages depends on the +# skeleton and the toolchain is a target package, as is skeleton. +# Hence, skeleton would depends on the toolchain and the toolchain would depend +# on skeleton. +SKELETON_INIT_SYSTEMD_ADD_TOOLCHAIN_DEPENDENCY = NO +SKELETON_INIT_SYSTEMD_ADD_SKELETON_DEPENDENCY = NO + +SKELETON_INIT_SYSTEMD_DEPENDENCIES = skeleton-common + +SKELETON_INIT_SYSTEMD_PROVIDES = skeleton + +ifeq ($(BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW),y) + +define SKELETON_INIT_SYSTEMD_ROOT_RO_OR_RW + echo "/dev/root / auto rw 0 1" >$(TARGET_DIR)/etc/fstab + mkdir -p $(TARGET_DIR)/var +endef + +else + +# On a R/O rootfs, /var is a tmpfs filesystem. So, at build time, we +# redirect /var to the "factory settings" location. Just before the +# filesystem gets created, the /var symlink will be replaced with +# a real (but empty) directory, and the "factory files" will be copied +# back there by the tmpfiles.d mechanism. +define SKELETON_INIT_SYSTEMD_ROOT_RO_OR_RW + mkdir -p $(TARGET_DIR)/etc/systemd/tmpfiles.d + mkdir -p $(TARGET_DIR)/usr/share/factory/var + ln -s usr/share/factory/var $(TARGET_DIR)/var + echo "/dev/root / auto ro 0 1" >$(TARGET_DIR)/etc/fstab + echo "tmpfs /var tmpfs mode=1777 0 0" >>$(TARGET_DIR)/etc/fstab +endef + +define SKELETON_INIT_SYSTEMD_PRE_ROOTFS_VAR + rm -f $(TARGET_DIR)/var + mkdir $(TARGET_DIR)/var + for i in $(TARGET_DIR)/usr/share/factory/var/*; do \ + j="$${i#$(TARGET_DIR)/usr/share/factory}"; \ + if [ -L "$${i}" ]; then \ + printf "L+! %s - - - - %s\n" \ + "$${j}" "../usr/share/factory/$${j}" \ + || exit 1; \ + else \ + printf "C! %s - - - -\n" "$${j}" \ + || exit 1; \ + fi; \ + done >$(TARGET_DIR)/etc/tmpfiles.d/var-factory.conf +endef +SKELETON_INIT_SYSTEMD_ROOTFS_PRE_CMD_HOOKS += SKELETON_INIT_SYSTEMD_PRE_ROOTFS_VAR + +define SKELETON_INIT_SYSTEMD_POST_ROOTFS_VAR + rm -rf $(TARGET_DIR)/var + ln -s usr/share/factory/var $(TARGET_DIR)/var +endef +SKELETON_INIT_SYSTEMD_ROOTFS_POST_CMD_HOOKS += SKELETON_INIT_SYSTEMD_POST_ROOTFS_VAR + +endif + +define SKELETON_INIT_SYSTEMD_INSTALL_TARGET_CMDS + mkdir -p $(TARGET_DIR)/home + mkdir -p $(TARGET_DIR)/srv + $(SKELETON_INIT_SYSTEMD_ROOT_RO_OR_RW) +endef + +$(eval $(generic-package)) diff --git a/package/skeleton-systemd/Config.in b/package/skeleton-systemd/Config.in deleted file mode 100644 index c507264598..0000000000 --- a/package/skeleton-systemd/Config.in +++ /dev/null @@ -1,7 +0,0 @@ -config BR2_PACKAGE_SKELETON_SYSTEMD - bool - select BR2_PACKAGE_HAS_SKELETON - select BR2_PACKAGE_SKELETON_COMMON - -config BR2_PACKAGE_PROVIDES_SKELETON - default "skeleton-systemd" if BR2_PACKAGE_SKELETON_SYSTEMD diff --git a/package/skeleton-systemd/skeleton-systemd.mk b/package/skeleton-systemd/skeleton-systemd.mk deleted file mode 100644 index 860ebea2cd..0000000000 --- a/package/skeleton-systemd/skeleton-systemd.mk +++ /dev/null @@ -1,71 +0,0 @@ -################################################################################ -# -# skeleton-systemd -# -################################################################################ - -# The skeleton can't depend on the toolchain, since all packages depends on the -# skeleton and the toolchain is a target package, as is skeleton. -# Hence, skeleton would depends on the toolchain and the toolchain would depend -# on skeleton. -SKELETON_SYSTEMD_ADD_TOOLCHAIN_DEPENDENCY = NO -SKELETON_SYSTEMD_ADD_SKELETON_DEPENDENCY = NO - -SKELETON_SYSTEMD_DEPENDENCIES = skeleton-common - -SKELETON_SYSTEMD_PROVIDES = skeleton - -ifeq ($(BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW),y) - -define SKELETON_SYSTEMD_ROOT_RO_OR_RW - echo "/dev/root / auto rw 0 1" >$(TARGET_DIR)/etc/fstab - mkdir -p $(TARGET_DIR)/var -endef - -else - -# On a R/O rootfs, /var is a tmpfs filesystem. So, at build time, we -# redirect /var to the "factory settings" location. Just before the -# filesystem gets created, the /var symlink will be replaced with -# a real (but empty) directory, and the "factory files" will be copied -# back there by the tmpfiles.d mechanism. -define SKELETON_SYSTEMD_ROOT_RO_OR_RW - mkdir -p $(TARGET_DIR)/etc/systemd/tmpfiles.d - mkdir -p $(TARGET_DIR)/usr/share/factory/var - ln -s usr/share/factory/var $(TARGET_DIR)/var - echo "/dev/root / auto ro 0 1" >$(TARGET_DIR)/etc/fstab - echo "tmpfs /var tmpfs mode=1777 0 0" >>$(TARGET_DIR)/etc/fstab -endef - -define SKELETON_SYSTEMD_PRE_ROOTFS_VAR - rm -f $(TARGET_DIR)/var - mkdir $(TARGET_DIR)/var - for i in $(TARGET_DIR)/usr/share/factory/var/*; do \ - j="$${i#$(TARGET_DIR)/usr/share/factory}"; \ - if [ -L "$${i}" ]; then \ - printf "L+! %s - - - - %s\n" \ - "$${j}" "../usr/share/factory/$${j}" \ - || exit 1; \ - else \ - printf "C! %s - - - -\n" "$${j}" \ - || exit 1; \ - fi; \ - done >$(TARGET_DIR)/etc/tmpfiles.d/var-factory.conf -endef -SKELETON_SYSTEMD_ROOTFS_PRE_CMD_HOOKS += SKELETON_SYSTEMD_PRE_ROOTFS_VAR - -define SKELETON_SYSTEMD_POST_ROOTFS_VAR - rm -rf $(TARGET_DIR)/var - ln -s usr/share/factory/var $(TARGET_DIR)/var -endef -SKELETON_SYSTEMD_ROOTFS_POST_CMD_HOOKS += SKELETON_SYSTEMD_POST_ROOTFS_VAR - -endif - -define SKELETON_SYSTEMD_INSTALL_TARGET_CMDS - mkdir -p $(TARGET_DIR)/home - mkdir -p $(TARGET_DIR)/srv - $(SKELETON_SYSTEMD_ROOT_RO_OR_RW) -endef - -$(eval $(generic-package)) diff --git a/system/Config.in b/system/Config.in index 45326f0985..cbde411895 100644 --- a/system/Config.in +++ b/system/Config.in @@ -11,7 +11,7 @@ config BR2_ROOTFS_SKELETON_DEFAULT bool "default target skeleton" select BR2_PACKAGE_SKELETON_SYSV if BR2_INIT_SYSV select BR2_PACKAGE_SKELETON_SYSV if BR2_INIT_BUSYBOX - select BR2_PACKAGE_SKELETON_SYSTEMD if BR2_INIT_SYSTEMD + select BR2_PACKAGE_SKELETON_INIT_SYSTEMD if BR2_INIT_SYSTEMD select BR2_PACKAGE_SKELETON_INIT_NONE if BR2_INIT_NONE help Use default target skeleton