Message ID | 20180506213116.25084-3-casantos@datacom.ind.br |
---|---|
State | Superseded, archived |
Headers | show |
Series | Improve verification of custom rootfs skeletons and overlays | expand |
Hello Carlos, On Sun, 6 May 2018 18:31:14 -0300, Carlos Santos wrote: > skeleton-custom does not install the required /bin, /lib and /sbin > directories (or symlinks), which may result in an imcomplete tree, The > user could add the required directories/symlinks to the skeleton but > they maye be invalid, depending on the state of BR2_ROOTFS_MERGED_USR. maye -> may > > Steps to reproduce: > > - Enable BR2_ROOTFS_MERGED_USR and BR2_INIT_SYSTEMD > - Set BR2_ROOTFS_SKELETON_CUSTOM_PATH to "system/skeleton" > - Run "make skeleton" > - target/{bin.lib,sbin} will not exist > > Add calls to SYSTEM_USR_SYMLINKS_OR_DIRS to INSTALL_TARGET_CMDS and > INSTALL_STAGING_CMDS, so the required directories or symlinks are > created. > > Add a paragraph to the documentation clarifying that custom skeletons > should not contain /bin, /lib or /sbin. Maybe I don't understand the full scope of the problem, but to me, it looks weird that the full contents of the skeleton (default or custom) are not copied to the target root filesystem. It goes against the basic expectations of what the skeleton is. Of course, I am fine with checking that the skeleton complies with the BR2_ROOTFS_MERGED_USR option, but preventing the skeleton from having /bin, /lib and /sbin looks weird. So much that it needs to be mentioned in the documentation. Thomas
> From: "Thomas Petazzoni" <thomas.petazzoni@bootlin.com> > To: "Carlos Santos" <casantos@datacom.ind.br> > Cc: "buildroot" <buildroot@buildroot.org>, "yann morin 1998" <yann.morin.1998@gmail.com>, "Thomas De Schampheleire" > <thomas.de_schampheleire@nokia.com> > Sent: Monday, May 7, 2018 4:08:11 AM > Subject: Re: [Buildroot] [PATCH 2/4] skeleton-custom: install /bin, /lib, and /sbin > Hello Carlos, > > On Sun, 6 May 2018 18:31:14 -0300, Carlos Santos wrote: >> skeleton-custom does not install the required /bin, /lib and /sbin >> directories (or symlinks), which may result in an imcomplete tree, The >> user could add the required directories/symlinks to the skeleton but >> they maye be invalid, depending on the state of BR2_ROOTFS_MERGED_USR. > > maye -> may :-) > >> >> Steps to reproduce: >> >> - Enable BR2_ROOTFS_MERGED_USR and BR2_INIT_SYSTEMD >> - Set BR2_ROOTFS_SKELETON_CUSTOM_PATH to "system/skeleton" >> - Run "make skeleton" >> - target/{bin.lib,sbin} will not exist >> >> Add calls to SYSTEM_USR_SYMLINKS_OR_DIRS to INSTALL_TARGET_CMDS and >> INSTALL_STAGING_CMDS, so the required directories or symlinks are >> created. >> >> Add a paragraph to the documentation clarifying that custom skeletons >> should not contain /bin, /lib or /sbin. > > Maybe I don't understand the full scope of the problem, but to me, it > looks weird that the full contents of the skeleton (default or custom) > are not copied to the target root filesystem. It goes against the basic > expectations of what the skeleton is. > > Of course, I am fine with checking that the skeleton complies with the > BR2_ROOTFS_MERGED_USR option, but preventing the skeleton from > having /bin, /lib and /sbin looks weird. So much that it needs to be > mentioned in the documentation. Notice that I used “should” in the documentation, not “must”. It is still OK to have /bin, /lib and /sbin in custom skeletons and rootfs overlays if BR2_ROOTFS_MERGED_USR is not set.
Hello Carlos, On Mon, 7 May 2018 08:16:48 -0300 (BRT), Carlos Santos wrote: > > Of course, I am fine with checking that the skeleton complies with the > > BR2_ROOTFS_MERGED_USR option, but preventing the skeleton from > > having /bin, /lib and /sbin looks weird. So much that it needs to be > > mentioned in the documentation. > > Notice that I used “should” in the documentation, not “must”. It is > still OK to have /bin, /lib and /sbin in custom skeletons and rootfs > overlays if BR2_ROOTFS_MERGED_USR is not set. Ah, OK, but then the explanation should be worded differently. What about something like: """ When +BR2_ROOTFS_MERGED_USR+ is enabled, then the custom skeleton must not contain the +/bin+, +/lib+ or +/sbin+ directories, as Buildroot will create them as symbolic links to the relevant folders in +/usr+. In such a situation, should the skeleton have any programs or libraries, they should be placed in +/usr/bin+, +/usr/sbin+ and +/usr/lib+. """ Or something along those lines. Thomas
diff --git a/docs/manual/customize-rootfs.txt b/docs/manual/customize-rootfs.txt index 44fc460670..8982e03498 100644 --- a/docs/manual/customize-rootfs.txt +++ b/docs/manual/customize-rootfs.txt @@ -100,6 +100,11 @@ To enable this feature, enable config option +System configuration+ menu. If you specify a relative path, it will be relative to the root of the Buildroot tree. + +Custom skeletons should not contain the '/bin', '/lib' or '/sbin' paths, + since they are created during the build, either as directories or as + symbolic links to their counterparts under 'usr', depending on the + system configuration. ++ This method is not recommended because it duplicates the entire skeleton, which prevents taking advantage of the fixes or improvements brought to the default skeleton in later Buildroot releases. diff --git a/package/skeleton-custom/skeleton-custom.mk b/package/skeleton-custom/skeleton-custom.mk index b1cddd9146..01cd62794d 100644 --- a/package/skeleton-custom/skeleton-custom.mk +++ b/package/skeleton-custom/skeleton-custom.mk @@ -43,6 +43,7 @@ endif # things we customise in the custom skeleton. define SKELETON_CUSTOM_INSTALL_TARGET_CMDS $(call SYSTEM_RSYNC,$(SKELETON_CUSTOM_PATH),$(TARGET_DIR)) + $(call SYSTEM_USR_SYMLINKS_OR_DIRS,$(TARGET_DIR)) $(call SYSTEM_LIB_SYMLINK,$(TARGET_DIR)) $(INSTALL) -m 0644 support/misc/target-dir-warning.txt \ $(TARGET_DIR_WARNING_FILE) @@ -54,6 +55,7 @@ endef # skeleton to staging. define SKELETON_CUSTOM_INSTALL_STAGING_CMDS $(call SYSTEM_RSYNC,$(SKELETON_CUSTOM_PATH),$(STAGING_DIR)) + $(call SYSTEM_USR_SYMLINKS_OR_DIRS,$(STAGING_DIR)) $(call SYSTEM_LIB_SYMLINK,$(STAGING_DIR)) endef
skeleton-custom does not install the required /bin, /lib and /sbin directories (or symlinks), which may result in an imcomplete tree, The user could add the required directories/symlinks to the skeleton but they maye be invalid, depending on the state of BR2_ROOTFS_MERGED_USR. Steps to reproduce: - Enable BR2_ROOTFS_MERGED_USR and BR2_INIT_SYSTEMD - Set BR2_ROOTFS_SKELETON_CUSTOM_PATH to "system/skeleton" - Run "make skeleton" - target/{bin.lib,sbin} will not exist Add calls to SYSTEM_USR_SYMLINKS_OR_DIRS to INSTALL_TARGET_CMDS and INSTALL_STAGING_CMDS, so the required directories or symlinks are created. Add a paragraph to the documentation clarifying that custom skeletons should not contain /bin, /lib or /sbin. Signed-off-by: Carlos Santos <casantos@datacom.ind.br> --- docs/manual/customize-rootfs.txt | 5 +++++ package/skeleton-custom/skeleton-custom.mk | 2 ++ 2 files changed, 7 insertions(+)