Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v4] package/dosfstools: introduce custom install routine
Date: Fri, 31 May 2019 22:06:25 +0200	[thread overview]
Message-ID: <20190531200625.GB3407@scaer> (raw)
In-Reply-To: <20190531194159.2566-1-mmayer@broadcom.com>

Markus, All,

On 2019-05-31 12:41 -0700, Markus Mayer spake thusly:
> We can't use dosfstools' install target, because it'll install *all*
> binaries, even the disabled ones. Also, we can't just delete dosfstools
> binaries from the target directory after installing them, because other
> packages (specifically Busybox) may provide tools of the same name, and

If busybox installs applets also installed by dosfstools, then we also
want to expand the exsiting list to also cover dosfstools:
    https://git.buildroot.org/buildroot/tree/package/busybox/busybox.mk#n24

Can you send a (separate) patch doing so?

As for "other packages", which one do you refer to? We want to ensure
that those other packages and dosfstools do not compete to install their
files, so we want to guarantee the ordering between those, so we need an
explicit dependency too.

However, I checked in Ubtuntu 19.04, and all the files referenced in
this patch ({mkfs,fsck).{fat,vfat,msdos} or mkdosfs or dosfsck) are only
provided by dosfstools. I also could not readily identify a package in
Buildroot that could provide them either...

Regards,
Yann E. MORIN.

> we may end up deleting those instead.
> 
> To avoid any issues, we create our own install routines, which only
> copy the enabled binaries into the target location.
> 
> Signed-off-by: Markus Mayer <mmayer@broadcom.com>
> ---
> Changes since v3:
> - use $(INSTALL) -D -m 0755 $(@D)/src ...
> - don't use post-install hooks
> - instead call install macros from custom install target
> 
> Changes since v2:
> - use custom install routine that only copies the binaries we want
> 
> Changes since v1:
> - don't bother removing man page files
> - use rsync instead of tar to copy files to the destination
> 
>  package/dosfstools/dosfstools.mk | 34 +++++++++++++++++++++-----------
>  1 file changed, 22 insertions(+), 12 deletions(-)
> 
> diff --git a/package/dosfstools/dosfstools.mk b/package/dosfstools/dosfstools.mk
> index 6eb0851d0e23..cf2233e5819b 100644
> --- a/package/dosfstools/dosfstools.mk
> +++ b/package/dosfstools/dosfstools.mk
> @@ -24,26 +24,36 @@ DOSFSTOOLS_CONF_OPTS += LIBS="-liconv"
>  DOSFSTOOLS_DEPENDENCIES += libiconv
>  endif
>  
> -ifeq ($(BR2_PACKAGE_DOSFSTOOLS_FATLABEL),)
> -define DOSFSTOOLS_REMOVE_FATLABEL
> -	rm -f $(addprefix $(TARGET_DIR)/sbin/,dosfslabel fatlabel)
> +ifeq ($(BR2_PACKAGE_DOSFSTOOLS_FATLABEL),y)
> +define DOSFSTOOLS_INSTALL_FATLABEL
> +	$(INSTALL) -D -m 0755 $(@D)/src/fatlabel $(TARGET_DIR)/sbin
> +	ln -sf fatlabel $(TARGET_DIR)/sbin/dosfslabel
>  endef
> -DOSFSTOOLS_POST_INSTALL_TARGET_HOOKS += DOSFSTOOLS_REMOVE_FATLABEL
>  endif
>  
> -ifeq ($(BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT),)
> -define DOSFSTOOLS_REMOVE_FSCK_FAT
> -	rm -f $(addprefix $(TARGET_DIR)/sbin/,fsck.fat dosfsck fsck.msdos fsck.vfat)
> +ifeq ($(BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT),y)
> +define DOSFSTOOLS_INSTALL_FSCK_FAT
> +	$(INSTALL) -D -m 0755 $(@D)/src/fsck.fat $(TARGET_DIR)/sbin
> +	ln -sf fsck.fat $(TARGET_DIR)/sbin/fsck.vfat
> +	ln -sf fsck.fat $(TARGET_DIR)/sbin/fsck.msdos
> +	ln -sf fsck.fat $(TARGET_DIR)/sbin/dosfsck
>  endef
> -DOSFSTOOLS_POST_INSTALL_TARGET_HOOKS += DOSFSTOOLS_REMOVE_FSCK_FAT
>  endif
>  
> -ifeq ($(BR2_PACKAGE_DOSFSTOOLS_MKFS_FAT),)
> -define DOSFSTOOLS_REMOVE_MKFS_FAT
> -	rm -f $(addprefix $(TARGET_DIR)/sbin/,mkfs.fat mkdosfs mkfs.msdos mkfs.vfat)
> +ifeq ($(BR2_PACKAGE_DOSFSTOOLS_MKFS_FAT),y)
> +define DOSFSTOOLS_INSTALL_MKFS_FAT
> +	$(INSTALL) -D -m 0755 $(@D)/src/mkfs.fat $(TARGET_DIR)/sbin
> +	ln -sf mkfs.fat $(TARGET_DIR)/sbin/mkdosfs
> +	ln -sf mkfs.fat $(TARGET_DIR)/sbin/mkfs.msdos
> +	ln -sf mkfs.fat $(TARGET_DIR)/sbin/mkfs.vfat
>  endef
> -DOSFSTOOLS_POST_INSTALL_TARGET_HOOKS += DOSFSTOOLS_REMOVE_MKFS_FAT
>  endif
>  
> +define DOSFSTOOLS_INSTALL_TARGET_CMDS
> +	$(call DOSFSTOOLS_INSTALL_FATLABEL)
> +	$(call DOSFSTOOLS_INSTALL_FSCK_FAT)
> +	$(call DOSFSTOOLS_INSTALL_MKFS_FAT)
> +endef
> +
>  $(eval $(autotools-package))
>  $(eval $(host-autotools-package))
> -- 
> 2.17.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  reply	other threads:[~2019-05-31 20:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-31 19:41 [Buildroot] [PATCH v4] package/dosfstools: introduce custom install routine Markus Mayer
2019-05-31 20:06 ` Yann E. MORIN [this message]
2019-05-31 20:35   ` Markus Mayer
2019-05-31 20:43     ` Yann E. MORIN
2019-05-31 20:19 ` Thomas Petazzoni
2019-06-06 15:37 ` Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190531200625.GB3407@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox