[OE-core] [PATCH] grub-mkconfig: Use -c instead of --printf for stat

Burton, Ross ross.burton at intel.com
Mon May 13 21:51:14 UTC 2019


This isn't OE-specific, can you try and send that upstream so we don't
carry the patch forever?

Also needs rebasing to current master.

Ross

On Wed, 17 Apr 2019 at 03:52, Ovidiu Panait <ovidiu.panait at windriver.com> wrote:
>
> "--printf" only works with the stat variant provided by coreutils.
>
> With busybox, when running grub-mkconfig, stat will fail with the
> following error:
> stat: unrecognized option '--printf=%T'
>
> Usage: stat [OPTIONS] FILE...
>
> Signed-off-by: Ovidiu Panait <ovidiu.panait at windriver.com>
> ---
>  ...fig-Use-c-instead-of-printf-for-stat.patch | 36 +++++++++++++++++++
>  meta/recipes-bsp/grub/grub2.inc               |  1 +
>  2 files changed, 37 insertions(+)
>  create mode 100644 meta/recipes-bsp/grub/files/0001-grub-mkconfig-Use-c-instead-of-printf-for-stat.patch
>
> diff --git a/meta/recipes-bsp/grub/files/0001-grub-mkconfig-Use-c-instead-of-printf-for-stat.patch b/meta/recipes-bsp/grub/files/0001-grub-mkconfig-Use-c-instead-of-printf-for-stat.patch
> new file mode 100644
> index 0000000000..0700911b78
> --- /dev/null
> +++ b/meta/recipes-bsp/grub/files/0001-grub-mkconfig-Use-c-instead-of-printf-for-stat.patch
> @@ -0,0 +1,36 @@
> +From b5011ea2bc57d80b3e5a42bc308fa2000e85eab1 Mon Sep 17 00:00:00 2001
> +From: Ovidiu Panait <ovidiu.panait at windriver.com>
> +Date: Wed, 17 Apr 2019 12:10:28 +0300
> +Subject: [PATCH] grub-mkconfig: Use -c instead of --printf for stat
> +
> +"--printf" only works with the stat variant provided by coreutils.
> +
> +With busybox, when running grub-mkconfig, stat will fail with the
> +following error:
> +stat: unrecognized option '--printf=%T'
> +
> +Usage: stat [OPTIONS] FILE...
> +
> +Upstream-Status: Inappropriate [OE specific]
> +
> +Signed-off-by: Ovidiu Panait <ovidiu.panait at windriver.com>
> +---
> + util/grub-mkconfig.in | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
> +index f8496d2..628706d 100644
> +--- a/util/grub-mkconfig.in
> ++++ b/util/grub-mkconfig.in
> +@@ -144,7 +144,7 @@ GRUB_DEVICE_BOOT_UUID="`${grub_probe} --device ${GRUB_DEVICE_BOOT} --target=fs_u
> + GRUB_FS="`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2> /dev/null || echo unknown`"
> +
> + if [ x"$GRUB_FS" = xunknown ]; then
> +-    GRUB_FS="$(stat -f --printf=%T / || echo unknown)"
> ++    GRUB_FS="$(stat -f -c %T / || echo unknown)"
> + fi
> +
> + if test -f ${sysconfdir}/default/grub ; then
> +--
> +2.20.1
> +
> diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc
> index c6994723f9..a6909c31ca 100644
> --- a/meta/recipes-bsp/grub/grub2.inc
> +++ b/meta/recipes-bsp/grub/grub2.inc
> @@ -23,6 +23,7 @@ SRC_URI = "https://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \
>             file://0001-grub-setup-Debug-message-cleanup.patch \
>             file://disable-address-of-packed-member.patch \
>             file://fix.build.with.squashfs.patch \
> +           file://0001-grub-mkconfig-Use-c-instead-of-printf-for-stat.patch \
>  "
>  SRC_URI[md5sum] = "1116d1f60c840e6dbd67abbc99acb45d"
>  SRC_URI[sha256sum] = "660ee136fbcee08858516ed4de2ad87068bfe1b6b8b37896ce3529ff054a726d"
> --
> 2.20.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


More information about the Openembedded-core mailing list