* [Buildroot] [PATCH 01/24 v2] package/skeleton: remove useless .empty file
2016-06-22 19:07 [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton) Yann E. MORIN
@ 2016-06-22 19:07 ` Yann E. MORIN
2016-07-04 7:28 ` Arnout Vandecappelle
2016-07-05 13:57 ` Thomas Petazzoni
2016-06-22 19:07 ` [Buildroot] [PATCH 02/24 v2] system: sysvinit only selects busybox-show-others if busybox is enabled Yann E. MORIN
` (23 subsequent siblings)
24 siblings, 2 replies; 73+ messages in thread
From: Yann E. MORIN @ 2016-06-22 19:07 UTC (permalink / raw)
To: buildroot
We now have a real file in that directory, so we do not need a .empty
placeholder.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
system/skeleton/etc/network/if-pre-up.d/.empty | 0
1 file changed, 0 insertions(+), 0 deletions(-)
delete mode 100644 system/skeleton/etc/network/if-pre-up.d/.empty
diff --git a/system/skeleton/etc/network/if-pre-up.d/.empty b/system/skeleton/etc/network/if-pre-up.d/.empty
deleted file mode 100644
index e69de29..0000000
--
2.7.4
^ permalink raw reply [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 01/24 v2] package/skeleton: remove useless .empty file
2016-06-22 19:07 ` [Buildroot] [PATCH 01/24 v2] package/skeleton: remove useless .empty file Yann E. MORIN
@ 2016-07-04 7:28 ` Arnout Vandecappelle
2016-07-05 13:57 ` Thomas Petazzoni
1 sibling, 0 replies; 73+ messages in thread
From: Arnout Vandecappelle @ 2016-07-04 7:28 UTC (permalink / raw)
To: buildroot
On 22-06-16 21:07, Yann E. MORIN wrote:
> We now have a real file in that directory, so we do not need a .empty
> placeholder.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Regards,
Arnout
> ---
> system/skeleton/etc/network/if-pre-up.d/.empty | 0
> 1 file changed, 0 insertions(+), 0 deletions(-)
> delete mode 100644 system/skeleton/etc/network/if-pre-up.d/.empty
>
> diff --git a/system/skeleton/etc/network/if-pre-up.d/.empty b/system/skeleton/etc/network/if-pre-up.d/.empty
> deleted file mode 100644
> index e69de29..0000000
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 01/24 v2] package/skeleton: remove useless .empty file
2016-06-22 19:07 ` [Buildroot] [PATCH 01/24 v2] package/skeleton: remove useless .empty file Yann E. MORIN
2016-07-04 7:28 ` Arnout Vandecappelle
@ 2016-07-05 13:57 ` Thomas Petazzoni
1 sibling, 0 replies; 73+ messages in thread
From: Thomas Petazzoni @ 2016-07-05 13:57 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 22 Jun 2016 21:07:23 +0200, Yann E. MORIN wrote:
> We now have a real file in that directory, so we do not need a .empty
> placeholder.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> ---
> system/skeleton/etc/network/if-pre-up.d/.empty | 0
> 1 file changed, 0 insertions(+), 0 deletions(-)
> delete mode 100644 system/skeleton/etc/network/if-pre-up.d/.empty
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 02/24 v2] system: sysvinit only selects busybox-show-others if busybox is enabled
2016-06-22 19:07 [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton) Yann E. MORIN
2016-06-22 19:07 ` [Buildroot] [PATCH 01/24 v2] package/skeleton: remove useless .empty file Yann E. MORIN
@ 2016-06-22 19:07 ` Yann E. MORIN
2016-07-03 7:53 ` Romain Naour
2016-06-22 19:07 ` [Buildroot] [PATCH 03/24 v2] package/skeleton: respect variables namespace Yann E. MORIN
` (22 subsequent siblings)
24 siblings, 1 reply; 73+ messages in thread
From: Yann E. MORIN @ 2016-06-22 19:07 UTC (permalink / raw)
To: buildroot
BR2_PACKAGE_BUSYBOX_SHOW_OTHERS is a bit special. When Busybox is
enabled, it is a Busybox option. When Busybox is not enabled, it is a
stand-alone option, forcibly enabled.
So we can safely 'select' it without ensuring (via a 'depends on' or
another 'select') that Busybox is enabled.
However, the name of this option does not express the fact that it is
safe to select it without checking Busybox, which can lead to a bit of
time-consuming head-scratching.
To avoid future puzzlement from an unsuspecting observer, consider this
to be a Busybox option, and only select it when Busybox is enabled.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
---
Changes v1 -> v2:
- only select if busybox is enabled (Thomas)
---
Hopefully, this will avoid people to go hunting like I did, and loose a
few precious minutes of hair-pulling... ;-]
---
system/Config.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/system/Config.in b/system/Config.in
index 9441467..2d20230 100644
--- a/system/Config.in
+++ b/system/Config.in
@@ -74,7 +74,7 @@ config BR2_INIT_BUSYBOX
config BR2_INIT_SYSV
bool "systemV"
- select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # sysvinit
+ select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS if BR2_PACKAGE_BUSYBOX # sysvinit
select BR2_PACKAGE_INITSCRIPTS
select BR2_PACKAGE_SYSVINIT
--
2.7.4
^ permalink raw reply related [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 02/24 v2] system: sysvinit only selects busybox-show-others if busybox is enabled
2016-06-22 19:07 ` [Buildroot] [PATCH 02/24 v2] system: sysvinit only selects busybox-show-others if busybox is enabled Yann E. MORIN
@ 2016-07-03 7:53 ` Romain Naour
2016-07-04 16:49 ` Yann E. MORIN
0 siblings, 1 reply; 73+ messages in thread
From: Romain Naour @ 2016-07-03 7:53 UTC (permalink / raw)
To: buildroot
Hi Yann,
Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> BR2_PACKAGE_BUSYBOX_SHOW_OTHERS is a bit special. When Busybox is
> enabled, it is a Busybox option. When Busybox is not enabled, it is a
> stand-alone option, forcibly enabled.
>
> So we can safely 'select' it without ensuring (via a 'depends on' or
> another 'select') that Busybox is enabled.
>
> However, the name of this option does not express the fact that it is
> safe to select it without checking Busybox, which can lead to a bit of
> time-consuming head-scratching.
>
> To avoid future puzzlement from an unsuspecting observer, consider this
> to be a Busybox option, and only select it when Busybox is enabled.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: Peter Korsgaard <peter@korsgaard.com>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Not related to your patch but should we do the same change for tovid and systemd
packages which select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS ?
Best regards,
Romain
>
> ---
> Changes v1 -> v2:
> - only select if busybox is enabled (Thomas)
>
> ---
> Hopefully, this will avoid people to go hunting like I did, and loose a
> few precious minutes of hair-pulling... ;-]
> ---
> system/Config.in | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/system/Config.in b/system/Config.in
> index 9441467..2d20230 100644
> --- a/system/Config.in
> +++ b/system/Config.in
> @@ -74,7 +74,7 @@ config BR2_INIT_BUSYBOX
>
> config BR2_INIT_SYSV
> bool "systemV"
> - select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # sysvinit
> + select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS if BR2_PACKAGE_BUSYBOX # sysvinit
> select BR2_PACKAGE_INITSCRIPTS
> select BR2_PACKAGE_SYSVINIT
>
>
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 02/24 v2] system: sysvinit only selects busybox-show-others if busybox is enabled
2016-07-03 7:53 ` Romain Naour
@ 2016-07-04 16:49 ` Yann E. MORIN
2016-07-05 13:59 ` Thomas Petazzoni
0 siblings, 1 reply; 73+ messages in thread
From: Yann E. MORIN @ 2016-07-04 16:49 UTC (permalink / raw)
To: buildroot
Romain, All,
On 2016-07-03 09:53 +0200, Romain Naour spake thusly:
> Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> > BR2_PACKAGE_BUSYBOX_SHOW_OTHERS is a bit special. When Busybox is
> > enabled, it is a Busybox option. When Busybox is not enabled, it is a
> > stand-alone option, forcibly enabled.
> >
> > So we can safely 'select' it without ensuring (via a 'depends on' or
> > another 'select') that Busybox is enabled.
> >
> > However, the name of this option does not express the fact that it is
> > safe to select it without checking Busybox, which can lead to a bit of
> > time-consuming head-scratching.
> >
> > To avoid future puzzlement from an unsuspecting observer, consider this
> > to be a Busybox option, and only select it when Busybox is enabled.
> >
> > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> > Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> > Cc: Peter Korsgaard <peter@korsgaard.com>
>
> Reviewed-by: Romain Naour <romain.naour@gmail.com>
>
> Not related to your patch but should we do the same change for tovid and systemd
> packages which select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS ?
Indeed, but in retrospect, I think I should drop this patch
altogether...
This option is really special, so I think a better solution would
probably to add a big fat comment above that option that basically
states that:
# This option is not an option of Busybox, it canbe selected even
# if Busybox is not enabled.
I'll do that in a follow-up series.
Thanks for the review! ;-)
Regards,
Yann E. MORIN.
> Best regards,
> Romain
>
> >
> > ---
> > Changes v1 -> v2:
> > - only select if busybox is enabled (Thomas)
> >
> > ---
> > Hopefully, this will avoid people to go hunting like I did, and loose a
> > few precious minutes of hair-pulling... ;-]
> > ---
> > system/Config.in | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/system/Config.in b/system/Config.in
> > index 9441467..2d20230 100644
> > --- a/system/Config.in
> > +++ b/system/Config.in
> > @@ -74,7 +74,7 @@ config BR2_INIT_BUSYBOX
> >
> > config BR2_INIT_SYSV
> > bool "systemV"
> > - select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # sysvinit
> > + select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS if BR2_PACKAGE_BUSYBOX # sysvinit
> > select BR2_PACKAGE_INITSCRIPTS
> > select BR2_PACKAGE_SYSVINIT
> >
> >
>
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 02/24 v2] system: sysvinit only selects busybox-show-others if busybox is enabled
2016-07-04 16:49 ` Yann E. MORIN
@ 2016-07-05 13:59 ` Thomas Petazzoni
0 siblings, 0 replies; 73+ messages in thread
From: Thomas Petazzoni @ 2016-07-05 13:59 UTC (permalink / raw)
To: buildroot
Hello,
On Mon, 4 Jul 2016 18:49:17 +0200, Yann E. MORIN wrote:
> Indeed, but in retrospect, I think I should drop this patch
> altogether...
Following this, I've marked this patch as Rejected. It's indeed simpler
to just select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS, even if technically
when Busybox is disabled, this symbol is always set to 'y'.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 03/24 v2] package/skeleton: respect variables namespace
2016-06-22 19:07 [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton) Yann E. MORIN
2016-06-22 19:07 ` [Buildroot] [PATCH 01/24 v2] package/skeleton: remove useless .empty file Yann E. MORIN
2016-06-22 19:07 ` [Buildroot] [PATCH 02/24 v2] system: sysvinit only selects busybox-show-others if busybox is enabled Yann E. MORIN
@ 2016-06-22 19:07 ` Yann E. MORIN
2016-07-03 8:15 ` Romain Naour
2016-07-05 13:28 ` Thomas Petazzoni
2016-06-22 19:07 ` [Buildroot] [PATCH 04/24 v2] system/skeleton: update etc/mtab with a more sensible link Yann E. MORIN
` (21 subsequent siblings)
24 siblings, 2 replies; 73+ messages in thread
From: Yann E. MORIN @ 2016-06-22 19:07 UTC (permalink / raw)
To: buildroot
In makefiles, variables have global scope. We traditionally ensure that
we get no name clashing by prefixing all variables with the package
name.
Currently, this is not the case in the skeleton package, for historical
reasons (code snippets copied over from the common Makefiles). We
currently have a mix of naming for the variables:
- some are indeed prefixed with SKELETON_
- some are prefixed with SYSTEM_
- some are prefixed with both
- some are not prefixed
Clean up these discrepancies, and prefix all variables with just
SKELETON_ and drop the SYSTEM_ prefix.
Also include SET_ in all variables that do set something (getty) for
consistency across all the variables.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
package/skeleton/skeleton.mk | 60 ++++++++++++++++++++++----------------------
1 file changed, 30 insertions(+), 30 deletions(-)
diff --git a/package/skeleton/skeleton.mk b/package/skeleton/skeleton.mk
index 4e3cdc6..3852448 100644
--- a/package/skeleton/skeleton.mk
+++ b/package/skeleton/skeleton.mk
@@ -121,24 +121,24 @@ SKELETON_TARGET_GENERIC_GETTY_TERM = $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_TE
SKELETON_TARGET_GENERIC_GETTY_OPTIONS = $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_OPTIONS))
ifneq ($(SKELETON_TARGET_GENERIC_HOSTNAME),)
-define SYSTEM_HOSTNAME
+define SKELETON_SET_HOSTNAME
mkdir -p $(TARGET_DIR)/etc
echo "$(SKELETON_TARGET_GENERIC_HOSTNAME)" > $(TARGET_DIR)/etc/hostname
$(SED) '$$a \127.0.1.1\t$(SKELETON_TARGET_GENERIC_HOSTNAME)' \
-e '/^127.0.1.1/d' $(TARGET_DIR)/etc/hosts
endef
-TARGET_FINALIZE_HOOKS += SYSTEM_HOSTNAME
+TARGET_FINALIZE_HOOKS += SKELETON_SET_HOSTNAME
endif
ifneq ($(SKELETON_TARGET_GENERIC_ISSUE),)
-define SYSTEM_ISSUE
+define SKELETON_SET_ISSUE
mkdir -p $(TARGET_DIR)/etc
echo "$(SKELETON_TARGET_GENERIC_ISSUE)" > $(TARGET_DIR)/etc/issue
endef
-TARGET_FINALIZE_HOOKS += SYSTEM_ISSUE
+TARGET_FINALIZE_HOOKS += SKELETON_SET_ISSUE
endif
-define SET_NETWORK_LOCALHOST
+define SKELETON_SET_NETWORK_LOCALHOST
( \
echo "# interface file auto-generated by buildroot"; \
echo ; \
@@ -147,14 +147,14 @@ define SET_NETWORK_LOCALHOST
) > $(TARGET_DIR)/etc/network/interfaces
endef
-NETWORK_DHCP_IFACE = $(call qstrip,$(BR2_SYSTEM_DHCP))
+SKELETON_NETWORK_DHCP_IFACE = $(call qstrip,$(BR2_SYSTEM_DHCP))
-ifneq ($(NETWORK_DHCP_IFACE),)
-define SET_NETWORK_DHCP
+ifneq ($(SKELETON_NETWORK_DHCP_IFACE),)
+define SKELETON_SET_NETWORK_DHCP
( \
echo ; \
- echo "auto $(NETWORK_DHCP_IFACE)"; \
- echo "iface $(NETWORK_DHCP_IFACE) inet dhcp"; \
+ echo "auto $(SKELETON_NETWORK_DHCP_IFACE)"; \
+ echo "iface $(SKELETON_NETWORK_DHCP_IFACE) inet dhcp"; \
echo " pre-up /etc/network/nfs_check"; \
echo " wait-delay 15"; \
) >> $(TARGET_DIR)/etc/network/interfaces
@@ -163,13 +163,13 @@ define SET_NETWORK_DHCP
endef
endif
-define SET_NETWORK
+define SKELETON_SET_NETWORK
mkdir -p $(TARGET_DIR)/etc/network/
- $(SET_NETWORK_LOCALHOST)
- $(SET_NETWORK_DHCP)
+ $(SKELETON_SET_NETWORK_LOCALHOST)
+ $(SKELETON_SET_NETWORK_DHCP)
endef
-TARGET_FINALIZE_HOOKS += SET_NETWORK
+TARGET_FINALIZE_HOOKS += SKELETON_SET_NETWORK
# The TARGET_FINALIZE_HOOKS must be sourced only if the users choose to use the
# default skeleton.
@@ -177,66 +177,66 @@ ifeq ($(BR2_ROOTFS_SKELETON_DEFAULT),y)
ifeq ($(BR2_TARGET_ENABLE_ROOT_LOGIN),y)
ifeq ($(SKELETON_TARGET_GENERIC_ROOT_PASSWD),)
-SYSTEM_ROOT_PASSWORD =
+SKELETON_ROOT_PASSWORD =
else ifneq ($(filter $$1$$% $$5$$% $$6$$%,$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)),)
-SYSTEM_ROOT_PASSWORD = '$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)'
+SKELETON_ROOT_PASSWORD = '$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)'
else
SKELETON_DEPENDENCIES += host-mkpasswd
# This variable will only be evaluated in the finalize stage, so we can
# be sure that host-mkpasswd will have already been built by that time.
-SYSTEM_ROOT_PASSWORD = "`$(MKPASSWD) -m "$(SKELETON_TARGET_GENERIC_PASSWD_METHOD)" "$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)"`"
+SKELETON_ROOT_PASSWORD = "`$(MKPASSWD) -m "$(SKELETON_TARGET_GENERIC_PASSWD_METHOD)" "$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)"`"
endif
else # !BR2_TARGET_ENABLE_ROOT_LOGIN
-SYSTEM_ROOT_PASSWORD = "*"
+SKELETON_ROOT_PASSWORD = "*"
endif
-define SKELETON_SYSTEM_SET_ROOT_PASSWD
- $(SED) s,^root:[^:]*:,root:$(SYSTEM_ROOT_PASSWORD):, $(TARGET_DIR)/etc/shadow
+define SKELETON_SET_ROOT_PASSWD
+ $(SED) s,^root:[^:]*:,root:$(SKELETON_ROOT_PASSWORD):, $(TARGET_DIR)/etc/shadow
endef
-TARGET_FINALIZE_HOOKS += SKELETON_SYSTEM_SET_ROOT_PASSWD
+TARGET_FINALIZE_HOOKS += SKELETON_SET_ROOT_PASSWD
ifeq ($(BR2_SYSTEM_BIN_SH_NONE),y)
-define SKELETON_SYSTEM_BIN_SH
+define SKELETON_BIN_SH
rm -f $(TARGET_DIR)/bin/sh
endef
else
-define SKELETON_SYSTEM_BIN_SH
+define SKELETON_BIN_SH
ln -sf $(SKELETON_TARGET_GENERIC_BIN_SH) $(TARGET_DIR)/bin/sh
endef
endif
-TARGET_FINALIZE_HOOKS += SKELETON_SYSTEM_BIN_SH
+TARGET_FINALIZE_HOOKS += SKELETON_BIN_SH
ifeq ($(BR2_TARGET_GENERIC_GETTY),y)
ifeq ($(BR2_INIT_SYSV),y)
# In sysvinit inittab, the "id" must not be longer than 4 bytes, so we
# skip the "tty" part and keep only the remaining.
-define SKELETON_SYSTEM_GETTY
+define SKELETON_SET_GETTY
$(SED) '/# GENERIC_SERIAL$$/s~^.*#~$(shell echo $(SKELETON_TARGET_GENERIC_GETTY_PORT) | tail -c+4)::respawn:/sbin/getty -L $(SKELETON_TARGET_GENERIC_GETTY_OPTIONS) $(SKELETON_TARGET_GENERIC_GETTY_PORT) $(SKELETON_TARGET_GENERIC_GETTY_BAUDRATE) $(SKELETON_TARGET_GENERIC_GETTY_TERM) #~' \
$(TARGET_DIR)/etc/inittab
endef
else ifeq ($(BR2_INIT_BUSYBOX),y)
# Add getty to busybox inittab
-define SKELETON_SYSTEM_GETTY
+define SKELETON_SET_GETTY
$(SED) '/# GENERIC_SERIAL$$/s~^.*#~$(SKELETON_TARGET_GENERIC_GETTY_PORT)::respawn:/sbin/getty -L $(SKELETON_TARGET_GENERIC_GETTY_OPTIONS) $(SKELETON_TARGET_GENERIC_GETTY_PORT) $(SKELETON_TARGET_GENERIC_GETTY_BAUDRATE) $(SKELETON_TARGET_GENERIC_GETTY_TERM) #~' \
$(TARGET_DIR)/etc/inittab
endef
endif
-TARGET_FINALIZE_HOOKS += SKELETON_SYSTEM_GETTY
+TARGET_FINALIZE_HOOKS += SKELETON_SET_GETTY
endif
ifeq ($(BR2_INIT_BUSYBOX)$(BR2_INIT_SYSV),y)
ifeq ($(BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW),y)
# Find commented line, if any, and remove leading '#'s
-define SKELETON_SYSTEM_REMOUNT_RW
+define SKELETON_REMOUNT_RW
$(SED) '/^#.*-o remount,rw \/$$/s~^#\+~~' $(TARGET_DIR)/etc/inittab
endef
else
# Find uncommented line, if any, and add a leading '#'
-define SKELETON_SYSTEM_REMOUNT_RW
+define SKELETON_REMOUNT_RW
$(SED) '/^[^#].*-o remount,rw \/$$/s~^~#~' $(TARGET_DIR)/etc/inittab
endef
endif
-TARGET_FINALIZE_HOOKS += SKELETON_SYSTEM_REMOUNT_RW
+TARGET_FINALIZE_HOOKS += SKELETON_REMOUNT_RW
endif # BR2_INIT_BUSYBOX || BR2_INIT_SYSV
endif # BR2_ROOTFS_SKELETON_DEFAULT
--
2.7.4
^ permalink raw reply related [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 03/24 v2] package/skeleton: respect variables namespace
2016-06-22 19:07 ` [Buildroot] [PATCH 03/24 v2] package/skeleton: respect variables namespace Yann E. MORIN
@ 2016-07-03 8:15 ` Romain Naour
2016-07-05 13:28 ` Thomas Petazzoni
1 sibling, 0 replies; 73+ messages in thread
From: Romain Naour @ 2016-07-03 8:15 UTC (permalink / raw)
To: buildroot
Hi Yann,
Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> In makefiles, variables have global scope. We traditionally ensure that
> we get no name clashing by prefixing all variables with the package
> name.
>
> Currently, this is not the case in the skeleton package, for historical
> reasons (code snippets copied over from the common Makefiles). We
> currently have a mix of naming for the variables:
> - some are indeed prefixed with SKELETON_
> - some are prefixed with SYSTEM_
> - some are prefixed with both
> - some are not prefixed
>
> Clean up these discrepancies, and prefix all variables with just
> SKELETON_ and drop the SYSTEM_ prefix.
>
> Also include SET_ in all variables that do set something (getty) for
> consistency across all the variables.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Best regards,
Romain
> ---
> package/skeleton/skeleton.mk | 60 ++++++++++++++++++++++----------------------
> 1 file changed, 30 insertions(+), 30 deletions(-)
>
> diff --git a/package/skeleton/skeleton.mk b/package/skeleton/skeleton.mk
> index 4e3cdc6..3852448 100644
> --- a/package/skeleton/skeleton.mk
> +++ b/package/skeleton/skeleton.mk
> @@ -121,24 +121,24 @@ SKELETON_TARGET_GENERIC_GETTY_TERM = $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_TE
> SKELETON_TARGET_GENERIC_GETTY_OPTIONS = $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_OPTIONS))
>
> ifneq ($(SKELETON_TARGET_GENERIC_HOSTNAME),)
> -define SYSTEM_HOSTNAME
> +define SKELETON_SET_HOSTNAME
> mkdir -p $(TARGET_DIR)/etc
> echo "$(SKELETON_TARGET_GENERIC_HOSTNAME)" > $(TARGET_DIR)/etc/hostname
> $(SED) '$$a \127.0.1.1\t$(SKELETON_TARGET_GENERIC_HOSTNAME)' \
> -e '/^127.0.1.1/d' $(TARGET_DIR)/etc/hosts
> endef
> -TARGET_FINALIZE_HOOKS += SYSTEM_HOSTNAME
> +TARGET_FINALIZE_HOOKS += SKELETON_SET_HOSTNAME
> endif
>
> ifneq ($(SKELETON_TARGET_GENERIC_ISSUE),)
> -define SYSTEM_ISSUE
> +define SKELETON_SET_ISSUE
> mkdir -p $(TARGET_DIR)/etc
> echo "$(SKELETON_TARGET_GENERIC_ISSUE)" > $(TARGET_DIR)/etc/issue
> endef
> -TARGET_FINALIZE_HOOKS += SYSTEM_ISSUE
> +TARGET_FINALIZE_HOOKS += SKELETON_SET_ISSUE
> endif
>
> -define SET_NETWORK_LOCALHOST
> +define SKELETON_SET_NETWORK_LOCALHOST
> ( \
> echo "# interface file auto-generated by buildroot"; \
> echo ; \
> @@ -147,14 +147,14 @@ define SET_NETWORK_LOCALHOST
> ) > $(TARGET_DIR)/etc/network/interfaces
> endef
>
> -NETWORK_DHCP_IFACE = $(call qstrip,$(BR2_SYSTEM_DHCP))
> +SKELETON_NETWORK_DHCP_IFACE = $(call qstrip,$(BR2_SYSTEM_DHCP))
>
> -ifneq ($(NETWORK_DHCP_IFACE),)
> -define SET_NETWORK_DHCP
> +ifneq ($(SKELETON_NETWORK_DHCP_IFACE),)
> +define SKELETON_SET_NETWORK_DHCP
> ( \
> echo ; \
> - echo "auto $(NETWORK_DHCP_IFACE)"; \
> - echo "iface $(NETWORK_DHCP_IFACE) inet dhcp"; \
> + echo "auto $(SKELETON_NETWORK_DHCP_IFACE)"; \
> + echo "iface $(SKELETON_NETWORK_DHCP_IFACE) inet dhcp"; \
> echo " pre-up /etc/network/nfs_check"; \
> echo " wait-delay 15"; \
> ) >> $(TARGET_DIR)/etc/network/interfaces
> @@ -163,13 +163,13 @@ define SET_NETWORK_DHCP
> endef
> endif
>
> -define SET_NETWORK
> +define SKELETON_SET_NETWORK
> mkdir -p $(TARGET_DIR)/etc/network/
> - $(SET_NETWORK_LOCALHOST)
> - $(SET_NETWORK_DHCP)
> + $(SKELETON_SET_NETWORK_LOCALHOST)
> + $(SKELETON_SET_NETWORK_DHCP)
> endef
>
> -TARGET_FINALIZE_HOOKS += SET_NETWORK
> +TARGET_FINALIZE_HOOKS += SKELETON_SET_NETWORK
>
> # The TARGET_FINALIZE_HOOKS must be sourced only if the users choose to use the
> # default skeleton.
> @@ -177,66 +177,66 @@ ifeq ($(BR2_ROOTFS_SKELETON_DEFAULT),y)
>
> ifeq ($(BR2_TARGET_ENABLE_ROOT_LOGIN),y)
> ifeq ($(SKELETON_TARGET_GENERIC_ROOT_PASSWD),)
> -SYSTEM_ROOT_PASSWORD =
> +SKELETON_ROOT_PASSWORD =
> else ifneq ($(filter $$1$$% $$5$$% $$6$$%,$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)),)
> -SYSTEM_ROOT_PASSWORD = '$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)'
> +SKELETON_ROOT_PASSWORD = '$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)'
> else
> SKELETON_DEPENDENCIES += host-mkpasswd
> # This variable will only be evaluated in the finalize stage, so we can
> # be sure that host-mkpasswd will have already been built by that time.
> -SYSTEM_ROOT_PASSWORD = "`$(MKPASSWD) -m "$(SKELETON_TARGET_GENERIC_PASSWD_METHOD)" "$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)"`"
> +SKELETON_ROOT_PASSWORD = "`$(MKPASSWD) -m "$(SKELETON_TARGET_GENERIC_PASSWD_METHOD)" "$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)"`"
> endif
> else # !BR2_TARGET_ENABLE_ROOT_LOGIN
> -SYSTEM_ROOT_PASSWORD = "*"
> +SKELETON_ROOT_PASSWORD = "*"
> endif
>
> -define SKELETON_SYSTEM_SET_ROOT_PASSWD
> - $(SED) s,^root:[^:]*:,root:$(SYSTEM_ROOT_PASSWORD):, $(TARGET_DIR)/etc/shadow
> +define SKELETON_SET_ROOT_PASSWD
> + $(SED) s,^root:[^:]*:,root:$(SKELETON_ROOT_PASSWORD):, $(TARGET_DIR)/etc/shadow
> endef
> -TARGET_FINALIZE_HOOKS += SKELETON_SYSTEM_SET_ROOT_PASSWD
> +TARGET_FINALIZE_HOOKS += SKELETON_SET_ROOT_PASSWD
>
> ifeq ($(BR2_SYSTEM_BIN_SH_NONE),y)
> -define SKELETON_SYSTEM_BIN_SH
> +define SKELETON_BIN_SH
> rm -f $(TARGET_DIR)/bin/sh
> endef
> else
> -define SKELETON_SYSTEM_BIN_SH
> +define SKELETON_BIN_SH
> ln -sf $(SKELETON_TARGET_GENERIC_BIN_SH) $(TARGET_DIR)/bin/sh
> endef
> endif
> -TARGET_FINALIZE_HOOKS += SKELETON_SYSTEM_BIN_SH
> +TARGET_FINALIZE_HOOKS += SKELETON_BIN_SH
>
> ifeq ($(BR2_TARGET_GENERIC_GETTY),y)
> ifeq ($(BR2_INIT_SYSV),y)
> # In sysvinit inittab, the "id" must not be longer than 4 bytes, so we
> # skip the "tty" part and keep only the remaining.
> -define SKELETON_SYSTEM_GETTY
> +define SKELETON_SET_GETTY
> $(SED) '/# GENERIC_SERIAL$$/s~^.*#~$(shell echo $(SKELETON_TARGET_GENERIC_GETTY_PORT) | tail -c+4)::respawn:/sbin/getty -L $(SKELETON_TARGET_GENERIC_GETTY_OPTIONS) $(SKELETON_TARGET_GENERIC_GETTY_PORT) $(SKELETON_TARGET_GENERIC_GETTY_BAUDRATE) $(SKELETON_TARGET_GENERIC_GETTY_TERM) #~' \
> $(TARGET_DIR)/etc/inittab
> endef
> else ifeq ($(BR2_INIT_BUSYBOX),y)
> # Add getty to busybox inittab
> -define SKELETON_SYSTEM_GETTY
> +define SKELETON_SET_GETTY
> $(SED) '/# GENERIC_SERIAL$$/s~^.*#~$(SKELETON_TARGET_GENERIC_GETTY_PORT)::respawn:/sbin/getty -L $(SKELETON_TARGET_GENERIC_GETTY_OPTIONS) $(SKELETON_TARGET_GENERIC_GETTY_PORT) $(SKELETON_TARGET_GENERIC_GETTY_BAUDRATE) $(SKELETON_TARGET_GENERIC_GETTY_TERM) #~' \
> $(TARGET_DIR)/etc/inittab
> endef
> endif
> -TARGET_FINALIZE_HOOKS += SKELETON_SYSTEM_GETTY
> +TARGET_FINALIZE_HOOKS += SKELETON_SET_GETTY
> endif
>
> ifeq ($(BR2_INIT_BUSYBOX)$(BR2_INIT_SYSV),y)
> ifeq ($(BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW),y)
> # Find commented line, if any, and remove leading '#'s
> -define SKELETON_SYSTEM_REMOUNT_RW
> +define SKELETON_REMOUNT_RW
> $(SED) '/^#.*-o remount,rw \/$$/s~^#\+~~' $(TARGET_DIR)/etc/inittab
> endef
> else
> # Find uncommented line, if any, and add a leading '#'
> -define SKELETON_SYSTEM_REMOUNT_RW
> +define SKELETON_REMOUNT_RW
> $(SED) '/^[^#].*-o remount,rw \/$$/s~^~#~' $(TARGET_DIR)/etc/inittab
> endef
> endif
> -TARGET_FINALIZE_HOOKS += SKELETON_SYSTEM_REMOUNT_RW
> +TARGET_FINALIZE_HOOKS += SKELETON_REMOUNT_RW
> endif # BR2_INIT_BUSYBOX || BR2_INIT_SYSV
>
> endif # BR2_ROOTFS_SKELETON_DEFAULT
>
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 03/24 v2] package/skeleton: respect variables namespace
2016-06-22 19:07 ` [Buildroot] [PATCH 03/24 v2] package/skeleton: respect variables namespace Yann E. MORIN
2016-07-03 8:15 ` Romain Naour
@ 2016-07-05 13:28 ` Thomas Petazzoni
1 sibling, 0 replies; 73+ messages in thread
From: Thomas Petazzoni @ 2016-07-05 13:28 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 22 Jun 2016 21:07:25 +0200, Yann E. MORIN wrote:
> In makefiles, variables have global scope. We traditionally ensure that
> we get no name clashing by prefixing all variables with the package
> name.
>
> Currently, this is not the case in the skeleton package, for historical
> reasons (code snippets copied over from the common Makefiles). We
> currently have a mix of naming for the variables:
> - some are indeed prefixed with SKELETON_
> - some are prefixed with SYSTEM_
> - some are prefixed with both
> - some are not prefixed
>
> Clean up these discrepancies, and prefix all variables with just
> SKELETON_ and drop the SYSTEM_ prefix.
>
> Also include SET_ in all variables that do set something (getty) for
> consistency across all the variables.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> ---
> package/skeleton/skeleton.mk | 60 ++++++++++++++++++++++----------------------
> 1 file changed, 30 insertions(+), 30 deletions(-)
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 04/24 v2] system/skeleton: update etc/mtab with a more sensible link
2016-06-22 19:07 [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton) Yann E. MORIN
` (2 preceding siblings ...)
2016-06-22 19:07 ` [Buildroot] [PATCH 03/24 v2] package/skeleton: respect variables namespace Yann E. MORIN
@ 2016-06-22 19:07 ` Yann E. MORIN
2016-07-03 8:28 ` Romain Naour
` (2 more replies)
2016-06-22 19:07 ` [Buildroot] [PATCH 05/24 v2] system: systemd only really supports a R/W rootfs Yann E. MORIN
` (20 subsequent siblings)
24 siblings, 3 replies; 73+ messages in thread
From: Yann E. MORIN @ 2016-06-22 19:07 UTC (permalink / raw)
To: buildroot
Currently, our /etc/mtab points to /proc/mounts. This was all neat so
far, and was good for a sysv-like init system.
However, the way today is to point it at /proc/self/mounts, the
per-process mount tab.
Additionnally, that's what systemd expects. If /etc/mtab is not a
symlink to ../proc/self/mounts and the rootfs is readonly, systemd would
whine loudly (and a service unit would be marked failed).
Since it works well for sysv-like init systems too, just use that.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
system/skeleton/etc/mtab | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/system/skeleton/etc/mtab b/system/skeleton/etc/mtab
index 4c0a094..5c4677a 120000
--- a/system/skeleton/etc/mtab
+++ b/system/skeleton/etc/mtab
@@ -1 +1 @@
-/proc/mounts
\ No newline at end of file
+../proc/self/mounts
\ No newline at end of file
--
2.7.4
^ permalink raw reply related [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 04/24 v2] system/skeleton: update etc/mtab with a more sensible link
2016-06-22 19:07 ` [Buildroot] [PATCH 04/24 v2] system/skeleton: update etc/mtab with a more sensible link Yann E. MORIN
@ 2016-07-03 8:28 ` Romain Naour
2016-07-04 7:27 ` Arnout Vandecappelle
2016-07-05 13:28 ` Thomas Petazzoni
2 siblings, 0 replies; 73+ messages in thread
From: Romain Naour @ 2016-07-03 8:28 UTC (permalink / raw)
To: buildroot
Hi Yann,
Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> Currently, our /etc/mtab points to /proc/mounts. This was all neat so
> far, and was good for a sysv-like init system.
>
> However, the way today is to point it at /proc/self/mounts, the
> per-process mount tab.
>
> Additionnally, that's what systemd expects. If /etc/mtab is not a
> symlink to ../proc/self/mounts and the rootfs is readonly, systemd would
> whine loudly (and a service unit would be marked failed).
>
> Since it works well for sysv-like init systems too, just use that.
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Best regards,
Romain
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> ---
> system/skeleton/etc/mtab | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/system/skeleton/etc/mtab b/system/skeleton/etc/mtab
> index 4c0a094..5c4677a 120000
> --- a/system/skeleton/etc/mtab
> +++ b/system/skeleton/etc/mtab
> @@ -1 +1 @@
> -/proc/mounts
> \ No newline at end of file
> +../proc/self/mounts
> \ No newline at end of file
>
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 04/24 v2] system/skeleton: update etc/mtab with a more sensible link
2016-06-22 19:07 ` [Buildroot] [PATCH 04/24 v2] system/skeleton: update etc/mtab with a more sensible link Yann E. MORIN
2016-07-03 8:28 ` Romain Naour
@ 2016-07-04 7:27 ` Arnout Vandecappelle
2016-07-05 13:28 ` Thomas Petazzoni
2 siblings, 0 replies; 73+ messages in thread
From: Arnout Vandecappelle @ 2016-07-04 7:27 UTC (permalink / raw)
To: buildroot
On 22-06-16 21:07, Yann E. MORIN wrote:
> Currently, our /etc/mtab points to /proc/mounts. This was all neat so
> far, and was good for a sysv-like init system.
>
> However, the way today is to point it at /proc/self/mounts, the
> per-process mount tab.
>
> Additionnally, that's what systemd expects. If /etc/mtab is not a
> symlink to ../proc/self/mounts and the rootfs is readonly, systemd would
> whine loudly (and a service unit would be marked failed).
>
> Since it works well for sysv-like init systems too, just use that.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
I was worried a bit that /proc/self/mounts would need a relatively recent
kernel, but it already existed in 2.6.18 and probably earlier, so that's OK.
Then I worried about the relative instead of absolute symlink (I prefer an
absolute symlink for something like this), but is seems systemd really wants the
relative link, so OK.
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Regards,
Arnout
> ---
> system/skeleton/etc/mtab | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/system/skeleton/etc/mtab b/system/skeleton/etc/mtab
> index 4c0a094..5c4677a 120000
> --- a/system/skeleton/etc/mtab
> +++ b/system/skeleton/etc/mtab
> @@ -1 +1 @@
> -/proc/mounts
> \ No newline at end of file
> +../proc/self/mounts
> \ No newline at end of file
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 04/24 v2] system/skeleton: update etc/mtab with a more sensible link
2016-06-22 19:07 ` [Buildroot] [PATCH 04/24 v2] system/skeleton: update etc/mtab with a more sensible link Yann E. MORIN
2016-07-03 8:28 ` Romain Naour
2016-07-04 7:27 ` Arnout Vandecappelle
@ 2016-07-05 13:28 ` Thomas Petazzoni
2 siblings, 0 replies; 73+ messages in thread
From: Thomas Petazzoni @ 2016-07-05 13:28 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 22 Jun 2016 21:07:26 +0200, Yann E. MORIN wrote:
> Currently, our /etc/mtab points to /proc/mounts. This was all neat so
> far, and was good for a sysv-like init system.
>
> However, the way today is to point it at /proc/self/mounts, the
> per-process mount tab.
>
> Additionnally, that's what systemd expects. If /etc/mtab is not a
> symlink to ../proc/self/mounts and the rootfs is readonly, systemd would
> whine loudly (and a service unit would be marked failed).
>
> Since it works well for sysv-like init systems too, just use that.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> ---
> system/skeleton/etc/mtab | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 05/24 v2] system: systemd only really supports a R/W rootfs
2016-06-22 19:07 [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton) Yann E. MORIN
` (3 preceding siblings ...)
2016-06-22 19:07 ` [Buildroot] [PATCH 04/24 v2] system/skeleton: update etc/mtab with a more sensible link Yann E. MORIN
@ 2016-06-22 19:07 ` Yann E. MORIN
2016-07-03 8:31 ` Romain Naour
2016-07-05 13:29 ` Thomas Petazzoni
2016-06-22 19:07 ` [Buildroot] [PATCH 06/24 v2] package/systemd: disabling tty1 getty is a post-install hook Yann E. MORIN
` (19 subsequent siblings)
24 siblings, 2 replies; 73+ messages in thread
From: Yann E. MORIN @ 2016-06-22 19:07 UTC (permalink / raw)
To: buildroot
Supporting a R/O rootfs needs a bit more love to be fully operational.
This will come in later patches...
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
system/Config.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/system/Config.in b/system/Config.in
index 2d20230..4f9f270 100644
--- a/system/Config.in
+++ b/system/Config.in
@@ -94,6 +94,7 @@ config BR2_INIT_SYSTEMD
depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
select BR2_ROOTFS_MERGED_USR
select BR2_PACKAGE_SYSTEMD
+ select BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW
comment "systemd needs (e)glibc toolchain, headers >= 3.10"
depends on !(BR2_TOOLCHAIN_USES_GLIBC \
--
2.7.4
^ permalink raw reply related [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 05/24 v2] system: systemd only really supports a R/W rootfs
2016-06-22 19:07 ` [Buildroot] [PATCH 05/24 v2] system: systemd only really supports a R/W rootfs Yann E. MORIN
@ 2016-07-03 8:31 ` Romain Naour
2016-07-05 13:29 ` Thomas Petazzoni
1 sibling, 0 replies; 73+ messages in thread
From: Romain Naour @ 2016-07-03 8:31 UTC (permalink / raw)
To: buildroot
Hi Yann,
Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> Supporting a R/O rootfs needs a bit more love to be fully operational.
> This will come in later patches...
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Best regards,
Romain
> ---
> system/Config.in | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/system/Config.in b/system/Config.in
> index 2d20230..4f9f270 100644
> --- a/system/Config.in
> +++ b/system/Config.in
> @@ -94,6 +94,7 @@ config BR2_INIT_SYSTEMD
> depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
> select BR2_ROOTFS_MERGED_USR
> select BR2_PACKAGE_SYSTEMD
> + select BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW
>
> comment "systemd needs (e)glibc toolchain, headers >= 3.10"
> depends on !(BR2_TOOLCHAIN_USES_GLIBC \
>
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 05/24 v2] system: systemd only really supports a R/W rootfs
2016-06-22 19:07 ` [Buildroot] [PATCH 05/24 v2] system: systemd only really supports a R/W rootfs Yann E. MORIN
2016-07-03 8:31 ` Romain Naour
@ 2016-07-05 13:29 ` Thomas Petazzoni
1 sibling, 0 replies; 73+ messages in thread
From: Thomas Petazzoni @ 2016-07-05 13:29 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 22 Jun 2016 21:07:27 +0200, Yann E. MORIN wrote:
> Supporting a R/O rootfs needs a bit more love to be fully operational.
> This will come in later patches...
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> ---
> system/Config.in | 1 +
> 1 file changed, 1 insertion(+)
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 06/24 v2] package/systemd: disabling tty1 getty is a post-install hook
2016-06-22 19:07 [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton) Yann E. MORIN
` (4 preceding siblings ...)
2016-06-22 19:07 ` [Buildroot] [PATCH 05/24 v2] system: systemd only really supports a R/W rootfs Yann E. MORIN
@ 2016-06-22 19:07 ` Yann E. MORIN
2016-07-03 8:37 ` Romain Naour
2016-07-05 13:41 ` Thomas Petazzoni
2016-06-22 19:07 ` [Buildroot] [PATCH 07/24 v2] system: provide no default for custom skeleton path Yann E. MORIN
` (18 subsequent siblings)
24 siblings, 2 replies; 73+ messages in thread
From: Yann E. MORIN @ 2016-06-22 19:07 UTC (permalink / raw)
To: buildroot
Currently, we disable the getty on tty1 as a "init" step. It looks
better like it is a post-install hook.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
package/systemd/systemd.mk | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
index c0503ae..7e8fc0b 100644
--- a/package/systemd/systemd.mk
+++ b/package/systemd/systemd.mk
@@ -211,10 +211,15 @@ define SYSTEMD_INSTALL_MACHINEID_HOOK
touch $(TARGET_DIR)/etc/machine-id
endef
+define SYSTEMD_DISABLE_SERVICE_TTY1_HOOK
+ rm -f $(TARGET_DIR)/etc/systemd/system/getty.target.wants/getty at tty1.service
+endef
+
SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
SYSTEMD_INSTALL_INIT_HOOK \
SYSTEMD_INSTALL_MACHINEID_HOOK \
- SYSTEMD_INSTALL_RESOLVCONF_HOOK
+ SYSTEMD_INSTALL_RESOLVCONF_HOOK \
+ SYSTEMD_DISABLE_SERVICE_TTY1_HOOK
define SYSTEMD_USERS
systemd-journal -1 systemd-journal -1 * /var/log/journal - - Journal
@@ -228,10 +233,6 @@ define SYSTEMD_USERS
- - input -1 * - - - Input device group
endef
-define SYSTEMD_DISABLE_SERVICE_TTY1
- rm -f $(TARGET_DIR)/etc/systemd/system/getty.target.wants/getty at tty1.service
-endef
-
ifneq ($(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)),)
# systemd needs getty.service for VTs and serial-getty.service for serial ttys
# also patch the file to use the correct baud-rate, the default baudrate is 115200 so look for that
@@ -252,7 +253,6 @@ endef
endif
define SYSTEMD_INSTALL_INIT_SYSTEMD
- $(SYSTEMD_DISABLE_SERVICE_TTY1)
$(SYSTEMD_INSTALL_SERVICE_TTY)
$(SYSTEMD_INSTALL_SERVICE_NETWORK)
$(SYSTEMD_INSTALL_SERVICE_TIMESYNC)
--
2.7.4
^ permalink raw reply related [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 06/24 v2] package/systemd: disabling tty1 getty is a post-install hook
2016-06-22 19:07 ` [Buildroot] [PATCH 06/24 v2] package/systemd: disabling tty1 getty is a post-install hook Yann E. MORIN
@ 2016-07-03 8:37 ` Romain Naour
2016-07-04 17:13 ` Yann E. MORIN
2016-07-05 13:41 ` Thomas Petazzoni
1 sibling, 1 reply; 73+ messages in thread
From: Romain Naour @ 2016-07-03 8:37 UTC (permalink / raw)
To: buildroot
Hi Yann,
Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> Currently, we disable the getty on tty1 as a "init" step. It looks
> better like it is a post-install hook.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> ---
> package/systemd/systemd.mk | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
> index c0503ae..7e8fc0b 100644
> --- a/package/systemd/systemd.mk
> +++ b/package/systemd/systemd.mk
> @@ -211,10 +211,15 @@ define SYSTEMD_INSTALL_MACHINEID_HOOK
> touch $(TARGET_DIR)/etc/machine-id
> endef
>
> +define SYSTEMD_DISABLE_SERVICE_TTY1_HOOK
> + rm -f $(TARGET_DIR)/etc/systemd/system/getty.target.wants/getty at tty1.service
> +endef
> +
> SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
> SYSTEMD_INSTALL_INIT_HOOK \
> SYSTEMD_INSTALL_MACHINEID_HOOK \
> - SYSTEMD_INSTALL_RESOLVCONF_HOOK
> + SYSTEMD_INSTALL_RESOLVCONF_HOOK \
> + SYSTEMD_DISABLE_SERVICE_TTY1_HOOK
It would be great to keep alphabetical order :)
Otherwise:
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Best regards,
Romain
>
> define SYSTEMD_USERS
> systemd-journal -1 systemd-journal -1 * /var/log/journal - - Journal
> @@ -228,10 +233,6 @@ define SYSTEMD_USERS
> - - input -1 * - - - Input device group
> endef
>
> -define SYSTEMD_DISABLE_SERVICE_TTY1
> - rm -f $(TARGET_DIR)/etc/systemd/system/getty.target.wants/getty at tty1.service
> -endef
> -
> ifneq ($(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)),)
> # systemd needs getty.service for VTs and serial-getty.service for serial ttys
> # also patch the file to use the correct baud-rate, the default baudrate is 115200 so look for that
> @@ -252,7 +253,6 @@ endef
> endif
>
> define SYSTEMD_INSTALL_INIT_SYSTEMD
> - $(SYSTEMD_DISABLE_SERVICE_TTY1)
> $(SYSTEMD_INSTALL_SERVICE_TTY)
> $(SYSTEMD_INSTALL_SERVICE_NETWORK)
> $(SYSTEMD_INSTALL_SERVICE_TIMESYNC)
>
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 06/24 v2] package/systemd: disabling tty1 getty is a post-install hook
2016-07-03 8:37 ` Romain Naour
@ 2016-07-04 17:13 ` Yann E. MORIN
0 siblings, 0 replies; 73+ messages in thread
From: Yann E. MORIN @ 2016-07-04 17:13 UTC (permalink / raw)
To: buildroot
Romain, All,
On 2016-07-03 10:37 +0200, Romain Naour spake thusly:
> Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> > Currently, we disable the getty on tty1 as a "init" step. It looks
> > better like it is a post-install hook.
> >
> > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> > ---
> > package/systemd/systemd.mk | 12 ++++++------
> > 1 file changed, 6 insertions(+), 6 deletions(-)
> >
> > diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
> > index c0503ae..7e8fc0b 100644
> > --- a/package/systemd/systemd.mk
> > +++ b/package/systemd/systemd.mk
> > @@ -211,10 +211,15 @@ define SYSTEMD_INSTALL_MACHINEID_HOOK
> > touch $(TARGET_DIR)/etc/machine-id
> > endef
> >
> > +define SYSTEMD_DISABLE_SERVICE_TTY1_HOOK
> > + rm -f $(TARGET_DIR)/etc/systemd/system/getty.target.wants/getty at tty1.service
> > +endef
> > +
> > SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
> > SYSTEMD_INSTALL_INIT_HOOK \
> > SYSTEMD_INSTALL_MACHINEID_HOOK \
> > - SYSTEMD_INSTALL_RESOLVCONF_HOOK
> > + SYSTEMD_INSTALL_RESOLVCONF_HOOK \
> > + SYSTEMD_DISABLE_SERVICE_TTY1_HOOK
>
> It would be great to keep alphabetical order :)
Well, 'SERVICE' comes after 'RESOLVCONF', no?
OK, 'DISABLE' comes before 'INSTALL'... ;-)
I can switch, yes.
> Otherwise:
> Reviewed-by: Romain Naour <romain.naour@gmail.com>
OK, thanks! :-)
Regards,
Yann E. MORIN.
> Best regards,
> Romain
>
>
> >
> > define SYSTEMD_USERS
> > systemd-journal -1 systemd-journal -1 * /var/log/journal - - Journal
> > @@ -228,10 +233,6 @@ define SYSTEMD_USERS
> > - - input -1 * - - - Input device group
> > endef
> >
> > -define SYSTEMD_DISABLE_SERVICE_TTY1
> > - rm -f $(TARGET_DIR)/etc/systemd/system/getty.target.wants/getty at tty1.service
> > -endef
> > -
> > ifneq ($(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)),)
> > # systemd needs getty.service for VTs and serial-getty.service for serial ttys
> > # also patch the file to use the correct baud-rate, the default baudrate is 115200 so look for that
> > @@ -252,7 +253,6 @@ endef
> > endif
> >
> > define SYSTEMD_INSTALL_INIT_SYSTEMD
> > - $(SYSTEMD_DISABLE_SERVICE_TTY1)
> > $(SYSTEMD_INSTALL_SERVICE_TTY)
> > $(SYSTEMD_INSTALL_SERVICE_NETWORK)
> > $(SYSTEMD_INSTALL_SERVICE_TIMESYNC)
> >
>
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 06/24 v2] package/systemd: disabling tty1 getty is a post-install hook
2016-06-22 19:07 ` [Buildroot] [PATCH 06/24 v2] package/systemd: disabling tty1 getty is a post-install hook Yann E. MORIN
2016-07-03 8:37 ` Romain Naour
@ 2016-07-05 13:41 ` Thomas Petazzoni
1 sibling, 0 replies; 73+ messages in thread
From: Thomas Petazzoni @ 2016-07-05 13:41 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 22 Jun 2016 21:07:28 +0200, Yann E. MORIN wrote:
> +define SYSTEMD_DISABLE_SERVICE_TTY1_HOOK
> + rm -f $(TARGET_DIR)/etc/systemd/system/getty.target.wants/getty at tty1.service
> +endef
> +
> SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
> SYSTEMD_INSTALL_INIT_HOOK \
> SYSTEMD_INSTALL_MACHINEID_HOOK \
> - SYSTEMD_INSTALL_RESOLVCONF_HOOK
> + SYSTEMD_INSTALL_RESOLVCONF_HOOK \
> + SYSTEMD_DISABLE_SERVICE_TTY1_HOOK
>
> define SYSTEMD_USERS
> systemd-journal -1 systemd-journal -1 * /var/log/journal - - Journal
> @@ -228,10 +233,6 @@ define SYSTEMD_USERS
> - - input -1 * - - - Input device group
> endef
>
> -define SYSTEMD_DISABLE_SERVICE_TTY1
> - rm -f $(TARGET_DIR)/etc/systemd/system/getty.target.wants/getty at tty1.service
> -endef
> -
> ifneq ($(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)),)
> # systemd needs getty.service for VTs and serial-getty.service for serial ttys
> # also patch the file to use the correct baud-rate, the default baudrate is 115200 so look for that
> @@ -252,7 +253,6 @@ endef
> endif
>
> define SYSTEMD_INSTALL_INIT_SYSTEMD
> - $(SYSTEMD_DISABLE_SERVICE_TTY1)
> $(SYSTEMD_INSTALL_SERVICE_TTY)
> $(SYSTEMD_INSTALL_SERVICE_NETWORK)
> $(SYSTEMD_INSTALL_SERVICE_TIMESYNC)
Doing this change doesn't work if BR2_TARGET_GENERIC_GETTY_PORT is
"tty1". In this case, you will create getty at tty1.service symlink during
<pkg>_INIT_SYSTEMD, and then you will remove it in your post-install
target hook. And you end up with no getty@<foo>.service symbolic link.
So, I've marked this patch as Rejected in patchwork.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 07/24 v2] system: provide no default for custom skeleton path
2016-06-22 19:07 [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton) Yann E. MORIN
` (5 preceding siblings ...)
2016-06-22 19:07 ` [Buildroot] [PATCH 06/24 v2] package/systemd: disabling tty1 getty is a post-install hook Yann E. MORIN
@ 2016-06-22 19:07 ` Yann E. MORIN
2016-07-03 8:42 ` Romain Naour
2016-07-05 13:59 ` Thomas Petazzoni
2016-06-22 19:07 ` [Buildroot] [PATCH 08/24 v2] system: move the rootfs skeleton choice Yann E. MORIN
` (17 subsequent siblings)
24 siblings, 2 replies; 73+ messages in thread
From: Yann E. MORIN @ 2016-06-22 19:07 UTC (permalink / raw)
To: buildroot
Being custom means that our default one is not suitable to start with.
So there is no reson to offer it as the default path.
Add a separating empty line, for good measure, too.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
system/Config.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/system/Config.in b/system/Config.in
index 4f9f270..04b886b 100644
--- a/system/Config.in
+++ b/system/Config.in
@@ -179,9 +179,9 @@ config BR2_ROOTFS_SKELETON_CUSTOM
endchoice
if BR2_ROOTFS_SKELETON_CUSTOM
+
config BR2_ROOTFS_SKELETON_CUSTOM_PATH
string "custom target skeleton path"
- default "system/skeleton"
help
Path to custom target skeleton.
--
2.7.4
^ permalink raw reply related [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 07/24 v2] system: provide no default for custom skeleton path
2016-06-22 19:07 ` [Buildroot] [PATCH 07/24 v2] system: provide no default for custom skeleton path Yann E. MORIN
@ 2016-07-03 8:42 ` Romain Naour
2016-07-04 7:30 ` Arnout Vandecappelle
2016-07-04 17:21 ` Yann E. MORIN
2016-07-05 13:59 ` Thomas Petazzoni
1 sibling, 2 replies; 73+ messages in thread
From: Romain Naour @ 2016-07-03 8:42 UTC (permalink / raw)
To: buildroot
Yann,
Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> Being custom means that our default one is not suitable to start with.
>
> So there is no reson to offer it as the default path.
>
> Add a separating empty line, for good measure, too.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> ---
> system/Config.in | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/system/Config.in b/system/Config.in
> index 4f9f270..04b886b 100644
> --- a/system/Config.in
> +++ b/system/Config.in
> @@ -179,9 +179,9 @@ config BR2_ROOTFS_SKELETON_CUSTOM
> endchoice
>
> if BR2_ROOTFS_SKELETON_CUSTOM
> +
> config BR2_ROOTFS_SKELETON_CUSTOM_PATH
> string "custom target skeleton path"
> - default "system/skeleton"
Then, I think we should add a check in skeleton.mk if
BR2_ROOTFS_SKELETON_CUSTOM_PATH is not empty and print an explicit error message.
Best regards,
Romain
> help
> Path to custom target skeleton.
>
>
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 07/24 v2] system: provide no default for custom skeleton path
2016-07-03 8:42 ` Romain Naour
@ 2016-07-04 7:30 ` Arnout Vandecappelle
2016-07-04 17:21 ` Yann E. MORIN
1 sibling, 0 replies; 73+ messages in thread
From: Arnout Vandecappelle @ 2016-07-04 7:30 UTC (permalink / raw)
To: buildroot
On 03-07-16 10:42, Romain Naour wrote:
> Yann,
>
> Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
>> Being custom means that our default one is not suitable to start with.
>>
>> So there is no reson to offer it as the default path.
>>
>> Add a separating empty line, for good measure, too.
>>
>> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
>> ---
>> system/Config.in | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/system/Config.in b/system/Config.in
>> index 4f9f270..04b886b 100644
>> --- a/system/Config.in
>> +++ b/system/Config.in
>> @@ -179,9 +179,9 @@ config BR2_ROOTFS_SKELETON_CUSTOM
>> endchoice
>>
>> if BR2_ROOTFS_SKELETON_CUSTOM
>> +
>> config BR2_ROOTFS_SKELETON_CUSTOM_PATH
>> string "custom target skeleton path"
>> - default "system/skeleton"
>
> Then, I think we should add a check in skeleton.mk if
> BR2_ROOTFS_SKELETON_CUSTOM_PATH is not empty and print an explicit error message.
+1 to that. I checked, we don't have it at the moment.
Regards,
Arnout
>
> Best regards,
> Romain
>
>
>> help
>> Path to custom target skeleton.
>>
>>
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 07/24 v2] system: provide no default for custom skeleton path
2016-07-03 8:42 ` Romain Naour
2016-07-04 7:30 ` Arnout Vandecappelle
@ 2016-07-04 17:21 ` Yann E. MORIN
1 sibling, 0 replies; 73+ messages in thread
From: Yann E. MORIN @ 2016-07-04 17:21 UTC (permalink / raw)
To: buildroot
Romain, All,
On 2016-07-03 10:42 +0200, Romain Naour spake thusly:
> Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> > Being custom means that our default one is not suitable to start with.
> >
> > So there is no reson to offer it as the default path.
> >
> > Add a separating empty line, for good measure, too.
> >
> > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> > ---
> > system/Config.in | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/system/Config.in b/system/Config.in
> > index 4f9f270..04b886b 100644
> > --- a/system/Config.in
> > +++ b/system/Config.in
> > @@ -179,9 +179,9 @@ config BR2_ROOTFS_SKELETON_CUSTOM
> > endchoice
> >
> > if BR2_ROOTFS_SKELETON_CUSTOM
> > +
> > config BR2_ROOTFS_SKELETON_CUSTOM_PATH
> > string "custom target skeleton path"
> > - default "system/skeleton"
>
> Then, I think we should add a check in skeleton.mk if
> BR2_ROOTFS_SKELETON_CUSTOM_PATH is not empty and print an explicit error message.
ACK.
Regards,
Yann E. MORIN.
> Best regards,
> Romain
>
>
> > help
> > Path to custom target skeleton.
> >
> >
>
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 07/24 v2] system: provide no default for custom skeleton path
2016-06-22 19:07 ` [Buildroot] [PATCH 07/24 v2] system: provide no default for custom skeleton path Yann E. MORIN
2016-07-03 8:42 ` Romain Naour
@ 2016-07-05 13:59 ` Thomas Petazzoni
1 sibling, 0 replies; 73+ messages in thread
From: Thomas Petazzoni @ 2016-07-05 13:59 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 22 Jun 2016 21:07:29 +0200, Yann E. MORIN wrote:
> Being custom means that our default one is not suitable to start with.
>
> So there is no reson to offer it as the default path.
>
> Add a separating empty line, for good measure, too.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Looks good, but I'll wait for a respin with the check that the path is
not empty.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 08/24 v2] system: move the rootfs skeleton choice
2016-06-22 19:07 [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton) Yann E. MORIN
` (6 preceding siblings ...)
2016-06-22 19:07 ` [Buildroot] [PATCH 07/24 v2] system: provide no default for custom skeleton path Yann E. MORIN
@ 2016-06-22 19:07 ` Yann E. MORIN
2016-07-03 8:50 ` Romain Naour
2016-06-22 19:07 ` [Buildroot] [PATCH 09/24 v2] system: do not handle network settings for custom skeleton Yann E. MORIN
` (16 subsequent siblings)
24 siblings, 1 reply; 73+ messages in thread
From: Yann E. MORIN @ 2016-06-22 19:07 UTC (permalink / raw)
To: buildroot
In the following commits, we'll be switching more options to be
conditional on the default or custom skeleton.
So, it makes sense that those options come after the choice of a
skeleton.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
system/Config.in | 56 ++++++++++++++++++++++++++++----------------------------
1 file changed, 28 insertions(+), 28 deletions(-)
diff --git a/system/Config.in b/system/Config.in
index 04b886b..662443b 100644
--- a/system/Config.in
+++ b/system/Config.in
@@ -1,5 +1,33 @@
menu "System configuration"
+choice
+ prompt "Root FS skeleton"
+
+config BR2_ROOTFS_SKELETON_DEFAULT
+ bool "default target skeleton"
+ help
+ Use default target skeleton
+
+config BR2_ROOTFS_SKELETON_CUSTOM
+ bool "custom target skeleton"
+ help
+ Use custom target skeleton.
+
+endchoice
+
+if BR2_ROOTFS_SKELETON_CUSTOM
+
+config BR2_ROOTFS_SKELETON_CUSTOM_PATH
+ string "custom target skeleton path"
+ help
+ Path to custom target skeleton.
+
+# dummy config so merged /usr workarounds can also be activated for
+# custom rootfs skeleton
+config BR2_ROOTFS_MERGED_USR
+
+endif
+
config BR2_TARGET_GENERIC_HOSTNAME
string "System hostname"
default "buildroot"
@@ -163,34 +191,6 @@ config BR2_ROOTFS_STATIC_DEVICE_TABLE
See package/makedevs/README for details on the usage and
syntax of these files.
-choice
- prompt "Root FS skeleton"
-
-config BR2_ROOTFS_SKELETON_DEFAULT
- bool "default target skeleton"
- help
- Use default target skeleton
-
-config BR2_ROOTFS_SKELETON_CUSTOM
- bool "custom target skeleton"
- help
- Use custom target skeleton.
-
-endchoice
-
-if BR2_ROOTFS_SKELETON_CUSTOM
-
-config BR2_ROOTFS_SKELETON_CUSTOM_PATH
- string "custom target skeleton path"
- help
- Path to custom target skeleton.
-
-# dummy config so merged /usr workarounds can also be activated for
-# custom rootfs skeleton
-config BR2_ROOTFS_MERGED_USR
-
-endif
-
if BR2_ROOTFS_SKELETON_DEFAULT
config BR2_ROOTFS_MERGED_USR
--
2.7.4
^ permalink raw reply related [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 08/24 v2] system: move the rootfs skeleton choice
2016-06-22 19:07 ` [Buildroot] [PATCH 08/24 v2] system: move the rootfs skeleton choice Yann E. MORIN
@ 2016-07-03 8:50 ` Romain Naour
0 siblings, 0 replies; 73+ messages in thread
From: Romain Naour @ 2016-07-03 8:50 UTC (permalink / raw)
To: buildroot
Hi Yann,
Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> In the following commits, we'll be switching more options to be
> conditional on the default or custom skeleton.
>
> So, it makes sense that those options come after the choice of a
> skeleton.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Best regards,
Romain
> ---
> system/Config.in | 56 ++++++++++++++++++++++++++++----------------------------
> 1 file changed, 28 insertions(+), 28 deletions(-)
>
> diff --git a/system/Config.in b/system/Config.in
> index 04b886b..662443b 100644
> --- a/system/Config.in
> +++ b/system/Config.in
> @@ -1,5 +1,33 @@
> menu "System configuration"
>
> +choice
> + prompt "Root FS skeleton"
> +
> +config BR2_ROOTFS_SKELETON_DEFAULT
> + bool "default target skeleton"
> + help
> + Use default target skeleton
> +
> +config BR2_ROOTFS_SKELETON_CUSTOM
> + bool "custom target skeleton"
> + help
> + Use custom target skeleton.
> +
> +endchoice
> +
> +if BR2_ROOTFS_SKELETON_CUSTOM
> +
> +config BR2_ROOTFS_SKELETON_CUSTOM_PATH
> + string "custom target skeleton path"
> + help
> + Path to custom target skeleton.
> +
> +# dummy config so merged /usr workarounds can also be activated for
> +# custom rootfs skeleton
> +config BR2_ROOTFS_MERGED_USR
> +
> +endif
> +
> config BR2_TARGET_GENERIC_HOSTNAME
> string "System hostname"
> default "buildroot"
> @@ -163,34 +191,6 @@ config BR2_ROOTFS_STATIC_DEVICE_TABLE
> See package/makedevs/README for details on the usage and
> syntax of these files.
>
> -choice
> - prompt "Root FS skeleton"
> -
> -config BR2_ROOTFS_SKELETON_DEFAULT
> - bool "default target skeleton"
> - help
> - Use default target skeleton
> -
> -config BR2_ROOTFS_SKELETON_CUSTOM
> - bool "custom target skeleton"
> - help
> - Use custom target skeleton.
> -
> -endchoice
> -
> -if BR2_ROOTFS_SKELETON_CUSTOM
> -
> -config BR2_ROOTFS_SKELETON_CUSTOM_PATH
> - string "custom target skeleton path"
> - help
> - Path to custom target skeleton.
> -
> -# dummy config so merged /usr workarounds can also be activated for
> -# custom rootfs skeleton
> -config BR2_ROOTFS_MERGED_USR
> -
> -endif
> -
> if BR2_ROOTFS_SKELETON_DEFAULT
>
> config BR2_ROOTFS_MERGED_USR
>
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 09/24 v2] system: do not handle network settings for custom skeleton
2016-06-22 19:07 [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton) Yann E. MORIN
` (7 preceding siblings ...)
2016-06-22 19:07 ` [Buildroot] [PATCH 08/24 v2] system: move the rootfs skeleton choice Yann E. MORIN
@ 2016-06-22 19:07 ` Yann E. MORIN
2016-07-03 9:00 ` Romain Naour
2016-06-22 19:07 ` [Buildroot] [PATCH 10/24 v2] package/perl: use dummy hostname Yann E. MORIN
` (15 subsequent siblings)
24 siblings, 1 reply; 73+ messages in thread
From: Yann E. MORIN @ 2016-06-22 19:07 UTC (permalink / raw)
To: buildroot
We expect the custom skeleton to be fully filled with the necessary
files, now. There is definitely no reason we should handle network
settings in there. A user using a custom skeleton should be fully
responsible for providing a functional skeleton.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
package/skeleton/skeleton.mk | 8 ++++----
system/Config.in | 5 ++---
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/package/skeleton/skeleton.mk b/package/skeleton/skeleton.mk
index 3852448..144b759 100644
--- a/package/skeleton/skeleton.mk
+++ b/package/skeleton/skeleton.mk
@@ -138,6 +138,10 @@ endef
TARGET_FINALIZE_HOOKS += SKELETON_SET_ISSUE
endif
+# The TARGET_FINALIZE_HOOKS must be sourced only if the users choose to use the
+# default skeleton.
+ifeq ($(BR2_ROOTFS_SKELETON_DEFAULT),y)
+
define SKELETON_SET_NETWORK_LOCALHOST
( \
echo "# interface file auto-generated by buildroot"; \
@@ -171,10 +175,6 @@ endef
TARGET_FINALIZE_HOOKS += SKELETON_SET_NETWORK
-# The TARGET_FINALIZE_HOOKS must be sourced only if the users choose to use the
-# default skeleton.
-ifeq ($(BR2_ROOTFS_SKELETON_DEFAULT),y)
-
ifeq ($(BR2_TARGET_ENABLE_ROOT_LOGIN),y)
ifeq ($(SKELETON_TARGET_GENERIC_ROOT_PASSWD),)
SKELETON_ROOT_PASSWORD =
diff --git a/system/Config.in b/system/Config.in
index 662443b..c02f394 100644
--- a/system/Config.in
+++ b/system/Config.in
@@ -352,9 +352,6 @@ config BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW
read-only.
If unsure, say Y.
-endif # BR2_ROOTFS_SKELETON_DEFAULT
-
-
config BR2_SYSTEM_DHCP
string "Network interface to configure through DHCP"
default ""
@@ -374,6 +371,8 @@ comment "automatic network configuration via DHCP is not compatible with network
comment "automatic network configuration via DHCP needs ifupdown or busybox"
depends on !(BR2_PACKAGE_BUSYBOX || BR2_PACKAGE_IFUPDOWN)
+endif # BR2_ROOTFS_SKELETON_DEFAULT
+
config BR2_TARGET_TZ_INFO
bool "Install timezone info"
# No timezone for musl; only for uClibc or (e)glibc.
--
2.7.4
^ permalink raw reply related [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 09/24 v2] system: do not handle network settings for custom skeleton
2016-06-22 19:07 ` [Buildroot] [PATCH 09/24 v2] system: do not handle network settings for custom skeleton Yann E. MORIN
@ 2016-07-03 9:00 ` Romain Naour
0 siblings, 0 replies; 73+ messages in thread
From: Romain Naour @ 2016-07-03 9:00 UTC (permalink / raw)
To: buildroot
Hi Yann,
Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> We expect the custom skeleton to be fully filled with the necessary
> files, now. There is definitely no reason we should handle network
> settings in there. A user using a custom skeleton should be fully
> responsible for providing a functional skeleton.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Best regards,
Romain
> ---
> package/skeleton/skeleton.mk | 8 ++++----
> system/Config.in | 5 ++---
> 2 files changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/package/skeleton/skeleton.mk b/package/skeleton/skeleton.mk
> index 3852448..144b759 100644
> --- a/package/skeleton/skeleton.mk
> +++ b/package/skeleton/skeleton.mk
> @@ -138,6 +138,10 @@ endef
> TARGET_FINALIZE_HOOKS += SKELETON_SET_ISSUE
> endif
>
> +# The TARGET_FINALIZE_HOOKS must be sourced only if the users choose to use the
> +# default skeleton.
> +ifeq ($(BR2_ROOTFS_SKELETON_DEFAULT),y)
> +
> define SKELETON_SET_NETWORK_LOCALHOST
> ( \
> echo "# interface file auto-generated by buildroot"; \
> @@ -171,10 +175,6 @@ endef
>
> TARGET_FINALIZE_HOOKS += SKELETON_SET_NETWORK
>
> -# The TARGET_FINALIZE_HOOKS must be sourced only if the users choose to use the
> -# default skeleton.
> -ifeq ($(BR2_ROOTFS_SKELETON_DEFAULT),y)
> -
> ifeq ($(BR2_TARGET_ENABLE_ROOT_LOGIN),y)
> ifeq ($(SKELETON_TARGET_GENERIC_ROOT_PASSWD),)
> SKELETON_ROOT_PASSWORD =
> diff --git a/system/Config.in b/system/Config.in
> index 662443b..c02f394 100644
> --- a/system/Config.in
> +++ b/system/Config.in
> @@ -352,9 +352,6 @@ config BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW
> read-only.
> If unsure, say Y.
>
> -endif # BR2_ROOTFS_SKELETON_DEFAULT
> -
> -
> config BR2_SYSTEM_DHCP
> string "Network interface to configure through DHCP"
> default ""
> @@ -374,6 +371,8 @@ comment "automatic network configuration via DHCP is not compatible with network
> comment "automatic network configuration via DHCP needs ifupdown or busybox"
> depends on !(BR2_PACKAGE_BUSYBOX || BR2_PACKAGE_IFUPDOWN)
>
> +endif # BR2_ROOTFS_SKELETON_DEFAULT
> +
> config BR2_TARGET_TZ_INFO
> bool "Install timezone info"
> # No timezone for musl; only for uClibc or (e)glibc.
>
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 10/24 v2] package/perl: use dummy hostname
2016-06-22 19:07 [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton) Yann E. MORIN
` (8 preceding siblings ...)
2016-06-22 19:07 ` [Buildroot] [PATCH 09/24 v2] system: do not handle network settings for custom skeleton Yann E. MORIN
@ 2016-06-22 19:07 ` Yann E. MORIN
2016-07-03 9:05 ` Romain Naour
2016-07-05 13:59 ` Thomas Petazzoni
2016-06-22 19:07 ` [Buildroot] [PATCH 11/24 v2] system: do not set hostname and issue for custom skeleton Yann E. MORIN
` (14 subsequent siblings)
24 siblings, 2 replies; 73+ messages in thread
From: Yann E. MORIN @ 2016-06-22 19:07 UTC (permalink / raw)
To: buildroot
The hostname does not look like it serves any useful purpose, except
maybe to set set perladmin email.
Which is undoubtfully useless on the target.
A followup commit will make the hostname depend on the default skeleton,
so it won't always be available. We can not rely on it to be set.
Besides, even today it is not guaranteed to be set; a user may well
leave it empty.
Use a dummy hostname.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
package/perl/perl.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/perl/perl.mk b/package/perl/perl.mk
index 11b10ff..29af7a4 100644
--- a/package/perl/perl.mk
+++ b/package/perl/perl.mk
@@ -54,7 +54,7 @@ PERL_CONF_OPTS = \
-Dccflags="$(TARGET_CFLAGS)" \
-Dldflags="$(TARGET_LDFLAGS) -lm" \
-Dmydomain="" \
- -Dmyhostname="$(BR2_TARGET_GENERIC_HOSTNAME)" \
+ -Dmyhostname="noname" \
-Dmyuname="Buildroot $(BR2_VERSION_FULL)" \
-Dosname=linux \
-Dosvers=$(LINUX_VERSION) \
--
2.7.4
^ permalink raw reply related [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 10/24 v2] package/perl: use dummy hostname
2016-06-22 19:07 ` [Buildroot] [PATCH 10/24 v2] package/perl: use dummy hostname Yann E. MORIN
@ 2016-07-03 9:05 ` Romain Naour
2016-07-05 13:59 ` Thomas Petazzoni
1 sibling, 0 replies; 73+ messages in thread
From: Romain Naour @ 2016-07-03 9:05 UTC (permalink / raw)
To: buildroot
Hi Yann,
Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> The hostname does not look like it serves any useful purpose, except
> maybe to set set perladmin email.
>
> Which is undoubtfully useless on the target.
>
> A followup commit will make the hostname depend on the default skeleton,
> so it won't always be available. We can not rely on it to be set.
>
> Besides, even today it is not guaranteed to be set; a user may well
> leave it empty.
>
> Use a dummy hostname.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Best regards,
Romain
> ---
> package/perl/perl.mk | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/package/perl/perl.mk b/package/perl/perl.mk
> index 11b10ff..29af7a4 100644
> --- a/package/perl/perl.mk
> +++ b/package/perl/perl.mk
> @@ -54,7 +54,7 @@ PERL_CONF_OPTS = \
> -Dccflags="$(TARGET_CFLAGS)" \
> -Dldflags="$(TARGET_LDFLAGS) -lm" \
> -Dmydomain="" \
> - -Dmyhostname="$(BR2_TARGET_GENERIC_HOSTNAME)" \
> + -Dmyhostname="noname" \
> -Dmyuname="Buildroot $(BR2_VERSION_FULL)" \
> -Dosname=linux \
> -Dosvers=$(LINUX_VERSION) \
>
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 10/24 v2] package/perl: use dummy hostname
2016-06-22 19:07 ` [Buildroot] [PATCH 10/24 v2] package/perl: use dummy hostname Yann E. MORIN
2016-07-03 9:05 ` Romain Naour
@ 2016-07-05 13:59 ` Thomas Petazzoni
1 sibling, 0 replies; 73+ messages in thread
From: Thomas Petazzoni @ 2016-07-05 13:59 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 22 Jun 2016 21:07:32 +0200, Yann E. MORIN wrote:
> The hostname does not look like it serves any useful purpose, except
> maybe to set set perladmin email.
>
> Which is undoubtfully useless on the target.
>
> A followup commit will make the hostname depend on the default skeleton,
> so it won't always be available. We can not rely on it to be set.
>
> Besides, even today it is not guaranteed to be set; a user may well
> leave it empty.
>
> Use a dummy hostname.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> ---
> package/perl/perl.mk | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 11/24 v2] system: do not set hostname and issue for custom skeleton
2016-06-22 19:07 [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton) Yann E. MORIN
` (9 preceding siblings ...)
2016-06-22 19:07 ` [Buildroot] [PATCH 10/24 v2] package/perl: use dummy hostname Yann E. MORIN
@ 2016-06-22 19:07 ` Yann E. MORIN
2016-07-03 9:11 ` Romain Naour
2016-06-22 19:07 ` [Buildroot] [PATCH 12/24 v2] core/pkg-generic: add variable to skip skeleton dependency Yann E. MORIN
` (13 subsequent siblings)
24 siblings, 1 reply; 73+ messages in thread
From: Yann E. MORIN @ 2016-06-22 19:07 UTC (permalink / raw)
To: buildroot
We expect the custom skeleton to be fully filled with the necessary
files, now. There is definitely no reason we should handle setting the
hostname and the issue file in there. A user using a custom skeleton
should be fully responsible for providing a functional skeleton.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
Note: beside the skeleton, the only other user of the hostname was the
perl package, and it was just previously changed not to use it anymore.
---
package/skeleton/skeleton.mk | 8 ++++----
system/Config.in | 4 ++++
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/package/skeleton/skeleton.mk b/package/skeleton/skeleton.mk
index 144b759..e67a477 100644
--- a/package/skeleton/skeleton.mk
+++ b/package/skeleton/skeleton.mk
@@ -110,6 +110,10 @@ define SKELETON_INSTALL_STAGING_CMDS
ln -snf lib $(STAGING_DIR)/usr/$(SKELETON_LIB_SYMLINK)
endef
+# The TARGET_FINALIZE_HOOKS must be sourced only if the users choose to use the
+# default skeleton.
+ifeq ($(BR2_ROOTFS_SKELETON_DEFAULT),y)
+
SKELETON_TARGET_GENERIC_HOSTNAME = $(call qstrip,$(BR2_TARGET_GENERIC_HOSTNAME))
SKELETON_TARGET_GENERIC_ISSUE = $(call qstrip,$(BR2_TARGET_GENERIC_ISSUE))
SKELETON_TARGET_GENERIC_ROOT_PASSWD = $(call qstrip,$(BR2_TARGET_GENERIC_ROOT_PASSWD))
@@ -138,10 +142,6 @@ endef
TARGET_FINALIZE_HOOKS += SKELETON_SET_ISSUE
endif
-# The TARGET_FINALIZE_HOOKS must be sourced only if the users choose to use the
-# default skeleton.
-ifeq ($(BR2_ROOTFS_SKELETON_DEFAULT),y)
-
define SKELETON_SET_NETWORK_LOCALHOST
( \
echo "# interface file auto-generated by buildroot"; \
diff --git a/system/Config.in b/system/Config.in
index c02f394..3a38bd4 100644
--- a/system/Config.in
+++ b/system/Config.in
@@ -28,6 +28,8 @@ config BR2_ROOTFS_MERGED_USR
endif
+if BR2_ROOTFS_SKELETON_DEFAULT
+
config BR2_TARGET_GENERIC_HOSTNAME
string "System hostname"
default "buildroot"
@@ -46,6 +48,8 @@ config BR2_TARGET_GENERIC_ISSUE
Leave empty to not create /etc/issue, or to keep the
one from a custom skeleton.
+endif
+
choice
bool "Passwords encoding"
default BR2_TARGET_GENERIC_PASSWD_MD5
--
2.7.4
^ permalink raw reply related [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 11/24 v2] system: do not set hostname and issue for custom skeleton
2016-06-22 19:07 ` [Buildroot] [PATCH 11/24 v2] system: do not set hostname and issue for custom skeleton Yann E. MORIN
@ 2016-07-03 9:11 ` Romain Naour
0 siblings, 0 replies; 73+ messages in thread
From: Romain Naour @ 2016-07-03 9:11 UTC (permalink / raw)
To: buildroot
Hi Yann,
Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> We expect the custom skeleton to be fully filled with the necessary
> files, now. There is definitely no reason we should handle setting the
> hostname and the issue file in there. A user using a custom skeleton
> should be fully responsible for providing a functional skeleton.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Best regards,
Romain
>
> ---
> Note: beside the skeleton, the only other user of the hostname was the
> perl package, and it was just previously changed not to use it anymore.
> ---
> package/skeleton/skeleton.mk | 8 ++++----
> system/Config.in | 4 ++++
> 2 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/package/skeleton/skeleton.mk b/package/skeleton/skeleton.mk
> index 144b759..e67a477 100644
> --- a/package/skeleton/skeleton.mk
> +++ b/package/skeleton/skeleton.mk
> @@ -110,6 +110,10 @@ define SKELETON_INSTALL_STAGING_CMDS
> ln -snf lib $(STAGING_DIR)/usr/$(SKELETON_LIB_SYMLINK)
> endef
>
> +# The TARGET_FINALIZE_HOOKS must be sourced only if the users choose to use the
> +# default skeleton.
> +ifeq ($(BR2_ROOTFS_SKELETON_DEFAULT),y)
> +
> SKELETON_TARGET_GENERIC_HOSTNAME = $(call qstrip,$(BR2_TARGET_GENERIC_HOSTNAME))
> SKELETON_TARGET_GENERIC_ISSUE = $(call qstrip,$(BR2_TARGET_GENERIC_ISSUE))
> SKELETON_TARGET_GENERIC_ROOT_PASSWD = $(call qstrip,$(BR2_TARGET_GENERIC_ROOT_PASSWD))
> @@ -138,10 +142,6 @@ endef
> TARGET_FINALIZE_HOOKS += SKELETON_SET_ISSUE
> endif
>
> -# The TARGET_FINALIZE_HOOKS must be sourced only if the users choose to use the
> -# default skeleton.
> -ifeq ($(BR2_ROOTFS_SKELETON_DEFAULT),y)
> -
> define SKELETON_SET_NETWORK_LOCALHOST
> ( \
> echo "# interface file auto-generated by buildroot"; \
> diff --git a/system/Config.in b/system/Config.in
> index c02f394..3a38bd4 100644
> --- a/system/Config.in
> +++ b/system/Config.in
> @@ -28,6 +28,8 @@ config BR2_ROOTFS_MERGED_USR
>
> endif
>
> +if BR2_ROOTFS_SKELETON_DEFAULT
> +
> config BR2_TARGET_GENERIC_HOSTNAME
> string "System hostname"
> default "buildroot"
> @@ -46,6 +48,8 @@ config BR2_TARGET_GENERIC_ISSUE
> Leave empty to not create /etc/issue, or to keep the
> one from a custom skeleton.
>
> +endif
> +
> choice
> bool "Passwords encoding"
> default BR2_TARGET_GENERIC_PASSWD_MD5
>
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 12/24 v2] core/pkg-generic: add variable to skip skeleton dependency
2016-06-22 19:07 [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton) Yann E. MORIN
` (10 preceding siblings ...)
2016-06-22 19:07 ` [Buildroot] [PATCH 11/24 v2] system: do not set hostname and issue for custom skeleton Yann E. MORIN
@ 2016-06-22 19:07 ` Yann E. MORIN
2016-07-03 9:30 ` Romain Naour
2016-06-22 19:07 ` [Buildroot] [PATCH 13/24 v2] package/skeleton: add macro to rsync skeleton directory Yann E. MORIN
` (12 subsequent siblings)
24 siblings, 1 reply; 73+ messages in thread
From: Yann E. MORIN @ 2016-06-22 19:07 UTC (permalink / raw)
To: buildroot
We currently skip the skeleton dependency by checking if the current
package is the skeleton.
We are going to introduce more skeleton-related packages, so we
need a way to exclude the skeleton dependency for those, or we'd
get a circular dependency, for the same reason we need to skip
the toolchain dependency.
Instead of checking for all the skeleton-providing packages in the core
infra, add a new package options so that packages can express they do
not need the dependency on the skeleton, like we have an option to avoid
the depednency on the toolchain. The only packages that will use that
option are probably the skeletons, so we need not document this
variable, like we did not document the option to exclude the dependency
on the toolchain.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
package/pkg-generic.mk | 7 +++++--
package/skeleton/skeleton.mk | 1 +
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 374d9d5..3281374 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -486,15 +486,18 @@ $(2)_REDIST_SOURCES_DIR = $$(REDIST_SOURCES_DIR_$$(call UPPERCASE,$(4)))/$$($(2)
# When a target package is a toolchain dependency set this variable to
# 'NO' so the 'toolchain' dependency is not added to prevent a circular
-# dependency
+# dependency.
+# Similarly for the skeleton.
$(2)_ADD_TOOLCHAIN_DEPENDENCY ?= YES
+$(2)_ADD_SKELETON_DEPENDENCY ?= YES
+
ifeq ($(4),host)
$(2)_DEPENDENCIES ?= $$(filter-out host-skeleton host-toolchain $(1),\
$$(patsubst host-host-%,host-%,$$(addprefix host-,$$($(3)_DEPENDENCIES))))
endif
ifeq ($(4),target)
-ifneq ($(1),skeleton)
+ifeq ($$($(2)_ADD_SKELETON_DEPENDENCY),YES)
$(2)_DEPENDENCIES += skeleton
endif
ifeq ($$($(2)_ADD_TOOLCHAIN_DEPENDENCY),YES)
diff --git a/package/skeleton/skeleton.mk b/package/skeleton/skeleton.mk
index e67a477..072d217 100644
--- a/package/skeleton/skeleton.mk
+++ b/package/skeleton/skeleton.mk
@@ -12,6 +12,7 @@ SKELETON_SOURCE =
# Hence, skeleton would depends on the toolchain and the toolchain would depend
# on skeleton.
SKELETON_ADD_TOOLCHAIN_DEPENDENCY = NO
+SKELETON_ADD_SKELETON_DEPENDENCY = NO
# The skeleton also handles the merged /usr case in the sysroot
SKELETON_INSTALL_STAGING = YES
--
2.7.4
^ permalink raw reply related [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 12/24 v2] core/pkg-generic: add variable to skip skeleton dependency
2016-06-22 19:07 ` [Buildroot] [PATCH 12/24 v2] core/pkg-generic: add variable to skip skeleton dependency Yann E. MORIN
@ 2016-07-03 9:30 ` Romain Naour
0 siblings, 0 replies; 73+ messages in thread
From: Romain Naour @ 2016-07-03 9:30 UTC (permalink / raw)
To: buildroot
Hi Yann,
Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> We currently skip the skeleton dependency by checking if the current
> package is the skeleton.
>
> We are going to introduce more skeleton-related packages, so we
> need a way to exclude the skeleton dependency for those, or we'd
> get a circular dependency, for the same reason we need to skip
> the toolchain dependency.
>
> Instead of checking for all the skeleton-providing packages in the core
> infra, add a new package options so that packages can express they do
> not need the dependency on the skeleton, like we have an option to avoid
> the depednency on the toolchain. The only packages that will use that
> option are probably the skeletons, so we need not document this
> variable, like we did not document the option to exclude the dependency
> on the toolchain.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Best regards,
Romain
> ---
> package/pkg-generic.mk | 7 +++++--
> package/skeleton/skeleton.mk | 1 +
> 2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index 374d9d5..3281374 100644
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -486,15 +486,18 @@ $(2)_REDIST_SOURCES_DIR = $$(REDIST_SOURCES_DIR_$$(call UPPERCASE,$(4)))/$$($(2)
>
> # When a target package is a toolchain dependency set this variable to
> # 'NO' so the 'toolchain' dependency is not added to prevent a circular
> -# dependency
> +# dependency.
> +# Similarly for the skeleton.
> $(2)_ADD_TOOLCHAIN_DEPENDENCY ?= YES
> +$(2)_ADD_SKELETON_DEPENDENCY ?= YES
> +
>
> ifeq ($(4),host)
> $(2)_DEPENDENCIES ?= $$(filter-out host-skeleton host-toolchain $(1),\
> $$(patsubst host-host-%,host-%,$$(addprefix host-,$$($(3)_DEPENDENCIES))))
> endif
> ifeq ($(4),target)
> -ifneq ($(1),skeleton)
> +ifeq ($$($(2)_ADD_SKELETON_DEPENDENCY),YES)
> $(2)_DEPENDENCIES += skeleton
> endif
> ifeq ($$($(2)_ADD_TOOLCHAIN_DEPENDENCY),YES)
> diff --git a/package/skeleton/skeleton.mk b/package/skeleton/skeleton.mk
> index e67a477..072d217 100644
> --- a/package/skeleton/skeleton.mk
> +++ b/package/skeleton/skeleton.mk
> @@ -12,6 +12,7 @@ SKELETON_SOURCE =
> # Hence, skeleton would depends on the toolchain and the toolchain would depend
> # on skeleton.
> SKELETON_ADD_TOOLCHAIN_DEPENDENCY = NO
> +SKELETON_ADD_SKELETON_DEPENDENCY = NO
>
> # The skeleton also handles the merged /usr case in the sysroot
> SKELETON_INSTALL_STAGING = YES
>
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 13/24 v2] package/skeleton: add macro to rsync skeleton directory
2016-06-22 19:07 [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton) Yann E. MORIN
` (11 preceding siblings ...)
2016-06-22 19:07 ` [Buildroot] [PATCH 12/24 v2] core/pkg-generic: add variable to skip skeleton dependency Yann E. MORIN
@ 2016-06-22 19:07 ` Yann E. MORIN
2016-07-03 9:39 ` Romain Naour
2016-06-22 19:07 ` [Buildroot] [PATCH 14/24 v2] core/pkg-generic: allow packages to declare target-finalize hooks Yann E. MORIN
` (11 subsequent siblings)
24 siblings, 1 reply; 73+ messages in thread
From: Yann E. MORIN @ 2016-06-22 19:07 UTC (permalink / raw)
To: buildroot
The rsync command is currently called from a single location. In
follow-up patches, it will be called from various places now.
It will be easier to update and fix this command if it is defined in a
single location, rather than if duplicated in many places.
Define a macro that skeleton packages can call to install their skeleton
directories. Since at least one occurence of it will want to install in
staging, the macro must accept a destination path, rather than hard-code
target as the destination.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
package/skeleton/skeleton.mk | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/package/skeleton/skeleton.mk b/package/skeleton/skeleton.mk
index 072d217..e3ae694 100644
--- a/package/skeleton/skeleton.mk
+++ b/package/skeleton/skeleton.mk
@@ -62,6 +62,14 @@ SKELETON_PATH = system/skeleton
endif # ! custom skeleton
+# This function rsyncs the skeleton directory in $(1) to the destination
+# in $(2), which should be either $(TARTGET_DIR) or $(STAGING_DIR)
+define SKELETON_RSYNC
+ rsync -a --ignore-times $(RSYNC_VCS_EXCLUSIONS) \
+ --chmod=u=rwX,go=rX --exclude .empty --exclude '*~' \
+ $(1)/ $(2)/
+endef
+
# This function handles the merged or non-merged /usr cases
ifeq ($(BR2_ROOTFS_MERGED_USR),y)
define SKELETON_USR_SYMLINKS_OR_DIRS
@@ -86,9 +94,7 @@ SKELETON_LIB_SYMLINK = lib32
endif
define SKELETON_INSTALL_TARGET_CMDS
- rsync -a --ignore-times $(RSYNC_VCS_EXCLUSIONS) \
- --chmod=u=rwX,go=rX --exclude .empty --exclude '*~' \
- $(SKELETON_PATH)/ $(TARGET_DIR)/
+ $(call SKELETON_RSYNC,$(SKELETON_PATH),$(TARGET_DIR))
$(call SKELETON_USR_SYMLINKS_OR_DIRS,$(TARGET_DIR))
ln -snf lib $(TARGET_DIR)/$(SKELETON_LIB_SYMLINK)
ln -snf lib $(TARGET_DIR)/usr/$(SKELETON_LIB_SYMLINK)
--
2.7.4
^ permalink raw reply related [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 13/24 v2] package/skeleton: add macro to rsync skeleton directory
2016-06-22 19:07 ` [Buildroot] [PATCH 13/24 v2] package/skeleton: add macro to rsync skeleton directory Yann E. MORIN
@ 2016-07-03 9:39 ` Romain Naour
0 siblings, 0 replies; 73+ messages in thread
From: Romain Naour @ 2016-07-03 9:39 UTC (permalink / raw)
To: buildroot
Hi Yann,
Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> The rsync command is currently called from a single location. In
> follow-up patches, it will be called from various places now.
>
> It will be easier to update and fix this command if it is defined in a
> single location, rather than if duplicated in many places.
>
> Define a macro that skeleton packages can call to install their skeleton
> directories. Since at least one occurence of it will want to install in
> staging, the macro must accept a destination path, rather than hard-code
> target as the destination.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Best regards,
Romain
> ---
> package/skeleton/skeleton.mk | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/package/skeleton/skeleton.mk b/package/skeleton/skeleton.mk
> index 072d217..e3ae694 100644
> --- a/package/skeleton/skeleton.mk
> +++ b/package/skeleton/skeleton.mk
> @@ -62,6 +62,14 @@ SKELETON_PATH = system/skeleton
>
> endif # ! custom skeleton
>
> +# This function rsyncs the skeleton directory in $(1) to the destination
> +# in $(2), which should be either $(TARTGET_DIR) or $(STAGING_DIR)
> +define SKELETON_RSYNC
> + rsync -a --ignore-times $(RSYNC_VCS_EXCLUSIONS) \
> + --chmod=u=rwX,go=rX --exclude .empty --exclude '*~' \
> + $(1)/ $(2)/
> +endef
> +
> # This function handles the merged or non-merged /usr cases
> ifeq ($(BR2_ROOTFS_MERGED_USR),y)
> define SKELETON_USR_SYMLINKS_OR_DIRS
> @@ -86,9 +94,7 @@ SKELETON_LIB_SYMLINK = lib32
> endif
>
> define SKELETON_INSTALL_TARGET_CMDS
> - rsync -a --ignore-times $(RSYNC_VCS_EXCLUSIONS) \
> - --chmod=u=rwX,go=rX --exclude .empty --exclude '*~' \
> - $(SKELETON_PATH)/ $(TARGET_DIR)/
> + $(call SKELETON_RSYNC,$(SKELETON_PATH),$(TARGET_DIR))
> $(call SKELETON_USR_SYMLINKS_OR_DIRS,$(TARGET_DIR))
> ln -snf lib $(TARGET_DIR)/$(SKELETON_LIB_SYMLINK)
> ln -snf lib $(TARGET_DIR)/usr/$(SKELETON_LIB_SYMLINK)
>
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 14/24 v2] core/pkg-generic: allow packages to declare target-finalize hooks
2016-06-22 19:07 [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton) Yann E. MORIN
` (12 preceding siblings ...)
2016-06-22 19:07 ` [Buildroot] [PATCH 13/24 v2] package/skeleton: add macro to rsync skeleton directory Yann E. MORIN
@ 2016-06-22 19:07 ` Yann E. MORIN
2016-07-03 9:53 ` Romain Naour
2016-07-05 14:00 ` Thomas Petazzoni
2016-06-22 19:07 ` [Buildroot] [PATCH 15/24 v2] packages: use the <PKG>_TARGET_FINALIZE_HOOKS Yann E. MORIN
` (10 subsequent siblings)
24 siblings, 2 replies; 73+ messages in thread
From: Yann E. MORIN @ 2016-06-22 19:07 UTC (permalink / raw)
To: buildroot
Currently, our skeleton declares target-finalize hooks, and does so
unconditionally.
That's fine since we have a single skeleton package, and thus the hooks
it declares need not be conditional.
However, we're going to be adding more skeleton packages, one for the
custom skeleton, one for the sysv-like init systems and, eventually, one
for the systemd init system.
In that case, we will not want the sysv-like target-finalize hooks to be
applied when the init system is systemd. And the other way around, of
course. And so on for each type of skeleton...
The only solution we have so far is to enclose all target-finalize hooks
declarations between an ifeq-block to check that the package is enabled.
This is cumbersome to do, even more so when the hooks are themselves
conditional.
Add support in the core infra for packages to register such hooks, like
is done to register users, device tables and whatnots.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
docs/manual/adding-packages-hooks.txt | 7 +++++++
package/pkg-generic.mk | 2 ++
2 files changed, 9 insertions(+)
diff --git a/docs/manual/adding-packages-hooks.txt b/docs/manual/adding-packages-hooks.txt
index 5b5bf6a..d25092a 100644
--- a/docs/manual/adding-packages-hooks.txt
+++ b/docs/manual/adding-packages-hooks.txt
@@ -77,3 +77,10 @@ others, use the following variables:
* +$(SRCDIR)+: the path to the overridden source directory
* +$(@D)+: the path to the build directory
+
+==== Target-finalize hook
+
+Packages may also register hooks in +LIBFOO_TARGET_FINALIZE_HOOKS+.
+These hooks are run after all packages are built, but before the
+filesystem images are generated. They are seldom used, and your
+package probably do not need them.
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 3281374..4415342 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -558,6 +558,7 @@ $(2)_PRE_INSTALL_IMAGES_HOOKS ?=
$(2)_POST_INSTALL_IMAGES_HOOKS ?=
$(2)_PRE_LEGAL_INFO_HOOKS ?=
$(2)_POST_LEGAL_INFO_HOOKS ?=
+$(2)_TARGET_FINALIZE_HOOKS ?=
# human-friendly targets and target sequencing
$(1): $(1)-install
@@ -858,6 +859,7 @@ endif
ifneq ($$($(2)_USERS),)
PACKAGES_USERS += $$($(2)_USERS)$$(sep)
endif
+TARGET_FINALIZE_HOOKS += $$($(2)_TARGET_FINALIZE_HOOKS)
ifeq ($$($(2)_SITE_METHOD),svn)
DL_TOOLS_DEPENDENCIES += svn
--
2.7.4
^ permalink raw reply related [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 14/24 v2] core/pkg-generic: allow packages to declare target-finalize hooks
2016-06-22 19:07 ` [Buildroot] [PATCH 14/24 v2] core/pkg-generic: allow packages to declare target-finalize hooks Yann E. MORIN
@ 2016-07-03 9:53 ` Romain Naour
2016-07-05 14:00 ` Thomas Petazzoni
1 sibling, 0 replies; 73+ messages in thread
From: Romain Naour @ 2016-07-03 9:53 UTC (permalink / raw)
To: buildroot
Hi Yann,
Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> Currently, our skeleton declares target-finalize hooks, and does so
> unconditionally.
>
> That's fine since we have a single skeleton package, and thus the hooks
> it declares need not be conditional.
>
> However, we're going to be adding more skeleton packages, one for the
> custom skeleton, one for the sysv-like init systems and, eventually, one
> for the systemd init system.
>
> In that case, we will not want the sysv-like target-finalize hooks to be
> applied when the init system is systemd. And the other way around, of
> course. And so on for each type of skeleton...
>
> The only solution we have so far is to enclose all target-finalize hooks
> declarations between an ifeq-block to check that the package is enabled.
> This is cumbersome to do, even more so when the hooks are themselves
> conditional.
>
> Add support in the core infra for packages to register such hooks, like
> is done to register users, device tables and whatnots.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Best regards,
Romain
> ---
> docs/manual/adding-packages-hooks.txt | 7 +++++++
> package/pkg-generic.mk | 2 ++
> 2 files changed, 9 insertions(+)
>
> diff --git a/docs/manual/adding-packages-hooks.txt b/docs/manual/adding-packages-hooks.txt
> index 5b5bf6a..d25092a 100644
> --- a/docs/manual/adding-packages-hooks.txt
> +++ b/docs/manual/adding-packages-hooks.txt
> @@ -77,3 +77,10 @@ others, use the following variables:
>
> * +$(SRCDIR)+: the path to the overridden source directory
> * +$(@D)+: the path to the build directory
> +
> +==== Target-finalize hook
> +
> +Packages may also register hooks in +LIBFOO_TARGET_FINALIZE_HOOKS+.
> +These hooks are run after all packages are built, but before the
> +filesystem images are generated. They are seldom used, and your
> +package probably do not need them.
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index 3281374..4415342 100644
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -558,6 +558,7 @@ $(2)_PRE_INSTALL_IMAGES_HOOKS ?=
> $(2)_POST_INSTALL_IMAGES_HOOKS ?=
> $(2)_PRE_LEGAL_INFO_HOOKS ?=
> $(2)_POST_LEGAL_INFO_HOOKS ?=
> +$(2)_TARGET_FINALIZE_HOOKS ?=
>
> # human-friendly targets and target sequencing
> $(1): $(1)-install
> @@ -858,6 +859,7 @@ endif
> ifneq ($$($(2)_USERS),)
> PACKAGES_USERS += $$($(2)_USERS)$$(sep)
> endif
> +TARGET_FINALIZE_HOOKS += $$($(2)_TARGET_FINALIZE_HOOKS)
>
> ifeq ($$($(2)_SITE_METHOD),svn)
> DL_TOOLS_DEPENDENCIES += svn
>
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 14/24 v2] core/pkg-generic: allow packages to declare target-finalize hooks
2016-06-22 19:07 ` [Buildroot] [PATCH 14/24 v2] core/pkg-generic: allow packages to declare target-finalize hooks Yann E. MORIN
2016-07-03 9:53 ` Romain Naour
@ 2016-07-05 14:00 ` Thomas Petazzoni
1 sibling, 0 replies; 73+ messages in thread
From: Thomas Petazzoni @ 2016-07-05 14:00 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 22 Jun 2016 21:07:36 +0200, Yann E. MORIN wrote:
> Currently, our skeleton declares target-finalize hooks, and does so
> unconditionally.
>
> That's fine since we have a single skeleton package, and thus the hooks
> it declares need not be conditional.
>
> However, we're going to be adding more skeleton packages, one for the
> custom skeleton, one for the sysv-like init systems and, eventually, one
> for the systemd init system.
>
> In that case, we will not want the sysv-like target-finalize hooks to be
> applied when the init system is systemd. And the other way around, of
> course. And so on for each type of skeleton...
>
> The only solution we have so far is to enclose all target-finalize hooks
> declarations between an ifeq-block to check that the package is enabled.
> This is cumbersome to do, even more so when the hooks are themselves
> conditional.
>
> Add support in the core infra for packages to register such hooks, like
> is done to register users, device tables and whatnots.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> ---
> docs/manual/adding-packages-hooks.txt | 7 +++++++
> package/pkg-generic.mk | 2 ++
> 2 files changed, 9 insertions(+)
I've applied after rewriting the commit log. Indeed, I am not yet sure
we will have multiple skeleton packages, so the commit log from that
perspective may not be correct. However, the functionality itself is
useful on its own, for other packages, which is why I've applied it.
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 15/24 v2] packages: use the <PKG>_TARGET_FINALIZE_HOOKS
2016-06-22 19:07 [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton) Yann E. MORIN
` (13 preceding siblings ...)
2016-06-22 19:07 ` [Buildroot] [PATCH 14/24 v2] core/pkg-generic: allow packages to declare target-finalize hooks Yann E. MORIN
@ 2016-06-22 19:07 ` Yann E. MORIN
2016-07-03 10:02 ` Romain Naour
2016-07-05 14:01 ` Thomas Petazzoni
2016-06-22 19:07 ` [Buildroot] [PATCH 16/24 v2] package/skeleton: split into sysv and custom skeleton Yann E. MORIN
` (9 subsequent siblings)
24 siblings, 2 replies; 73+ messages in thread
From: Yann E. MORIN @ 2016-06-22 19:07 UTC (permalink / raw)
To: buildroot
Register package-specific target-finalize hooks with the
newly-introduced <PKG>_TARGET_FINALIZE_HOOKS.
This incidentally fixes luarocks, which was registering target-finalize
hooks even when it was not enabled.
To be noted, the skeleton package is not converted, because it is not
optional, we always have it; so its hooks would always be registered
anyway. Besides, the followup patches would render this conversion moot
anyway, since those hooks would be spread across the various skeleton
packages.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
package/google-breakpad/google-breakpad.mk | 6 ++----
package/libglib2/libglib2.mk | 6 ++----
package/libgtk3/libgtk3.mk | 4 +---
package/luarocks/luarocks.mk | 3 +--
package/perl/perl.mk | 4 +---
package/python/python.mk | 10 ++++------
package/python3/python3.mk | 10 ++++------
7 files changed, 15 insertions(+), 28 deletions(-)
diff --git a/package/google-breakpad/google-breakpad.mk b/package/google-breakpad/google-breakpad.mk
index 1bbe4da..7a88c76 100644
--- a/package/google-breakpad/google-breakpad.mk
+++ b/package/google-breakpad/google-breakpad.mk
@@ -13,15 +13,13 @@ GOOGLE_BREAKPAD_INSTALL_TARGET = NO
GOOGLE_BREAKPAD_INSTALL_STAGING = YES
GOOGLE_BREAKPAD_LICENSE = BSD-3c
GOOGLE_BREAKPAD_LICENSE_FILES = LICENSE
-
-ifeq ($(BR2_PACKAGE_GOOGLE_BREAKPAD),y)
GOOGLE_BREAKPAD_DEPENDENCIES = host-google-breakpad
+
define GOOGLE_BREAKPAD_EXTRACT_SYMBOLS
$(EXTRA_ENV) package/google-breakpad/gen-syms.sh $(STAGING_DIR) \
$(TARGET_DIR) $(call qstrip,$(BR2_GOOGLE_BREAKPAD_INCLUDE_FILES))
endef
-TARGET_FINALIZE_HOOKS += GOOGLE_BREAKPAD_EXTRACT_SYMBOLS
-endif
+GOOGLE_BREAKPAD_TARGET_FINALIZE_HOOKS += GOOGLE_BREAKPAD_EXTRACT_SYMBOLS
$(eval $(autotools-package))
$(eval $(host-autotools-package))
diff --git a/package/libglib2/libglib2.mk b/package/libglib2/libglib2.mk
index b479bae..e2bff6d 100644
--- a/package/libglib2/libglib2.mk
+++ b/package/libglib2/libglib2.mk
@@ -160,10 +160,8 @@ define LIBGLIB2_COMPILE_SCHEMAS
--targetdir=$(TARGET_DIR)/usr/share/glib-2.0/schemas
endef
-ifeq ($(BR2_PACKAGE_LIBGLIB2),y)
-TARGET_FINALIZE_HOOKS += LIBGLIB2_REMOVE_TARGET_SCHEMAS
-TARGET_FINALIZE_HOOKS += LIBGLIB2_COMPILE_SCHEMAS
-endif
+LIBGLIB2_TARGET_FINALIZE_HOOKS += LIBGLIB2_REMOVE_TARGET_SCHEMAS
+LIBGLIB2_TARGET_FINALIZE_HOOKS += LIBGLIB2_COMPILE_SCHEMAS
$(eval $(autotools-package))
$(eval $(host-autotools-package))
diff --git a/package/libgtk3/libgtk3.mk b/package/libgtk3/libgtk3.mk
index f447e7a..08d172f 100644
--- a/package/libgtk3/libgtk3.mk
+++ b/package/libgtk3/libgtk3.mk
@@ -182,13 +182,11 @@ endef
# Create icon-theme.cache for each of the icon directories/themes
# It's not strictly necessary but speeds up lookups
-ifeq ($(BR2_PACKAGE_LIBGTK3),y)
define LIBGTK3_UPDATE_ICON_CACHE
find $(TARGET_DIR)/usr/share/icons -maxdepth 1 -mindepth 1 -type d \
-exec $(HOST_DIR)/usr/bin/gtk-update-icon-cache {} \;
endef
-TARGET_FINALIZE_HOOKS += LIBGTK3_UPDATE_ICON_CACHE
-endif
+LIBGTK3_TARGET_FINALIZE_HOOKS += LIBGTK3_UPDATE_ICON_CACHE
$(eval $(autotools-package))
$(eval $(host-autotools-package))
diff --git a/package/luarocks/luarocks.mk b/package/luarocks/luarocks.mk
index 656b832..eddd435 100644
--- a/package/luarocks/luarocks.mk
+++ b/package/luarocks/luarocks.mk
@@ -60,5 +60,4 @@ define LUAROCKS_FINALIZE_TARGET
rm -rf $(TARGET_DIR)/usr/lib/luarocks
endef
-TARGET_FINALIZE_HOOKS += LUAROCKS_FINALIZE_TARGET
-
+LUAROCKS_TARGET_FINALIZE_HOOKS += LUAROCKS_FINALIZE_TARGET
diff --git a/package/perl/perl.mk b/package/perl/perl.mk
index 29af7a4..ca70123 100644
--- a/package/perl/perl.mk
+++ b/package/perl/perl.mk
@@ -114,7 +114,6 @@ endef
$(eval $(generic-package))
$(eval $(host-generic-package))
-ifeq ($(BR2_PACKAGE_PERL),y)
define PERL_FINALIZE_TARGET
rm -rf $(TARGET_DIR)/usr/lib/perl5/$(PERL_VERSION)/pod
rm -rf $(TARGET_DIR)/usr/lib/perl5/$(PERL_VERSION)/$(PERL_ARCHNAME)/CORE
@@ -122,5 +121,4 @@ define PERL_FINALIZE_TARGET
find $(TARGET_DIR)/usr/lib/perl5/ -name '*.bs' -print0 | xargs -0 rm -f
find $(TARGET_DIR)/usr/lib/perl5/ -name '.packlist' -print0 | xargs -0 rm -f
endef
-TARGET_FINALIZE_HOOKS += PERL_FINALIZE_TARGET
-endif
+PERL_TARGET_FINALIZE_HOOKS += PERL_FINALIZE_TARGET
diff --git a/package/python/python.mk b/package/python/python.mk
index 913dc2c..5e13bf3 100644
--- a/package/python/python.mk
+++ b/package/python/python.mk
@@ -226,7 +226,7 @@ define PYTHON_CREATE_PYC_FILES
endef
ifeq ($(BR2_PACKAGE_PYTHON_PYC_ONLY)$(BR2_PACKAGE_PYTHON_PY_PYC),y)
-TARGET_FINALIZE_HOOKS += PYTHON_CREATE_PYC_FILES
+PYTHON_TARGET_FINALIZE_HOOKS += PYTHON_CREATE_PYC_FILES
endif
ifeq ($(BR2_PACKAGE_PYTHON_PYC_ONLY),y)
@@ -234,7 +234,7 @@ define PYTHON_REMOVE_PY_FILES
find $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR) -name '*.py' -print0 | \
xargs -0 --no-run-if-empty rm -f
endef
-TARGET_FINALIZE_HOOKS += PYTHON_REMOVE_PY_FILES
+PYTHON_TARGET_FINALIZE_HOOKS += PYTHON_REMOVE_PY_FILES
endif
# Normally, *.pyc files should not have been compiled, but just in
@@ -244,14 +244,12 @@ define PYTHON_REMOVE_PYC_FILES
find $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR) -name '*.pyc' -print0 | \
xargs -0 --no-run-if-empty rm -f
endef
-TARGET_FINALIZE_HOOKS += PYTHON_REMOVE_PYC_FILES
+PYTHON_TARGET_FINALIZE_HOOKS += PYTHON_REMOVE_PYC_FILES
endif
# In all cases, we don't want to keep the optimized .pyo files
-ifeq ($(BR2_PACKAGE_PYTHON),y)
define PYTHON_REMOVE_PYO_FILES
find $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR) -name '*.pyo' -print0 | \
xargs -0 --no-run-if-empty rm -f
endef
-TARGET_FINALIZE_HOOKS += PYTHON_REMOVE_PYO_FILES
-endif
+PYTHON_TARGET_FINALIZE_HOOKS += PYTHON_REMOVE_PYO_FILES
diff --git a/package/python3/python3.mk b/package/python3/python3.mk
index 8459b11..dc776fe 100644
--- a/package/python3/python3.mk
+++ b/package/python3/python3.mk
@@ -217,7 +217,7 @@ define PYTHON3_CREATE_PYC_FILES
endef
ifeq ($(BR2_PACKAGE_PYTHON3_PYC_ONLY)$(BR2_PACKAGE_PYTHON3_PY_PYC),y)
-TARGET_FINALIZE_HOOKS += PYTHON3_CREATE_PYC_FILES
+PYTHON3_TARGET_FINALIZE_HOOKS += PYTHON3_CREATE_PYC_FILES
endif
ifeq ($(BR2_PACKAGE_PYTHON3_PYC_ONLY),y)
@@ -225,7 +225,7 @@ define PYTHON3_REMOVE_PY_FILES
find $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR) -name '*.py' -print0 | \
xargs -0 --no-run-if-empty rm -f
endef
-TARGET_FINALIZE_HOOKS += PYTHON3_REMOVE_PY_FILES
+PYTHON3_TARGET_FINALIZE_HOOKS += PYTHON3_REMOVE_PY_FILES
endif
# Normally, *.pyc files should not have been compiled, but just in
@@ -235,16 +235,14 @@ define PYTHON3_REMOVE_PYC_FILES
find $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR) -name '*.pyc' -print0 | \
xargs -0 --no-run-if-empty rm -f
endef
-TARGET_FINALIZE_HOOKS += PYTHON3_REMOVE_PYC_FILES
+PYTHON3_TARGET_FINALIZE_HOOKS += PYTHON3_REMOVE_PYC_FILES
endif
# In all cases, we don't want to keep the optimized .opt-1.pyc and
# .opt-2.pyc files, since they can't work without their non-optimized
# variant.
-ifeq ($(BR2_PACKAGE_PYTHON3),y)
define PYTHON3_REMOVE_OPTIMIZED_PYC_FILES
find $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR) -name '*.opt-1.pyc' -print0 -o -name '*.opt-2.pyc' -print0 | \
xargs -0 --no-run-if-empty rm -f
endef
-TARGET_FINALIZE_HOOKS += PYTHON3_REMOVE_OPTIMIZED_PYC_FILES
-endif
+PYTHON3_TARGET_FINALIZE_HOOKS += PYTHON3_REMOVE_OPTIMIZED_PYC_FILES
--
2.7.4
^ permalink raw reply related [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 15/24 v2] packages: use the <PKG>_TARGET_FINALIZE_HOOKS
2016-06-22 19:07 ` [Buildroot] [PATCH 15/24 v2] packages: use the <PKG>_TARGET_FINALIZE_HOOKS Yann E. MORIN
@ 2016-07-03 10:02 ` Romain Naour
2016-07-04 18:05 ` Yann E. MORIN
2016-07-05 14:01 ` Thomas Petazzoni
1 sibling, 1 reply; 73+ messages in thread
From: Romain Naour @ 2016-07-03 10:02 UTC (permalink / raw)
To: buildroot
Hi Yann,
Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> Register package-specific target-finalize hooks with the
> newly-introduced <PKG>_TARGET_FINALIZE_HOOKS.
>
> This incidentally fixes luarocks, which was registering target-finalize
> hooks even when it was not enabled.
>
> To be noted, the skeleton package is not converted, because it is not
> optional, we always have it; so its hooks would always be registered
> anyway. Besides, the followup patches would render this conversion moot
> anyway, since those hooks would be spread across the various skeleton
> packages.
Have you considered the two TARGET_FINALIZE_HOOKS from the toolchain package ?
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Otherwise:
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Best regards,
Romain
> ---
> package/google-breakpad/google-breakpad.mk | 6 ++----
> package/libglib2/libglib2.mk | 6 ++----
> package/libgtk3/libgtk3.mk | 4 +---
> package/luarocks/luarocks.mk | 3 +--
> package/perl/perl.mk | 4 +---
> package/python/python.mk | 10 ++++------
> package/python3/python3.mk | 10 ++++------
> 7 files changed, 15 insertions(+), 28 deletions(-)
>
> diff --git a/package/google-breakpad/google-breakpad.mk b/package/google-breakpad/google-breakpad.mk
> index 1bbe4da..7a88c76 100644
> --- a/package/google-breakpad/google-breakpad.mk
> +++ b/package/google-breakpad/google-breakpad.mk
> @@ -13,15 +13,13 @@ GOOGLE_BREAKPAD_INSTALL_TARGET = NO
> GOOGLE_BREAKPAD_INSTALL_STAGING = YES
> GOOGLE_BREAKPAD_LICENSE = BSD-3c
> GOOGLE_BREAKPAD_LICENSE_FILES = LICENSE
> -
> -ifeq ($(BR2_PACKAGE_GOOGLE_BREAKPAD),y)
> GOOGLE_BREAKPAD_DEPENDENCIES = host-google-breakpad
> +
> define GOOGLE_BREAKPAD_EXTRACT_SYMBOLS
> $(EXTRA_ENV) package/google-breakpad/gen-syms.sh $(STAGING_DIR) \
> $(TARGET_DIR) $(call qstrip,$(BR2_GOOGLE_BREAKPAD_INCLUDE_FILES))
> endef
> -TARGET_FINALIZE_HOOKS += GOOGLE_BREAKPAD_EXTRACT_SYMBOLS
> -endif
> +GOOGLE_BREAKPAD_TARGET_FINALIZE_HOOKS += GOOGLE_BREAKPAD_EXTRACT_SYMBOLS
>
> $(eval $(autotools-package))
> $(eval $(host-autotools-package))
> diff --git a/package/libglib2/libglib2.mk b/package/libglib2/libglib2.mk
> index b479bae..e2bff6d 100644
> --- a/package/libglib2/libglib2.mk
> +++ b/package/libglib2/libglib2.mk
> @@ -160,10 +160,8 @@ define LIBGLIB2_COMPILE_SCHEMAS
> --targetdir=$(TARGET_DIR)/usr/share/glib-2.0/schemas
> endef
>
> -ifeq ($(BR2_PACKAGE_LIBGLIB2),y)
> -TARGET_FINALIZE_HOOKS += LIBGLIB2_REMOVE_TARGET_SCHEMAS
> -TARGET_FINALIZE_HOOKS += LIBGLIB2_COMPILE_SCHEMAS
> -endif
> +LIBGLIB2_TARGET_FINALIZE_HOOKS += LIBGLIB2_REMOVE_TARGET_SCHEMAS
> +LIBGLIB2_TARGET_FINALIZE_HOOKS += LIBGLIB2_COMPILE_SCHEMAS
>
> $(eval $(autotools-package))
> $(eval $(host-autotools-package))
> diff --git a/package/libgtk3/libgtk3.mk b/package/libgtk3/libgtk3.mk
> index f447e7a..08d172f 100644
> --- a/package/libgtk3/libgtk3.mk
> +++ b/package/libgtk3/libgtk3.mk
> @@ -182,13 +182,11 @@ endef
>
> # Create icon-theme.cache for each of the icon directories/themes
> # It's not strictly necessary but speeds up lookups
> -ifeq ($(BR2_PACKAGE_LIBGTK3),y)
> define LIBGTK3_UPDATE_ICON_CACHE
> find $(TARGET_DIR)/usr/share/icons -maxdepth 1 -mindepth 1 -type d \
> -exec $(HOST_DIR)/usr/bin/gtk-update-icon-cache {} \;
> endef
> -TARGET_FINALIZE_HOOKS += LIBGTK3_UPDATE_ICON_CACHE
> -endif
> +LIBGTK3_TARGET_FINALIZE_HOOKS += LIBGTK3_UPDATE_ICON_CACHE
>
> $(eval $(autotools-package))
> $(eval $(host-autotools-package))
> diff --git a/package/luarocks/luarocks.mk b/package/luarocks/luarocks.mk
> index 656b832..eddd435 100644
> --- a/package/luarocks/luarocks.mk
> +++ b/package/luarocks/luarocks.mk
> @@ -60,5 +60,4 @@ define LUAROCKS_FINALIZE_TARGET
> rm -rf $(TARGET_DIR)/usr/lib/luarocks
> endef
>
> -TARGET_FINALIZE_HOOKS += LUAROCKS_FINALIZE_TARGET
> -
> +LUAROCKS_TARGET_FINALIZE_HOOKS += LUAROCKS_FINALIZE_TARGET
> diff --git a/package/perl/perl.mk b/package/perl/perl.mk
> index 29af7a4..ca70123 100644
> --- a/package/perl/perl.mk
> +++ b/package/perl/perl.mk
> @@ -114,7 +114,6 @@ endef
> $(eval $(generic-package))
> $(eval $(host-generic-package))
>
> -ifeq ($(BR2_PACKAGE_PERL),y)
> define PERL_FINALIZE_TARGET
> rm -rf $(TARGET_DIR)/usr/lib/perl5/$(PERL_VERSION)/pod
> rm -rf $(TARGET_DIR)/usr/lib/perl5/$(PERL_VERSION)/$(PERL_ARCHNAME)/CORE
> @@ -122,5 +121,4 @@ define PERL_FINALIZE_TARGET
> find $(TARGET_DIR)/usr/lib/perl5/ -name '*.bs' -print0 | xargs -0 rm -f
> find $(TARGET_DIR)/usr/lib/perl5/ -name '.packlist' -print0 | xargs -0 rm -f
> endef
> -TARGET_FINALIZE_HOOKS += PERL_FINALIZE_TARGET
> -endif
> +PERL_TARGET_FINALIZE_HOOKS += PERL_FINALIZE_TARGET
> diff --git a/package/python/python.mk b/package/python/python.mk
> index 913dc2c..5e13bf3 100644
> --- a/package/python/python.mk
> +++ b/package/python/python.mk
> @@ -226,7 +226,7 @@ define PYTHON_CREATE_PYC_FILES
> endef
>
> ifeq ($(BR2_PACKAGE_PYTHON_PYC_ONLY)$(BR2_PACKAGE_PYTHON_PY_PYC),y)
> -TARGET_FINALIZE_HOOKS += PYTHON_CREATE_PYC_FILES
> +PYTHON_TARGET_FINALIZE_HOOKS += PYTHON_CREATE_PYC_FILES
> endif
>
> ifeq ($(BR2_PACKAGE_PYTHON_PYC_ONLY),y)
> @@ -234,7 +234,7 @@ define PYTHON_REMOVE_PY_FILES
> find $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR) -name '*.py' -print0 | \
> xargs -0 --no-run-if-empty rm -f
> endef
> -TARGET_FINALIZE_HOOKS += PYTHON_REMOVE_PY_FILES
> +PYTHON_TARGET_FINALIZE_HOOKS += PYTHON_REMOVE_PY_FILES
> endif
>
> # Normally, *.pyc files should not have been compiled, but just in
> @@ -244,14 +244,12 @@ define PYTHON_REMOVE_PYC_FILES
> find $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR) -name '*.pyc' -print0 | \
> xargs -0 --no-run-if-empty rm -f
> endef
> -TARGET_FINALIZE_HOOKS += PYTHON_REMOVE_PYC_FILES
> +PYTHON_TARGET_FINALIZE_HOOKS += PYTHON_REMOVE_PYC_FILES
> endif
>
> # In all cases, we don't want to keep the optimized .pyo files
> -ifeq ($(BR2_PACKAGE_PYTHON),y)
> define PYTHON_REMOVE_PYO_FILES
> find $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR) -name '*.pyo' -print0 | \
> xargs -0 --no-run-if-empty rm -f
> endef
> -TARGET_FINALIZE_HOOKS += PYTHON_REMOVE_PYO_FILES
> -endif
> +PYTHON_TARGET_FINALIZE_HOOKS += PYTHON_REMOVE_PYO_FILES
> diff --git a/package/python3/python3.mk b/package/python3/python3.mk
> index 8459b11..dc776fe 100644
> --- a/package/python3/python3.mk
> +++ b/package/python3/python3.mk
> @@ -217,7 +217,7 @@ define PYTHON3_CREATE_PYC_FILES
> endef
>
> ifeq ($(BR2_PACKAGE_PYTHON3_PYC_ONLY)$(BR2_PACKAGE_PYTHON3_PY_PYC),y)
> -TARGET_FINALIZE_HOOKS += PYTHON3_CREATE_PYC_FILES
> +PYTHON3_TARGET_FINALIZE_HOOKS += PYTHON3_CREATE_PYC_FILES
> endif
>
> ifeq ($(BR2_PACKAGE_PYTHON3_PYC_ONLY),y)
> @@ -225,7 +225,7 @@ define PYTHON3_REMOVE_PY_FILES
> find $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR) -name '*.py' -print0 | \
> xargs -0 --no-run-if-empty rm -f
> endef
> -TARGET_FINALIZE_HOOKS += PYTHON3_REMOVE_PY_FILES
> +PYTHON3_TARGET_FINALIZE_HOOKS += PYTHON3_REMOVE_PY_FILES
> endif
>
> # Normally, *.pyc files should not have been compiled, but just in
> @@ -235,16 +235,14 @@ define PYTHON3_REMOVE_PYC_FILES
> find $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR) -name '*.pyc' -print0 | \
> xargs -0 --no-run-if-empty rm -f
> endef
> -TARGET_FINALIZE_HOOKS += PYTHON3_REMOVE_PYC_FILES
> +PYTHON3_TARGET_FINALIZE_HOOKS += PYTHON3_REMOVE_PYC_FILES
> endif
>
> # In all cases, we don't want to keep the optimized .opt-1.pyc and
> # .opt-2.pyc files, since they can't work without their non-optimized
> # variant.
> -ifeq ($(BR2_PACKAGE_PYTHON3),y)
> define PYTHON3_REMOVE_OPTIMIZED_PYC_FILES
> find $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR) -name '*.opt-1.pyc' -print0 -o -name '*.opt-2.pyc' -print0 | \
> xargs -0 --no-run-if-empty rm -f
> endef
> -TARGET_FINALIZE_HOOKS += PYTHON3_REMOVE_OPTIMIZED_PYC_FILES
> -endif
> +PYTHON3_TARGET_FINALIZE_HOOKS += PYTHON3_REMOVE_OPTIMIZED_PYC_FILES
>
^ permalink raw reply [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 15/24 v2] packages: use the <PKG>_TARGET_FINALIZE_HOOKS
2016-07-03 10:02 ` Romain Naour
@ 2016-07-04 18:05 ` Yann E. MORIN
0 siblings, 0 replies; 73+ messages in thread
From: Yann E. MORIN @ 2016-07-04 18:05 UTC (permalink / raw)
To: buildroot
Romain, All,
On 2016-07-03 12:02 +0200, Romain Naour spake thusly:
> Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> > Register package-specific target-finalize hooks with the
> > newly-introduced <PKG>_TARGET_FINALIZE_HOOKS.
> >
> > This incidentally fixes luarocks, which was registering target-finalize
> > hooks even when it was not enabled.
> >
> > To be noted, the skeleton package is not converted, because it is not
> > optional, we always have it; so its hooks would always be registered
> > anyway. Besides, the followup patches would render this conversion moot
> > anyway, since those hooks would be spread across the various skeleton
> > packages.
>
> Have you considered the two TARGET_FINALIZE_HOOKS from the toolchain package ?
Good idea! Done, now.
> >
> > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
>
> Otherwise:
> Reviewed-by: Romain Naour <romain.naour@gmail.com>
Thanks! :-)
Regards,
Yann E. MORIN.
> Best regards,
> Romain
>
>
> > ---
> > package/google-breakpad/google-breakpad.mk | 6 ++----
> > package/libglib2/libglib2.mk | 6 ++----
> > package/libgtk3/libgtk3.mk | 4 +---
> > package/luarocks/luarocks.mk | 3 +--
> > package/perl/perl.mk | 4 +---
> > package/python/python.mk | 10 ++++------
> > package/python3/python3.mk | 10 ++++------
> > 7 files changed, 15 insertions(+), 28 deletions(-)
> >
> > diff --git a/package/google-breakpad/google-breakpad.mk b/package/google-breakpad/google-breakpad.mk
> > index 1bbe4da..7a88c76 100644
> > --- a/package/google-breakpad/google-breakpad.mk
> > +++ b/package/google-breakpad/google-breakpad.mk
> > @@ -13,15 +13,13 @@ GOOGLE_BREAKPAD_INSTALL_TARGET = NO
> > GOOGLE_BREAKPAD_INSTALL_STAGING = YES
> > GOOGLE_BREAKPAD_LICENSE = BSD-3c
> > GOOGLE_BREAKPAD_LICENSE_FILES = LICENSE
> > -
> > -ifeq ($(BR2_PACKAGE_GOOGLE_BREAKPAD),y)
> > GOOGLE_BREAKPAD_DEPENDENCIES = host-google-breakpad
> > +
> > define GOOGLE_BREAKPAD_EXTRACT_SYMBOLS
> > $(EXTRA_ENV) package/google-breakpad/gen-syms.sh $(STAGING_DIR) \
> > $(TARGET_DIR) $(call qstrip,$(BR2_GOOGLE_BREAKPAD_INCLUDE_FILES))
> > endef
> > -TARGET_FINALIZE_HOOKS += GOOGLE_BREAKPAD_EXTRACT_SYMBOLS
> > -endif
> > +GOOGLE_BREAKPAD_TARGET_FINALIZE_HOOKS += GOOGLE_BREAKPAD_EXTRACT_SYMBOLS
> >
> > $(eval $(autotools-package))
> > $(eval $(host-autotools-package))
> > diff --git a/package/libglib2/libglib2.mk b/package/libglib2/libglib2.mk
> > index b479bae..e2bff6d 100644
> > --- a/package/libglib2/libglib2.mk
> > +++ b/package/libglib2/libglib2.mk
> > @@ -160,10 +160,8 @@ define LIBGLIB2_COMPILE_SCHEMAS
> > --targetdir=$(TARGET_DIR)/usr/share/glib-2.0/schemas
> > endef
> >
> > -ifeq ($(BR2_PACKAGE_LIBGLIB2),y)
> > -TARGET_FINALIZE_HOOKS += LIBGLIB2_REMOVE_TARGET_SCHEMAS
> > -TARGET_FINALIZE_HOOKS += LIBGLIB2_COMPILE_SCHEMAS
> > -endif
> > +LIBGLIB2_TARGET_FINALIZE_HOOKS += LIBGLIB2_REMOVE_TARGET_SCHEMAS
> > +LIBGLIB2_TARGET_FINALIZE_HOOKS += LIBGLIB2_COMPILE_SCHEMAS
> >
> > $(eval $(autotools-package))
> > $(eval $(host-autotools-package))
> > diff --git a/package/libgtk3/libgtk3.mk b/package/libgtk3/libgtk3.mk
> > index f447e7a..08d172f 100644
> > --- a/package/libgtk3/libgtk3.mk
> > +++ b/package/libgtk3/libgtk3.mk
> > @@ -182,13 +182,11 @@ endef
> >
> > # Create icon-theme.cache for each of the icon directories/themes
> > # It's not strictly necessary but speeds up lookups
> > -ifeq ($(BR2_PACKAGE_LIBGTK3),y)
> > define LIBGTK3_UPDATE_ICON_CACHE
> > find $(TARGET_DIR)/usr/share/icons -maxdepth 1 -mindepth 1 -type d \
> > -exec $(HOST_DIR)/usr/bin/gtk-update-icon-cache {} \;
> > endef
> > -TARGET_FINALIZE_HOOKS += LIBGTK3_UPDATE_ICON_CACHE
> > -endif
> > +LIBGTK3_TARGET_FINALIZE_HOOKS += LIBGTK3_UPDATE_ICON_CACHE
> >
> > $(eval $(autotools-package))
> > $(eval $(host-autotools-package))
> > diff --git a/package/luarocks/luarocks.mk b/package/luarocks/luarocks.mk
> > index 656b832..eddd435 100644
> > --- a/package/luarocks/luarocks.mk
> > +++ b/package/luarocks/luarocks.mk
> > @@ -60,5 +60,4 @@ define LUAROCKS_FINALIZE_TARGET
> > rm -rf $(TARGET_DIR)/usr/lib/luarocks
> > endef
> >
> > -TARGET_FINALIZE_HOOKS += LUAROCKS_FINALIZE_TARGET
> > -
> > +LUAROCKS_TARGET_FINALIZE_HOOKS += LUAROCKS_FINALIZE_TARGET
> > diff --git a/package/perl/perl.mk b/package/perl/perl.mk
> > index 29af7a4..ca70123 100644
> > --- a/package/perl/perl.mk
> > +++ b/package/perl/perl.mk
> > @@ -114,7 +114,6 @@ endef
> > $(eval $(generic-package))
> > $(eval $(host-generic-package))
> >
> > -ifeq ($(BR2_PACKAGE_PERL),y)
> > define PERL_FINALIZE_TARGET
> > rm -rf $(TARGET_DIR)/usr/lib/perl5/$(PERL_VERSION)/pod
> > rm -rf $(TARGET_DIR)/usr/lib/perl5/$(PERL_VERSION)/$(PERL_ARCHNAME)/CORE
> > @@ -122,5 +121,4 @@ define PERL_FINALIZE_TARGET
> > find $(TARGET_DIR)/usr/lib/perl5/ -name '*.bs' -print0 | xargs -0 rm -f
> > find $(TARGET_DIR)/usr/lib/perl5/ -name '.packlist' -print0 | xargs -0 rm -f
> > endef
> > -TARGET_FINALIZE_HOOKS += PERL_FINALIZE_TARGET
> > -endif
> > +PERL_TARGET_FINALIZE_HOOKS += PERL_FINALIZE_TARGET
> > diff --git a/package/python/python.mk b/package/python/python.mk
> > index 913dc2c..5e13bf3 100644
> > --- a/package/python/python.mk
> > +++ b/package/python/python.mk
> > @@ -226,7 +226,7 @@ define PYTHON_CREATE_PYC_FILES
> > endef
> >
> > ifeq ($(BR2_PACKAGE_PYTHON_PYC_ONLY)$(BR2_PACKAGE_PYTHON_PY_PYC),y)
> > -TARGET_FINALIZE_HOOKS += PYTHON_CREATE_PYC_FILES
> > +PYTHON_TARGET_FINALIZE_HOOKS += PYTHON_CREATE_PYC_FILES
> > endif
> >
> > ifeq ($(BR2_PACKAGE_PYTHON_PYC_ONLY),y)
> > @@ -234,7 +234,7 @@ define PYTHON_REMOVE_PY_FILES
> > find $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR) -name '*.py' -print0 | \
> > xargs -0 --no-run-if-empty rm -f
> > endef
> > -TARGET_FINALIZE_HOOKS += PYTHON_REMOVE_PY_FILES
> > +PYTHON_TARGET_FINALIZE_HOOKS += PYTHON_REMOVE_PY_FILES
> > endif
> >
> > # Normally, *.pyc files should not have been compiled, but just in
> > @@ -244,14 +244,12 @@ define PYTHON_REMOVE_PYC_FILES
> > find $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR) -name '*.pyc' -print0 | \
> > xargs -0 --no-run-if-empty rm -f
> > endef
> > -TARGET_FINALIZE_HOOKS += PYTHON_REMOVE_PYC_FILES
> > +PYTHON_TARGET_FINALIZE_HOOKS += PYTHON_REMOVE_PYC_FILES
> > endif
> >
> > # In all cases, we don't want to keep the optimized .pyo files
> > -ifeq ($(BR2_PACKAGE_PYTHON),y)
> > define PYTHON_REMOVE_PYO_FILES
> > find $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR) -name '*.pyo' -print0 | \
> > xargs -0 --no-run-if-empty rm -f
> > endef
> > -TARGET_FINALIZE_HOOKS += PYTHON_REMOVE_PYO_FILES
> > -endif
> > +PYTHON_TARGET_FINALIZE_HOOKS += PYTHON_REMOVE_PYO_FILES
> > diff --git a/package/python3/python3.mk b/package/python3/python3.mk
> > index 8459b11..dc776fe 100644
> > --- a/package/python3/python3.mk
> > +++ b/package/python3/python3.mk
> > @@ -217,7 +217,7 @@ define PYTHON3_CREATE_PYC_FILES
> > endef
> >
> > ifeq ($(BR2_PACKAGE_PYTHON3_PYC_ONLY)$(BR2_PACKAGE_PYTHON3_PY_PYC),y)
> > -TARGET_FINALIZE_HOOKS += PYTHON3_CREATE_PYC_FILES
> > +PYTHON3_TARGET_FINALIZE_HOOKS += PYTHON3_CREATE_PYC_FILES
> > endif
> >
> > ifeq ($(BR2_PACKAGE_PYTHON3_PYC_ONLY),y)
> > @@ -225,7 +225,7 @@ define PYTHON3_REMOVE_PY_FILES
> > find $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR) -name '*.py' -print0 | \
> > xargs -0 --no-run-if-empty rm -f
> > endef
> > -TARGET_FINALIZE_HOOKS += PYTHON3_REMOVE_PY_FILES
> > +PYTHON3_TARGET_FINALIZE_HOOKS += PYTHON3_REMOVE_PY_FILES
> > endif
> >
> > # Normally, *.pyc files should not have been compiled, but just in
> > @@ -235,16 +235,14 @@ define PYTHON3_REMOVE_PYC_FILES
> > find $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR) -name '*.pyc' -print0 | \
> > xargs -0 --no-run-if-empty rm -f
> > endef
> > -TARGET_FINALIZE_HOOKS += PYTHON3_REMOVE_PYC_FILES
> > +PYTHON3_TARGET_FINALIZE_HOOKS += PYTHON3_REMOVE_PYC_FILES
> > endif
> >
> > # In all cases, we don't want to keep the optimized .opt-1.pyc and
> > # .opt-2.pyc files, since they can't work without their non-optimized
> > # variant.
> > -ifeq ($(BR2_PACKAGE_PYTHON3),y)
> > define PYTHON3_REMOVE_OPTIMIZED_PYC_FILES
> > find $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR) -name '*.opt-1.pyc' -print0 -o -name '*.opt-2.pyc' -print0 | \
> > xargs -0 --no-run-if-empty rm -f
> > endef
> > -TARGET_FINALIZE_HOOKS += PYTHON3_REMOVE_OPTIMIZED_PYC_FILES
> > -endif
> > +PYTHON3_TARGET_FINALIZE_HOOKS += PYTHON3_REMOVE_OPTIMIZED_PYC_FILES
> >
>
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 15/24 v2] packages: use the <PKG>_TARGET_FINALIZE_HOOKS
2016-06-22 19:07 ` [Buildroot] [PATCH 15/24 v2] packages: use the <PKG>_TARGET_FINALIZE_HOOKS Yann E. MORIN
2016-07-03 10:02 ` Romain Naour
@ 2016-07-05 14:01 ` Thomas Petazzoni
1 sibling, 0 replies; 73+ messages in thread
From: Thomas Petazzoni @ 2016-07-05 14:01 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 22 Jun 2016 21:07:37 +0200, Yann E. MORIN wrote:
> Register package-specific target-finalize hooks with the
> newly-introduced <PKG>_TARGET_FINALIZE_HOOKS.
>
> This incidentally fixes luarocks, which was registering target-finalize
> hooks even when it was not enabled.
>
> To be noted, the skeleton package is not converted, because it is not
> optional, we always have it; so its hooks would always be registered
> anyway. Besides, the followup patches would render this conversion moot
> anyway, since those hooks would be spread across the various skeleton
> packages.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> ---
> package/google-breakpad/google-breakpad.mk | 6 ++----
> package/libglib2/libglib2.mk | 6 ++----
> package/libgtk3/libgtk3.mk | 4 +---
> package/luarocks/luarocks.mk | 3 +--
> package/perl/perl.mk | 4 +---
> package/python/python.mk | 10 ++++------
> package/python3/python3.mk | 10 ++++------
> 7 files changed, 15 insertions(+), 28 deletions(-)
Applied to master, thanks. Please send a followup patch changing the
TARGET_FINALIZE_HOOKS in the toolchain package, as suggested by Romain.
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 16/24 v2] package/skeleton: split into sysv and custom skeleton
2016-06-22 19:07 [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton) Yann E. MORIN
` (14 preceding siblings ...)
2016-06-22 19:07 ` [Buildroot] [PATCH 15/24 v2] packages: use the <PKG>_TARGET_FINALIZE_HOOKS Yann E. MORIN
@ 2016-06-22 19:07 ` Yann E. MORIN
2016-07-03 10:27 ` Romain Naour
2016-06-22 19:07 ` [Buildroot] [PATCH 17/24 v2] package/skeleton: make it a virtual package Yann E. MORIN
` (8 subsequent siblings)
24 siblings, 1 reply; 73+ messages in thread
From: Yann E. MORIN @ 2016-06-22 19:07 UTC (permalink / raw)
To: buildroot
Currently, both the sysv-like and custom skeletons are managed in a
single package.
However, for the custom skeleton, we basically do nothing, except for
a few symlinks for the /lib directory aliases, and a few checks about
merged /usr.
OTOH, for the default (sysv-like) skeleton, we do a lot more things,
like tweaking the issue, the hostname, setting the root password and so
on...
Furthermore, we're soon gonna have a skeleton for each kind of init
system, be it sysv-based or systemd.
So, it makes sense to offload the custom skeleton management to its own
package.
We change the way we check for the merged /usr readiness, from checking
at make parse time, to a configure command. This has virtually zero
impact, since the skeleton is the very first package to be "built", so
its configure commands are the very first to be run. It however slightly
cimplifies the .mk as we need not enclose the parse-time checks inside
an ifeq-block to check if the package is enabled.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
package/Config.in | 2 +
package/skeleton-custom/Config.in | 2 +
package/skeleton-custom/skeleton-custom.mk | 112 +++++++++++++++++++
package/skeleton-sysv/Config.in | 2 +
package/skeleton-sysv/skeleton-sysv.mk | 126 +++++++++++++++++++++
package/skeleton/Config.in | 2 +
package/skeleton/skeleton.mk | 172 ++++-------------------------
7 files changed, 265 insertions(+), 153 deletions(-)
create mode 100644 package/skeleton-custom/Config.in
create mode 100644 package/skeleton-custom/skeleton-custom.mk
create mode 100644 package/skeleton-sysv/Config.in
create mode 100644 package/skeleton-sysv/skeleton-sysv.mk
diff --git a/package/Config.in b/package/Config.in
index a2a02a8..fd445f4 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2,6 +2,8 @@ menu "Target packages"
source "package/busybox/Config.in"
source "package/skeleton/Config.in"
+ source "package/skeleton-custom/Config.in"
+ source "package/skeleton-sysv/Config.in"
menu "Audio and video applications"
source "package/alsa-utils/Config.in"
diff --git a/package/skeleton-custom/Config.in b/package/skeleton-custom/Config.in
new file mode 100644
index 0000000..1f3c87c
--- /dev/null
+++ b/package/skeleton-custom/Config.in
@@ -0,0 +1,2 @@
+config BR2_PACKAGE_SKELETON_CUSTOM
+ bool
diff --git a/package/skeleton-custom/skeleton-custom.mk b/package/skeleton-custom/skeleton-custom.mk
new file mode 100644
index 0000000..8690af4
--- /dev/null
+++ b/package/skeleton-custom/skeleton-custom.mk
@@ -0,0 +1,112 @@
+################################################################################
+#
+# skeleton-custom
+#
+################################################################################
+
+SKELETON_CUSTOM_SOURCE =
+
+SKELETON_CUSTOM_ADD_TOOLCHAIN_DEPENDENCY = NO
+SKELETON_CUSTOM_ADD_SKELETON_DEPENDENCY = NO
+
+SKELETON_CUSTOM_INSTALL_STAGING = YES
+
+SKELETON_CUSTOM_PATH = $(call qstrip,$(BR2_ROOTFS_SKELETON_CUSTOM_PATH))
+
+# Extract the inode numbers for all of those directories. In case any is
+# a symlink, we want to get the inode of the pointed-to directory, so we
+# append '/.' to be sure we get the target directory. Since the symlinks
+# can be anyway (/bin -> /usr/bin or /usr/bin -> /bin), we do that for
+# all of them.
+#
+SKELETON_CUSTOM_LIB_INODE = $(shell stat -c '%i' $(SKELETON_CUSTOM_PATH)/lib/. 2>/dev/null)
+SKELETON_CUSTOM_BIN_INODE = $(shell stat -c '%i' $(SKELETON_CUSTOM_PATH)/bin/. 2>/dev/null)
+SKELETON_CUSTOM_SBIN_INODE = $(shell stat -c '%i' $(SKELETON_CUSTOM_PATH)/sbin/. 2>/dev/null)
+SKELETON_CUSTOM_USR_LIB_INODE = $(shell stat -c '%i' $(SKELETON_CUSTOM_PATH)/usr/lib/. 2>/dev/null)
+SKELETON_CUSTOM_USR_BIN_INODE = $(shell stat -c '%i' $(SKELETON_CUSTOM_PATH)/usr/bin/. 2>/dev/null)
+SKELETON_CUSTOM_USR_SBIN_INODE = $(shell stat -c '%i' $(SKELETON_CUSTOM_PATH)/usr/sbin/. 2>/dev/null)
+
+# Ensure that the custom skeleton has /lib, /bin and /sbin, and their
+# /usr counterparts
+define SKELETON_CUSTOM_MISSING_DIRS
+ if [ -z "$(SKELETON_CUSTOM_LIB_INODE)" ]; then \
+ missing+=" /lib"; \
+ fi; \
+ if [ -z "$(SKELETON_CUSTOM_USR_LIB_INODE)" ]; then \
+ missing+=" /usr/lib"; \
+ fi; \
+ if [ -z "$(SKELETON_CUSTOM_BIN_INODE)" ]; then \
+ missing+=" /bin"; \
+ fi; \
+ if [ -z "$(SKELETON_CUSTOM_USR_BIN_INODE)" ]; then \
+ missing+=" /usr/bin"; \
+ fi; \
+ if [ -z "$(SKELETON_CUSTOM_SBIN_INODE)" ]; then \
+ missing+=" /sbin"; \
+ fi; \
+ if [ -z "$(SKELETON_CUSTOM_USR_SBIN_INODE)" ]; then \
+ missing+=" /usr/sbin"; \
+ fi; \
+ if [ "$${missing" ]; then \
+ printf "The custom skeleton in %s is missing\n" "$(SKELETON_CUSTOM_PATH)"; \
+ printf "the following directories:\n"; \
+ printf " %s\n" "$${missing}"; \
+ exit 1; \
+ fi
+endef
+
+# For a merged /usr, ensure that /lib, /bin and /sbin and their /usr
+# counterparts are appropriately setup symlinks ones to the others.
+ifeq ($(BR2_ROOTFS_MERGED_USR),y)
+
+define SKELETON_CUSTOM_MERGED_USR
+ if [ $(SKELETON_LIB_INODE) != $(SKELETON_USR_LIB_INODE) ]; then \
+ missing+=" /lib"; \
+ fi; \
+ if [ $(SKELETON_BIN_INODE) != $(SKELETON_USR_BIN_INODE) ]; then \
+ missing+=" /bin"; \
+ fi; \
+ if [ $(SKELETON_SBIN_INODE) != $(SKELETON_USR_SBIN_INODE) ]; then \
+ missing+=" /sbin"; \
+ fi;
+ if [ "$${missing}" ]; then
+ printf "The custom skeleton in %s is not\n" "$(SKELETON_CUSTOM_PATH)"; \
+ printf "using a merged /usr for the following directories:\n"; \
+ printf " %s\n" "$${missing}"; \
+ exit 1; \
+ fi
+endef
+
+endif # merged /usr
+
+# We used to do the followinf checks in Makefile code, to catch the
+# errors as early as possible. But the skeleton is the very first
+# package to be installed, so we do the checks in its configure
+# commands; they are almost as early as if they were done in Makefile
+# code.
+define SKELETON_CUSTOM_CONFIGURE_CMDS
+ $(SKELETON_CUSTOM_MISSING_DIRS)
+ $(SKELETON_CUSTOM_MERGED_USR)
+endef
+
+# Provided by the 'skeleton' package:
+# - SKELETON_LIB_SYMLINK
+
+define SKELETON_CUSTOM_INSTALL_TARGET_CMDS
+ $(call SKELETON_RSYNC,$(SKELETON_CUSTOM_PATH),$(TARGET_DIR))
+ ln -snf lib $(TARGET_DIR)/$(SKELETON_LIB_SYMLINK)
+ ln -snf lib $(TARGET_DIR)/usr/$(SKELETON_LIB_SYMLINK)
+endef
+
+# For the staging dir, we don't really care what we install, but we
+# need the /lib and /usr/lib apropriately setup.
+# Since we ensure, above, that they are correct in the skeleton, we
+# can simply copy it to staging.
+define SKELETON_CUSTOM_INSTALL_STAGING_CMDS
+ $(call SKELETON_RSYNC,$(SKELETON_CUSTOM_PATH),$(STAGING_DIR))
+ $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include
+ ln -snf lib $(STAGING_DIR)/$(SKELETON_LIB_SYMLINK)
+ ln -snf lib $(STAGING_DIR)/usr/$(SKELETON_LIB_SYMLINK)
+endef
+
+$(eval $(generic-package))
diff --git a/package/skeleton-sysv/Config.in b/package/skeleton-sysv/Config.in
new file mode 100644
index 0000000..8c2e7dd
--- /dev/null
+++ b/package/skeleton-sysv/Config.in
@@ -0,0 +1,2 @@
+config BR2_PACKAGE_SKELETON_SYSV
+ bool
diff --git a/package/skeleton-sysv/skeleton-sysv.mk b/package/skeleton-sysv/skeleton-sysv.mk
new file mode 100644
index 0000000..0a2f51b
--- /dev/null
+++ b/package/skeleton-sysv/skeleton-sysv.mk
@@ -0,0 +1,126 @@
+################################################################################
+#
+# skeleton-sysv
+#
+################################################################################
+
+SKELETON_SYSV_SOURCE =
+
+SKELETON_SYSV_ADD_TOOLCHAIN_DEPENDENCY = NO
+SKELETON_SYSV_ADD_SKELETON_DEPENDENCY = NO
+
+SKELETON_SYSV_INSTALL_STAGING = YES
+
+# Provided by the 'skeleton' package:
+# - SKELETON_USR_SYMLINKS_OR_DIRS
+# - SKELETON_LIB_SYMLINK
+# - SKELETON_TARGET_GENERIC_HOSTNAME
+# - SKELETON_TARGET_GENERIC_ISSUE
+# - SKELETON_TARGET_ROOT_PASSWD
+# - SKELETON_TARGET_GENERIC_BIN_SH
+# - SKELETON_TARGET_GENERIC_GETTY_PORT
+# - SKELETON_TARGET_GENERIC_GETTY_BAUDRATE
+# - SKELETON_TARGET_GENERIC_GETTY_TERM
+# - SKELETON_TARGET_GENERIC_GETTY_OPTIONS
+# - SKELETON_SET_NETWORK_IFUPDOWN_LOOPBACK
+# - SKELETON_SET_NETWORK_IFUPDOWN_DHCP
+
+define SKELETON_INSTALL_TARGET_CMDS
+ $(call SKELETON_RSYNC,system/skeleton,$(TARGET_DIR))
+ $(call SKELETON_USR_SYMLINKS_OR_DIRS,$(TARGET_DIR))
+ ln -snf lib $(TARGET_DIR)/$(SKELETON_LIB_SYMLINK)
+ ln -snf lib $(TARGET_DIR)/usr/$(SKELETON_LIB_SYMLINK)
+ $(INSTALL) -m 0644 support/misc/target-dir-warning.txt \
+ $(TARGET_DIR_WARNING_FILE)
+endef
+
+# For the staging dir, we don't really care about /bin and /sbin.
+# But for consistency with the target dir, and to simplify the code,
+# we still handle them for the merged or non-merged /usr cases.
+# Since the toolchain is not yet available, the staging is not yet
+# populated, so we need to create the directories in /usr
+define SKELETON_SYSV_INSTALL_STAGING_CMDS
+ $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/lib
+ $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/bin
+ $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/sbin
+ $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include
+ $(call SKELETON_USR_SYMLINKS_OR_DIRS,$(STAGING_DIR))
+ ln -snf lib $(STAGING_DIR)/$(SKELETON_LIB_SYMLINK)
+ ln -snf lib $(STAGING_DIR)/usr/$(SKELETON_LIB_SYMLINK)
+endef
+
+ifneq ($(SKELETON_TARGET_GENERIC_HOSTNAME),)
+define SKELETON_SYSV_SET_HOSTNAME
+ mkdir -p $(TARGET_DIR)/etc
+ echo "$(SKELETON_TARGET_GENERIC_HOSTNAME)" > $(TARGET_DIR)/etc/hostname
+ $(SED) '$$a \127.0.1.1\t$(SKELETON_TARGET_GENERIC_HOSTNAME)' \
+ -e '/^127.0.1.1/d' $(TARGET_DIR)/etc/hosts
+endef
+SKELETON_SYSV_TARGET_FINALIZE_HOOKS += SKELETON_SYSV_SET_HOSTNAME
+endif
+
+ifneq ($(SKELETON_TARGET_GENERIC_ISSUE),)
+define SKELETON_SYSV_SET_ISSUE
+ mkdir -p $(TARGET_DIR)/etc
+ echo "$(SKELETON_TARGET_GENERIC_ISSUE)" > $(TARGET_DIR)/etc/issue
+endef
+SKELETON_SYSV_TARGET_FINALIZE_HOOKS += SKELETON_SYSV_SET_ISSUE
+endif
+
+define SKELETON_SYSV_SET_NETWORK
+ mkdir -p $(TARGET_DIR)/etc/network/
+ $(SKELETON_SET_NETWORK_IFUPDOWN_LOOPBACK)
+ $(SKELETON_SET_NETWORK_IFUPDOWN_DHCP)
+endef
+SKELETON_SYSV_TARGET_FINALIZE_HOOKS += SKELETON_SYSV_SET_NETWORK
+
+define SKELETON_SYSV_SET_ROOT_PASSWD
+ $(SED) s,^root:[^:]*:,root:$(SKELETON_SYSV_ROOT_PASSWORD):, $(TARGET_DIR)/etc/shadow
+endef
+SKELETON_SYSV_TARGET_FINALIZE_HOOKS += SKELETON_SYSV_SET_ROOT_PASSWD
+
+ifeq ($(BR2_SYSTEM_BIN_SH_NONE),y)
+define SKELETON_SYSV_BIN_SH
+ rm -f $(TARGET_DIR)/bin/sh
+endef
+else
+define SKELETON_SYSV_BIN_SH
+ ln -sf $(SKELETON_TARGET_GENERIC_BIN_SH) $(TARGET_DIR)/bin/sh
+endef
+endif
+SKELETON_SYSV_TARGET_FINALIZE_HOOKS += SKELETON_SYSV_BIN_SH
+
+ifeq ($(BR2_TARGET_GENERIC_GETTY),y)
+ifeq ($(BR2_INIT_SYSV),y)
+# In sysvinit inittab, the "id" must not be longer than 4 bytes, so we
+# skip the "tty" part and keep only the remaining.
+define SKELETON_SYSV_SET_GETTY
+ $(SED) '/# GENERIC_SERIAL$$/s~^.*#~$(shell echo $(SKELETON_TARGET_GENERIC_GETTY_PORT) | tail -c+4)::respawn:/sbin/getty -L $(SKELETON_TARGET_GENERIC_GETTY_OPTIONS) $(SKELETON_TARGET_GENERIC_GETTY_PORT) $(SKELETON_TARGET_GENERIC_GETTY_BAUDRATE) $(SKELETON_TARGET_GENERIC_GETTY_TERM) #~' \
+ $(TARGET_DIR)/etc/inittab
+endef
+else ifeq ($(BR2_INIT_BUSYBOX),y)
+# Add getty to busybox inittab
+define SKELETON_SYSV_SET_GETTY
+ $(SED) '/# GENERIC_SERIAL$$/s~^.*#~$(SKELETON_TARGET_GENERIC_GETTY_PORT)::respawn:/sbin/getty -L $(SKELETON_TARGET_GENERIC_GETTY_OPTIONS) $(SKELETON_TARGET_GENERIC_GETTY_PORT) $(SKELETON_TARGET_GENERIC_GETTY_BAUDRATE) $(SKELETON_TARGET_GENERIC_GETTY_TERM) #~' \
+ $(TARGET_DIR)/etc/inittab
+endef
+endif
+SKELETON_SYSV_TARGET_FINALIZE_HOOKS += SKELETON_SYSV_SET_GETTY
+endif
+
+ifeq ($(BR2_INIT_BUSYBOX)$(BR2_INIT_SYSV),y)
+ifeq ($(BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW),y)
+# Find commented line, if any, and remove leading '#'s
+define SKELETON_SYSV_REMOUNT_RW
+ $(SED) '/^#.*-o remount,rw \/$$/s~^#\+~~' $(TARGET_DIR)/etc/inittab
+endef
+else
+# Find uncommented line, if any, and add a leading '#'
+define SKELETON_SYSV_REMOUNT_RW
+ $(SED) '/^[^#].*-o remount,rw \/$$/s~^~#~' $(TARGET_DIR)/etc/inittab
+endef
+endif
+SKELETON_SYSV_TARGET_FINALIZE_HOOKS += SKELETON_SYSV_REMOUNT_RW
+endif # BR2_INIT_BUSYBOX || BR2_INIT_SYSV
+
+$(eval $(generic-package))
diff --git a/package/skeleton/Config.in b/package/skeleton/Config.in
index d25147b..6db0634 100644
--- a/package/skeleton/Config.in
+++ b/package/skeleton/Config.in
@@ -1,5 +1,7 @@
config BR2_PACKAGE_SKELETON
bool
default y
+ select BR2_PACKAGE_SKELETON_SYSV if BR2_ROOTFS_SKELETON_DEFAULT
+ select BR2_PACKAGE_SKELETON_CUSTOM if BR2_ROOTFS_SKELETON_CUSTOM
help
The basic skeleton for your rootfs.
diff --git a/package/skeleton/skeleton.mk b/package/skeleton/skeleton.mk
index e3ae694..bd787db 100644
--- a/package/skeleton/skeleton.mk
+++ b/package/skeleton/skeleton.mk
@@ -7,6 +7,10 @@
# source included in buildroot
SKELETON_SOURCE =
+SKELETON_DEPENDENCIES = \
+ $(if $(BR2_PACKAGE_SKELETON_SYSV),skeleton-sysv) \
+ $(if $(BR2_PACKAGE_SKELETON_CUSTOM),skeleton-custom)
+
# 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
@@ -14,53 +18,19 @@ SKELETON_SOURCE =
SKELETON_ADD_TOOLCHAIN_DEPENDENCY = NO
SKELETON_ADD_SKELETON_DEPENDENCY = NO
-# The skeleton also handles the merged /usr case in the sysroot
-SKELETON_INSTALL_STAGING = YES
-
-ifeq ($(BR2_ROOTFS_SKELETON_CUSTOM),y)
-
-SKELETON_PATH = $(call qstrip,$(BR2_ROOTFS_SKELETON_CUSTOM_PATH))
-
-ifeq ($(BR2_ROOTFS_MERGED_USR),y)
-
-# Ensure the user has prepared a merged /usr.
-#
-# Extract the inode numbers for all of those directories. In case any is
-# a symlink, we want to get the inode of the pointed-to directory, so we
-# append '/.' to be sure we get the target directory. Since the symlinks
-# can be anyway (/bin -> /usr/bin or /usr/bin -> /bin), we do that for
-# all of them.
-#
-SKELETON_LIB_INODE = $(shell stat -c '%i' $(SKELETON_PATH)/lib/.)
-SKELETON_BIN_INODE = $(shell stat -c '%i' $(SKELETON_PATH)/bin/.)
-SKELETON_SBIN_INODE = $(shell stat -c '%i' $(SKELETON_PATH)/sbin/.)
-SKELETON_USR_LIB_INODE = $(shell stat -c '%i' $(SKELETON_PATH)/usr/lib/.)
-SKELETON_USR_BIN_INODE = $(shell stat -c '%i' $(SKELETON_PATH)/usr/bin/.)
-SKELETON_USR_SBIN_INODE = $(shell stat -c '%i' $(SKELETON_PATH)/usr/sbin/.)
-
-ifneq ($(SKELETON_LIB_INODE),$(SKELETON_USR_LIB_INODE))
-SKELETON_CUSTOM_NOT_MERGED_USR += /lib
-endif
-ifneq ($(SKELETON_BIN_INODE),$(SKELETON_USR_BIN_INODE))
-SKELETON_CUSTOM_NOT_MERGED_USR += /bin
-endif
-ifneq ($(SKELETON_SBIN_INODE),$(SKELETON_USR_SBIN_INODE))
-SKELETON_CUSTOM_NOT_MERGED_USR += /sbin
-endif
-
-ifneq ($(SKELETON_CUSTOM_NOT_MERGED_USR),)
-$(error The custom skeleton in $(SKELETON_PATH) is not \
- using a merged /usr for the following directories: \
- $(SKELETON_CUSTOM_NOT_MERGED_USR))
-endif
-
-endif # merged /usr
-
-else # ! custom skeleton
-
-SKELETON_PATH = system/skeleton
-
-endif # ! custom skeleton
+# The following definitions are to be used by the specific skeletons:
+# - SKELETON_USR_SYMLINKS_OR_DIRS
+# - SKELETON_LIB_SYMLINK
+# - SKELETON_TARGET_GENERIC_HOSTNAME
+# - SKELETON_TARGET_GENERIC_ISSUE
+# - SKELETON_TARGET_ROOT_PASSWD
+# - SKELETON_TARGET_GENERIC_BIN_SH
+# - SKELETON_TARGET_GENERIC_GETTY_PORT
+# - SKELETON_TARGET_GENERIC_GETTY_BAUDRATE
+# - SKELETON_TARGET_GENERIC_GETTY_TERM
+# - SKELETON_TARGET_GENERIC_GETTY_OPTIONS
+# - SKELETON_SET_NETWORK_IFUPDOWN_LOOPBACK
+# - SKELETON_SET_NETWORK_IFUPDOWN_DHCP
# This function rsyncs the skeleton directory in $(1) to the destination
# in $(2), which should be either $(TARTGET_DIR) or $(STAGING_DIR)
@@ -93,34 +63,6 @@ else
SKELETON_LIB_SYMLINK = lib32
endif
-define SKELETON_INSTALL_TARGET_CMDS
- $(call SKELETON_RSYNC,$(SKELETON_PATH),$(TARGET_DIR))
- $(call SKELETON_USR_SYMLINKS_OR_DIRS,$(TARGET_DIR))
- ln -snf lib $(TARGET_DIR)/$(SKELETON_LIB_SYMLINK)
- ln -snf lib $(TARGET_DIR)/usr/$(SKELETON_LIB_SYMLINK)
- $(INSTALL) -m 0644 support/misc/target-dir-warning.txt \
- $(TARGET_DIR_WARNING_FILE)
-endef
-
-# For the staging dir, we don't really care about /bin and /sbin.
-# But for consistency with the target dir, and to simplify the code,
-# we still handle them for the merged or non-merged /usr cases.
-# Since the toolchain is not yet available, the staging is not yet
-# populated, so we need to create the directories in /usr
-define SKELETON_INSTALL_STAGING_CMDS
- $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/lib
- $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/bin
- $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/sbin
- $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include
- $(call SKELETON_USR_SYMLINKS_OR_DIRS,$(STAGING_DIR))
- ln -snf lib $(STAGING_DIR)/$(SKELETON_LIB_SYMLINK)
- ln -snf lib $(STAGING_DIR)/usr/$(SKELETON_LIB_SYMLINK)
-endef
-
-# The TARGET_FINALIZE_HOOKS must be sourced only if the users choose to use the
-# default skeleton.
-ifeq ($(BR2_ROOTFS_SKELETON_DEFAULT),y)
-
SKELETON_TARGET_GENERIC_HOSTNAME = $(call qstrip,$(BR2_TARGET_GENERIC_HOSTNAME))
SKELETON_TARGET_GENERIC_ISSUE = $(call qstrip,$(BR2_TARGET_GENERIC_ISSUE))
SKELETON_TARGET_GENERIC_ROOT_PASSWD = $(call qstrip,$(BR2_TARGET_GENERIC_ROOT_PASSWD))
@@ -131,25 +73,8 @@ SKELETON_TARGET_GENERIC_GETTY_BAUDRATE = $(call qstrip,$(BR2_TARGET_GENERIC_GETT
SKELETON_TARGET_GENERIC_GETTY_TERM = $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_TERM))
SKELETON_TARGET_GENERIC_GETTY_OPTIONS = $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_OPTIONS))
-ifneq ($(SKELETON_TARGET_GENERIC_HOSTNAME),)
-define SKELETON_SET_HOSTNAME
- mkdir -p $(TARGET_DIR)/etc
- echo "$(SKELETON_TARGET_GENERIC_HOSTNAME)" > $(TARGET_DIR)/etc/hostname
- $(SED) '$$a \127.0.1.1\t$(SKELETON_TARGET_GENERIC_HOSTNAME)' \
- -e '/^127.0.1.1/d' $(TARGET_DIR)/etc/hosts
-endef
-TARGET_FINALIZE_HOOKS += SKELETON_SET_HOSTNAME
-endif
-ifneq ($(SKELETON_TARGET_GENERIC_ISSUE),)
-define SKELETON_SET_ISSUE
- mkdir -p $(TARGET_DIR)/etc
- echo "$(SKELETON_TARGET_GENERIC_ISSUE)" > $(TARGET_DIR)/etc/issue
-endef
-TARGET_FINALIZE_HOOKS += SKELETON_SET_ISSUE
-endif
-
-define SKELETON_SET_NETWORK_LOCALHOST
+define SKELETON_SET_NETWORK_IFUPDOWN_LOOPBACK
( \
echo "# interface file auto-generated by buildroot"; \
echo ; \
@@ -161,7 +86,7 @@ endef
SKELETON_NETWORK_DHCP_IFACE = $(call qstrip,$(BR2_SYSTEM_DHCP))
ifneq ($(SKELETON_NETWORK_DHCP_IFACE),)
-define SKELETON_SET_NETWORK_DHCP
+define SKELETON_SET_NETWORK_IFUPDOWN_DHCP
( \
echo ; \
echo "auto $(SKELETON_NETWORK_DHCP_IFACE)"; \
@@ -174,14 +99,6 @@ define SKELETON_SET_NETWORK_DHCP
endef
endif
-define SKELETON_SET_NETWORK
- mkdir -p $(TARGET_DIR)/etc/network/
- $(SKELETON_SET_NETWORK_LOCALHOST)
- $(SKELETON_SET_NETWORK_DHCP)
-endef
-
-TARGET_FINALIZE_HOOKS += SKELETON_SET_NETWORK
-
ifeq ($(BR2_TARGET_ENABLE_ROOT_LOGIN),y)
ifeq ($(SKELETON_TARGET_GENERIC_ROOT_PASSWD),)
SKELETON_ROOT_PASSWORD =
@@ -197,55 +114,4 @@ else # !BR2_TARGET_ENABLE_ROOT_LOGIN
SKELETON_ROOT_PASSWORD = "*"
endif
-define SKELETON_SET_ROOT_PASSWD
- $(SED) s,^root:[^:]*:,root:$(SKELETON_ROOT_PASSWORD):, $(TARGET_DIR)/etc/shadow
-endef
-TARGET_FINALIZE_HOOKS += SKELETON_SET_ROOT_PASSWD
-
-ifeq ($(BR2_SYSTEM_BIN_SH_NONE),y)
-define SKELETON_BIN_SH
- rm -f $(TARGET_DIR)/bin/sh
-endef
-else
-define SKELETON_BIN_SH
- ln -sf $(SKELETON_TARGET_GENERIC_BIN_SH) $(TARGET_DIR)/bin/sh
-endef
-endif
-TARGET_FINALIZE_HOOKS += SKELETON_BIN_SH
-
-ifeq ($(BR2_TARGET_GENERIC_GETTY),y)
-ifeq ($(BR2_INIT_SYSV),y)
-# In sysvinit inittab, the "id" must not be longer than 4 bytes, so we
-# skip the "tty" part and keep only the remaining.
-define SKELETON_SET_GETTY
- $(SED) '/# GENERIC_SERIAL$$/s~^.*#~$(shell echo $(SKELETON_TARGET_GENERIC_GETTY_PORT) | tail -c+4)::respawn:/sbin/getty -L $(SKELETON_TARGET_GENERIC_GETTY_OPTIONS) $(SKELETON_TARGET_GENERIC_GETTY_PORT) $(SKELETON_TARGET_GENERIC_GETTY_BAUDRATE) $(SKELETON_TARGET_GENERIC_GETTY_TERM) #~' \
- $(TARGET_DIR)/etc/inittab
-endef
-else ifeq ($(BR2_INIT_BUSYBOX),y)
-# Add getty to busybox inittab
-define SKELETON_SET_GETTY
- $(SED) '/# GENERIC_SERIAL$$/s~^.*#~$(SKELETON_TARGET_GENERIC_GETTY_PORT)::respawn:/sbin/getty -L $(SKELETON_TARGET_GENERIC_GETTY_OPTIONS) $(SKELETON_TARGET_GENERIC_GETTY_PORT) $(SKELETON_TARGET_GENERIC_GETTY_BAUDRATE) $(SKELETON_TARGET_GENERIC_GETTY_TERM) #~' \
- $(TARGET_DIR)/etc/inittab
-endef
-endif
-TARGET_FINALIZE_HOOKS += SKELETON_SET_GETTY
-endif
-
-ifeq ($(BR2_INIT_BUSYBOX)$(BR2_INIT_SYSV),y)
-ifeq ($(BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW),y)
-# Find commented line, if any, and remove leading '#'s
-define SKELETON_REMOUNT_RW
- $(SED) '/^#.*-o remount,rw \/$$/s~^#\+~~' $(TARGET_DIR)/etc/inittab
-endef
-else
-# Find uncommented line, if any, and add a leading '#'
-define SKELETON_REMOUNT_RW
- $(SED) '/^[^#].*-o remount,rw \/$$/s~^~#~' $(TARGET_DIR)/etc/inittab
-endef
-endif
-TARGET_FINALIZE_HOOKS += SKELETON_REMOUNT_RW
-endif # BR2_INIT_BUSYBOX || BR2_INIT_SYSV
-
-endif # BR2_ROOTFS_SKELETON_DEFAULT
-
$(eval $(generic-package))
--
2.7.4
^ permalink raw reply related [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 16/24 v2] package/skeleton: split into sysv and custom skeleton
2016-06-22 19:07 ` [Buildroot] [PATCH 16/24 v2] package/skeleton: split into sysv and custom skeleton Yann E. MORIN
@ 2016-07-03 10:27 ` Romain Naour
2016-07-05 7:26 ` Yann E. MORIN
0 siblings, 1 reply; 73+ messages in thread
From: Romain Naour @ 2016-07-03 10:27 UTC (permalink / raw)
To: buildroot
Hi Yann,
Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> Currently, both the sysv-like and custom skeletons are managed in a
> single package.
>
> However, for the custom skeleton, we basically do nothing, except for
> a few symlinks for the /lib directory aliases, and a few checks about
> merged /usr.
>
> OTOH, for the default (sysv-like) skeleton, we do a lot more things,
> like tweaking the issue, the hostname, setting the root password and so
> on...
>
> Furthermore, we're soon gonna have a skeleton for each kind of init
> system, be it sysv-based or systemd.
>
> So, it makes sense to offload the custom skeleton management to its own
> package.
>
> We change the way we check for the merged /usr readiness, from checking
> at make parse time, to a configure command. This has virtually zero
> impact, since the skeleton is the very first package to be "built", so
> its configure commands are the very first to be run. It however slightly
> cimplifies the .mk as we need not enclose the parse-time checks inside
^
s/cimplifies/simplifies/
> an ifeq-block to check if the package is enabled.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> ---
> package/Config.in | 2 +
> package/skeleton-custom/Config.in | 2 +
> package/skeleton-custom/skeleton-custom.mk | 112 +++++++++++++++++++
> package/skeleton-sysv/Config.in | 2 +
> package/skeleton-sysv/skeleton-sysv.mk | 126 +++++++++++++++++++++
> package/skeleton/Config.in | 2 +
> package/skeleton/skeleton.mk | 172 ++++-------------------------
> 7 files changed, 265 insertions(+), 153 deletions(-)
> create mode 100644 package/skeleton-custom/Config.in
> create mode 100644 package/skeleton-custom/skeleton-custom.mk
> create mode 100644 package/skeleton-sysv/Config.in
> create mode 100644 package/skeleton-sysv/skeleton-sysv.mk
>
> diff --git a/package/Config.in b/package/Config.in
> index a2a02a8..fd445f4 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -2,6 +2,8 @@ menu "Target packages"
>
> source "package/busybox/Config.in"
> source "package/skeleton/Config.in"
> + source "package/skeleton-custom/Config.in"
> + source "package/skeleton-sysv/Config.in"
>
> menu "Audio and video applications"
> source "package/alsa-utils/Config.in"
> diff --git a/package/skeleton-custom/Config.in b/package/skeleton-custom/Config.in
> new file mode 100644
> index 0000000..1f3c87c
> --- /dev/null
> +++ b/package/skeleton-custom/Config.in
> @@ -0,0 +1,2 @@
> +config BR2_PACKAGE_SKELETON_CUSTOM
> + bool
> diff --git a/package/skeleton-custom/skeleton-custom.mk b/package/skeleton-custom/skeleton-custom.mk
> new file mode 100644
> index 0000000..8690af4
> --- /dev/null
> +++ b/package/skeleton-custom/skeleton-custom.mk
> @@ -0,0 +1,112 @@
> +################################################################################
> +#
> +# skeleton-custom
> +#
> +################################################################################
> +
> +SKELETON_CUSTOM_SOURCE =
> +
> +SKELETON_CUSTOM_ADD_TOOLCHAIN_DEPENDENCY = NO
> +SKELETON_CUSTOM_ADD_SKELETON_DEPENDENCY = NO
> +
> +SKELETON_CUSTOM_INSTALL_STAGING = YES
> +
> +SKELETON_CUSTOM_PATH = $(call qstrip,$(BR2_ROOTFS_SKELETON_CUSTOM_PATH))
> +
> +# Extract the inode numbers for all of those directories. In case any is
> +# a symlink, we want to get the inode of the pointed-to directory, so we
> +# append '/.' to be sure we get the target directory. Since the symlinks
> +# can be anyway (/bin -> /usr/bin or /usr/bin -> /bin), we do that for
> +# all of them.
> +#
> +SKELETON_CUSTOM_LIB_INODE = $(shell stat -c '%i' $(SKELETON_CUSTOM_PATH)/lib/. 2>/dev/null)
> +SKELETON_CUSTOM_BIN_INODE = $(shell stat -c '%i' $(SKELETON_CUSTOM_PATH)/bin/. 2>/dev/null)
> +SKELETON_CUSTOM_SBIN_INODE = $(shell stat -c '%i' $(SKELETON_CUSTOM_PATH)/sbin/. 2>/dev/null)
> +SKELETON_CUSTOM_USR_LIB_INODE = $(shell stat -c '%i' $(SKELETON_CUSTOM_PATH)/usr/lib/. 2>/dev/null)
> +SKELETON_CUSTOM_USR_BIN_INODE = $(shell stat -c '%i' $(SKELETON_CUSTOM_PATH)/usr/bin/. 2>/dev/null)
> +SKELETON_CUSTOM_USR_SBIN_INODE = $(shell stat -c '%i' $(SKELETON_CUSTOM_PATH)/usr/sbin/. 2>/dev/null)
> +
> +# Ensure that the custom skeleton has /lib, /bin and /sbin, and their
> +# /usr counterparts
> +define SKELETON_CUSTOM_MISSING_DIRS
> + if [ -z "$(SKELETON_CUSTOM_LIB_INODE)" ]; then \
> + missing+=" /lib"; \
> + fi; \
> + if [ -z "$(SKELETON_CUSTOM_USR_LIB_INODE)" ]; then \
> + missing+=" /usr/lib"; \
> + fi; \
> + if [ -z "$(SKELETON_CUSTOM_BIN_INODE)" ]; then \
> + missing+=" /bin"; \
> + fi; \
> + if [ -z "$(SKELETON_CUSTOM_USR_BIN_INODE)" ]; then \
> + missing+=" /usr/bin"; \
> + fi; \
> + if [ -z "$(SKELETON_CUSTOM_SBIN_INODE)" ]; then \
> + missing+=" /sbin"; \
> + fi; \
> + if [ -z "$(SKELETON_CUSTOM_USR_SBIN_INODE)" ]; then \
> + missing+=" /usr/sbin"; \
> + fi; \
> + if [ "$${missing" ]; then \
> + printf "The custom skeleton in %s is missing\n" "$(SKELETON_CUSTOM_PATH)"; \
> + printf "the following directories:\n"; \
> + printf " %s\n" "$${missing}"; \
> + exit 1; \
> + fi
> +endef
> +
> +# For a merged /usr, ensure that /lib, /bin and /sbin and their /usr
> +# counterparts are appropriately setup symlinks ones to the others.
> +ifeq ($(BR2_ROOTFS_MERGED_USR),y)
> +
> +define SKELETON_CUSTOM_MERGED_USR
> + if [ $(SKELETON_LIB_INODE) != $(SKELETON_USR_LIB_INODE) ]; then \
> + missing+=" /lib"; \
> + fi; \
> + if [ $(SKELETON_BIN_INODE) != $(SKELETON_USR_BIN_INODE) ]; then \
> + missing+=" /bin"; \
> + fi; \
> + if [ $(SKELETON_SBIN_INODE) != $(SKELETON_USR_SBIN_INODE) ]; then \
> + missing+=" /sbin"; \
> + fi;
> + if [ "$${missing}" ]; then
> + printf "The custom skeleton in %s is not\n" "$(SKELETON_CUSTOM_PATH)"; \
> + printf "using a merged /usr for the following directories:\n"; \
> + printf " %s\n" "$${missing}"; \
> + exit 1; \
> + fi
> +endef
> +
> +endif # merged /usr
> +
> +# We used to do the followinf checks in Makefile code, to catch the
> +# errors as early as possible. But the skeleton is the very first
> +# package to be installed, so we do the checks in its configure
> +# commands; they are almost as early as if they were done in Makefile
> +# code.
> +define SKELETON_CUSTOM_CONFIGURE_CMDS
> + $(SKELETON_CUSTOM_MISSING_DIRS)
> + $(SKELETON_CUSTOM_MERGED_USR)
> +endef
> +
> +# Provided by the 'skeleton' package:
> +# - SKELETON_LIB_SYMLINK
> +
> +define SKELETON_CUSTOM_INSTALL_TARGET_CMDS
> + $(call SKELETON_RSYNC,$(SKELETON_CUSTOM_PATH),$(TARGET_DIR))
> + ln -snf lib $(TARGET_DIR)/$(SKELETON_LIB_SYMLINK)
> + ln -snf lib $(TARGET_DIR)/usr/$(SKELETON_LIB_SYMLINK)
> +endef
> +
> +# For the staging dir, we don't really care what we install, but we
> +# need the /lib and /usr/lib apropriately setup.
> +# Since we ensure, above, that they are correct in the skeleton, we
> +# can simply copy it to staging.
> +define SKELETON_CUSTOM_INSTALL_STAGING_CMDS
> + $(call SKELETON_RSYNC,$(SKELETON_CUSTOM_PATH),$(STAGING_DIR))
> + $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include
> + ln -snf lib $(STAGING_DIR)/$(SKELETON_LIB_SYMLINK)
> + ln -snf lib $(STAGING_DIR)/usr/$(SKELETON_LIB_SYMLINK)
> +endef
> +
> +$(eval $(generic-package))
> diff --git a/package/skeleton-sysv/Config.in b/package/skeleton-sysv/Config.in
> new file mode 100644
> index 0000000..8c2e7dd
> --- /dev/null
> +++ b/package/skeleton-sysv/Config.in
> @@ -0,0 +1,2 @@
> +config BR2_PACKAGE_SKELETON_SYSV
> + bool
> diff --git a/package/skeleton-sysv/skeleton-sysv.mk b/package/skeleton-sysv/skeleton-sysv.mk
> new file mode 100644
> index 0000000..0a2f51b
> --- /dev/null
> +++ b/package/skeleton-sysv/skeleton-sysv.mk
> @@ -0,0 +1,126 @@
> +################################################################################
> +#
> +# skeleton-sysv
> +#
> +################################################################################
> +
> +SKELETON_SYSV_SOURCE =
> +
> +SKELETON_SYSV_ADD_TOOLCHAIN_DEPENDENCY = NO
> +SKELETON_SYSV_ADD_SKELETON_DEPENDENCY = NO
> +
> +SKELETON_SYSV_INSTALL_STAGING = YES
> +
> +# Provided by the 'skeleton' package:
> +# - SKELETON_USR_SYMLINKS_OR_DIRS
> +# - SKELETON_LIB_SYMLINK
> +# - SKELETON_TARGET_GENERIC_HOSTNAME
> +# - SKELETON_TARGET_GENERIC_ISSUE
> +# - SKELETON_TARGET_ROOT_PASSWD
> +# - SKELETON_TARGET_GENERIC_BIN_SH
> +# - SKELETON_TARGET_GENERIC_GETTY_PORT
> +# - SKELETON_TARGET_GENERIC_GETTY_BAUDRATE
> +# - SKELETON_TARGET_GENERIC_GETTY_TERM
> +# - SKELETON_TARGET_GENERIC_GETTY_OPTIONS
> +# - SKELETON_SET_NETWORK_IFUPDOWN_LOOPBACK
> +# - SKELETON_SET_NETWORK_IFUPDOWN_DHCP
> +
> +define SKELETON_INSTALL_TARGET_CMDS
s/SKELETON_INSTALL_TARGET_CMDS/SKELETON_SYSV_INSTALL_TARGET_CMDS/
> + $(call SKELETON_RSYNC,system/skeleton,$(TARGET_DIR))
> + $(call SKELETON_USR_SYMLINKS_OR_DIRS,$(TARGET_DIR))
> + ln -snf lib $(TARGET_DIR)/$(SKELETON_LIB_SYMLINK)
> + ln -snf lib $(TARGET_DIR)/usr/$(SKELETON_LIB_SYMLINK)
> + $(INSTALL) -m 0644 support/misc/target-dir-warning.txt \
> + $(TARGET_DIR_WARNING_FILE)
> +endef
> +
> +# For the staging dir, we don't really care about /bin and /sbin.
> +# But for consistency with the target dir, and to simplify the code,
> +# we still handle them for the merged or non-merged /usr cases.
> +# Since the toolchain is not yet available, the staging is not yet
> +# populated, so we need to create the directories in /usr
> +define SKELETON_SYSV_INSTALL_STAGING_CMDS
> + $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/lib
> + $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/bin
> + $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/sbin
> + $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include
> + $(call SKELETON_USR_SYMLINKS_OR_DIRS,$(STAGING_DIR))
> + ln -snf lib $(STAGING_DIR)/$(SKELETON_LIB_SYMLINK)
> + ln -snf lib $(STAGING_DIR)/usr/$(SKELETON_LIB_SYMLINK)
> +endef
> +
> +ifneq ($(SKELETON_TARGET_GENERIC_HOSTNAME),)
> +define SKELETON_SYSV_SET_HOSTNAME
> + mkdir -p $(TARGET_DIR)/etc
> + echo "$(SKELETON_TARGET_GENERIC_HOSTNAME)" > $(TARGET_DIR)/etc/hostname
> + $(SED) '$$a \127.0.1.1\t$(SKELETON_TARGET_GENERIC_HOSTNAME)' \
> + -e '/^127.0.1.1/d' $(TARGET_DIR)/etc/hosts
> +endef
> +SKELETON_SYSV_TARGET_FINALIZE_HOOKS += SKELETON_SYSV_SET_HOSTNAME
> +endif
> +
> +ifneq ($(SKELETON_TARGET_GENERIC_ISSUE),)
> +define SKELETON_SYSV_SET_ISSUE
> + mkdir -p $(TARGET_DIR)/etc
> + echo "$(SKELETON_TARGET_GENERIC_ISSUE)" > $(TARGET_DIR)/etc/issue
> +endef
> +SKELETON_SYSV_TARGET_FINALIZE_HOOKS += SKELETON_SYSV_SET_ISSUE
> +endif
> +
> +define SKELETON_SYSV_SET_NETWORK
> + mkdir -p $(TARGET_DIR)/etc/network/
> + $(SKELETON_SET_NETWORK_IFUPDOWN_LOOPBACK)
> + $(SKELETON_SET_NETWORK_IFUPDOWN_DHCP)
> +endef
> +SKELETON_SYSV_TARGET_FINALIZE_HOOKS += SKELETON_SYSV_SET_NETWORK
> +
> +define SKELETON_SYSV_SET_ROOT_PASSWD
> + $(SED) s,^root:[^:]*:,root:$(SKELETON_SYSV_ROOT_PASSWORD):, $(TARGET_DIR)/etc/shadow
> +endef
> +SKELETON_SYSV_TARGET_FINALIZE_HOOKS += SKELETON_SYSV_SET_ROOT_PASSWD
> +
> +ifeq ($(BR2_SYSTEM_BIN_SH_NONE),y)
> +define SKELETON_SYSV_BIN_SH
> + rm -f $(TARGET_DIR)/bin/sh
> +endef
> +else
> +define SKELETON_SYSV_BIN_SH
> + ln -sf $(SKELETON_TARGET_GENERIC_BIN_SH) $(TARGET_DIR)/bin/sh
> +endef
> +endif
> +SKELETON_SYSV_TARGET_FINALIZE_HOOKS += SKELETON_SYSV_BIN_SH
> +
> +ifeq ($(BR2_TARGET_GENERIC_GETTY),y)
> +ifeq ($(BR2_INIT_SYSV),y)
> +# In sysvinit inittab, the "id" must not be longer than 4 bytes, so we
> +# skip the "tty" part and keep only the remaining.
> +define SKELETON_SYSV_SET_GETTY
> + $(SED) '/# GENERIC_SERIAL$$/s~^.*#~$(shell echo $(SKELETON_TARGET_GENERIC_GETTY_PORT) | tail -c+4)::respawn:/sbin/getty -L $(SKELETON_TARGET_GENERIC_GETTY_OPTIONS) $(SKELETON_TARGET_GENERIC_GETTY_PORT) $(SKELETON_TARGET_GENERIC_GETTY_BAUDRATE) $(SKELETON_TARGET_GENERIC_GETTY_TERM) #~' \
> + $(TARGET_DIR)/etc/inittab
> +endef
> +else ifeq ($(BR2_INIT_BUSYBOX),y)
> +# Add getty to busybox inittab
> +define SKELETON_SYSV_SET_GETTY
> + $(SED) '/# GENERIC_SERIAL$$/s~^.*#~$(SKELETON_TARGET_GENERIC_GETTY_PORT)::respawn:/sbin/getty -L $(SKELETON_TARGET_GENERIC_GETTY_OPTIONS) $(SKELETON_TARGET_GENERIC_GETTY_PORT) $(SKELETON_TARGET_GENERIC_GETTY_BAUDRATE) $(SKELETON_TARGET_GENERIC_GETTY_TERM) #~' \
> + $(TARGET_DIR)/etc/inittab
> +endef
> +endif
> +SKELETON_SYSV_TARGET_FINALIZE_HOOKS += SKELETON_SYSV_SET_GETTY
> +endif
> +
> +ifeq ($(BR2_INIT_BUSYBOX)$(BR2_INIT_SYSV),y)
> +ifeq ($(BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW),y)
> +# Find commented line, if any, and remove leading '#'s
> +define SKELETON_SYSV_REMOUNT_RW
> + $(SED) '/^#.*-o remount,rw \/$$/s~^#\+~~' $(TARGET_DIR)/etc/inittab
> +endef
> +else
> +# Find uncommented line, if any, and add a leading '#'
> +define SKELETON_SYSV_REMOUNT_RW
> + $(SED) '/^[^#].*-o remount,rw \/$$/s~^~#~' $(TARGET_DIR)/etc/inittab
> +endef
> +endif
> +SKELETON_SYSV_TARGET_FINALIZE_HOOKS += SKELETON_SYSV_REMOUNT_RW
> +endif # BR2_INIT_BUSYBOX || BR2_INIT_SYSV
> +
> +$(eval $(generic-package))
> diff --git a/package/skeleton/Config.in b/package/skeleton/Config.in
> index d25147b..6db0634 100644
> --- a/package/skeleton/Config.in
> +++ b/package/skeleton/Config.in
> @@ -1,5 +1,7 @@
> config BR2_PACKAGE_SKELETON
> bool
> default y
> + select BR2_PACKAGE_SKELETON_SYSV if BR2_ROOTFS_SKELETON_DEFAULT
> + select BR2_PACKAGE_SKELETON_CUSTOM if BR2_ROOTFS_SKELETON_CUSTOM
> help
> The basic skeleton for your rootfs.
> diff --git a/package/skeleton/skeleton.mk b/package/skeleton/skeleton.mk
> index e3ae694..bd787db 100644
> --- a/package/skeleton/skeleton.mk
> +++ b/package/skeleton/skeleton.mk
> @@ -7,6 +7,10 @@
> # source included in buildroot
> SKELETON_SOURCE =
>
> +SKELETON_DEPENDENCIES = \
> + $(if $(BR2_PACKAGE_SKELETON_SYSV),skeleton-sysv) \
> + $(if $(BR2_PACKAGE_SKELETON_CUSTOM),skeleton-custom)
> +
> # 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
> @@ -14,53 +18,19 @@ SKELETON_SOURCE =
> SKELETON_ADD_TOOLCHAIN_DEPENDENCY = NO
> SKELETON_ADD_SKELETON_DEPENDENCY = NO
>
> -# The skeleton also handles the merged /usr case in the sysroot
> -SKELETON_INSTALL_STAGING = YES
> -
> -ifeq ($(BR2_ROOTFS_SKELETON_CUSTOM),y)
> -
> -SKELETON_PATH = $(call qstrip,$(BR2_ROOTFS_SKELETON_CUSTOM_PATH))
> -
> -ifeq ($(BR2_ROOTFS_MERGED_USR),y)
> -
> -# Ensure the user has prepared a merged /usr.
> -#
> -# Extract the inode numbers for all of those directories. In case any is
> -# a symlink, we want to get the inode of the pointed-to directory, so we
> -# append '/.' to be sure we get the target directory. Since the symlinks
> -# can be anyway (/bin -> /usr/bin or /usr/bin -> /bin), we do that for
> -# all of them.
> -#
> -SKELETON_LIB_INODE = $(shell stat -c '%i' $(SKELETON_PATH)/lib/.)
> -SKELETON_BIN_INODE = $(shell stat -c '%i' $(SKELETON_PATH)/bin/.)
> -SKELETON_SBIN_INODE = $(shell stat -c '%i' $(SKELETON_PATH)/sbin/.)
> -SKELETON_USR_LIB_INODE = $(shell stat -c '%i' $(SKELETON_PATH)/usr/lib/.)
> -SKELETON_USR_BIN_INODE = $(shell stat -c '%i' $(SKELETON_PATH)/usr/bin/.)
> -SKELETON_USR_SBIN_INODE = $(shell stat -c '%i' $(SKELETON_PATH)/usr/sbin/.)
> -
> -ifneq ($(SKELETON_LIB_INODE),$(SKELETON_USR_LIB_INODE))
> -SKELETON_CUSTOM_NOT_MERGED_USR += /lib
> -endif
> -ifneq ($(SKELETON_BIN_INODE),$(SKELETON_USR_BIN_INODE))
> -SKELETON_CUSTOM_NOT_MERGED_USR += /bin
> -endif
> -ifneq ($(SKELETON_SBIN_INODE),$(SKELETON_USR_SBIN_INODE))
> -SKELETON_CUSTOM_NOT_MERGED_USR += /sbin
> -endif
> -
> -ifneq ($(SKELETON_CUSTOM_NOT_MERGED_USR),)
> -$(error The custom skeleton in $(SKELETON_PATH) is not \
> - using a merged /usr for the following directories: \
> - $(SKELETON_CUSTOM_NOT_MERGED_USR))
> -endif
> -
> -endif # merged /usr
> -
> -else # ! custom skeleton
> -
> -SKELETON_PATH = system/skeleton
> -
> -endif # ! custom skeleton
> +# The following definitions are to be used by the specific skeletons:
> +# - SKELETON_USR_SYMLINKS_OR_DIRS
> +# - SKELETON_LIB_SYMLINK
> +# - SKELETON_TARGET_GENERIC_HOSTNAME
> +# - SKELETON_TARGET_GENERIC_ISSUE
> +# - SKELETON_TARGET_ROOT_PASSWD
> +# - SKELETON_TARGET_GENERIC_BIN_SH
> +# - SKELETON_TARGET_GENERIC_GETTY_PORT
> +# - SKELETON_TARGET_GENERIC_GETTY_BAUDRATE
> +# - SKELETON_TARGET_GENERIC_GETTY_TERM
> +# - SKELETON_TARGET_GENERIC_GETTY_OPTIONS
> +# - SKELETON_SET_NETWORK_IFUPDOWN_LOOPBACK
> +# - SKELETON_SET_NETWORK_IFUPDOWN_DHCP
>
> # This function rsyncs the skeleton directory in $(1) to the destination
> # in $(2), which should be either $(TARTGET_DIR) or $(STAGING_DIR)
> @@ -93,34 +63,6 @@ else
> SKELETON_LIB_SYMLINK = lib32
> endif
>
> -define SKELETON_INSTALL_TARGET_CMDS
> - $(call SKELETON_RSYNC,$(SKELETON_PATH),$(TARGET_DIR))
> - $(call SKELETON_USR_SYMLINKS_OR_DIRS,$(TARGET_DIR))
> - ln -snf lib $(TARGET_DIR)/$(SKELETON_LIB_SYMLINK)
> - ln -snf lib $(TARGET_DIR)/usr/$(SKELETON_LIB_SYMLINK)
> - $(INSTALL) -m 0644 support/misc/target-dir-warning.txt \
> - $(TARGET_DIR_WARNING_FILE)
> -endef
> -
> -# For the staging dir, we don't really care about /bin and /sbin.
> -# But for consistency with the target dir, and to simplify the code,
> -# we still handle them for the merged or non-merged /usr cases.
> -# Since the toolchain is not yet available, the staging is not yet
> -# populated, so we need to create the directories in /usr
> -define SKELETON_INSTALL_STAGING_CMDS
> - $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/lib
> - $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/bin
> - $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/sbin
> - $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include
> - $(call SKELETON_USR_SYMLINKS_OR_DIRS,$(STAGING_DIR))
> - ln -snf lib $(STAGING_DIR)/$(SKELETON_LIB_SYMLINK)
> - ln -snf lib $(STAGING_DIR)/usr/$(SKELETON_LIB_SYMLINK)
> -endef
> -
> -# The TARGET_FINALIZE_HOOKS must be sourced only if the users choose to use the
> -# default skeleton.
> -ifeq ($(BR2_ROOTFS_SKELETON_DEFAULT),y)
> -
> SKELETON_TARGET_GENERIC_HOSTNAME = $(call qstrip,$(BR2_TARGET_GENERIC_HOSTNAME))
> SKELETON_TARGET_GENERIC_ISSUE = $(call qstrip,$(BR2_TARGET_GENERIC_ISSUE))
> SKELETON_TARGET_GENERIC_ROOT_PASSWD = $(call qstrip,$(BR2_TARGET_GENERIC_ROOT_PASSWD))
> @@ -131,25 +73,8 @@ SKELETON_TARGET_GENERIC_GETTY_BAUDRATE = $(call qstrip,$(BR2_TARGET_GENERIC_GETT
> SKELETON_TARGET_GENERIC_GETTY_TERM = $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_TERM))
> SKELETON_TARGET_GENERIC_GETTY_OPTIONS = $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_OPTIONS))
>
> -ifneq ($(SKELETON_TARGET_GENERIC_HOSTNAME),)
> -define SKELETON_SET_HOSTNAME
> - mkdir -p $(TARGET_DIR)/etc
> - echo "$(SKELETON_TARGET_GENERIC_HOSTNAME)" > $(TARGET_DIR)/etc/hostname
> - $(SED) '$$a \127.0.1.1\t$(SKELETON_TARGET_GENERIC_HOSTNAME)' \
> - -e '/^127.0.1.1/d' $(TARGET_DIR)/etc/hosts
> -endef
> -TARGET_FINALIZE_HOOKS += SKELETON_SET_HOSTNAME
> -endif
>
> -ifneq ($(SKELETON_TARGET_GENERIC_ISSUE),)
> -define SKELETON_SET_ISSUE
> - mkdir -p $(TARGET_DIR)/etc
> - echo "$(SKELETON_TARGET_GENERIC_ISSUE)" > $(TARGET_DIR)/etc/issue
> -endef
> -TARGET_FINALIZE_HOOKS += SKELETON_SET_ISSUE
> -endif
> -
> -define SKELETON_SET_NETWORK_LOCALHOST
> +define SKELETON_SET_NETWORK_IFUPDOWN_LOOPBACK
> ( \
> echo "# interface file auto-generated by buildroot"; \
> echo ; \
> @@ -161,7 +86,7 @@ endef
> SKELETON_NETWORK_DHCP_IFACE = $(call qstrip,$(BR2_SYSTEM_DHCP))
>
> ifneq ($(SKELETON_NETWORK_DHCP_IFACE),)
> -define SKELETON_SET_NETWORK_DHCP
> +define SKELETON_SET_NETWORK_IFUPDOWN_DHCP
> ( \
> echo ; \
> echo "auto $(SKELETON_NETWORK_DHCP_IFACE)"; \
> @@ -174,14 +99,6 @@ define SKELETON_SET_NETWORK_DHCP
> endef
> endif
>
> -define SKELETON_SET_NETWORK
> - mkdir -p $(TARGET_DIR)/etc/network/
> - $(SKELETON_SET_NETWORK_LOCALHOST)
> - $(SKELETON_SET_NETWORK_DHCP)
> -endef
> -
> -TARGET_FINALIZE_HOOKS += SKELETON_SET_NETWORK
> -
> ifeq ($(BR2_TARGET_ENABLE_ROOT_LOGIN),y)
> ifeq ($(SKELETON_TARGET_GENERIC_ROOT_PASSWD),)
> SKELETON_ROOT_PASSWORD =
> @@ -197,55 +114,4 @@ else # !BR2_TARGET_ENABLE_ROOT_LOGIN
> SKELETON_ROOT_PASSWORD = "*"
> endif
>
> -define SKELETON_SET_ROOT_PASSWD
> - $(SED) s,^root:[^:]*:,root:$(SKELETON_ROOT_PASSWORD):, $(TARGET_DIR)/etc/shadow
> -endef
> -TARGET_FINALIZE_HOOKS += SKELETON_SET_ROOT_PASSWD
> -
> -ifeq ($(BR2_SYSTEM_BIN_SH_NONE),y)
> -define SKELETON_BIN_SH
> - rm -f $(TARGET_DIR)/bin/sh
> -endef
> -else
> -define SKELETON_BIN_SH
> - ln -sf $(SKELETON_TARGET_GENERIC_BIN_SH) $(TARGET_DIR)/bin/sh
> -endef
> -endif
> -TARGET_FINALIZE_HOOKS += SKELETON_BIN_SH
> -
> -ifeq ($(BR2_TARGET_GENERIC_GETTY),y)
> -ifeq ($(BR2_INIT_SYSV),y)
> -# In sysvinit inittab, the "id" must not be longer than 4 bytes, so we
> -# skip the "tty" part and keep only the remaining.
> -define SKELETON_SET_GETTY
> - $(SED) '/# GENERIC_SERIAL$$/s~^.*#~$(shell echo $(SKELETON_TARGET_GENERIC_GETTY_PORT) | tail -c+4)::respawn:/sbin/getty -L $(SKELETON_TARGET_GENERIC_GETTY_OPTIONS) $(SKELETON_TARGET_GENERIC_GETTY_PORT) $(SKELETON_TARGET_GENERIC_GETTY_BAUDRATE) $(SKELETON_TARGET_GENERIC_GETTY_TERM) #~' \
> - $(TARGET_DIR)/etc/inittab
> -endef
> -else ifeq ($(BR2_INIT_BUSYBOX),y)
> -# Add getty to busybox inittab
> -define SKELETON_SET_GETTY
> - $(SED) '/# GENERIC_SERIAL$$/s~^.*#~$(SKELETON_TARGET_GENERIC_GETTY_PORT)::respawn:/sbin/getty -L $(SKELETON_TARGET_GENERIC_GETTY_OPTIONS) $(SKELETON_TARGET_GENERIC_GETTY_PORT) $(SKELETON_TARGET_GENERIC_GETTY_BAUDRATE) $(SKELETON_TARGET_GENERIC_GETTY_TERM) #~' \
> - $(TARGET_DIR)/etc/inittab
> -endef
> -endif
> -TARGET_FINALIZE_HOOKS += SKELETON_SET_GETTY
> -endif
> -
> -ifeq ($(BR2_INIT_BUSYBOX)$(BR2_INIT_SYSV),y)
> -ifeq ($(BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW),y)
> -# Find commented line, if any, and remove leading '#'s
> -define SKELETON_REMOUNT_RW
> - $(SED) '/^#.*-o remount,rw \/$$/s~^#\+~~' $(TARGET_DIR)/etc/inittab
> -endef
> -else
> -# Find uncommented line, if any, and add a leading '#'
> -define SKELETON_REMOUNT_RW
> - $(SED) '/^[^#].*-o remount,rw \/$$/s~^~#~' $(TARGET_DIR)/etc/inittab
> -endef
> -endif
> -TARGET_FINALIZE_HOOKS += SKELETON_REMOUNT_RW
> -endif # BR2_INIT_BUSYBOX || BR2_INIT_SYSV
> -
> -endif # BR2_ROOTFS_SKELETON_DEFAULT
> -
> $(eval $(generic-package))
Have you considered to convert skeleton package to a virtual package with
skeleton-sysv and skeleton-custom as providers ?
Best regards,
Romain
>
^ permalink raw reply [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 16/24 v2] package/skeleton: split into sysv and custom skeleton
2016-07-03 10:27 ` Romain Naour
@ 2016-07-05 7:26 ` Yann E. MORIN
0 siblings, 0 replies; 73+ messages in thread
From: Yann E. MORIN @ 2016-07-05 7:26 UTC (permalink / raw)
To: buildroot
Romain, All,
On 2016-07-03 12:27 +0200, Romain Naour spake thusly:
> Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> > Currently, both the sysv-like and custom skeletons are managed in a
> > single package.
> >
> > However, for the custom skeleton, we basically do nothing, except for
> > a few symlinks for the /lib directory aliases, and a few checks about
> > merged /usr.
> >
> > OTOH, for the default (sysv-like) skeleton, we do a lot more things,
> > like tweaking the issue, the hostname, setting the root password and so
> > on...
> >
> > Furthermore, we're soon gonna have a skeleton for each kind of init
> > system, be it sysv-based or systemd.
> >
> > So, it makes sense to offload the custom skeleton management to its own
> > package.
> >
> > We change the way we check for the merged /usr readiness, from checking
> > at make parse time, to a configure command. This has virtually zero
> > impact, since the skeleton is the very first package to be "built", so
> > its configure commands are the very first to be run. It however slightly
> > cimplifies the .mk as we need not enclose the parse-time checks inside
> ^
> s/cimplifies/simplifies/
Fixed.
[--SNIP--]
> > diff --git a/package/skeleton-sysv/skeleton-sysv.mk b/package/skeleton-sysv/skeleton-sysv.mk
> > new file mode 100644
> > index 0000000..0a2f51b
> > --- /dev/null
> > +++ b/package/skeleton-sysv/skeleton-sysv.mk
> > @@ -0,0 +1,126 @@
> > +################################################################################
> > +#
> > +# skeleton-sysv
> > +#
> > +################################################################################
> > +
> > +SKELETON_SYSV_SOURCE =
> > +
> > +SKELETON_SYSV_ADD_TOOLCHAIN_DEPENDENCY = NO
> > +SKELETON_SYSV_ADD_SKELETON_DEPENDENCY = NO
> > +
> > +SKELETON_SYSV_INSTALL_STAGING = YES
> > +
> > +# Provided by the 'skeleton' package:
> > +# - SKELETON_USR_SYMLINKS_OR_DIRS
> > +# - SKELETON_LIB_SYMLINK
> > +# - SKELETON_TARGET_GENERIC_HOSTNAME
> > +# - SKELETON_TARGET_GENERIC_ISSUE
> > +# - SKELETON_TARGET_ROOT_PASSWD
> > +# - SKELETON_TARGET_GENERIC_BIN_SH
> > +# - SKELETON_TARGET_GENERIC_GETTY_PORT
> > +# - SKELETON_TARGET_GENERIC_GETTY_BAUDRATE
> > +# - SKELETON_TARGET_GENERIC_GETTY_TERM
> > +# - SKELETON_TARGET_GENERIC_GETTY_OPTIONS
> > +# - SKELETON_SET_NETWORK_IFUPDOWN_LOOPBACK
> > +# - SKELETON_SET_NETWORK_IFUPDOWN_DHCP
> > +
> > +define SKELETON_INSTALL_TARGET_CMDS
>
> s/SKELETON_INSTALL_TARGET_CMDS/SKELETON_SYSV_INSTALL_TARGET_CMDS/
Good catch, fixed.
[--SNIP--]
> Have you considered to convert skeleton package to a virtual package with
> skeleton-sysv and skeleton-custom as providers ?
Have you considered looking at the following patch? ;-)
(I know you have!)
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 17/24 v2] package/skeleton: make it a virtual package
2016-06-22 19:07 [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton) Yann E. MORIN
` (15 preceding siblings ...)
2016-06-22 19:07 ` [Buildroot] [PATCH 16/24 v2] package/skeleton: split into sysv and custom skeleton Yann E. MORIN
@ 2016-06-22 19:07 ` Yann E. MORIN
2016-07-03 10:47 ` Romain Naour
2016-06-22 19:07 ` [Buildroot] [PATCH 18/24 v2] package/skeleton-sysv: split into skeleton-common Yann E. MORIN
` (7 subsequent siblings)
24 siblings, 1 reply; 73+ messages in thread
From: Yann E. MORIN @ 2016-06-22 19:07 UTC (permalink / raw)
To: buildroot
The skeleton package now only serves as an intermediate package to
direct to the real skeleton implementaion.
This is exactly what a virtual package is. Make it so.
Note: when graphing the dependency chain, and contrary to other virtual
packages, skeleton is de facto excluded from the dependencies of all
packages, and is "attached" as a dependency of the "All" package
instead, so as not to make the graph overly complicated and unreadable.
So, for it to appear on the graph, it needs to have a
BR2_PACKAGE_SKELETON kconfig variable, so that it appears in the output
of "make show-targets", like we do for the toolchain.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
package/skeleton-custom/Config.in | 4 ++++
package/skeleton-custom/skeleton-custom.mk | 2 ++
package/skeleton-sysv/Config.in | 4 ++++
package/skeleton-sysv/skeleton-sysv.mk | 2 ++
package/skeleton/Config.in | 13 +++++++++++--
package/skeleton/skeleton.mk | 11 ++---------
system/Config.in | 2 ++
7 files changed, 27 insertions(+), 11 deletions(-)
diff --git a/package/skeleton-custom/Config.in b/package/skeleton-custom/Config.in
index 1f3c87c..601c3b2 100644
--- a/package/skeleton-custom/Config.in
+++ b/package/skeleton-custom/Config.in
@@ -1,2 +1,6 @@
config BR2_PACKAGE_SKELETON_CUSTOM
bool
+ select BR2_PACKAGE_HAS_SKELETON
+
+config BR2_PACKAGE_PROVIDES_SKELETON
+ default "skeleton-custom" if BR2_PACKAGE_SKELETON_CUSTOM
diff --git a/package/skeleton-custom/skeleton-custom.mk b/package/skeleton-custom/skeleton-custom.mk
index 8690af4..e251448 100644
--- a/package/skeleton-custom/skeleton-custom.mk
+++ b/package/skeleton-custom/skeleton-custom.mk
@@ -6,6 +6,8 @@
SKELETON_CUSTOM_SOURCE =
+SKELETON_CUSTOM_PROVIDES = skeleton
+
SKELETON_CUSTOM_ADD_TOOLCHAIN_DEPENDENCY = NO
SKELETON_CUSTOM_ADD_SKELETON_DEPENDENCY = NO
diff --git a/package/skeleton-sysv/Config.in b/package/skeleton-sysv/Config.in
index 8c2e7dd..95c796f 100644
--- a/package/skeleton-sysv/Config.in
+++ b/package/skeleton-sysv/Config.in
@@ -1,2 +1,6 @@
config BR2_PACKAGE_SKELETON_SYSV
bool
+ select BR2_PACKAGE_HAS_SKELETON
+
+config BR2_PACKAGE_PROVIDES_SKELETON
+ default "skeleton-sysv" if BR2_PACKAGE_SKELETON_SYSV
diff --git a/package/skeleton-sysv/skeleton-sysv.mk b/package/skeleton-sysv/skeleton-sysv.mk
index 0a2f51b..aa0b65c 100644
--- a/package/skeleton-sysv/skeleton-sysv.mk
+++ b/package/skeleton-sysv/skeleton-sysv.mk
@@ -6,6 +6,8 @@
SKELETON_SYSV_SOURCE =
+SKELETON_SYSV_PROVIDES = skeleton
+
SKELETON_SYSV_ADD_TOOLCHAIN_DEPENDENCY = NO
SKELETON_SYSV_ADD_SKELETON_DEPENDENCY = NO
diff --git a/package/skeleton/Config.in b/package/skeleton/Config.in
index 6db0634..762196c 100644
--- a/package/skeleton/Config.in
+++ b/package/skeleton/Config.in
@@ -1,7 +1,16 @@
+# Every packages depend on the 'skeleton' package, but noone selects its
+# symbol since it is an implicit dependency. So we just force that symbol
+# to always be 'y' so that it does appear in the dependency graph. Just
+# for that, no kidding.
config BR2_PACKAGE_SKELETON
bool
default y
- select BR2_PACKAGE_SKELETON_SYSV if BR2_ROOTFS_SKELETON_DEFAULT
- select BR2_PACKAGE_SKELETON_CUSTOM if BR2_ROOTFS_SKELETON_CUSTOM
help
The basic skeleton for your rootfs.
+
+config BR2_PACKAGE_HAS_SKELETON
+ bool
+
+config BR2_PACKAGE_PROVIDES_SKELETON
+ string
+ depends on BR2_PACKAGE_SKELETON
diff --git a/package/skeleton/skeleton.mk b/package/skeleton/skeleton.mk
index bd787db..b791650 100644
--- a/package/skeleton/skeleton.mk
+++ b/package/skeleton/skeleton.mk
@@ -4,13 +4,6 @@
#
################################################################################
-# source included in buildroot
-SKELETON_SOURCE =
-
-SKELETON_DEPENDENCIES = \
- $(if $(BR2_PACKAGE_SKELETON_SYSV),skeleton-sysv) \
- $(if $(BR2_PACKAGE_SKELETON_CUSTOM),skeleton-custom)
-
# 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
@@ -18,6 +11,8 @@ SKELETON_DEPENDENCIES = \
SKELETON_ADD_TOOLCHAIN_DEPENDENCY = NO
SKELETON_ADD_SKELETON_DEPENDENCY = NO
+$(eval $(virtual-package))
+
# The following definitions are to be used by the specific skeletons:
# - SKELETON_USR_SYMLINKS_OR_DIRS
# - SKELETON_LIB_SYMLINK
@@ -113,5 +108,3 @@ endif
else # !BR2_TARGET_ENABLE_ROOT_LOGIN
SKELETON_ROOT_PASSWORD = "*"
endif
-
-$(eval $(generic-package))
diff --git a/system/Config.in b/system/Config.in
index 3a38bd4..3792be2 100644
--- a/system/Config.in
+++ b/system/Config.in
@@ -5,11 +5,13 @@ choice
config BR2_ROOTFS_SKELETON_DEFAULT
bool "default target skeleton"
+ select BR2_PACKAGE_SKELETON_SYSV
help
Use default target skeleton
config BR2_ROOTFS_SKELETON_CUSTOM
bool "custom target skeleton"
+ select BR2_PACKAGE_SKELETON_CUSTOM
help
Use custom target skeleton.
--
2.7.4
^ permalink raw reply related [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 17/24 v2] package/skeleton: make it a virtual package
2016-06-22 19:07 ` [Buildroot] [PATCH 17/24 v2] package/skeleton: make it a virtual package Yann E. MORIN
@ 2016-07-03 10:47 ` Romain Naour
2016-07-05 7:45 ` Yann E. MORIN
0 siblings, 1 reply; 73+ messages in thread
From: Romain Naour @ 2016-07-03 10:47 UTC (permalink / raw)
To: buildroot
Hi Yann,
Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> The skeleton package now only serves as an intermediate package to
> direct to the real skeleton implementaion.
^
s/implementaion/implementation/
>
> This is exactly what a virtual package is. Make it so.
Great, you already addressed my previous comment :)
>
> Note: when graphing the dependency chain, and contrary to other virtual
> packages, skeleton is de facto excluded from the dependencies of all
> packages, and is "attached" as a dependency of the "All" package
> instead, so as not to make the graph overly complicated and unreadable.
>
> So, for it to appear on the graph, it needs to have a
> BR2_PACKAGE_SKELETON kconfig variable, so that it appears in the output
> of "make show-targets", like we do for the toolchain.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> ---
> package/skeleton-custom/Config.in | 4 ++++
> package/skeleton-custom/skeleton-custom.mk | 2 ++
> package/skeleton-sysv/Config.in | 4 ++++
> package/skeleton-sysv/skeleton-sysv.mk | 2 ++
> package/skeleton/Config.in | 13 +++++++++++--
> package/skeleton/skeleton.mk | 11 ++---------
> system/Config.in | 2 ++
> 7 files changed, 27 insertions(+), 11 deletions(-)
>
> diff --git a/package/skeleton-custom/Config.in b/package/skeleton-custom/Config.in
> index 1f3c87c..601c3b2 100644
> --- a/package/skeleton-custom/Config.in
> +++ b/package/skeleton-custom/Config.in
> @@ -1,2 +1,6 @@
> config BR2_PACKAGE_SKELETON_CUSTOM
> bool
> + select BR2_PACKAGE_HAS_SKELETON
> +
> +config BR2_PACKAGE_PROVIDES_SKELETON
> + default "skeleton-custom" if BR2_PACKAGE_SKELETON_CUSTOM
> diff --git a/package/skeleton-custom/skeleton-custom.mk b/package/skeleton-custom/skeleton-custom.mk
> index 8690af4..e251448 100644
> --- a/package/skeleton-custom/skeleton-custom.mk
> +++ b/package/skeleton-custom/skeleton-custom.mk
> @@ -6,6 +6,8 @@
>
> SKELETON_CUSTOM_SOURCE =
>
> +SKELETON_CUSTOM_PROVIDES = skeleton
> +
> SKELETON_CUSTOM_ADD_TOOLCHAIN_DEPENDENCY = NO
> SKELETON_CUSTOM_ADD_SKELETON_DEPENDENCY = NO
>
> diff --git a/package/skeleton-sysv/Config.in b/package/skeleton-sysv/Config.in
> index 8c2e7dd..95c796f 100644
> --- a/package/skeleton-sysv/Config.in
> +++ b/package/skeleton-sysv/Config.in
> @@ -1,2 +1,6 @@
> config BR2_PACKAGE_SKELETON_SYSV
> bool
> + select BR2_PACKAGE_HAS_SKELETON
> +
> +config BR2_PACKAGE_PROVIDES_SKELETON
> + default "skeleton-sysv" if BR2_PACKAGE_SKELETON_SYSV
> diff --git a/package/skeleton-sysv/skeleton-sysv.mk b/package/skeleton-sysv/skeleton-sysv.mk
> index 0a2f51b..aa0b65c 100644
> --- a/package/skeleton-sysv/skeleton-sysv.mk
> +++ b/package/skeleton-sysv/skeleton-sysv.mk
> @@ -6,6 +6,8 @@
>
> SKELETON_SYSV_SOURCE =
>
> +SKELETON_SYSV_PROVIDES = skeleton
> +
> SKELETON_SYSV_ADD_TOOLCHAIN_DEPENDENCY = NO
> SKELETON_SYSV_ADD_SKELETON_DEPENDENCY = NO
>
> diff --git a/package/skeleton/Config.in b/package/skeleton/Config.in
> index 6db0634..762196c 100644
> --- a/package/skeleton/Config.in
> +++ b/package/skeleton/Config.in
> @@ -1,7 +1,16 @@
> +# Every packages depend on the 'skeleton' package, but noone selects its
^
s/noone/none/
> +# symbol since it is an implicit dependency. So we just force that symbol
> +# to always be 'y' so that it does appear in the dependency graph. Just
> +# for that, no kidding.
> config BR2_PACKAGE_SKELETON
> bool
> default y
> - select BR2_PACKAGE_SKELETON_SYSV if BR2_ROOTFS_SKELETON_DEFAULT
> - select BR2_PACKAGE_SKELETON_CUSTOM if BR2_ROOTFS_SKELETON_CUSTOM
> help
> The basic skeleton for your rootfs.
> +
> +config BR2_PACKAGE_HAS_SKELETON
> + bool
> +
> +config BR2_PACKAGE_PROVIDES_SKELETON
> + string
> + depends on BR2_PACKAGE_SKELETON
Should it be depends on BR2_PACKAGE_HAS_SKELETON instead ?
Other that that, the patch looks ok.
Best regards,
Romain
> diff --git a/package/skeleton/skeleton.mk b/package/skeleton/skeleton.mk
> index bd787db..b791650 100644
> --- a/package/skeleton/skeleton.mk
> +++ b/package/skeleton/skeleton.mk
> @@ -4,13 +4,6 @@
> #
> ################################################################################
>
> -# source included in buildroot
> -SKELETON_SOURCE =
> -
> -SKELETON_DEPENDENCIES = \
> - $(if $(BR2_PACKAGE_SKELETON_SYSV),skeleton-sysv) \
> - $(if $(BR2_PACKAGE_SKELETON_CUSTOM),skeleton-custom)
> -
> # 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
> @@ -18,6 +11,8 @@ SKELETON_DEPENDENCIES = \
> SKELETON_ADD_TOOLCHAIN_DEPENDENCY = NO
> SKELETON_ADD_SKELETON_DEPENDENCY = NO
>
> +$(eval $(virtual-package))
> +
> # The following definitions are to be used by the specific skeletons:
> # - SKELETON_USR_SYMLINKS_OR_DIRS
> # - SKELETON_LIB_SYMLINK
> @@ -113,5 +108,3 @@ endif
> else # !BR2_TARGET_ENABLE_ROOT_LOGIN
> SKELETON_ROOT_PASSWORD = "*"
> endif
> -
> -$(eval $(generic-package))
> diff --git a/system/Config.in b/system/Config.in
> index 3a38bd4..3792be2 100644
> --- a/system/Config.in
> +++ b/system/Config.in
> @@ -5,11 +5,13 @@ choice
>
> config BR2_ROOTFS_SKELETON_DEFAULT
> bool "default target skeleton"
> + select BR2_PACKAGE_SKELETON_SYSV
> help
> Use default target skeleton
>
> config BR2_ROOTFS_SKELETON_CUSTOM
> bool "custom target skeleton"
> + select BR2_PACKAGE_SKELETON_CUSTOM
> help
> Use custom target skeleton.
>
>
^ permalink raw reply [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 17/24 v2] package/skeleton: make it a virtual package
2016-07-03 10:47 ` Romain Naour
@ 2016-07-05 7:45 ` Yann E. MORIN
0 siblings, 0 replies; 73+ messages in thread
From: Yann E. MORIN @ 2016-07-05 7:45 UTC (permalink / raw)
To: buildroot
Romain, All,
On 2016-07-03 12:47 +0200, Romain Naour spake thusly:
> Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> > The skeleton package now only serves as an intermediate package to
> > direct to the real skeleton implementaion.
> ^
> s/implementaion/implementation/
Fixed.
> > This is exactly what a virtual package is. Make it so.
> Great, you already addressed my previous comment :)
Ehehe! ;-)
[--SNIP--]
> > +config BR2_PACKAGE_HAS_SKELETON
> > + bool
> > +
> > +config BR2_PACKAGE_PROVIDES_SKELETON
> > + string
> > + depends on BR2_PACKAGE_SKELETON
>
> Should it be depends on BR2_PACKAGE_HAS_SKELETON instead ?
Yep, good catch.
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 18/24 v2] package/skeleton-sysv: split into skeleton-common
2016-06-22 19:07 [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton) Yann E. MORIN
` (16 preceding siblings ...)
2016-06-22 19:07 ` [Buildroot] [PATCH 17/24 v2] package/skeleton: make it a virtual package Yann E. MORIN
@ 2016-06-22 19:07 ` Yann E. MORIN
2016-07-03 11:05 ` Romain Naour
2016-06-22 19:07 ` [Buildroot] [PATCH 19/24 v2] system: split skeleton Yann E. MORIN
` (6 subsequent siblings)
24 siblings, 1 reply; 73+ messages in thread
From: Yann E. MORIN @ 2016-06-22 19:07 UTC (permalink / raw)
To: buildroot
Add skeleton-common, the base skeleton shared between the sysv/busybox
and systemd skeletons (the latter to come in followup patches).
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
package/Config.in | 1 +
package/skeleton-common/Config.in | 2 +
package/skeleton-common/skeleton-common.mk | 99 ++++++++++++++++++++++++++++++
package/skeleton-sysv/Config.in | 1 +
package/skeleton-sysv/skeleton-sysv.mk | 60 +-----------------
package/skeleton/skeleton.mk | 25 +-------
6 files changed, 106 insertions(+), 82 deletions(-)
create mode 100644 package/skeleton-common/Config.in
create mode 100644 package/skeleton-common/skeleton-common.mk
diff --git a/package/Config.in b/package/Config.in
index fd445f4..9db6332 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2,6 +2,7 @@ menu "Target packages"
source "package/busybox/Config.in"
source "package/skeleton/Config.in"
+ source "package/skeleton-common/Config.in"
source "package/skeleton-custom/Config.in"
source "package/skeleton-sysv/Config.in"
diff --git a/package/skeleton-common/Config.in b/package/skeleton-common/Config.in
new file mode 100644
index 0000000..9abed42
--- /dev/null
+++ b/package/skeleton-common/Config.in
@@ -0,0 +1,2 @@
+config BR2_PACKAGE_SKELETON_COMMON
+ bool
diff --git a/package/skeleton-common/skeleton-common.mk b/package/skeleton-common/skeleton-common.mk
new file mode 100644
index 0000000..544cce7
--- /dev/null
+++ b/package/skeleton-common/skeleton-common.mk
@@ -0,0 +1,99 @@
+################################################################################
+#
+# skeleton-common
+#
+################################################################################
+
+SKELETON_COMMON_SOURCE =
+
+SKELETON_COMMON_ADD_TOOLCHAIN_DEPENDENCY = NO
+SKELETON_COMMON_ADD_SKELETON_DEPENDENCY = NO
+
+SKELETON_COMMON_INSTALL_STAGING = YES
+
+SKELETON_COMMON_PATH = system/skeleton
+
+# Provided by the 'skeleton' package:
+# - SKELETON_USR_SYMLINKS_OR_DIRS
+# - SKELETON_LIB_SYMLINK
+
+SKELETON_COMMON_TARGET_GENERIC_HOSTNAME = $(call qstrip,$(BR2_TARGET_GENERIC_HOSTNAME))
+SKELETON_COMMON_TARGET_GENERIC_ISSUE = $(call qstrip,$(BR2_TARGET_GENERIC_ISSUE))
+SKELETON_COMMON_TARGET_GENERIC_ROOT_PASSWD = $(call qstrip,$(BR2_TARGET_GENERIC_ROOT_PASSWD))
+SKELETON_COMMON_TARGET_GENERIC_PASSWD_METHOD = $(call qstrip,$(BR2_TARGET_GENERIC_PASSWD_METHOD))
+SKELETON_COMMON_TARGET_GENERIC_BIN_SH = $(call qstrip,$(BR2_SYSTEM_BIN_SH))
+
+ifeq ($(BR2_TARGET_ENABLE_ROOT_LOGIN),y)
+ifeq ($(SKELETON_TARGET_GENERIC_ROOT_PASSWD),)
+SKELETON_ROOT_PASSWORD =
+else ifneq ($(filter $$1$$% $$5$$% $$6$$%,$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)),)
+SKELETON_ROOT_PASSWORD = '$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)'
+else
+SKELETON_DEPENDENCIES += host-mkpasswd
+# This variable will only be evaluated in the finalize stage, so we can
+# be sure that host-mkpasswd will have already been built by that time.
+SKELETON_ROOT_PASSWORD = "`$(MKPASSWD) -m "$(SKELETON_TARGET_GENERIC_PASSWD_METHOD)" "$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)"`"
+endif
+else # !BR2_TARGET_ENABLE_ROOT_LOGIN
+SKELETON_ROOT_PASSWORD = "*"
+endif
+
+define SKELETON_COMMON_INSTALL_TARGET_CMDS
+ $(call SKELETON_RSYNC,$(SKELETON_COMMON_PATH),$(TARGET_DIR))
+ $(call SKELETON_USR_SYMLINKS_OR_DIRS,$(TARGET_DIR))
+ ln -snf lib $(TARGET_DIR)/$(SKELETON_LIB_SYMLINK)
+ ln -snf lib $(TARGET_DIR)/usr/$(SKELETON_LIB_SYMLINK)
+ $(INSTALL) -m 0644 support/misc/target-dir-warning.txt \
+ $(TARGET_DIR_WARNING_FILE)
+endef
+
+# For the staging dir, we don't really care about /bin and /sbin.
+# But for consistency with the target dir, and to simplify the code,
+# we still handle them for the merged or non-merged /usr cases.
+# Since the toolchain is not yet available, the staging is not yet
+# populated, so we need to create the directories in /usr
+define SKELETON_COMMON_INSTALL_STAGING_CMDS
+ $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/lib
+ $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/bin
+ $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/sbin
+ $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include
+ $(call SKELETON_USR_SYMLINKS_OR_DIRS,$(STAGING_DIR))
+ ln -snf lib $(STAGING_DIR)/$(SKELETON_LIB_SYMLINK)
+ ln -snf lib $(STAGING_DIR)/usr/$(SKELETON_LIB_SYMLINK)
+endef
+
+ifneq ($(SKELETON_COMMON_TARGET_GENERIC_HOSTNAME),)
+define SKELETON_COMMON_SET_HOSTNAME
+ mkdir -p $(TARGET_DIR)/etc
+ echo "$(SKELETON_COMMON_TARGET_GENERIC_HOSTNAME)" > $(TARGET_DIR)/etc/hostname
+ $(SED) '$$a \127.0.1.1\t$(SKELETON_COMMON_TARGET_GENERIC_HOSTNAME)' \
+ -e '/^127.0.1.1/d' $(TARGET_DIR)/etc/hosts
+endef
+SKELETON_COMMON_TARGET_FINALIZE_HOOKS += SKELETON_COMMON_SET_HOSTNAME
+endif
+
+ifneq ($(SKELETON_COMMON_TARGET_GENERIC_ISSUE),)
+define SKELETON_COMMON_SET_ISSUE
+ mkdir -p $(TARGET_DIR)/etc
+ echo "$(SKELETON_COMMON_TARGET_GENERIC_ISSUE)" > $(TARGET_DIR)/etc/issue
+endef
+SKELETON_COMMON_TARGET_FINALIZE_HOOKS += SKELETON_COMMON_SET_ISSUE
+endif
+
+define SKELETON_COMMON_SET_ROOT_PASSWD
+ $(SED) s,^root:[^:]*:,root:$(SKELETON_ROOT_PASSWORD):, $(TARGET_DIR)/etc/shadow
+endef
+SKELETON_COMMON_TARGET_FINALIZE_HOOKS += SKELETON_COMMON_SET_ROOT_PASSWD
+
+ifeq ($(BR2_SYSTEM_BIN_SH_NONE),y)
+define SKELETON_COMMON_BIN_SH
+ rm -f $(TARGET_DIR)/bin/sh
+endef
+else
+define SKELETON_COMMON_BIN_SH
+ ln -sf $(SKELETON_COMMON_TARGET_GENERIC_BIN_SH) $(TARGET_DIR)/bin/sh
+endef
+endif
+SKELETON_COMMON_TARGET_FINALIZE_HOOKS += SKELETON_COMMON_BIN_SH
+
+$(eval $(generic-package))
diff --git a/package/skeleton-sysv/Config.in b/package/skeleton-sysv/Config.in
index 95c796f..2f6dbd9 100644
--- a/package/skeleton-sysv/Config.in
+++ b/package/skeleton-sysv/Config.in
@@ -1,6 +1,7 @@
config BR2_PACKAGE_SKELETON_SYSV
bool
select BR2_PACKAGE_HAS_SKELETON
+ select BR2_PACKAGE_SKELETON_COMMON
config BR2_PACKAGE_PROVIDES_SKELETON
default "skeleton-sysv" if BR2_PACKAGE_SKELETON_SYSV
diff --git a/package/skeleton-sysv/skeleton-sysv.mk b/package/skeleton-sysv/skeleton-sysv.mk
index aa0b65c..6e15b15 100644
--- a/package/skeleton-sysv/skeleton-sysv.mk
+++ b/package/skeleton-sysv/skeleton-sysv.mk
@@ -8,6 +8,8 @@ SKELETON_SYSV_SOURCE =
SKELETON_SYSV_PROVIDES = skeleton
+SKELETON_SYSV_DEPENDENCIES = skeleton-common
+
SKELETON_SYSV_ADD_TOOLCHAIN_DEPENDENCY = NO
SKELETON_SYSV_ADD_SKELETON_DEPENDENCY = NO
@@ -27,48 +29,6 @@ SKELETON_SYSV_INSTALL_STAGING = YES
# - SKELETON_SET_NETWORK_IFUPDOWN_LOOPBACK
# - SKELETON_SET_NETWORK_IFUPDOWN_DHCP
-define SKELETON_INSTALL_TARGET_CMDS
- $(call SKELETON_RSYNC,system/skeleton,$(TARGET_DIR))
- $(call SKELETON_USR_SYMLINKS_OR_DIRS,$(TARGET_DIR))
- ln -snf lib $(TARGET_DIR)/$(SKELETON_LIB_SYMLINK)
- ln -snf lib $(TARGET_DIR)/usr/$(SKELETON_LIB_SYMLINK)
- $(INSTALL) -m 0644 support/misc/target-dir-warning.txt \
- $(TARGET_DIR_WARNING_FILE)
-endef
-
-# For the staging dir, we don't really care about /bin and /sbin.
-# But for consistency with the target dir, and to simplify the code,
-# we still handle them for the merged or non-merged /usr cases.
-# Since the toolchain is not yet available, the staging is not yet
-# populated, so we need to create the directories in /usr
-define SKELETON_SYSV_INSTALL_STAGING_CMDS
- $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/lib
- $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/bin
- $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/sbin
- $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include
- $(call SKELETON_USR_SYMLINKS_OR_DIRS,$(STAGING_DIR))
- ln -snf lib $(STAGING_DIR)/$(SKELETON_LIB_SYMLINK)
- ln -snf lib $(STAGING_DIR)/usr/$(SKELETON_LIB_SYMLINK)
-endef
-
-ifneq ($(SKELETON_TARGET_GENERIC_HOSTNAME),)
-define SKELETON_SYSV_SET_HOSTNAME
- mkdir -p $(TARGET_DIR)/etc
- echo "$(SKELETON_TARGET_GENERIC_HOSTNAME)" > $(TARGET_DIR)/etc/hostname
- $(SED) '$$a \127.0.1.1\t$(SKELETON_TARGET_GENERIC_HOSTNAME)' \
- -e '/^127.0.1.1/d' $(TARGET_DIR)/etc/hosts
-endef
-SKELETON_SYSV_TARGET_FINALIZE_HOOKS += SKELETON_SYSV_SET_HOSTNAME
-endif
-
-ifneq ($(SKELETON_TARGET_GENERIC_ISSUE),)
-define SKELETON_SYSV_SET_ISSUE
- mkdir -p $(TARGET_DIR)/etc
- echo "$(SKELETON_TARGET_GENERIC_ISSUE)" > $(TARGET_DIR)/etc/issue
-endef
-SKELETON_SYSV_TARGET_FINALIZE_HOOKS += SKELETON_SYSV_SET_ISSUE
-endif
-
define SKELETON_SYSV_SET_NETWORK
mkdir -p $(TARGET_DIR)/etc/network/
$(SKELETON_SET_NETWORK_IFUPDOWN_LOOPBACK)
@@ -76,22 +36,6 @@ define SKELETON_SYSV_SET_NETWORK
endef
SKELETON_SYSV_TARGET_FINALIZE_HOOKS += SKELETON_SYSV_SET_NETWORK
-define SKELETON_SYSV_SET_ROOT_PASSWD
- $(SED) s,^root:[^:]*:,root:$(SKELETON_SYSV_ROOT_PASSWORD):, $(TARGET_DIR)/etc/shadow
-endef
-SKELETON_SYSV_TARGET_FINALIZE_HOOKS += SKELETON_SYSV_SET_ROOT_PASSWD
-
-ifeq ($(BR2_SYSTEM_BIN_SH_NONE),y)
-define SKELETON_SYSV_BIN_SH
- rm -f $(TARGET_DIR)/bin/sh
-endef
-else
-define SKELETON_SYSV_BIN_SH
- ln -sf $(SKELETON_TARGET_GENERIC_BIN_SH) $(TARGET_DIR)/bin/sh
-endef
-endif
-SKELETON_SYSV_TARGET_FINALIZE_HOOKS += SKELETON_SYSV_BIN_SH
-
ifeq ($(BR2_TARGET_GENERIC_GETTY),y)
ifeq ($(BR2_INIT_SYSV),y)
# In sysvinit inittab, the "id" must not be longer than 4 bytes, so we
diff --git a/package/skeleton/skeleton.mk b/package/skeleton/skeleton.mk
index b791650..d93f939 100644
--- a/package/skeleton/skeleton.mk
+++ b/package/skeleton/skeleton.mk
@@ -16,10 +16,6 @@ $(eval $(virtual-package))
# The following definitions are to be used by the specific skeletons:
# - SKELETON_USR_SYMLINKS_OR_DIRS
# - SKELETON_LIB_SYMLINK
-# - SKELETON_TARGET_GENERIC_HOSTNAME
-# - SKELETON_TARGET_GENERIC_ISSUE
-# - SKELETON_TARGET_ROOT_PASSWD
-# - SKELETON_TARGET_GENERIC_BIN_SH
# - SKELETON_TARGET_GENERIC_GETTY_PORT
# - SKELETON_TARGET_GENERIC_GETTY_BAUDRATE
# - SKELETON_TARGET_GENERIC_GETTY_TERM
@@ -58,11 +54,7 @@ else
SKELETON_LIB_SYMLINK = lib32
endif
-SKELETON_TARGET_GENERIC_HOSTNAME = $(call qstrip,$(BR2_TARGET_GENERIC_HOSTNAME))
-SKELETON_TARGET_GENERIC_ISSUE = $(call qstrip,$(BR2_TARGET_GENERIC_ISSUE))
-SKELETON_TARGET_GENERIC_ROOT_PASSWD = $(call qstrip,$(BR2_TARGET_GENERIC_ROOT_PASSWD))
-SKELETON_TARGET_GENERIC_PASSWD_METHOD = $(call qstrip,$(BR2_TARGET_GENERIC_PASSWD_METHOD))
-SKELETON_TARGET_GENERIC_BIN_SH = $(call qstrip,$(BR2_SYSTEM_BIN_SH))
+# The various init systems have different ways of dealing with those:
SKELETON_TARGET_GENERIC_GETTY_PORT = $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT))
SKELETON_TARGET_GENERIC_GETTY_BAUDRATE = $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE))
SKELETON_TARGET_GENERIC_GETTY_TERM = $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_TERM))
@@ -93,18 +85,3 @@ define SKELETON_SET_NETWORK_IFUPDOWN_DHCP
$(TARGET_DIR)/etc/network/nfs_check
endef
endif
-
-ifeq ($(BR2_TARGET_ENABLE_ROOT_LOGIN),y)
-ifeq ($(SKELETON_TARGET_GENERIC_ROOT_PASSWD),)
-SKELETON_ROOT_PASSWORD =
-else ifneq ($(filter $$1$$% $$5$$% $$6$$%,$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)),)
-SKELETON_ROOT_PASSWORD = '$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)'
-else
-SKELETON_DEPENDENCIES += host-mkpasswd
-# This variable will only be evaluated in the finalize stage, so we can
-# be sure that host-mkpasswd will have already been built by that time.
-SKELETON_ROOT_PASSWORD = "`$(MKPASSWD) -m "$(SKELETON_TARGET_GENERIC_PASSWD_METHOD)" "$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)"`"
-endif
-else # !BR2_TARGET_ENABLE_ROOT_LOGIN
-SKELETON_ROOT_PASSWORD = "*"
-endif
--
2.7.4
^ permalink raw reply related [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 18/24 v2] package/skeleton-sysv: split into skeleton-common
2016-06-22 19:07 ` [Buildroot] [PATCH 18/24 v2] package/skeleton-sysv: split into skeleton-common Yann E. MORIN
@ 2016-07-03 11:05 ` Romain Naour
2016-07-05 7:49 ` Yann E. MORIN
0 siblings, 1 reply; 73+ messages in thread
From: Romain Naour @ 2016-07-03 11:05 UTC (permalink / raw)
To: buildroot
Hi Yann,
Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> Add skeleton-common, the base skeleton shared between the sysv/busybox
> and systemd skeletons (the latter to come in followup patches).
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> ---
> package/Config.in | 1 +
> package/skeleton-common/Config.in | 2 +
> package/skeleton-common/skeleton-common.mk | 99 ++++++++++++++++++++++++++++++
> package/skeleton-sysv/Config.in | 1 +
> package/skeleton-sysv/skeleton-sysv.mk | 60 +-----------------
> package/skeleton/skeleton.mk | 25 +-------
> 6 files changed, 106 insertions(+), 82 deletions(-)
> create mode 100644 package/skeleton-common/Config.in
> create mode 100644 package/skeleton-common/skeleton-common.mk
>
> diff --git a/package/Config.in b/package/Config.in
> index fd445f4..9db6332 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -2,6 +2,7 @@ menu "Target packages"
>
> source "package/busybox/Config.in"
> source "package/skeleton/Config.in"
> + source "package/skeleton-common/Config.in"
> source "package/skeleton-custom/Config.in"
> source "package/skeleton-sysv/Config.in"
>
> diff --git a/package/skeleton-common/Config.in b/package/skeleton-common/Config.in
> new file mode 100644
> index 0000000..9abed42
> --- /dev/null
> +++ b/package/skeleton-common/Config.in
> @@ -0,0 +1,2 @@
> +config BR2_PACKAGE_SKELETON_COMMON
> + bool
> diff --git a/package/skeleton-common/skeleton-common.mk b/package/skeleton-common/skeleton-common.mk
> new file mode 100644
> index 0000000..544cce7
> --- /dev/null
> +++ b/package/skeleton-common/skeleton-common.mk
> @@ -0,0 +1,99 @@
> +################################################################################
> +#
> +# skeleton-common
> +#
> +################################################################################
> +
> +SKELETON_COMMON_SOURCE =
> +
> +SKELETON_COMMON_ADD_TOOLCHAIN_DEPENDENCY = NO
> +SKELETON_COMMON_ADD_SKELETON_DEPENDENCY = NO
> +
> +SKELETON_COMMON_INSTALL_STAGING = YES
> +
> +SKELETON_COMMON_PATH = system/skeleton
> +
> +# Provided by the 'skeleton' package:
> +# - SKELETON_USR_SYMLINKS_OR_DIRS
> +# - SKELETON_LIB_SYMLINK
> +
> +SKELETON_COMMON_TARGET_GENERIC_HOSTNAME = $(call qstrip,$(BR2_TARGET_GENERIC_HOSTNAME))
> +SKELETON_COMMON_TARGET_GENERIC_ISSUE = $(call qstrip,$(BR2_TARGET_GENERIC_ISSUE))
> +SKELETON_COMMON_TARGET_GENERIC_ROOT_PASSWD = $(call qstrip,$(BR2_TARGET_GENERIC_ROOT_PASSWD))
> +SKELETON_COMMON_TARGET_GENERIC_PASSWD_METHOD = $(call qstrip,$(BR2_TARGET_GENERIC_PASSWD_METHOD))
> +SKELETON_COMMON_TARGET_GENERIC_BIN_SH = $(call qstrip,$(BR2_SYSTEM_BIN_SH))
> +
> +ifeq ($(BR2_TARGET_ENABLE_ROOT_LOGIN),y)
> +ifeq ($(SKELETON_TARGET_GENERIC_ROOT_PASSWD),)
> +SKELETON_ROOT_PASSWORD =
SKELETON_ROOT_PASSWORD should be renamed to SKELETON_COMMON_ROOT_PASSWORD ?
> +else ifneq ($(filter $$1$$% $$5$$% $$6$$%,$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)),)
> +SKELETON_ROOT_PASSWORD = '$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)'
> +else
> +SKELETON_DEPENDENCIES += host-mkpasswd
s/SKELETON_DEPENDENCIES/SKELETON_COMMON_DEPENDENCIES/ even if mkpasswd is used
in a target finalize hook.
Best regards,
Romain
> +# This variable will only be evaluated in the finalize stage, so we can
> +# be sure that host-mkpasswd will have already been built by that time.
> +SKELETON_ROOT_PASSWORD = "`$(MKPASSWD) -m "$(SKELETON_TARGET_GENERIC_PASSWD_METHOD)" "$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)"`"
> +endif
> +else # !BR2_TARGET_ENABLE_ROOT_LOGIN
> +SKELETON_ROOT_PASSWORD = "*"
> +endif
> +
> +define SKELETON_COMMON_INSTALL_TARGET_CMDS
> + $(call SKELETON_RSYNC,$(SKELETON_COMMON_PATH),$(TARGET_DIR))
> + $(call SKELETON_USR_SYMLINKS_OR_DIRS,$(TARGET_DIR))
> + ln -snf lib $(TARGET_DIR)/$(SKELETON_LIB_SYMLINK)
> + ln -snf lib $(TARGET_DIR)/usr/$(SKELETON_LIB_SYMLINK)
> + $(INSTALL) -m 0644 support/misc/target-dir-warning.txt \
> + $(TARGET_DIR_WARNING_FILE)
> +endef
> +
> +# For the staging dir, we don't really care about /bin and /sbin.
> +# But for consistency with the target dir, and to simplify the code,
> +# we still handle them for the merged or non-merged /usr cases.
> +# Since the toolchain is not yet available, the staging is not yet
> +# populated, so we need to create the directories in /usr
> +define SKELETON_COMMON_INSTALL_STAGING_CMDS
> + $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/lib
> + $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/bin
> + $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/sbin
> + $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include
> + $(call SKELETON_USR_SYMLINKS_OR_DIRS,$(STAGING_DIR))
> + ln -snf lib $(STAGING_DIR)/$(SKELETON_LIB_SYMLINK)
> + ln -snf lib $(STAGING_DIR)/usr/$(SKELETON_LIB_SYMLINK)
> +endef
> +
> +ifneq ($(SKELETON_COMMON_TARGET_GENERIC_HOSTNAME),)
> +define SKELETON_COMMON_SET_HOSTNAME
> + mkdir -p $(TARGET_DIR)/etc
> + echo "$(SKELETON_COMMON_TARGET_GENERIC_HOSTNAME)" > $(TARGET_DIR)/etc/hostname
> + $(SED) '$$a \127.0.1.1\t$(SKELETON_COMMON_TARGET_GENERIC_HOSTNAME)' \
> + -e '/^127.0.1.1/d' $(TARGET_DIR)/etc/hosts
> +endef
> +SKELETON_COMMON_TARGET_FINALIZE_HOOKS += SKELETON_COMMON_SET_HOSTNAME
> +endif
> +
> +ifneq ($(SKELETON_COMMON_TARGET_GENERIC_ISSUE),)
> +define SKELETON_COMMON_SET_ISSUE
> + mkdir -p $(TARGET_DIR)/etc
> + echo "$(SKELETON_COMMON_TARGET_GENERIC_ISSUE)" > $(TARGET_DIR)/etc/issue
> +endef
> +SKELETON_COMMON_TARGET_FINALIZE_HOOKS += SKELETON_COMMON_SET_ISSUE
> +endif
> +
> +define SKELETON_COMMON_SET_ROOT_PASSWD
> + $(SED) s,^root:[^:]*:,root:$(SKELETON_ROOT_PASSWORD):, $(TARGET_DIR)/etc/shadow
> +endef
> +SKELETON_COMMON_TARGET_FINALIZE_HOOKS += SKELETON_COMMON_SET_ROOT_PASSWD
> +
> +ifeq ($(BR2_SYSTEM_BIN_SH_NONE),y)
> +define SKELETON_COMMON_BIN_SH
> + rm -f $(TARGET_DIR)/bin/sh
> +endef
> +else
> +define SKELETON_COMMON_BIN_SH
> + ln -sf $(SKELETON_COMMON_TARGET_GENERIC_BIN_SH) $(TARGET_DIR)/bin/sh
> +endef
> +endif
> +SKELETON_COMMON_TARGET_FINALIZE_HOOKS += SKELETON_COMMON_BIN_SH
> +
> +$(eval $(generic-package))
> diff --git a/package/skeleton-sysv/Config.in b/package/skeleton-sysv/Config.in
> index 95c796f..2f6dbd9 100644
> --- a/package/skeleton-sysv/Config.in
> +++ b/package/skeleton-sysv/Config.in
> @@ -1,6 +1,7 @@
> config BR2_PACKAGE_SKELETON_SYSV
> bool
> select BR2_PACKAGE_HAS_SKELETON
> + select BR2_PACKAGE_SKELETON_COMMON
>
> config BR2_PACKAGE_PROVIDES_SKELETON
> default "skeleton-sysv" if BR2_PACKAGE_SKELETON_SYSV
> diff --git a/package/skeleton-sysv/skeleton-sysv.mk b/package/skeleton-sysv/skeleton-sysv.mk
> index aa0b65c..6e15b15 100644
> --- a/package/skeleton-sysv/skeleton-sysv.mk
> +++ b/package/skeleton-sysv/skeleton-sysv.mk
> @@ -8,6 +8,8 @@ SKELETON_SYSV_SOURCE =
>
> SKELETON_SYSV_PROVIDES = skeleton
>
> +SKELETON_SYSV_DEPENDENCIES = skeleton-common
> +
> SKELETON_SYSV_ADD_TOOLCHAIN_DEPENDENCY = NO
> SKELETON_SYSV_ADD_SKELETON_DEPENDENCY = NO
>
> @@ -27,48 +29,6 @@ SKELETON_SYSV_INSTALL_STAGING = YES
> # - SKELETON_SET_NETWORK_IFUPDOWN_LOOPBACK
> # - SKELETON_SET_NETWORK_IFUPDOWN_DHCP
>
> -define SKELETON_INSTALL_TARGET_CMDS
> - $(call SKELETON_RSYNC,system/skeleton,$(TARGET_DIR))
> - $(call SKELETON_USR_SYMLINKS_OR_DIRS,$(TARGET_DIR))
> - ln -snf lib $(TARGET_DIR)/$(SKELETON_LIB_SYMLINK)
> - ln -snf lib $(TARGET_DIR)/usr/$(SKELETON_LIB_SYMLINK)
> - $(INSTALL) -m 0644 support/misc/target-dir-warning.txt \
> - $(TARGET_DIR_WARNING_FILE)
> -endef
> -
> -# For the staging dir, we don't really care about /bin and /sbin.
> -# But for consistency with the target dir, and to simplify the code,
> -# we still handle them for the merged or non-merged /usr cases.
> -# Since the toolchain is not yet available, the staging is not yet
> -# populated, so we need to create the directories in /usr
> -define SKELETON_SYSV_INSTALL_STAGING_CMDS
> - $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/lib
> - $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/bin
> - $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/sbin
> - $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include
> - $(call SKELETON_USR_SYMLINKS_OR_DIRS,$(STAGING_DIR))
> - ln -snf lib $(STAGING_DIR)/$(SKELETON_LIB_SYMLINK)
> - ln -snf lib $(STAGING_DIR)/usr/$(SKELETON_LIB_SYMLINK)
> -endef
> -
> -ifneq ($(SKELETON_TARGET_GENERIC_HOSTNAME),)
> -define SKELETON_SYSV_SET_HOSTNAME
> - mkdir -p $(TARGET_DIR)/etc
> - echo "$(SKELETON_TARGET_GENERIC_HOSTNAME)" > $(TARGET_DIR)/etc/hostname
> - $(SED) '$$a \127.0.1.1\t$(SKELETON_TARGET_GENERIC_HOSTNAME)' \
> - -e '/^127.0.1.1/d' $(TARGET_DIR)/etc/hosts
> -endef
> -SKELETON_SYSV_TARGET_FINALIZE_HOOKS += SKELETON_SYSV_SET_HOSTNAME
> -endif
> -
> -ifneq ($(SKELETON_TARGET_GENERIC_ISSUE),)
> -define SKELETON_SYSV_SET_ISSUE
> - mkdir -p $(TARGET_DIR)/etc
> - echo "$(SKELETON_TARGET_GENERIC_ISSUE)" > $(TARGET_DIR)/etc/issue
> -endef
> -SKELETON_SYSV_TARGET_FINALIZE_HOOKS += SKELETON_SYSV_SET_ISSUE
> -endif
> -
> define SKELETON_SYSV_SET_NETWORK
> mkdir -p $(TARGET_DIR)/etc/network/
> $(SKELETON_SET_NETWORK_IFUPDOWN_LOOPBACK)
> @@ -76,22 +36,6 @@ define SKELETON_SYSV_SET_NETWORK
> endef
> SKELETON_SYSV_TARGET_FINALIZE_HOOKS += SKELETON_SYSV_SET_NETWORK
>
> -define SKELETON_SYSV_SET_ROOT_PASSWD
> - $(SED) s,^root:[^:]*:,root:$(SKELETON_SYSV_ROOT_PASSWORD):, $(TARGET_DIR)/etc/shadow
> -endef
> -SKELETON_SYSV_TARGET_FINALIZE_HOOKS += SKELETON_SYSV_SET_ROOT_PASSWD
> -
> -ifeq ($(BR2_SYSTEM_BIN_SH_NONE),y)
> -define SKELETON_SYSV_BIN_SH
> - rm -f $(TARGET_DIR)/bin/sh
> -endef
> -else
> -define SKELETON_SYSV_BIN_SH
> - ln -sf $(SKELETON_TARGET_GENERIC_BIN_SH) $(TARGET_DIR)/bin/sh
> -endef
> -endif
> -SKELETON_SYSV_TARGET_FINALIZE_HOOKS += SKELETON_SYSV_BIN_SH
> -
> ifeq ($(BR2_TARGET_GENERIC_GETTY),y)
> ifeq ($(BR2_INIT_SYSV),y)
> # In sysvinit inittab, the "id" must not be longer than 4 bytes, so we
> diff --git a/package/skeleton/skeleton.mk b/package/skeleton/skeleton.mk
> index b791650..d93f939 100644
> --- a/package/skeleton/skeleton.mk
> +++ b/package/skeleton/skeleton.mk
> @@ -16,10 +16,6 @@ $(eval $(virtual-package))
> # The following definitions are to be used by the specific skeletons:
> # - SKELETON_USR_SYMLINKS_OR_DIRS
> # - SKELETON_LIB_SYMLINK
> -# - SKELETON_TARGET_GENERIC_HOSTNAME
> -# - SKELETON_TARGET_GENERIC_ISSUE
> -# - SKELETON_TARGET_ROOT_PASSWD
> -# - SKELETON_TARGET_GENERIC_BIN_SH
> # - SKELETON_TARGET_GENERIC_GETTY_PORT
> # - SKELETON_TARGET_GENERIC_GETTY_BAUDRATE
> # - SKELETON_TARGET_GENERIC_GETTY_TERM
> @@ -58,11 +54,7 @@ else
> SKELETON_LIB_SYMLINK = lib32
> endif
>
> -SKELETON_TARGET_GENERIC_HOSTNAME = $(call qstrip,$(BR2_TARGET_GENERIC_HOSTNAME))
> -SKELETON_TARGET_GENERIC_ISSUE = $(call qstrip,$(BR2_TARGET_GENERIC_ISSUE))
> -SKELETON_TARGET_GENERIC_ROOT_PASSWD = $(call qstrip,$(BR2_TARGET_GENERIC_ROOT_PASSWD))
> -SKELETON_TARGET_GENERIC_PASSWD_METHOD = $(call qstrip,$(BR2_TARGET_GENERIC_PASSWD_METHOD))
> -SKELETON_TARGET_GENERIC_BIN_SH = $(call qstrip,$(BR2_SYSTEM_BIN_SH))
> +# The various init systems have different ways of dealing with those:
> SKELETON_TARGET_GENERIC_GETTY_PORT = $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT))
> SKELETON_TARGET_GENERIC_GETTY_BAUDRATE = $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE))
> SKELETON_TARGET_GENERIC_GETTY_TERM = $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_TERM))
> @@ -93,18 +85,3 @@ define SKELETON_SET_NETWORK_IFUPDOWN_DHCP
> $(TARGET_DIR)/etc/network/nfs_check
> endef
> endif
> -
> -ifeq ($(BR2_TARGET_ENABLE_ROOT_LOGIN),y)
> -ifeq ($(SKELETON_TARGET_GENERIC_ROOT_PASSWD),)
> -SKELETON_ROOT_PASSWORD =
> -else ifneq ($(filter $$1$$% $$5$$% $$6$$%,$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)),)
> -SKELETON_ROOT_PASSWORD = '$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)'
> -else
> -SKELETON_DEPENDENCIES += host-mkpasswd
> -# This variable will only be evaluated in the finalize stage, so we can
> -# be sure that host-mkpasswd will have already been built by that time.
> -SKELETON_ROOT_PASSWORD = "`$(MKPASSWD) -m "$(SKELETON_TARGET_GENERIC_PASSWD_METHOD)" "$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)"`"
> -endif
> -else # !BR2_TARGET_ENABLE_ROOT_LOGIN
> -SKELETON_ROOT_PASSWORD = "*"
> -endif
>
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 18/24 v2] package/skeleton-sysv: split into skeleton-common
2016-07-03 11:05 ` Romain Naour
@ 2016-07-05 7:49 ` Yann E. MORIN
0 siblings, 0 replies; 73+ messages in thread
From: Yann E. MORIN @ 2016-07-05 7:49 UTC (permalink / raw)
To: buildroot
Romain, All,
On 2016-07-03 13:05 +0200, Romain Naour spake thusly:
> Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> > Add skeleton-common, the base skeleton shared between the sysv/busybox
> > and systemd skeletons (the latter to come in followup patches).
> >
> > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> > ---
[--SNIP--]
> > diff --git a/package/skeleton-common/skeleton-common.mk b/package/skeleton-common/skeleton-common.mk
> > new file mode 100644
> > index 0000000..544cce7
> > --- /dev/null
> > +++ b/package/skeleton-common/skeleton-common.mk
> > @@ -0,0 +1,99 @@
> > +################################################################################
> > +#
> > +# skeleton-common
> > +#
> > +################################################################################
> > +
> > +SKELETON_COMMON_SOURCE =
> > +
> > +SKELETON_COMMON_ADD_TOOLCHAIN_DEPENDENCY = NO
> > +SKELETON_COMMON_ADD_SKELETON_DEPENDENCY = NO
> > +
> > +SKELETON_COMMON_INSTALL_STAGING = YES
> > +
> > +SKELETON_COMMON_PATH = system/skeleton
> > +
> > +# Provided by the 'skeleton' package:
> > +# - SKELETON_USR_SYMLINKS_OR_DIRS
> > +# - SKELETON_LIB_SYMLINK
> > +
> > +SKELETON_COMMON_TARGET_GENERIC_HOSTNAME = $(call qstrip,$(BR2_TARGET_GENERIC_HOSTNAME))
> > +SKELETON_COMMON_TARGET_GENERIC_ISSUE = $(call qstrip,$(BR2_TARGET_GENERIC_ISSUE))
> > +SKELETON_COMMON_TARGET_GENERIC_ROOT_PASSWD = $(call qstrip,$(BR2_TARGET_GENERIC_ROOT_PASSWD))
> > +SKELETON_COMMON_TARGET_GENERIC_PASSWD_METHOD = $(call qstrip,$(BR2_TARGET_GENERIC_PASSWD_METHOD))
> > +SKELETON_COMMON_TARGET_GENERIC_BIN_SH = $(call qstrip,$(BR2_SYSTEM_BIN_SH))
> > +
> > +ifeq ($(BR2_TARGET_ENABLE_ROOT_LOGIN),y)
> > +ifeq ($(SKELETON_TARGET_GENERIC_ROOT_PASSWD),)
> > +SKELETON_ROOT_PASSWORD =
>
> SKELETON_ROOT_PASSWORD should be renamed to SKELETON_COMMON_ROOT_PASSWORD ?
Done.
> > +else ifneq ($(filter $$1$$% $$5$$% $$6$$%,$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)),)
> > +SKELETON_ROOT_PASSWORD = '$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)'
> > +else
> > +SKELETON_DEPENDENCIES += host-mkpasswd
>
> s/SKELETON_DEPENDENCIES/SKELETON_COMMON_DEPENDENCIES/ even if mkpasswd is used
> in a target finalize hook.
Done.
Thanks! :-)
Regards,
Yann E. MORIN.
> Best regards,
> Romain
>
> > +# This variable will only be evaluated in the finalize stage, so we can
> > +# be sure that host-mkpasswd will have already been built by that time.
> > +SKELETON_ROOT_PASSWORD = "`$(MKPASSWD) -m "$(SKELETON_TARGET_GENERIC_PASSWD_METHOD)" "$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)"`"
> > +endif
> > +else # !BR2_TARGET_ENABLE_ROOT_LOGIN
> > +SKELETON_ROOT_PASSWORD = "*"
> > +endif
> > +
> > +define SKELETON_COMMON_INSTALL_TARGET_CMDS
> > + $(call SKELETON_RSYNC,$(SKELETON_COMMON_PATH),$(TARGET_DIR))
> > + $(call SKELETON_USR_SYMLINKS_OR_DIRS,$(TARGET_DIR))
> > + ln -snf lib $(TARGET_DIR)/$(SKELETON_LIB_SYMLINK)
> > + ln -snf lib $(TARGET_DIR)/usr/$(SKELETON_LIB_SYMLINK)
> > + $(INSTALL) -m 0644 support/misc/target-dir-warning.txt \
> > + $(TARGET_DIR_WARNING_FILE)
> > +endef
> > +
> > +# For the staging dir, we don't really care about /bin and /sbin.
> > +# But for consistency with the target dir, and to simplify the code,
> > +# we still handle them for the merged or non-merged /usr cases.
> > +# Since the toolchain is not yet available, the staging is not yet
> > +# populated, so we need to create the directories in /usr
> > +define SKELETON_COMMON_INSTALL_STAGING_CMDS
> > + $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/lib
> > + $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/bin
> > + $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/sbin
> > + $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include
> > + $(call SKELETON_USR_SYMLINKS_OR_DIRS,$(STAGING_DIR))
> > + ln -snf lib $(STAGING_DIR)/$(SKELETON_LIB_SYMLINK)
> > + ln -snf lib $(STAGING_DIR)/usr/$(SKELETON_LIB_SYMLINK)
> > +endef
> > +
> > +ifneq ($(SKELETON_COMMON_TARGET_GENERIC_HOSTNAME),)
> > +define SKELETON_COMMON_SET_HOSTNAME
> > + mkdir -p $(TARGET_DIR)/etc
> > + echo "$(SKELETON_COMMON_TARGET_GENERIC_HOSTNAME)" > $(TARGET_DIR)/etc/hostname
> > + $(SED) '$$a \127.0.1.1\t$(SKELETON_COMMON_TARGET_GENERIC_HOSTNAME)' \
> > + -e '/^127.0.1.1/d' $(TARGET_DIR)/etc/hosts
> > +endef
> > +SKELETON_COMMON_TARGET_FINALIZE_HOOKS += SKELETON_COMMON_SET_HOSTNAME
> > +endif
> > +
> > +ifneq ($(SKELETON_COMMON_TARGET_GENERIC_ISSUE),)
> > +define SKELETON_COMMON_SET_ISSUE
> > + mkdir -p $(TARGET_DIR)/etc
> > + echo "$(SKELETON_COMMON_TARGET_GENERIC_ISSUE)" > $(TARGET_DIR)/etc/issue
> > +endef
> > +SKELETON_COMMON_TARGET_FINALIZE_HOOKS += SKELETON_COMMON_SET_ISSUE
> > +endif
> > +
> > +define SKELETON_COMMON_SET_ROOT_PASSWD
> > + $(SED) s,^root:[^:]*:,root:$(SKELETON_ROOT_PASSWORD):, $(TARGET_DIR)/etc/shadow
> > +endef
> > +SKELETON_COMMON_TARGET_FINALIZE_HOOKS += SKELETON_COMMON_SET_ROOT_PASSWD
> > +
> > +ifeq ($(BR2_SYSTEM_BIN_SH_NONE),y)
> > +define SKELETON_COMMON_BIN_SH
> > + rm -f $(TARGET_DIR)/bin/sh
> > +endef
> > +else
> > +define SKELETON_COMMON_BIN_SH
> > + ln -sf $(SKELETON_COMMON_TARGET_GENERIC_BIN_SH) $(TARGET_DIR)/bin/sh
> > +endef
> > +endif
> > +SKELETON_COMMON_TARGET_FINALIZE_HOOKS += SKELETON_COMMON_BIN_SH
> > +
> > +$(eval $(generic-package))
> > diff --git a/package/skeleton-sysv/Config.in b/package/skeleton-sysv/Config.in
> > index 95c796f..2f6dbd9 100644
> > --- a/package/skeleton-sysv/Config.in
> > +++ b/package/skeleton-sysv/Config.in
> > @@ -1,6 +1,7 @@
> > config BR2_PACKAGE_SKELETON_SYSV
> > bool
> > select BR2_PACKAGE_HAS_SKELETON
> > + select BR2_PACKAGE_SKELETON_COMMON
> >
> > config BR2_PACKAGE_PROVIDES_SKELETON
> > default "skeleton-sysv" if BR2_PACKAGE_SKELETON_SYSV
> > diff --git a/package/skeleton-sysv/skeleton-sysv.mk b/package/skeleton-sysv/skeleton-sysv.mk
> > index aa0b65c..6e15b15 100644
> > --- a/package/skeleton-sysv/skeleton-sysv.mk
> > +++ b/package/skeleton-sysv/skeleton-sysv.mk
> > @@ -8,6 +8,8 @@ SKELETON_SYSV_SOURCE =
> >
> > SKELETON_SYSV_PROVIDES = skeleton
> >
> > +SKELETON_SYSV_DEPENDENCIES = skeleton-common
> > +
> > SKELETON_SYSV_ADD_TOOLCHAIN_DEPENDENCY = NO
> > SKELETON_SYSV_ADD_SKELETON_DEPENDENCY = NO
> >
> > @@ -27,48 +29,6 @@ SKELETON_SYSV_INSTALL_STAGING = YES
> > # - SKELETON_SET_NETWORK_IFUPDOWN_LOOPBACK
> > # - SKELETON_SET_NETWORK_IFUPDOWN_DHCP
> >
> > -define SKELETON_INSTALL_TARGET_CMDS
> > - $(call SKELETON_RSYNC,system/skeleton,$(TARGET_DIR))
> > - $(call SKELETON_USR_SYMLINKS_OR_DIRS,$(TARGET_DIR))
> > - ln -snf lib $(TARGET_DIR)/$(SKELETON_LIB_SYMLINK)
> > - ln -snf lib $(TARGET_DIR)/usr/$(SKELETON_LIB_SYMLINK)
> > - $(INSTALL) -m 0644 support/misc/target-dir-warning.txt \
> > - $(TARGET_DIR_WARNING_FILE)
> > -endef
> > -
> > -# For the staging dir, we don't really care about /bin and /sbin.
> > -# But for consistency with the target dir, and to simplify the code,
> > -# we still handle them for the merged or non-merged /usr cases.
> > -# Since the toolchain is not yet available, the staging is not yet
> > -# populated, so we need to create the directories in /usr
> > -define SKELETON_SYSV_INSTALL_STAGING_CMDS
> > - $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/lib
> > - $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/bin
> > - $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/sbin
> > - $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include
> > - $(call SKELETON_USR_SYMLINKS_OR_DIRS,$(STAGING_DIR))
> > - ln -snf lib $(STAGING_DIR)/$(SKELETON_LIB_SYMLINK)
> > - ln -snf lib $(STAGING_DIR)/usr/$(SKELETON_LIB_SYMLINK)
> > -endef
> > -
> > -ifneq ($(SKELETON_TARGET_GENERIC_HOSTNAME),)
> > -define SKELETON_SYSV_SET_HOSTNAME
> > - mkdir -p $(TARGET_DIR)/etc
> > - echo "$(SKELETON_TARGET_GENERIC_HOSTNAME)" > $(TARGET_DIR)/etc/hostname
> > - $(SED) '$$a \127.0.1.1\t$(SKELETON_TARGET_GENERIC_HOSTNAME)' \
> > - -e '/^127.0.1.1/d' $(TARGET_DIR)/etc/hosts
> > -endef
> > -SKELETON_SYSV_TARGET_FINALIZE_HOOKS += SKELETON_SYSV_SET_HOSTNAME
> > -endif
> > -
> > -ifneq ($(SKELETON_TARGET_GENERIC_ISSUE),)
> > -define SKELETON_SYSV_SET_ISSUE
> > - mkdir -p $(TARGET_DIR)/etc
> > - echo "$(SKELETON_TARGET_GENERIC_ISSUE)" > $(TARGET_DIR)/etc/issue
> > -endef
> > -SKELETON_SYSV_TARGET_FINALIZE_HOOKS += SKELETON_SYSV_SET_ISSUE
> > -endif
> > -
> > define SKELETON_SYSV_SET_NETWORK
> > mkdir -p $(TARGET_DIR)/etc/network/
> > $(SKELETON_SET_NETWORK_IFUPDOWN_LOOPBACK)
> > @@ -76,22 +36,6 @@ define SKELETON_SYSV_SET_NETWORK
> > endef
> > SKELETON_SYSV_TARGET_FINALIZE_HOOKS += SKELETON_SYSV_SET_NETWORK
> >
> > -define SKELETON_SYSV_SET_ROOT_PASSWD
> > - $(SED) s,^root:[^:]*:,root:$(SKELETON_SYSV_ROOT_PASSWORD):, $(TARGET_DIR)/etc/shadow
> > -endef
> > -SKELETON_SYSV_TARGET_FINALIZE_HOOKS += SKELETON_SYSV_SET_ROOT_PASSWD
> > -
> > -ifeq ($(BR2_SYSTEM_BIN_SH_NONE),y)
> > -define SKELETON_SYSV_BIN_SH
> > - rm -f $(TARGET_DIR)/bin/sh
> > -endef
> > -else
> > -define SKELETON_SYSV_BIN_SH
> > - ln -sf $(SKELETON_TARGET_GENERIC_BIN_SH) $(TARGET_DIR)/bin/sh
> > -endef
> > -endif
> > -SKELETON_SYSV_TARGET_FINALIZE_HOOKS += SKELETON_SYSV_BIN_SH
> > -
> > ifeq ($(BR2_TARGET_GENERIC_GETTY),y)
> > ifeq ($(BR2_INIT_SYSV),y)
> > # In sysvinit inittab, the "id" must not be longer than 4 bytes, so we
> > diff --git a/package/skeleton/skeleton.mk b/package/skeleton/skeleton.mk
> > index b791650..d93f939 100644
> > --- a/package/skeleton/skeleton.mk
> > +++ b/package/skeleton/skeleton.mk
> > @@ -16,10 +16,6 @@ $(eval $(virtual-package))
> > # The following definitions are to be used by the specific skeletons:
> > # - SKELETON_USR_SYMLINKS_OR_DIRS
> > # - SKELETON_LIB_SYMLINK
> > -# - SKELETON_TARGET_GENERIC_HOSTNAME
> > -# - SKELETON_TARGET_GENERIC_ISSUE
> > -# - SKELETON_TARGET_ROOT_PASSWD
> > -# - SKELETON_TARGET_GENERIC_BIN_SH
> > # - SKELETON_TARGET_GENERIC_GETTY_PORT
> > # - SKELETON_TARGET_GENERIC_GETTY_BAUDRATE
> > # - SKELETON_TARGET_GENERIC_GETTY_TERM
> > @@ -58,11 +54,7 @@ else
> > SKELETON_LIB_SYMLINK = lib32
> > endif
> >
> > -SKELETON_TARGET_GENERIC_HOSTNAME = $(call qstrip,$(BR2_TARGET_GENERIC_HOSTNAME))
> > -SKELETON_TARGET_GENERIC_ISSUE = $(call qstrip,$(BR2_TARGET_GENERIC_ISSUE))
> > -SKELETON_TARGET_GENERIC_ROOT_PASSWD = $(call qstrip,$(BR2_TARGET_GENERIC_ROOT_PASSWD))
> > -SKELETON_TARGET_GENERIC_PASSWD_METHOD = $(call qstrip,$(BR2_TARGET_GENERIC_PASSWD_METHOD))
> > -SKELETON_TARGET_GENERIC_BIN_SH = $(call qstrip,$(BR2_SYSTEM_BIN_SH))
> > +# The various init systems have different ways of dealing with those:
> > SKELETON_TARGET_GENERIC_GETTY_PORT = $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT))
> > SKELETON_TARGET_GENERIC_GETTY_BAUDRATE = $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE))
> > SKELETON_TARGET_GENERIC_GETTY_TERM = $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_TERM))
> > @@ -93,18 +85,3 @@ define SKELETON_SET_NETWORK_IFUPDOWN_DHCP
> > $(TARGET_DIR)/etc/network/nfs_check
> > endef
> > endif
> > -
> > -ifeq ($(BR2_TARGET_ENABLE_ROOT_LOGIN),y)
> > -ifeq ($(SKELETON_TARGET_GENERIC_ROOT_PASSWD),)
> > -SKELETON_ROOT_PASSWORD =
> > -else ifneq ($(filter $$1$$% $$5$$% $$6$$%,$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)),)
> > -SKELETON_ROOT_PASSWORD = '$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)'
> > -else
> > -SKELETON_DEPENDENCIES += host-mkpasswd
> > -# This variable will only be evaluated in the finalize stage, so we can
> > -# be sure that host-mkpasswd will have already been built by that time.
> > -SKELETON_ROOT_PASSWORD = "`$(MKPASSWD) -m "$(SKELETON_TARGET_GENERIC_PASSWD_METHOD)" "$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)"`"
> > -endif
> > -else # !BR2_TARGET_ENABLE_ROOT_LOGIN
> > -SKELETON_ROOT_PASSWORD = "*"
> > -endif
> >
>
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 19/24 v2] system: split skeleton
2016-06-22 19:07 [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton) Yann E. MORIN
` (17 preceding siblings ...)
2016-06-22 19:07 ` [Buildroot] [PATCH 18/24 v2] package/skeleton-sysv: split into skeleton-common Yann E. MORIN
@ 2016-06-22 19:07 ` Yann E. MORIN
2016-07-03 11:22 ` Romain Naour
2016-06-22 19:07 ` [Buildroot] [PATCH 20/24 v2] package/skeleton-systemd: new package Yann E. MORIN
` (5 subsequent siblings)
24 siblings, 1 reply; 73+ messages in thread
From: Yann E. MORIN @ 2016-06-22 19:07 UTC (permalink / raw)
To: buildroot
Move the sysv-related parts to separate skeletons.
The network-related parts of the skeleton will also be useable by the
systemd skeleton (but only when systemd-networkd is not enabled), so we
also split that out into its own skeleton.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
package/skeleton-sysv/skeleton-sysv.mk | 7 +++++++
.../network/if-up.d => skeleton-net/etc/network/if-down.d}/.empty | 0
.../{skeleton => skeleton-net}/etc/network/if-post-down.d/.empty | 0
.../{skeleton => skeleton-net}/etc/network/if-pre-up.d/wait_iface | 0
.../network/if-down.d => skeleton-net/etc/network/if-up.d}/.empty | 0
system/{skeleton => skeleton-sysv}/dev/log | 0
system/{skeleton/dev/shm => skeleton-sysv/dev/pts}/.empty | 0
system/{skeleton/dev/pts => skeleton-sysv/dev/shm}/.empty | 0
system/{skeleton => skeleton-sysv}/etc/fstab | 0
system/{skeleton => skeleton-sysv}/etc/resolv.conf | 0
system/{skeleton => skeleton-sysv}/var/cache | 0
system/{skeleton => skeleton-sysv}/var/lib/misc | 0
system/{skeleton => skeleton-sysv}/var/lock | 0
system/{skeleton => skeleton-sysv}/var/log | 0
system/{skeleton => skeleton-sysv}/var/run | 0
system/{skeleton => skeleton-sysv}/var/spool | 0
system/{skeleton => skeleton-sysv}/var/tmp | 0
system/skeleton/dev/.empty | 0
18 files changed, 7 insertions(+)
rename system/{skeleton/etc/network/if-up.d => skeleton-net/etc/network/if-down.d}/.empty (100%)
rename system/{skeleton => skeleton-net}/etc/network/if-post-down.d/.empty (100%)
rename system/{skeleton => skeleton-net}/etc/network/if-pre-up.d/wait_iface (100%)
rename system/{skeleton/etc/network/if-down.d => skeleton-net/etc/network/if-up.d}/.empty (100%)
rename system/{skeleton => skeleton-sysv}/dev/log (100%)
rename system/{skeleton/dev/shm => skeleton-sysv/dev/pts}/.empty (100%)
rename system/{skeleton/dev/pts => skeleton-sysv/dev/shm}/.empty (100%)
rename system/{skeleton => skeleton-sysv}/etc/fstab (100%)
rename system/{skeleton => skeleton-sysv}/etc/resolv.conf (100%)
rename system/{skeleton => skeleton-sysv}/var/cache (100%)
rename system/{skeleton => skeleton-sysv}/var/lib/misc (100%)
rename system/{skeleton => skeleton-sysv}/var/lock (100%)
rename system/{skeleton => skeleton-sysv}/var/log (100%)
rename system/{skeleton => skeleton-sysv}/var/run (100%)
rename system/{skeleton => skeleton-sysv}/var/spool (100%)
rename system/{skeleton => skeleton-sysv}/var/tmp (100%)
create mode 100644 system/skeleton/dev/.empty
diff --git a/package/skeleton-sysv/skeleton-sysv.mk b/package/skeleton-sysv/skeleton-sysv.mk
index 6e15b15..ee9e670 100644
--- a/package/skeleton-sysv/skeleton-sysv.mk
+++ b/package/skeleton-sysv/skeleton-sysv.mk
@@ -29,6 +29,13 @@ SKELETON_SYSV_INSTALL_STAGING = YES
# - SKELETON_SET_NETWORK_IFUPDOWN_LOOPBACK
# - SKELETON_SET_NETWORK_IFUPDOWN_DHCP
+# Even without a configured DHCP interface, we still need the network part
+# of the skeleton, because it is used to configure the loopback interface.
+define SKELETON_SYSV_INSTALL_TARGET_CMDS
+ $(call SKELETON_RSYNC,system/skeleton-sysv,$(TARGET_DIR))
+ $(call SKELETON_RSYNC,system/skeleton-net,$(TARGET_DIR))
+endef
+
define SKELETON_SYSV_SET_NETWORK
mkdir -p $(TARGET_DIR)/etc/network/
$(SKELETON_SET_NETWORK_IFUPDOWN_LOOPBACK)
diff --git a/system/skeleton/etc/network/if-up.d/.empty b/system/skeleton-net/etc/network/if-down.d/.empty
similarity index 100%
rename from system/skeleton/etc/network/if-up.d/.empty
rename to system/skeleton-net/etc/network/if-down.d/.empty
diff --git a/system/skeleton/etc/network/if-post-down.d/.empty b/system/skeleton-net/etc/network/if-post-down.d/.empty
similarity index 100%
rename from system/skeleton/etc/network/if-post-down.d/.empty
rename to system/skeleton-net/etc/network/if-post-down.d/.empty
diff --git a/system/skeleton/etc/network/if-pre-up.d/wait_iface b/system/skeleton-net/etc/network/if-pre-up.d/wait_iface
similarity index 100%
rename from system/skeleton/etc/network/if-pre-up.d/wait_iface
rename to system/skeleton-net/etc/network/if-pre-up.d/wait_iface
diff --git a/system/skeleton/etc/network/if-down.d/.empty b/system/skeleton-net/etc/network/if-up.d/.empty
similarity index 100%
rename from system/skeleton/etc/network/if-down.d/.empty
rename to system/skeleton-net/etc/network/if-up.d/.empty
diff --git a/system/skeleton/dev/log b/system/skeleton-sysv/dev/log
similarity index 100%
rename from system/skeleton/dev/log
rename to system/skeleton-sysv/dev/log
diff --git a/system/skeleton/dev/shm/.empty b/system/skeleton-sysv/dev/pts/.empty
similarity index 100%
rename from system/skeleton/dev/shm/.empty
rename to system/skeleton-sysv/dev/pts/.empty
diff --git a/system/skeleton/dev/pts/.empty b/system/skeleton-sysv/dev/shm/.empty
similarity index 100%
rename from system/skeleton/dev/pts/.empty
rename to system/skeleton-sysv/dev/shm/.empty
diff --git a/system/skeleton/etc/fstab b/system/skeleton-sysv/etc/fstab
similarity index 100%
rename from system/skeleton/etc/fstab
rename to system/skeleton-sysv/etc/fstab
diff --git a/system/skeleton/etc/resolv.conf b/system/skeleton-sysv/etc/resolv.conf
similarity index 100%
rename from system/skeleton/etc/resolv.conf
rename to system/skeleton-sysv/etc/resolv.conf
diff --git a/system/skeleton/var/cache b/system/skeleton-sysv/var/cache
similarity index 100%
rename from system/skeleton/var/cache
rename to system/skeleton-sysv/var/cache
diff --git a/system/skeleton/var/lib/misc b/system/skeleton-sysv/var/lib/misc
similarity index 100%
rename from system/skeleton/var/lib/misc
rename to system/skeleton-sysv/var/lib/misc
diff --git a/system/skeleton/var/lock b/system/skeleton-sysv/var/lock
similarity index 100%
rename from system/skeleton/var/lock
rename to system/skeleton-sysv/var/lock
diff --git a/system/skeleton/var/log b/system/skeleton-sysv/var/log
similarity index 100%
rename from system/skeleton/var/log
rename to system/skeleton-sysv/var/log
diff --git a/system/skeleton/var/run b/system/skeleton-sysv/var/run
similarity index 100%
rename from system/skeleton/var/run
rename to system/skeleton-sysv/var/run
diff --git a/system/skeleton/var/spool b/system/skeleton-sysv/var/spool
similarity index 100%
rename from system/skeleton/var/spool
rename to system/skeleton-sysv/var/spool
diff --git a/system/skeleton/var/tmp b/system/skeleton-sysv/var/tmp
similarity index 100%
rename from system/skeleton/var/tmp
rename to system/skeleton-sysv/var/tmp
diff --git a/system/skeleton/dev/.empty b/system/skeleton/dev/.empty
new file mode 100644
index 0000000..e69de29
--
2.7.4
^ permalink raw reply related [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 19/24 v2] system: split skeleton
2016-06-22 19:07 ` [Buildroot] [PATCH 19/24 v2] system: split skeleton Yann E. MORIN
@ 2016-07-03 11:22 ` Romain Naour
0 siblings, 0 replies; 73+ messages in thread
From: Romain Naour @ 2016-07-03 11:22 UTC (permalink / raw)
To: buildroot
Hi Yann,
Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> Move the sysv-related parts to separate skeletons.
>
> The network-related parts of the skeleton will also be useable by the
> systemd skeleton (but only when systemd-networkd is not enabled), so we
> also split that out into its own skeleton.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Best regards,
Romain
> ---
> package/skeleton-sysv/skeleton-sysv.mk | 7 +++++++
> .../network/if-up.d => skeleton-net/etc/network/if-down.d}/.empty | 0
> .../{skeleton => skeleton-net}/etc/network/if-post-down.d/.empty | 0
> .../{skeleton => skeleton-net}/etc/network/if-pre-up.d/wait_iface | 0
> .../network/if-down.d => skeleton-net/etc/network/if-up.d}/.empty | 0
> system/{skeleton => skeleton-sysv}/dev/log | 0
> system/{skeleton/dev/shm => skeleton-sysv/dev/pts}/.empty | 0
> system/{skeleton/dev/pts => skeleton-sysv/dev/shm}/.empty | 0
> system/{skeleton => skeleton-sysv}/etc/fstab | 0
> system/{skeleton => skeleton-sysv}/etc/resolv.conf | 0
> system/{skeleton => skeleton-sysv}/var/cache | 0
> system/{skeleton => skeleton-sysv}/var/lib/misc | 0
> system/{skeleton => skeleton-sysv}/var/lock | 0
> system/{skeleton => skeleton-sysv}/var/log | 0
> system/{skeleton => skeleton-sysv}/var/run | 0
> system/{skeleton => skeleton-sysv}/var/spool | 0
> system/{skeleton => skeleton-sysv}/var/tmp | 0
> system/skeleton/dev/.empty | 0
> 18 files changed, 7 insertions(+)
> rename system/{skeleton/etc/network/if-up.d => skeleton-net/etc/network/if-down.d}/.empty (100%)
> rename system/{skeleton => skeleton-net}/etc/network/if-post-down.d/.empty (100%)
> rename system/{skeleton => skeleton-net}/etc/network/if-pre-up.d/wait_iface (100%)
> rename system/{skeleton/etc/network/if-down.d => skeleton-net/etc/network/if-up.d}/.empty (100%)
> rename system/{skeleton => skeleton-sysv}/dev/log (100%)
> rename system/{skeleton/dev/shm => skeleton-sysv/dev/pts}/.empty (100%)
> rename system/{skeleton/dev/pts => skeleton-sysv/dev/shm}/.empty (100%)
> rename system/{skeleton => skeleton-sysv}/etc/fstab (100%)
> rename system/{skeleton => skeleton-sysv}/etc/resolv.conf (100%)
> rename system/{skeleton => skeleton-sysv}/var/cache (100%)
> rename system/{skeleton => skeleton-sysv}/var/lib/misc (100%)
> rename system/{skeleton => skeleton-sysv}/var/lock (100%)
> rename system/{skeleton => skeleton-sysv}/var/log (100%)
> rename system/{skeleton => skeleton-sysv}/var/run (100%)
> rename system/{skeleton => skeleton-sysv}/var/spool (100%)
> rename system/{skeleton => skeleton-sysv}/var/tmp (100%)
> create mode 100644 system/skeleton/dev/.empty
>
> diff --git a/package/skeleton-sysv/skeleton-sysv.mk b/package/skeleton-sysv/skeleton-sysv.mk
> index 6e15b15..ee9e670 100644
> --- a/package/skeleton-sysv/skeleton-sysv.mk
> +++ b/package/skeleton-sysv/skeleton-sysv.mk
> @@ -29,6 +29,13 @@ SKELETON_SYSV_INSTALL_STAGING = YES
> # - SKELETON_SET_NETWORK_IFUPDOWN_LOOPBACK
> # - SKELETON_SET_NETWORK_IFUPDOWN_DHCP
>
> +# Even without a configured DHCP interface, we still need the network part
> +# of the skeleton, because it is used to configure the loopback interface.
> +define SKELETON_SYSV_INSTALL_TARGET_CMDS
> + $(call SKELETON_RSYNC,system/skeleton-sysv,$(TARGET_DIR))
> + $(call SKELETON_RSYNC,system/skeleton-net,$(TARGET_DIR))
> +endef
> +
> define SKELETON_SYSV_SET_NETWORK
> mkdir -p $(TARGET_DIR)/etc/network/
> $(SKELETON_SET_NETWORK_IFUPDOWN_LOOPBACK)
> diff --git a/system/skeleton/etc/network/if-up.d/.empty b/system/skeleton-net/etc/network/if-down.d/.empty
> similarity index 100%
> rename from system/skeleton/etc/network/if-up.d/.empty
> rename to system/skeleton-net/etc/network/if-down.d/.empty
> diff --git a/system/skeleton/etc/network/if-post-down.d/.empty b/system/skeleton-net/etc/network/if-post-down.d/.empty
> similarity index 100%
> rename from system/skeleton/etc/network/if-post-down.d/.empty
> rename to system/skeleton-net/etc/network/if-post-down.d/.empty
> diff --git a/system/skeleton/etc/network/if-pre-up.d/wait_iface b/system/skeleton-net/etc/network/if-pre-up.d/wait_iface
> similarity index 100%
> rename from system/skeleton/etc/network/if-pre-up.d/wait_iface
> rename to system/skeleton-net/etc/network/if-pre-up.d/wait_iface
> diff --git a/system/skeleton/etc/network/if-down.d/.empty b/system/skeleton-net/etc/network/if-up.d/.empty
> similarity index 100%
> rename from system/skeleton/etc/network/if-down.d/.empty
> rename to system/skeleton-net/etc/network/if-up.d/.empty
> diff --git a/system/skeleton/dev/log b/system/skeleton-sysv/dev/log
> similarity index 100%
> rename from system/skeleton/dev/log
> rename to system/skeleton-sysv/dev/log
> diff --git a/system/skeleton/dev/shm/.empty b/system/skeleton-sysv/dev/pts/.empty
> similarity index 100%
> rename from system/skeleton/dev/shm/.empty
> rename to system/skeleton-sysv/dev/pts/.empty
> diff --git a/system/skeleton/dev/pts/.empty b/system/skeleton-sysv/dev/shm/.empty
> similarity index 100%
> rename from system/skeleton/dev/pts/.empty
> rename to system/skeleton-sysv/dev/shm/.empty
> diff --git a/system/skeleton/etc/fstab b/system/skeleton-sysv/etc/fstab
> similarity index 100%
> rename from system/skeleton/etc/fstab
> rename to system/skeleton-sysv/etc/fstab
> diff --git a/system/skeleton/etc/resolv.conf b/system/skeleton-sysv/etc/resolv.conf
> similarity index 100%
> rename from system/skeleton/etc/resolv.conf
> rename to system/skeleton-sysv/etc/resolv.conf
> diff --git a/system/skeleton/var/cache b/system/skeleton-sysv/var/cache
> similarity index 100%
> rename from system/skeleton/var/cache
> rename to system/skeleton-sysv/var/cache
> diff --git a/system/skeleton/var/lib/misc b/system/skeleton-sysv/var/lib/misc
> similarity index 100%
> rename from system/skeleton/var/lib/misc
> rename to system/skeleton-sysv/var/lib/misc
> diff --git a/system/skeleton/var/lock b/system/skeleton-sysv/var/lock
> similarity index 100%
> rename from system/skeleton/var/lock
> rename to system/skeleton-sysv/var/lock
> diff --git a/system/skeleton/var/log b/system/skeleton-sysv/var/log
> similarity index 100%
> rename from system/skeleton/var/log
> rename to system/skeleton-sysv/var/log
> diff --git a/system/skeleton/var/run b/system/skeleton-sysv/var/run
> similarity index 100%
> rename from system/skeleton/var/run
> rename to system/skeleton-sysv/var/run
> diff --git a/system/skeleton/var/spool b/system/skeleton-sysv/var/spool
> similarity index 100%
> rename from system/skeleton/var/spool
> rename to system/skeleton-sysv/var/spool
> diff --git a/system/skeleton/var/tmp b/system/skeleton-sysv/var/tmp
> similarity index 100%
> rename from system/skeleton/var/tmp
> rename to system/skeleton-sysv/var/tmp
> diff --git a/system/skeleton/dev/.empty b/system/skeleton/dev/.empty
> new file mode 100644
> index 0000000..e69de29
>
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 20/24 v2] package/skeleton-systemd: new package
2016-06-22 19:07 [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton) Yann E. MORIN
` (18 preceding siblings ...)
2016-06-22 19:07 ` [Buildroot] [PATCH 19/24 v2] system: split skeleton Yann E. MORIN
@ 2016-06-22 19:07 ` Yann E. MORIN
2016-07-03 11:34 ` Romain Naour
2016-06-22 19:07 ` [Buildroot] [PATCH 21/24 v2] system/systemd: needs timezone Yann E. MORIN
` (4 subsequent siblings)
24 siblings, 1 reply; 73+ messages in thread
From: Yann E. MORIN @ 2016-06-22 19:07 UTC (permalink / raw)
To: buildroot
Given the very few things to create in the skeleton, there is no real
need in having a pre-populated skeleton that we rsync. We can very well
just create the directory structure with simple mkdir commands.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
package/Config.in | 1 +
package/skeleton-systemd/Config.in | 7 +++++
package/skeleton-systemd/skeleton-systemd.mk | 43 ++++++++++++++++++++++++++++
system/Config.in | 3 +-
4 files changed, 53 insertions(+), 1 deletion(-)
create mode 100644 package/skeleton-systemd/Config.in
create mode 100644 package/skeleton-systemd/skeleton-systemd.mk
diff --git a/package/Config.in b/package/Config.in
index 9db6332..17356fe 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -4,6 +4,7 @@ menu "Target packages"
source "package/skeleton/Config.in"
source "package/skeleton-common/Config.in"
source "package/skeleton-custom/Config.in"
+ source "package/skeleton-systemd/Config.in"
source "package/skeleton-sysv/Config.in"
menu "Audio and video applications"
diff --git a/package/skeleton-systemd/Config.in b/package/skeleton-systemd/Config.in
new file mode 100644
index 0000000..c507264
--- /dev/null
+++ b/package/skeleton-systemd/Config.in
@@ -0,0 +1,7 @@
+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
new file mode 100644
index 0000000..e781ce9
--- /dev/null
+++ b/package/skeleton-systemd/skeleton-systemd.mk
@@ -0,0 +1,43 @@
+################################################################################
+#
+# skeleton-systemd
+#
+################################################################################
+
+SKELETON_SYSTEMD_SOURCE =
+
+SKELETON_SYSTEMD_PROVIDES = skeleton
+
+SKELETON_SYSTEMD_DEPENDENCIES = skeleton-common
+
+SKELETON_SYSTEMD_ADD_TOOLCHAIN_DEPENDENCY = NO
+SKELETON_SYSTEMD_ADD_SKELETON_DEPENDENCY = NO
+
+# In case we're not using systemd-networkd, use the sysv-like network infra;
+# otherwise, the necessary bits are installed by the systemd package.
+ifeq ($(BR2_PACKAGE_SYSTEMD_NETWORKD),)
+
+define SKELETON_SYSTEMD_RSYNC_NETWORK
+ $(call SKELETON_RSYNC,system/skeleton-net,$(TARGET_DIR))
+endef
+
+define SKELETON_SYSTEMD_SET_NETWORK
+ ln -fs ../tmp/resolv.conf $(TARGET_DIR)/etc/resolv.conf
+ mkdir -p $(TARGET_DIR)/etc/network/
+ $(SKELETON_SET_NETWORK_IFUPDOWN_LOOPBACK)
+ $(SKELETON_SET_NETWORK_IFUPDOWN_DHCP)
+endef
+SKELETON_SYSTEMD_TARGET_FINALIZE_HOOKS += SKELETON_SYSTEMD_SET_NETWORK
+
+endif # BR2_PACKAGE_SYSTEMD_NETWORKD not set
+
+define SKELETON_SYSTEMD_INSTALL_TARGET_CMDS
+ mkdir -p $(TARGET_DIR)/etc
+ 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
+ $(SKELETON_SYSTEMD_RSYNC_NETWORK)
+endef
+
+$(eval $(generic-package))
diff --git a/system/Config.in b/system/Config.in
index 3792be2..17ce832 100644
--- a/system/Config.in
+++ b/system/Config.in
@@ -5,7 +5,8 @@ choice
config BR2_ROOTFS_SKELETON_DEFAULT
bool "default target skeleton"
- select BR2_PACKAGE_SKELETON_SYSV
+ select BR2_PACKAGE_SKELETON_SYSV if !BR2_INIT_SYSTEMD
+ select BR2_PACKAGE_SKELETON_SYSTEMD if BR2_INIT_SYSTEMD
help
Use default target skeleton
--
2.7.4
^ permalink raw reply related [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 20/24 v2] package/skeleton-systemd: new package
2016-06-22 19:07 ` [Buildroot] [PATCH 20/24 v2] package/skeleton-systemd: new package Yann E. MORIN
@ 2016-07-03 11:34 ` Romain Naour
0 siblings, 0 replies; 73+ messages in thread
From: Romain Naour @ 2016-07-03 11:34 UTC (permalink / raw)
To: buildroot
Hi Yann,
Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> Given the very few things to create in the skeleton, there is no real
> need in having a pre-populated skeleton that we rsync. We can very well
> just create the directory structure with simple mkdir commands.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Best regards,
Romain
> ---
> package/Config.in | 1 +
> package/skeleton-systemd/Config.in | 7 +++++
> package/skeleton-systemd/skeleton-systemd.mk | 43 ++++++++++++++++++++++++++++
> system/Config.in | 3 +-
> 4 files changed, 53 insertions(+), 1 deletion(-)
> create mode 100644 package/skeleton-systemd/Config.in
> create mode 100644 package/skeleton-systemd/skeleton-systemd.mk
>
> diff --git a/package/Config.in b/package/Config.in
> index 9db6332..17356fe 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -4,6 +4,7 @@ menu "Target packages"
> source "package/skeleton/Config.in"
> source "package/skeleton-common/Config.in"
> source "package/skeleton-custom/Config.in"
> + source "package/skeleton-systemd/Config.in"
> source "package/skeleton-sysv/Config.in"
>
> menu "Audio and video applications"
> diff --git a/package/skeleton-systemd/Config.in b/package/skeleton-systemd/Config.in
> new file mode 100644
> index 0000000..c507264
> --- /dev/null
> +++ b/package/skeleton-systemd/Config.in
> @@ -0,0 +1,7 @@
> +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
> new file mode 100644
> index 0000000..e781ce9
> --- /dev/null
> +++ b/package/skeleton-systemd/skeleton-systemd.mk
> @@ -0,0 +1,43 @@
> +################################################################################
> +#
> +# skeleton-systemd
> +#
> +################################################################################
> +
> +SKELETON_SYSTEMD_SOURCE =
> +
> +SKELETON_SYSTEMD_PROVIDES = skeleton
> +
> +SKELETON_SYSTEMD_DEPENDENCIES = skeleton-common
> +
> +SKELETON_SYSTEMD_ADD_TOOLCHAIN_DEPENDENCY = NO
> +SKELETON_SYSTEMD_ADD_SKELETON_DEPENDENCY = NO
> +
> +# In case we're not using systemd-networkd, use the sysv-like network infra;
> +# otherwise, the necessary bits are installed by the systemd package.
> +ifeq ($(BR2_PACKAGE_SYSTEMD_NETWORKD),)
> +
> +define SKELETON_SYSTEMD_RSYNC_NETWORK
> + $(call SKELETON_RSYNC,system/skeleton-net,$(TARGET_DIR))
> +endef
> +
> +define SKELETON_SYSTEMD_SET_NETWORK
> + ln -fs ../tmp/resolv.conf $(TARGET_DIR)/etc/resolv.conf
> + mkdir -p $(TARGET_DIR)/etc/network/
> + $(SKELETON_SET_NETWORK_IFUPDOWN_LOOPBACK)
> + $(SKELETON_SET_NETWORK_IFUPDOWN_DHCP)
> +endef
> +SKELETON_SYSTEMD_TARGET_FINALIZE_HOOKS += SKELETON_SYSTEMD_SET_NETWORK
> +
> +endif # BR2_PACKAGE_SYSTEMD_NETWORKD not set
> +
> +define SKELETON_SYSTEMD_INSTALL_TARGET_CMDS
> + mkdir -p $(TARGET_DIR)/etc
> + 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
> + $(SKELETON_SYSTEMD_RSYNC_NETWORK)
> +endef
> +
> +$(eval $(generic-package))
> diff --git a/system/Config.in b/system/Config.in
> index 3792be2..17ce832 100644
> --- a/system/Config.in
> +++ b/system/Config.in
> @@ -5,7 +5,8 @@ choice
>
> config BR2_ROOTFS_SKELETON_DEFAULT
> bool "default target skeleton"
> - select BR2_PACKAGE_SKELETON_SYSV
> + select BR2_PACKAGE_SKELETON_SYSV if !BR2_INIT_SYSTEMD
> + select BR2_PACKAGE_SKELETON_SYSTEMD if BR2_INIT_SYSTEMD
> help
> Use default target skeleton
>
>
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 21/24 v2] system/systemd: needs timezone
2016-06-22 19:07 [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton) Yann E. MORIN
` (19 preceding siblings ...)
2016-06-22 19:07 ` [Buildroot] [PATCH 20/24 v2] package/skeleton-systemd: new package Yann E. MORIN
@ 2016-06-22 19:07 ` Yann E. MORIN
2016-07-03 11:41 ` Romain Naour
2016-06-22 19:07 ` [Buildroot] [PATCH 22/24 v2] fs: add pre- and post-command hooks Yann E. MORIN
` (3 subsequent siblings)
24 siblings, 1 reply; 73+ messages in thread
From: Yann E. MORIN @ 2016-06-22 19:07 UTC (permalink / raw)
To: buildroot
systemd does not like being booted without any timezone info (especially
on a R/O filesystem), so we forcibly enable that. If there is no default
timezone set, we fallback to UTC (which is basically what no TZ means
anyway).
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
package/skeleton-systemd/skeleton-systemd.mk | 7 +++++++
system/Config.in | 1 +
2 files changed, 8 insertions(+)
diff --git a/package/skeleton-systemd/skeleton-systemd.mk b/package/skeleton-systemd/skeleton-systemd.mk
index e781ce9..b45bbde 100644
--- a/package/skeleton-systemd/skeleton-systemd.mk
+++ b/package/skeleton-systemd/skeleton-systemd.mk
@@ -31,12 +31,19 @@ SKELETON_SYSTEMD_TARGET_FINALIZE_HOOKS += SKELETON_SYSTEMD_SET_NETWORK
endif # BR2_PACKAGE_SYSTEMD_NETWORKD not set
+SKELETON_SYSTEM_LOCALTIME = $(call qstrip,$(BR2_TARGET_LOCALTIME))
+ifeq ($(SKELETON_SYSTEM_LOCALTIME),)
+SKELETON_SYSTEM_LOCALTIME = Etc/UTC
+endif
+
define SKELETON_SYSTEMD_INSTALL_TARGET_CMDS
mkdir -p $(TARGET_DIR)/etc
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
+ ln -sf ../usr/share/zoneinfo/$(SKELETON_SYSTEMD_LOCALTIME) \
+ $(TARGET_DIR)/etc/localtime
$(SKELETON_SYSTEMD_RSYNC_NETWORK)
endef
diff --git a/system/Config.in b/system/Config.in
index 17ce832..07af2e0 100644
--- a/system/Config.in
+++ b/system/Config.in
@@ -130,6 +130,7 @@ config BR2_INIT_SYSTEMD
select BR2_ROOTFS_MERGED_USR
select BR2_PACKAGE_SYSTEMD
select BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW
+ select BR2_TARGET_TZ_INFO
comment "systemd needs (e)glibc toolchain, headers >= 3.10"
depends on !(BR2_TOOLCHAIN_USES_GLIBC \
--
2.7.4
^ permalink raw reply related [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 21/24 v2] system/systemd: needs timezone
2016-06-22 19:07 ` [Buildroot] [PATCH 21/24 v2] system/systemd: needs timezone Yann E. MORIN
@ 2016-07-03 11:41 ` Romain Naour
2016-07-05 8:03 ` Yann E. MORIN
0 siblings, 1 reply; 73+ messages in thread
From: Romain Naour @ 2016-07-03 11:41 UTC (permalink / raw)
To: buildroot
Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> systemd does not like being booted without any timezone info (especially
> on a R/O filesystem), so we forcibly enable that. If there is no default
> timezone set, we fallback to UTC (which is basically what no TZ means
> anyway).
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> ---
> package/skeleton-systemd/skeleton-systemd.mk | 7 +++++++
> system/Config.in | 1 +
> 2 files changed, 8 insertions(+)
>
> diff --git a/package/skeleton-systemd/skeleton-systemd.mk b/package/skeleton-systemd/skeleton-systemd.mk
> index e781ce9..b45bbde 100644
> --- a/package/skeleton-systemd/skeleton-systemd.mk
> +++ b/package/skeleton-systemd/skeleton-systemd.mk
> @@ -31,12 +31,19 @@ SKELETON_SYSTEMD_TARGET_FINALIZE_HOOKS += SKELETON_SYSTEMD_SET_NETWORK
>
> endif # BR2_PACKAGE_SYSTEMD_NETWORKD not set
>
> +SKELETON_SYSTEM_LOCALTIME = $(call qstrip,$(BR2_TARGET_LOCALTIME))
^
> +ifeq ($(SKELETON_SYSTEM_LOCALTIME),)
^
> +SKELETON_SYSTEM_LOCALTIME = Etc/UTC
^
> +endif
> +
s/SKELETON_SYSTEM_LOCALTIME/SKELETON_SYSTEMD_LOCALTIME/
> define SKELETON_SYSTEMD_INSTALL_TARGET_CMDS
> mkdir -p $(TARGET_DIR)/etc
> 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
> + ln -sf ../usr/share/zoneinfo/$(SKELETON_SYSTEMD_LOCALTIME) \
This one is ok :)
Best regards,
Romain
> + $(TARGET_DIR)/etc/localtime
> $(SKELETON_SYSTEMD_RSYNC_NETWORK)
> endef
>
> diff --git a/system/Config.in b/system/Config.in
> index 17ce832..07af2e0 100644
> --- a/system/Config.in
> +++ b/system/Config.in
> @@ -130,6 +130,7 @@ config BR2_INIT_SYSTEMD
> select BR2_ROOTFS_MERGED_USR
> select BR2_PACKAGE_SYSTEMD
> select BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW
> + select BR2_TARGET_TZ_INFO
>
> comment "systemd needs (e)glibc toolchain, headers >= 3.10"
> depends on !(BR2_TOOLCHAIN_USES_GLIBC \
>
^ permalink raw reply [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 21/24 v2] system/systemd: needs timezone
2016-07-03 11:41 ` Romain Naour
@ 2016-07-05 8:03 ` Yann E. MORIN
0 siblings, 0 replies; 73+ messages in thread
From: Yann E. MORIN @ 2016-07-05 8:03 UTC (permalink / raw)
To: buildroot
Romain, All,
On 2016-07-03 13:41 +0200, Romain Naour spake thusly:
> Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> > systemd does not like being booted without any timezone info (especially
> > on a R/O filesystem), so we forcibly enable that. If there is no default
> > timezone set, we fallback to UTC (which is basically what no TZ means
> > anyway).
> >
> > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> > ---
> > package/skeleton-systemd/skeleton-systemd.mk | 7 +++++++
> > system/Config.in | 1 +
> > 2 files changed, 8 insertions(+)
> >
> > diff --git a/package/skeleton-systemd/skeleton-systemd.mk b/package/skeleton-systemd/skeleton-systemd.mk
> > index e781ce9..b45bbde 100644
> > --- a/package/skeleton-systemd/skeleton-systemd.mk
> > +++ b/package/skeleton-systemd/skeleton-systemd.mk
> > @@ -31,12 +31,19 @@ SKELETON_SYSTEMD_TARGET_FINALIZE_HOOKS += SKELETON_SYSTEMD_SET_NETWORK
> >
> > endif # BR2_PACKAGE_SYSTEMD_NETWORKD not set
> >
> > +SKELETON_SYSTEM_LOCALTIME = $(call qstrip,$(BR2_TARGET_LOCALTIME))
> ^
> > +ifeq ($(SKELETON_SYSTEM_LOCALTIME),)
> ^
> > +SKELETON_SYSTEM_LOCALTIME = Etc/UTC
> ^
> > +endif
> > +
>
> s/SKELETON_SYSTEM_LOCALTIME/SKELETON_SYSTEMD_LOCALTIME/
Fixed.
Regards,
Yann E. MORIN.
> > define SKELETON_SYSTEMD_INSTALL_TARGET_CMDS
> > mkdir -p $(TARGET_DIR)/etc
> > 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
> > + ln -sf ../usr/share/zoneinfo/$(SKELETON_SYSTEMD_LOCALTIME) \
>
> This one is ok :)
>
> Best regards,
> Romain
>
>
> > + $(TARGET_DIR)/etc/localtime
> > $(SKELETON_SYSTEMD_RSYNC_NETWORK)
> > endef
> >
> > diff --git a/system/Config.in b/system/Config.in
> > index 17ce832..07af2e0 100644
> > --- a/system/Config.in
> > +++ b/system/Config.in
> > @@ -130,6 +130,7 @@ config BR2_INIT_SYSTEMD
> > select BR2_ROOTFS_MERGED_USR
> > select BR2_PACKAGE_SYSTEMD
> > select BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW
> > + select BR2_TARGET_TZ_INFO
> >
> > comment "systemd needs (e)glibc toolchain, headers >= 3.10"
> > depends on !(BR2_TOOLCHAIN_USES_GLIBC \
> >
>
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 22/24 v2] fs: add pre- and post-command hooks
2016-06-22 19:07 [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton) Yann E. MORIN
` (20 preceding siblings ...)
2016-06-22 19:07 ` [Buildroot] [PATCH 21/24 v2] system/systemd: needs timezone Yann E. MORIN
@ 2016-06-22 19:07 ` Yann E. MORIN
2016-07-03 11:49 ` Romain Naour
2016-06-22 19:07 ` [Buildroot] [PATCH 23/24 v2] system: make systemd work on a read-only rootfs Yann E. MORIN
` (2 subsequent siblings)
24 siblings, 1 reply; 73+ messages in thread
From: Yann E. MORIN @ 2016-06-22 19:07 UTC (permalink / raw)
To: buildroot
In some cases, the directory structure we want in the filesystem is not
exactly what we have in target/
For example, when systemd is used on a read-only rootfs, /var must be a
tmpfs. However, we may have packages that install stuff in there, and
set important rights (via the permission-table). So, at build time, we
need /var to be a symlink to the remanent location (/usr/share/factory)
while at runtime we need /var to be a directory.
One option would have seen to be do have /var as a real directory even
during build time, and in a target-finalize hook, move everything out of
there and into the "factory" location. However, that's not possible
because it's too early: some packages may want to set ownership and/or
acces rights on directories or files in /var, and this is only done in
the fakeroot script, which is called only later during the assembling of
the filesystem images.
Also, there would have been no way to undo the tweak (i.e. we need to
restore the /var symlink so that subsequent builds continue to work) if
it were done as a target-finalize hook.
The only solution is to allow packages to register pre- and post-hooks
that are called right before and right after the rootfs commands are
executed.
Those hooks are not documented on-purpose; they are probably going to be
used only by systemd.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
fs/common.mk | 4 ++++
package/pkg-generic.mk | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/fs/common.mk b/fs/common.mk
index b7202c3..8feb172 100644
--- a/fs/common.mk
+++ b/fs/common.mk
@@ -92,7 +92,11 @@ endif
$$(call PRINTF,$$(PACKAGES_PERMISSIONS_TABLE)) >> $$(FULL_DEVICE_TABLE)
echo "$$(HOST_DIR)/usr/bin/makedevs -d $$(FULL_DEVICE_TABLE) $$(TARGET_DIR)" >> $$(FAKEROOT_SCRIPT)
endif
+ $$(foreach hook,$$(FS_INIT_PRE_CMD_HOOKS),\
+ $$(call PRINTF,$$($$(hook))) >>$$(FAKEROOT_SCRIPT))
$$(call PRINTF,$$(ROOTFS_$(2)_CMD)) >> $$(FAKEROOT_SCRIPT)
+ $$(foreach hook,$$(FS_INIT_POST_CMD_HOOKS),\
+ $$(call PRINTF,$$($$(hook))) >>$$(FAKEROOT_SCRIPT))
chmod a+x $$(FAKEROOT_SCRIPT)
PATH=$$(BR_PATH) $$(HOST_DIR)/usr/bin/fakeroot -- $$(FAKEROOT_SCRIPT)
$$(INSTALL) -m 0644 support/misc/target-dir-warning.txt $$(TARGET_DIR_WARNING_FILE)
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 4415342..2f80392 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -559,6 +559,8 @@ $(2)_POST_INSTALL_IMAGES_HOOKS ?=
$(2)_PRE_LEGAL_INFO_HOOKS ?=
$(2)_POST_LEGAL_INFO_HOOKS ?=
$(2)_TARGET_FINALIZE_HOOKS ?=
+$(2)_FS_PRE_CMD_HOOKS ?=
+$(2)_FS_POST_CMD_HOOKS ?=
# human-friendly targets and target sequencing
$(1): $(1)-install
@@ -860,6 +862,8 @@ ifneq ($$($(2)_USERS),)
PACKAGES_USERS += $$($(2)_USERS)$$(sep)
endif
TARGET_FINALIZE_HOOKS += $$($(2)_TARGET_FINALIZE_HOOKS)
+FS_INIT_PRE_CMD_HOOKS += $$($(2)_FS_PRE_CMD_HOOKS)
+FS_INIT_POST_CMD_HOOKS += $$($(2)_FS_POST_CMD_HOOKS)
ifeq ($$($(2)_SITE_METHOD),svn)
DL_TOOLS_DEPENDENCIES += svn
--
2.7.4
^ permalink raw reply related [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 22/24 v2] fs: add pre- and post-command hooks
2016-06-22 19:07 ` [Buildroot] [PATCH 22/24 v2] fs: add pre- and post-command hooks Yann E. MORIN
@ 2016-07-03 11:49 ` Romain Naour
0 siblings, 0 replies; 73+ messages in thread
From: Romain Naour @ 2016-07-03 11:49 UTC (permalink / raw)
To: buildroot
Hi Yann,
Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> In some cases, the directory structure we want in the filesystem is not
> exactly what we have in target/
>
> For example, when systemd is used on a read-only rootfs, /var must be a
> tmpfs. However, we may have packages that install stuff in there, and
> set important rights (via the permission-table). So, at build time, we
> need /var to be a symlink to the remanent location (/usr/share/factory)
> while at runtime we need /var to be a directory.
>
> One option would have seen to be do have /var as a real directory even
> during build time, and in a target-finalize hook, move everything out of
> there and into the "factory" location. However, that's not possible
> because it's too early: some packages may want to set ownership and/or
> acces rights on directories or files in /var, and this is only done in
> the fakeroot script, which is called only later during the assembling of
> the filesystem images.
>
> Also, there would have been no way to undo the tweak (i.e. we need to
> restore the /var symlink so that subsequent builds continue to work) if
> it were done as a target-finalize hook.
>
> The only solution is to allow packages to register pre- and post-hooks
> that are called right before and right after the rootfs commands are
> executed.
>
> Those hooks are not documented on-purpose; they are probably going to be
> used only by systemd.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> ---
> fs/common.mk | 4 ++++
> package/pkg-generic.mk | 4 ++++
> 2 files changed, 8 insertions(+)
>
> diff --git a/fs/common.mk b/fs/common.mk
> index b7202c3..8feb172 100644
> --- a/fs/common.mk
> +++ b/fs/common.mk
> @@ -92,7 +92,11 @@ endif
> $$(call PRINTF,$$(PACKAGES_PERMISSIONS_TABLE)) >> $$(FULL_DEVICE_TABLE)
> echo "$$(HOST_DIR)/usr/bin/makedevs -d $$(FULL_DEVICE_TABLE) $$(TARGET_DIR)" >> $$(FAKEROOT_SCRIPT)
> endif
> + $$(foreach hook,$$(FS_INIT_PRE_CMD_HOOKS),\
> + $$(call PRINTF,$$($$(hook))) >>$$(FAKEROOT_SCRIPT))
^
> $$(call PRINTF,$$(ROOTFS_$(2)_CMD)) >> $$(FAKEROOT_SCRIPT)
> + $$(foreach hook,$$(FS_INIT_POST_CMD_HOOKS),\
> + $$(call PRINTF,$$($$(hook))) >>$$(FAKEROOT_SCRIPT))
^
We need a space between >> and $$
With that fixed:
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Best regards,
Romain
> chmod a+x $$(FAKEROOT_SCRIPT)
> PATH=$$(BR_PATH) $$(HOST_DIR)/usr/bin/fakeroot -- $$(FAKEROOT_SCRIPT)
> $$(INSTALL) -m 0644 support/misc/target-dir-warning.txt $$(TARGET_DIR_WARNING_FILE)
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index 4415342..2f80392 100644
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -559,6 +559,8 @@ $(2)_POST_INSTALL_IMAGES_HOOKS ?=
> $(2)_PRE_LEGAL_INFO_HOOKS ?=
> $(2)_POST_LEGAL_INFO_HOOKS ?=
> $(2)_TARGET_FINALIZE_HOOKS ?=
> +$(2)_FS_PRE_CMD_HOOKS ?=
> +$(2)_FS_POST_CMD_HOOKS ?=
>
> # human-friendly targets and target sequencing
> $(1): $(1)-install
> @@ -860,6 +862,8 @@ ifneq ($$($(2)_USERS),)
> PACKAGES_USERS += $$($(2)_USERS)$$(sep)
> endif
> TARGET_FINALIZE_HOOKS += $$($(2)_TARGET_FINALIZE_HOOKS)
> +FS_INIT_PRE_CMD_HOOKS += $$($(2)_FS_PRE_CMD_HOOKS)
> +FS_INIT_POST_CMD_HOOKS += $$($(2)_FS_POST_CMD_HOOKS)
>
> ifeq ($$($(2)_SITE_METHOD),svn)
> DL_TOOLS_DEPENDENCIES += svn
>
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 23/24 v2] system: make systemd work on a read-only rootfs
2016-06-22 19:07 [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton) Yann E. MORIN
` (21 preceding siblings ...)
2016-06-22 19:07 ` [Buildroot] [PATCH 22/24 v2] fs: add pre- and post-command hooks Yann E. MORIN
@ 2016-06-22 19:07 ` Yann E. MORIN
2016-07-03 12:54 ` Romain Naour
2016-06-22 19:07 ` [Buildroot] [PATCH 24/24 v2] system: allow DHCP interface with systemd-networkd Yann E. MORIN
2016-07-06 21:49 ` [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton) Thomas Petazzoni
24 siblings, 1 reply; 73+ messages in thread
From: Yann E. MORIN @ 2016-06-22 19:07 UTC (permalink / raw)
To: buildroot
When the rootfs is readonly, systemd will expect /var to be writable.
Because we do not really have a R/W filesystem to mount on /var, we make
it a tmpfs, and use the systemd-tmpfiles feautre to populate it with
"factory" defaults.
We obtain those factory defaults by redirecting /var to that location at
build time, usign a symlink /var -> /usr/share/factory which is the
location in which systemd-tmpfiles will look for when instructed to
"recursively copy" a directory.
With a line like:
C /var/something - - - -
it will look for /usr/share/factory/something and copy it (recursively
if it is a directory) to /var/something, but only if it does not already
exist there.
We also mark this copy with the exclamation mark, as it is only safe to
copy on boot, not when changing targets.
To be noted: the real format for such lines are:
C /var/something - - - - /from/where/to/copy/something
But if the source is not given, then it is implicitly taken from
/usr/share/factory (which in our case is as-good a location as whatever
else, so we use it, and thus we need not specify the source of the
copy).
Note that we treat symlinks a little bit specially, by creating symlinks
to the factory defaults rather than copying them.
Finally, /var at build time is a symlink, but at runtime, it must be a
directory (so we can mount the tmpfs over there). We can't change that
as a target-finalize hook, because:
- some packages may want to set ownership and/or acces rights on files
or directoris in /var, and that only happens while assemblig the
filesystem images; changing /var from a symlink to a (then empty)
directory would break this;
- /var would be a directory on sub-sequent builds (until the next
"make clean").
Instead, we use the newly-introduce pre- and post-rootfs command hooks,
to turn /var into a directory before assembling the image, and back to a
symlink after assembling the image.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
Note: I haven't seen any symlinks installed in the factory so far, but I
haven't build a lot of packages yet... So, I'm not sure what to do with
the symlinks, especially when a package install relative symlinks...
---
package/skeleton-systemd/skeleton-systemd.mk | 51 ++++++++++++++++++++++++++--
system/Config.in | 1 -
2 files changed, 49 insertions(+), 3 deletions(-)
diff --git a/package/skeleton-systemd/skeleton-systemd.mk b/package/skeleton-systemd/skeleton-systemd.mk
index b45bbde..c7c2e26 100644
--- a/package/skeleton-systemd/skeleton-systemd.mk
+++ b/package/skeleton-systemd/skeleton-systemd.mk
@@ -36,12 +36,59 @@ ifeq ($(SKELETON_SYSTEM_LOCALTIME),)
SKELETON_SYSTEM_LOCALTIME = Etc/UTC
endif
+ifeq ($(BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW),y)
+
+define SKELETON_SYSTEMD_ROOT_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
+ mkdir -p $(TARGET_DIR)/etc/systemd/tmpfiles.d
+ mkdir -p $(TARGET_DIR)/usr/share/factory
+ ln -s usr/share/factory $(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_VAR_PRE_FS
+ rm -f $(TARGET_DIR)/var
+ mkdir $(TARGET_DIR)/var
+ for i in $(TARGET_DIR)/usr/share/factory/*; do \
+ j="$${i##*/}"; \
+ if [ -L "$${i}" ]; then \
+ printf "L+! /var/%s - - - - %s\n" \
+ "$${j}" "../usr/share/factory/$${j}" \
+ || exit 1; \
+ else \
+ printf "C! /var/%s - - - -\n" "$${j}" \
+ || exit 1; \
+ fi; \
+ done >$(TARGET_DIR)/etc/systemd/tmpfiles.d/var-factory.conf
+endef
+SKELETON_SYSTEMD_FS_PRE_CMD_HOOKS += SKELETON_SYSTEMD_VAR_PRE_FS
+
+define SKELETON_SYSTEMD_VAR_POST_FS
+ rm -rf $(TARGET_DIR)/var
+ ln -s usr/share/factory $(TARGET_DIR)/var
+endef
+SKELETON_SYSTEMD_FS_POST_CMD_HOOKS += SKELETON_SYSTEMD_VAR_POST_FS
+
+endif
+
define SKELETON_SYSTEMD_INSTALL_TARGET_CMDS
mkdir -p $(TARGET_DIR)/etc
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
+ $(SKELETON_SYSTEMD_ROOT_RO)
+ $(SKELETON_SYSTEMD_ROOT_RW)
ln -sf ../usr/share/zoneinfo/$(SKELETON_SYSTEMD_LOCALTIME) \
$(TARGET_DIR)/etc/localtime
$(SKELETON_SYSTEMD_RSYNC_NETWORK)
diff --git a/system/Config.in b/system/Config.in
index 07af2e0..32d6542 100644
--- a/system/Config.in
+++ b/system/Config.in
@@ -129,7 +129,6 @@ config BR2_INIT_SYSTEMD
depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
select BR2_ROOTFS_MERGED_USR
select BR2_PACKAGE_SYSTEMD
- select BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW
select BR2_TARGET_TZ_INFO
comment "systemd needs (e)glibc toolchain, headers >= 3.10"
--
2.7.4
^ permalink raw reply related [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 23/24 v2] system: make systemd work on a read-only rootfs
2016-06-22 19:07 ` [Buildroot] [PATCH 23/24 v2] system: make systemd work on a read-only rootfs Yann E. MORIN
@ 2016-07-03 12:54 ` Romain Naour
2016-07-05 8:12 ` Yann E. MORIN
0 siblings, 1 reply; 73+ messages in thread
From: Romain Naour @ 2016-07-03 12:54 UTC (permalink / raw)
To: buildroot
Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> When the rootfs is readonly, systemd will expect /var to be writable.
> Because we do not really have a R/W filesystem to mount on /var, we make
> it a tmpfs, and use the systemd-tmpfiles feautre to populate it with
^
s/feautre/feature/
> "factory" defaults.
>
> We obtain those factory defaults by redirecting /var to that location at
> build time, usign a symlink /var -> /usr/share/factory which is the
^
s/usign/using/
> location in which systemd-tmpfiles will look for when instructed to
> "recursively copy" a directory.
>
> With a line like:
>
> C /var/something - - - -
>
> it will look for /usr/share/factory/something and copy it (recursively
> if it is a directory) to /var/something, but only if it does not already
> exist there.
>
> We also mark this copy with the exclamation mark, as it is only safe to
> copy on boot, not when changing targets.
>
> To be noted: the real format for such lines are:
>
> C /var/something - - - - /from/where/to/copy/something
>
> But if the source is not given, then it is implicitly taken from
> /usr/share/factory (which in our case is as-good a location as whatever
> else, so we use it, and thus we need not specify the source of the
> copy).
>
> Note that we treat symlinks a little bit specially, by creating symlinks
> to the factory defaults rather than copying them.
>
> Finally, /var at build time is a symlink, but at runtime, it must be a
> directory (so we can mount the tmpfs over there). We can't change that
> as a target-finalize hook, because:
>
> - some packages may want to set ownership and/or acces rights on files
^
s/acces/access/
> or directoris in /var, and that only happens while assemblig the
^ ^
s/directoris/directories/
s/assemblig/assembling/
> filesystem images; changing /var from a symlink to a (then empty)
> directory would break this;
>
> - /var would be a directory on sub-sequent builds (until the next
> "make clean").
>
> Instead, we use the newly-introduce pre- and post-rootfs command hooks,
> to turn /var into a directory before assembling the image, and back to a
> symlink after assembling the image.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
>
Other than small typos highlighted by my mail client ;-)
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Best regards,
Romain
> ---
> Note: I haven't seen any symlinks installed in the factory so far, but I
> haven't build a lot of packages yet... So, I'm not sure what to do with
> the symlinks, especially when a package install relative symlinks...
> ---
> package/skeleton-systemd/skeleton-systemd.mk | 51 ++++++++++++++++++++++++++--
> system/Config.in | 1 -
> 2 files changed, 49 insertions(+), 3 deletions(-)
>
> diff --git a/package/skeleton-systemd/skeleton-systemd.mk b/package/skeleton-systemd/skeleton-systemd.mk
> index b45bbde..c7c2e26 100644
> --- a/package/skeleton-systemd/skeleton-systemd.mk
> +++ b/package/skeleton-systemd/skeleton-systemd.mk
> @@ -36,12 +36,59 @@ ifeq ($(SKELETON_SYSTEM_LOCALTIME),)
> SKELETON_SYSTEM_LOCALTIME = Etc/UTC
> endif
>
> +ifeq ($(BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW),y)
> +
> +define SKELETON_SYSTEMD_ROOT_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
> + mkdir -p $(TARGET_DIR)/etc/systemd/tmpfiles.d
> + mkdir -p $(TARGET_DIR)/usr/share/factory
> + ln -s usr/share/factory $(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_VAR_PRE_FS
> + rm -f $(TARGET_DIR)/var
> + mkdir $(TARGET_DIR)/var
> + for i in $(TARGET_DIR)/usr/share/factory/*; do \
> + j="$${i##*/}"; \
> + if [ -L "$${i}" ]; then \
> + printf "L+! /var/%s - - - - %s\n" \
> + "$${j}" "../usr/share/factory/$${j}" \
> + || exit 1; \
> + else \
> + printf "C! /var/%s - - - -\n" "$${j}" \
> + || exit 1; \
> + fi; \
> + done >$(TARGET_DIR)/etc/systemd/tmpfiles.d/var-factory.conf
> +endef
> +SKELETON_SYSTEMD_FS_PRE_CMD_HOOKS += SKELETON_SYSTEMD_VAR_PRE_FS
> +
> +define SKELETON_SYSTEMD_VAR_POST_FS
> + rm -rf $(TARGET_DIR)/var
> + ln -s usr/share/factory $(TARGET_DIR)/var
> +endef
> +SKELETON_SYSTEMD_FS_POST_CMD_HOOKS += SKELETON_SYSTEMD_VAR_POST_FS
> +
> +endif
> +
> define SKELETON_SYSTEMD_INSTALL_TARGET_CMDS
> mkdir -p $(TARGET_DIR)/etc
> 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
> + $(SKELETON_SYSTEMD_ROOT_RO)
> + $(SKELETON_SYSTEMD_ROOT_RW)
> ln -sf ../usr/share/zoneinfo/$(SKELETON_SYSTEMD_LOCALTIME) \
> $(TARGET_DIR)/etc/localtime
> $(SKELETON_SYSTEMD_RSYNC_NETWORK)
> diff --git a/system/Config.in b/system/Config.in
> index 07af2e0..32d6542 100644
> --- a/system/Config.in
> +++ b/system/Config.in
> @@ -129,7 +129,6 @@ config BR2_INIT_SYSTEMD
> depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
> select BR2_ROOTFS_MERGED_USR
> select BR2_PACKAGE_SYSTEMD
> - select BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW
> select BR2_TARGET_TZ_INFO
>
> comment "systemd needs (e)glibc toolchain, headers >= 3.10"
>
^ permalink raw reply [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 23/24 v2] system: make systemd work on a read-only rootfs
2016-07-03 12:54 ` Romain Naour
@ 2016-07-05 8:12 ` Yann E. MORIN
0 siblings, 0 replies; 73+ messages in thread
From: Yann E. MORIN @ 2016-07-05 8:12 UTC (permalink / raw)
To: buildroot
Romain, All,
On 2016-07-03 14:54 +0200, Romain Naour spake thusly:
> Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> > When the rootfs is readonly, systemd will expect /var to be writable.
> > Because we do not really have a R/W filesystem to mount on /var, we make
> > it a tmpfs, and use the systemd-tmpfiles feautre to populate it with
> s/feautre/feature/
[--SNIP--]
> Other than small typos highlighted by my mail client ;-)
Typoes fixed, thanks!
Regards,
Yann E. MORIN.
> Reviewed-by: Romain Naour <romain.naour@gmail.com>
>
> Best regards,
> Romain
>
>
> > ---
> > Note: I haven't seen any symlinks installed in the factory so far, but I
> > haven't build a lot of packages yet... So, I'm not sure what to do with
> > the symlinks, especially when a package install relative symlinks...
> > ---
> > package/skeleton-systemd/skeleton-systemd.mk | 51 ++++++++++++++++++++++++++--
> > system/Config.in | 1 -
> > 2 files changed, 49 insertions(+), 3 deletions(-)
> >
> > diff --git a/package/skeleton-systemd/skeleton-systemd.mk b/package/skeleton-systemd/skeleton-systemd.mk
> > index b45bbde..c7c2e26 100644
> > --- a/package/skeleton-systemd/skeleton-systemd.mk
> > +++ b/package/skeleton-systemd/skeleton-systemd.mk
> > @@ -36,12 +36,59 @@ ifeq ($(SKELETON_SYSTEM_LOCALTIME),)
> > SKELETON_SYSTEM_LOCALTIME = Etc/UTC
> > endif
> >
> > +ifeq ($(BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW),y)
> > +
> > +define SKELETON_SYSTEMD_ROOT_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
> > + mkdir -p $(TARGET_DIR)/etc/systemd/tmpfiles.d
> > + mkdir -p $(TARGET_DIR)/usr/share/factory
> > + ln -s usr/share/factory $(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_VAR_PRE_FS
> > + rm -f $(TARGET_DIR)/var
> > + mkdir $(TARGET_DIR)/var
> > + for i in $(TARGET_DIR)/usr/share/factory/*; do \
> > + j="$${i##*/}"; \
> > + if [ -L "$${i}" ]; then \
> > + printf "L+! /var/%s - - - - %s\n" \
> > + "$${j}" "../usr/share/factory/$${j}" \
> > + || exit 1; \
> > + else \
> > + printf "C! /var/%s - - - -\n" "$${j}" \
> > + || exit 1; \
> > + fi; \
> > + done >$(TARGET_DIR)/etc/systemd/tmpfiles.d/var-factory.conf
> > +endef
> > +SKELETON_SYSTEMD_FS_PRE_CMD_HOOKS += SKELETON_SYSTEMD_VAR_PRE_FS
> > +
> > +define SKELETON_SYSTEMD_VAR_POST_FS
> > + rm -rf $(TARGET_DIR)/var
> > + ln -s usr/share/factory $(TARGET_DIR)/var
> > +endef
> > +SKELETON_SYSTEMD_FS_POST_CMD_HOOKS += SKELETON_SYSTEMD_VAR_POST_FS
> > +
> > +endif
> > +
> > define SKELETON_SYSTEMD_INSTALL_TARGET_CMDS
> > mkdir -p $(TARGET_DIR)/etc
> > 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
> > + $(SKELETON_SYSTEMD_ROOT_RO)
> > + $(SKELETON_SYSTEMD_ROOT_RW)
> > ln -sf ../usr/share/zoneinfo/$(SKELETON_SYSTEMD_LOCALTIME) \
> > $(TARGET_DIR)/etc/localtime
> > $(SKELETON_SYSTEMD_RSYNC_NETWORK)
> > diff --git a/system/Config.in b/system/Config.in
> > index 07af2e0..32d6542 100644
> > --- a/system/Config.in
> > +++ b/system/Config.in
> > @@ -129,7 +129,6 @@ config BR2_INIT_SYSTEMD
> > depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
> > select BR2_ROOTFS_MERGED_USR
> > select BR2_PACKAGE_SYSTEMD
> > - select BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW
> > select BR2_TARGET_TZ_INFO
> >
> > comment "systemd needs (e)glibc toolchain, headers >= 3.10"
> >
>
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 24/24 v2] system: allow DHCP interface with systemd-networkd
2016-06-22 19:07 [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton) Yann E. MORIN
` (22 preceding siblings ...)
2016-06-22 19:07 ` [Buildroot] [PATCH 23/24 v2] system: make systemd work on a read-only rootfs Yann E. MORIN
@ 2016-06-22 19:07 ` Yann E. MORIN
2016-07-03 12:59 ` Romain Naour
2016-07-06 21:49 ` [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton) Thomas Petazzoni
24 siblings, 1 reply; 73+ messages in thread
From: Yann E. MORIN @ 2016-06-22 19:07 UTC (permalink / raw)
To: buildroot
It is pretty trivial to enable a DHCP interface with systemd-networkd, we
just need to provide a .network config file with just the name of the
interface to bring up and activate DHCP on it.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
package/skeleton-systemd/skeleton-systemd.mk | 12 +++++++++++-
system/Config.in | 9 +++------
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/package/skeleton-systemd/skeleton-systemd.mk b/package/skeleton-systemd/skeleton-systemd.mk
index c7c2e26..cbaded2 100644
--- a/package/skeleton-systemd/skeleton-systemd.mk
+++ b/package/skeleton-systemd/skeleton-systemd.mk
@@ -15,7 +15,17 @@ SKELETON_SYSTEMD_ADD_SKELETON_DEPENDENCY = NO
# In case we're not using systemd-networkd, use the sysv-like network infra;
# otherwise, the necessary bits are installed by the systemd package.
-ifeq ($(BR2_PACKAGE_SYSTEMD_NETWORKD),)
+ifeq ($(BR2_PACKAGE_SYSTEMD_NETWORKD),y)
+
+define SKELETON_SYSTEMD_SET_NETWORK
+ mkdir -p $(TARGET_DIR)/etc/systemd/network
+ printf '[Match]\nName=%s\n[Network]\nDHCP=yes\n' \
+ $(SKELETON_NETWORK_DHCP_IFACE) \
+ >$(TARGET_DIR)/etc/systemd/network/$(SKELETON_NETWORK_DHCP_IFACE).network
+endef
+SKELETON_SYSTEMD_TARGET_FINALIZE_HOOKS += SKELETON_SYSTEMD_SET_NETWORK
+
+else # BR2_PACKAGE_SYSTEMD_NETWORKD is not set
define SKELETON_SYSTEMD_RSYNC_NETWORK
$(call SKELETON_RSYNC,system/skeleton-net,$(TARGET_DIR))
diff --git a/system/Config.in b/system/Config.in
index 32d6542..c90866c 100644
--- a/system/Config.in
+++ b/system/Config.in
@@ -362,7 +362,7 @@ config BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW
config BR2_SYSTEM_DHCP
string "Network interface to configure through DHCP"
default ""
- depends on !BR2_PACKAGE_SYSTEMD_NETWORKD && (BR2_PACKAGE_BUSYBOX || BR2_PACKAGE_IFUPDOWN)
+ depends on BR2_PACKAGE_SYSTEMD_NETWORKD || BR2_PACKAGE_BUSYBOX || BR2_PACKAGE_IFUPDOWN
help
Enter here the name of the network interface (E.G. eth0) to
automatically configure through DHCP at bootup.
@@ -372,11 +372,8 @@ config BR2_SYSTEM_DHCP
For more complicated network setups use an overlay to overwrite
/etc/network/interfaces or add a networkd configuration file.
-comment "automatic network configuration via DHCP is not compatible with networkd"
- depends on BR2_PACKAGE_SYSTEMD_NETWORKD
-
-comment "automatic network configuration via DHCP needs ifupdown or busybox"
- depends on !(BR2_PACKAGE_BUSYBOX || BR2_PACKAGE_IFUPDOWN)
+comment "automatic network configuration via DHCP needs systemd, busybox or ifupdown"
+ depends on !(BR2_PACKAGE_SYSTEMD_NETWORKD || BR2_PACKAGE_BUSYBOX || BR2_PACKAGE_IFUPDOWN)
endif # BR2_ROOTFS_SKELETON_DEFAULT
--
2.7.4
^ permalink raw reply related [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 24/24 v2] system: allow DHCP interface with systemd-networkd
2016-06-22 19:07 ` [Buildroot] [PATCH 24/24 v2] system: allow DHCP interface with systemd-networkd Yann E. MORIN
@ 2016-07-03 12:59 ` Romain Naour
0 siblings, 0 replies; 73+ messages in thread
From: Romain Naour @ 2016-07-03 12:59 UTC (permalink / raw)
To: buildroot
Hi Yann,
Le 22/06/2016 ? 21:07, Yann E. MORIN a ?crit :
> It is pretty trivial to enable a DHCP interface with systemd-networkd, we
> just need to provide a .network config file with just the name of the
> interface to bring up and activate DHCP on it.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Best regards,
Romain
> ---
> package/skeleton-systemd/skeleton-systemd.mk | 12 +++++++++++-
> system/Config.in | 9 +++------
> 2 files changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/package/skeleton-systemd/skeleton-systemd.mk b/package/skeleton-systemd/skeleton-systemd.mk
> index c7c2e26..cbaded2 100644
> --- a/package/skeleton-systemd/skeleton-systemd.mk
> +++ b/package/skeleton-systemd/skeleton-systemd.mk
> @@ -15,7 +15,17 @@ SKELETON_SYSTEMD_ADD_SKELETON_DEPENDENCY = NO
>
> # In case we're not using systemd-networkd, use the sysv-like network infra;
> # otherwise, the necessary bits are installed by the systemd package.
> -ifeq ($(BR2_PACKAGE_SYSTEMD_NETWORKD),)
> +ifeq ($(BR2_PACKAGE_SYSTEMD_NETWORKD),y)
> +
> +define SKELETON_SYSTEMD_SET_NETWORK
> + mkdir -p $(TARGET_DIR)/etc/systemd/network
> + printf '[Match]\nName=%s\n[Network]\nDHCP=yes\n' \
> + $(SKELETON_NETWORK_DHCP_IFACE) \
> + >$(TARGET_DIR)/etc/systemd/network/$(SKELETON_NETWORK_DHCP_IFACE).network
> +endef
> +SKELETON_SYSTEMD_TARGET_FINALIZE_HOOKS += SKELETON_SYSTEMD_SET_NETWORK
> +
> +else # BR2_PACKAGE_SYSTEMD_NETWORKD is not set
>
> define SKELETON_SYSTEMD_RSYNC_NETWORK
> $(call SKELETON_RSYNC,system/skeleton-net,$(TARGET_DIR))
> diff --git a/system/Config.in b/system/Config.in
> index 32d6542..c90866c 100644
> --- a/system/Config.in
> +++ b/system/Config.in
> @@ -362,7 +362,7 @@ config BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW
> config BR2_SYSTEM_DHCP
> string "Network interface to configure through DHCP"
> default ""
> - depends on !BR2_PACKAGE_SYSTEMD_NETWORKD && (BR2_PACKAGE_BUSYBOX || BR2_PACKAGE_IFUPDOWN)
> + depends on BR2_PACKAGE_SYSTEMD_NETWORKD || BR2_PACKAGE_BUSYBOX || BR2_PACKAGE_IFUPDOWN
> help
> Enter here the name of the network interface (E.G. eth0) to
> automatically configure through DHCP at bootup.
> @@ -372,11 +372,8 @@ config BR2_SYSTEM_DHCP
> For more complicated network setups use an overlay to overwrite
> /etc/network/interfaces or add a networkd configuration file.
>
> -comment "automatic network configuration via DHCP is not compatible with networkd"
> - depends on BR2_PACKAGE_SYSTEMD_NETWORKD
> -
> -comment "automatic network configuration via DHCP needs ifupdown or busybox"
> - depends on !(BR2_PACKAGE_BUSYBOX || BR2_PACKAGE_IFUPDOWN)
> +comment "automatic network configuration via DHCP needs systemd, busybox or ifupdown"
> + depends on !(BR2_PACKAGE_SYSTEMD_NETWORKD || BR2_PACKAGE_BUSYBOX || BR2_PACKAGE_IFUPDOWN)
>
> endif # BR2_ROOTFS_SKELETON_DEFAULT
>
>
^ permalink raw reply [flat|nested] 73+ messages in thread
* [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton)
2016-06-22 19:07 [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton) Yann E. MORIN
` (23 preceding siblings ...)
2016-06-22 19:07 ` [Buildroot] [PATCH 24/24 v2] system: allow DHCP interface with systemd-networkd Yann E. MORIN
@ 2016-07-06 21:49 ` Thomas Petazzoni
2016-07-06 22:34 ` Yann E. MORIN
24 siblings, 1 reply; 73+ messages in thread
From: Thomas Petazzoni @ 2016-07-06 21:49 UTC (permalink / raw)
To: buildroot
Hello,
OK, let's try to make a quick status on this series, after the
Buildroot Summer Camp and the discussions we had.
On Wed, 22 Jun 2016 21:07:41 +0200, Yann E. MORIN wrote:
> Yann E. MORIN (24):
> package/skeleton: remove useless .empty file
Merged.
> system: sysvinit only selects busybox-show-others if busybox is enabled
We decided collectively to not merge this, as other packages would have
to be changed, and the benefit is not very big.
> package/skeleton: respect variables namespace
Merged.
> system/skeleton: update etc/mtab with a more sensible link
Merged.
> system: systemd only really supports a R/W rootfs
Merged.
> package/systemd: disabling tty1 getty is a post-install hook
Rejected, as it was broken.
> system: provide no default for custom skeleton path
Generally agreed, but I'm waiting for a respin since there were some
comments.
> system: move the rootfs skeleton choice
Looks good as well, waiting for the respin (it depends on the previous
patch).
> system: do not handle network settings for custom skeleton
Ditto.
> package/perl: use dummy hostname
Merged.
> system: do not set hostname and issue for custom skeleton
Also looks good, but waiting for the respin, since it depends on the
previous patches.
> core/pkg-generic: add variable to skip skeleton dependency
> package/skeleton: add macro to rsync skeleton directory
Both not merged yet, they are needed only for the "split skeleton"
solution, which I'll discuss below.
> core/pkg-generic: allow packages to declare target-finalize hooks
> packages: use the <PKG>_TARGET_FINALIZE_HOOKS
Both merged. For the latter, a follow-up patch is needed to also use
the new mechanism in the toolchain package.
> package/skeleton: split into sysv and custom skeleton
> package/skeleton: make it a virtual package
> package/skeleton-sysv: split into skeleton-common
> system: split skeleton
> package/skeleton-systemd: new package
> system/systemd: needs timezone
OK, so this is the first big thing that remains: splitting the skeleton
into multiple parts. If I summarize your solution, it consists in
splitting the skeleton in several parts:
* 'skeleton', which becomes a virtual package that depends on the
actual skeleton.
* 'skeleton-custom', which is used when a custom skeleton is selected,
and does pretty much nothing except copy the custom skeleton
* 'skeleton-common', which contains the common parts of the systemd
and sysv skeleton
* 'skeleton-sysv', which depends on skeleton-common and contains the
sysv specific parts of the skeleton. In practice, this only contains
the /var sub-directories, /etc/fstab, the /etc/resolv.conf symbolic
link (which is the same in systemd, so it's not a real difference),
and the /dev sub-directories.
* 'skeleton-systemd', which depends on skeleton-common, but does not
copy itself some skeleton, as it instead just creates a bunch of
directories and files. In practice, the only thing useful that it
does is create a /etc/fstab file.
In addition, a 'skeleton-net' part is created, which is not a package,
but just a placeholder with the ifupdown configuration, used by both
the sysv init case, and the systemd-without-networkd case.
At the very least, I believe:
- the skeleton-net thing should be moved into a ifupdown-config package
- the skeleton-systemd should be simplified to not create directories
that already exist in skeleton-common
- the /etc/resolv.conf file should be kept in the common skeleton
Once this is done, I continue to wonder if this multiple skeleton
mechanism is really needed:
- the skeleton-systemd package does essentially nothing, except
creating the fstab, which the systemd package could do.
- the skeleton-sysv package also doesn't do much, and it could be done
in the existing initscripts package.
Really, the only thing that bothers me is that "initscripts" isn't a
very good name for a package that also installs other things than init
scripts. Perhaps naming it "sysv-base" or something would be clearer.
But maybe before taking a decision on this we simply need to see a
respin that does the first cleanups suggested above, so that we can
have a clearer vision of where things are going. The idea of skeleton
as a virtual package is also not bad, especially if we can get rid of
the weird skeleton-net situation, and really have
skeleton-{common,sysv,custom,} be real packages.
> fs: add pre- and post-command hooks
> system: make systemd work on a read-only rootfs
> system: allow DHCP interface with systemd-networkd
This is the second big thing: allow a systemd rootfs to be read-only.
The crux of the problem is that when /var is read-only, systemd
automatically mounts a tmpfs on /var, which defeats our traditional
mechanism to handle read-only rootfs.
The solution that Yann has designed consists in having /var be a
symlink to /usr/share/factory in the systemd skeleton. This way, during
the Buildroot build, all the packages that create stuff in /var end up
installing their stuff in /usr/share/factory. And then, thanks to the
pre/post hooks in the FS infrastructure, the code creates some tmpfiles
description for systemd for each file in /usr/share/factory and
replaces /var with a directory. This way, when systemd boots, it mounts
a tmpfs in /var and copies all the files from /usr/share/factory
to /var.
I am a bit annoyed by the complexity of this, and the "black magic"
involved, but on the other hand, I don't really see a better solution.
Another thing that bothers me is that then the solution to handle the
read-only rootfs problem then becomes radically different between the
sysv case and the systemd case. Maybe this is expected since the init
systems are so different.
But on the other hand, our existing mechanism to handle a read-only
rootfs in sysv land is not great: we create /var/log as a symlink
to /tmp, and /tmp is mounted as a tmpfs. This works fines if
applications just create files in /var/log. But if an application at
build time create a directory in /var/log, such as /var/log/daemond, it
might expect to find it at runtime, which will not be the case.
The /usr/share/factory solution solves this problem.
So, should we move to this /usr/share/factory solution also for sysv
init ?
Yann, what about:
(1) Getting a series that has just the respin of the preparatory
patches ;
(2) Separate the "skeleton re-org" series from the "systemd read-only
rootfs" series, so that we can progress on those topics one by
one ?
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton)
2016-07-06 21:49 ` [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton) Thomas Petazzoni
@ 2016-07-06 22:34 ` Yann E. MORIN
2016-07-17 8:49 ` Yann E. MORIN
0 siblings, 1 reply; 73+ messages in thread
From: Yann E. MORIN @ 2016-07-06 22:34 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2016-07-06 23:49 +0200, Thomas Petazzoni spake thusly:
> On Wed, 22 Jun 2016 21:07:41 +0200, Yann E. MORIN wrote:
> > system: sysvinit only selects busybox-show-others if busybox is enabled
> We decided collectively to not merge this, as other packages would have
> to be changed, and the benefit is not very big.
Yes, I replaced it with a patch that adds a comment for this variable.
> > system: provide no default for custom skeleton path
> Generally agreed, but I'm waiting for a respin since there were some
> comments.
> > system: move the rootfs skeleton choice
> Looks good as well, waiting for the respin (it depends on the previous
> patch).
> > system: do not handle network settings for custom skeleton
> Ditto.
> > system: do not set hostname and issue for custom skeleton
> Also looks good, but waiting for the respin, since it depends on the
> previous patches.
Yep, I'll respin shortly, it's almost ready.
> > core/pkg-generic: allow packages to declare target-finalize hooks
> > packages: use the <PKG>_TARGET_FINALIZE_HOOKS
> Both merged. For the latter, a follow-up patch is needed to also use
> the new mechanism in the toolchain package.
Already done here, will be part of the respin.
> > package/skeleton: split into sysv and custom skeleton
> > package/skeleton: make it a virtual package
> > package/skeleton-sysv: split into skeleton-common
> > system: split skeleton
> > package/skeleton-systemd: new package
> > system/systemd: needs timezone
>
> OK, so this is the first big thing that remains: splitting the skeleton
> into multiple parts. If I summarize your solution, it consists in
> splitting the skeleton in several parts:
>
> * 'skeleton', which becomes a virtual package that depends on the
> actual skeleton.
>
> * 'skeleton-custom', which is used when a custom skeleton is selected,
> and does pretty much nothing except copy the custom skeleton
>
> * 'skeleton-common', which contains the common parts of the systemd
> and sysv skeleton
>
> * 'skeleton-sysv', which depends on skeleton-common and contains the
> sysv specific parts of the skeleton. In practice, this only contains
> the /var sub-directories, /etc/fstab, the /etc/resolv.conf symbolic
> link (which is the same in systemd, so it's not a real difference),
> and the /dev sub-directories.
>
> * 'skeleton-systemd', which depends on skeleton-common, but does not
> copy itself some skeleton, as it instead just creates a bunch of
> directories and files. In practice, the only thing useful that it
> does is create a /etc/fstab file.
>
> In addition, a 'skeleton-net' part is created, which is not a package,
> but just a placeholder with the ifupdown configuration, used by both
> the sysv init case, and the systemd-without-networkd case.
>
> At the very least, I believe:
>
> - the skeleton-net thing should be moved into a ifupdown-config package
>
> - the skeleton-systemd should be simplified to not create directories
> that already exist in skeleton-common
>
> - the /etc/resolv.conf file should be kept in the common skeleton
>
> Once this is done, I continue to wonder if this multiple skeleton
> mechanism is really needed:
>
> - the skeleton-systemd package does essentially nothing, except
> creating the fstab, which the systemd package could do.
>
> - the skeleton-sysv package also doesn't do much, and it could be done
> in the existing initscripts package.
>
> Really, the only thing that bothers me is that "initscripts" isn't a
> very good name for a package that also installs other things than init
> scripts. Perhaps naming it "sysv-base" or something would be clearer.
>
> But maybe before taking a decision on this we simply need to see a
> respin that does the first cleanups suggested above, so that we can
> have a clearer vision of where things are going. The idea of skeleton
> as a virtual package is also not bad, especially if we can get rid of
> the weird skeleton-net situation, and really have
> skeleton-{common,sysv,custom,} be real packages.
I'm not going to do any change right now, to let the dust settle.
Once others have commented one way or another, I'll do the requested
changes.
> > fs: add pre- and post-command hooks
> > system: make systemd work on a read-only rootfs
> > system: allow DHCP interface with systemd-networkd
>
> This is the second big thing: allow a systemd rootfs to be read-only.
> The crux of the problem is that when /var is read-only, systemd
> automatically mounts a tmpfs on /var, which defeats our traditional
Nit: systemd *expects* /var to be a tmpfs (or at least that it be
writable). It does not do the mount; we do it explicitly in the fstab.
> mechanism to handle read-only rootfs.
>
> The solution that Yann has designed consists in having /var be a
> symlink to /usr/share/factory in the systemd skeleton. This way, during
> the Buildroot build, all the packages that create stuff in /var end up
> installing their stuff in /usr/share/factory. And then, thanks to the
> pre/post hooks in the FS infrastructure, the code creates some tmpfiles
> description for systemd for each file in /usr/share/factory and
> replaces /var with a directory. This way, when systemd boots, it mounts
> a tmpfs in /var and copies all the files from /usr/share/factory
> to /var.
>
> I am a bit annoyed by the complexity of this, and the "black magic"
> involved, but on the other hand, I don't really see a better solution.
>
> Another thing that bothers me is that then the solution to handle the
> read-only rootfs problem then becomes radically different between the
> sysv case and the systemd case. Maybe this is expected since the init
> systems are so different.
And now that I had time to think about it, there is even another issue
that I forgot to talk about: this relies on whether the user asked that
the rootfs be remounted R/W at boot (BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW).
If that is that case, we currently still offer a way to build
filesystems that are inherently R/O (cramfs, iso9660, squashfs...) I
would suggest that we hide those filesystems in that case.
Yet, when the option is not selected does not mean that we should not
allow a R/W filesystem either (the user may well want to boot a R/O ext4
but remount it for local upgrades, like a GPS database for example).
But surely, when the users asks / to be remounte R/W at boot, we *know*
we can't use a R/O filesystem.
> But on the other hand, our existing mechanism to handle a read-only
> rootfs in sysv land is not great: we create /var/log as a symlink
> to /tmp, and /tmp is mounted as a tmpfs. This works fines if
> applications just create files in /var/log. But if an application at
> build time create a directory in /var/log, such as /var/log/daemond, it
> might expect to find it at runtime, which will not be the case.
> The /usr/share/factory solution solves this problem.
>
> So, should we move to this /usr/share/factory solution also for sysv
> init ?
I'm OK with that, except we'd have to provide that mechanism ourselves
fot sysv init.
> Yann, what about:
>
> (1) Getting a series that has just the respin of the preparatory
> patches ;
Yep.
> (2) Separate the "skeleton re-org" series from the "systemd read-only
> rootfs" series, so that we can progress on those topics one by
> one ?
Well, "systemd on read-only rootfs" anyway depends on "systemd
skeleton-or-whatever-we're-gonna-do". ;-) But yes, I can do that.
Thanks for the great summary. I'll copy it for the next cover-letter I
need to send for this series. ;-)
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 73+ messages in thread* [Buildroot] [PATCH 00/24 v2] system: properly handle systemd as init system (branch yem/systemd-skeleton)
2016-07-06 22:34 ` Yann E. MORIN
@ 2016-07-17 8:49 ` Yann E. MORIN
0 siblings, 0 replies; 73+ messages in thread
From: Yann E. MORIN @ 2016-07-17 8:49 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2016-07-07 00:34 +0200, Yann E. MORIN spake thusly:
> On 2016-07-06 23:49 +0200, Thomas Petazzoni spake thusly:
> > On Wed, 22 Jun 2016 21:07:41 +0200, Yann E. MORIN wrote:
> > > package/skeleton: split into sysv and custom skeleton
> > > package/skeleton: make it a virtual package
> > > package/skeleton-sysv: split into skeleton-common
> > > system: split skeleton
> > > package/skeleton-systemd: new package
> > > system/systemd: needs timezone
> >
> > OK, so this is the first big thing that remains: splitting the skeleton
> > into multiple parts. If I summarize your solution, it consists in
> > splitting the skeleton in several parts:
[--SNIP--]
> > At the very least, I believe:
> >
> > - the skeleton-net thing should be moved into a ifupdown-config package
> >
> > - the skeleton-systemd should be simplified to not create directories
> > that already exist in skeleton-common
> >
> > - the /etc/resolv.conf file should be kept in the common skeleton
> >
> > Once this is done, I continue to wonder if this multiple skeleton
> > mechanism is really needed:
> >
> > - the skeleton-systemd package does essentially nothing, except
> > creating the fstab, which the systemd package could do.
> >
> > - the skeleton-sysv package also doesn't do much, and it could be done
> > in the existing initscripts package.
> >
> > Really, the only thing that bothers me is that "initscripts" isn't a
> > very good name for a package that also installs other things than init
> > scripts. Perhaps naming it "sysv-base" or something would be clearer.
> >
> > But maybe before taking a decision on this we simply need to see a
> > respin that does the first cleanups suggested above, so that we can
> > have a clearer vision of where things are going. The idea of skeleton
> > as a virtual package is also not bad, especially if we can get rid of
> > the weird skeleton-net situation, and really have
> > skeleton-{common,sysv,custom,} be real packages.
>
> I'm not going to do any change right now, to let the dust settle.
> Once others have commented one way or another, I'll do the requested
> changes.
Since no one commented, I'll go with Thomas' suggestion.
> > > fs: add pre- and post-command hooks
> > > system: make systemd work on a read-only rootfs
> > > system: allow DHCP interface with systemd-networkd
> >
> > This is the second big thing: allow a systemd rootfs to be read-only.
> > The crux of the problem is that when /var is read-only, systemd
> > automatically mounts a tmpfs on /var, which defeats our traditional
> > mechanism to handle read-only rootfs.
[--SNIP--]
> > I am a bit annoyed by the complexity of this, and the "black magic"
> > involved, but on the other hand, I don't really see a better solution.
Since there was no comment or counter-proposal, I'll keep this as-is, as
a follow-up to the above series.
> > Another thing that bothers me is that then the solution to handle the
> > read-only rootfs problem then becomes radically different between the
> > sysv case and the systemd case. Maybe this is expected since the init
> > systems are so different.
> >
> > But on the other hand, our existing mechanism to handle a read-only
> > rootfs in sysv land is not great: we create /var/log as a symlink
> > to /tmp, and /tmp is mounted as a tmpfs. This works fines if
> > applications just create files in /var/log. But if an application at
> > build time create a directory in /var/log, such as /var/log/daemond, it
> > might expect to find it at runtime, which will not be the case.
> > The /usr/share/factory solution solves this problem.
> >
> > So, should we move to this /usr/share/factory solution also for sysv
> > init ?
>
> I'm OK with that, except we'd have to provide that mechanism ourselves
> fot sysv init.
Sicne there was no comment for or against, I'll go to implementing the
factory stuff for both cases, sysv-init and systemd alike.
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 73+ messages in thread