Skip to contentSkip to conversation

grub-mkconfig: Use -c instead of --printf for stat

PATCH In review Ovidiu Panait 2 participants 2 messages May 14, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 grub-mkconfig: Use -c instead of --printf for stat

"--printf" only works with the stat variant provided by coreutils.

With busybox, stat will fail with the following error:
stat: unrecognized option '--printf=%T'

Usage: stat [OPTIONS] FILE...

---
 util/grub-mkconfig.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
util/grub-mkconfig.in +1 -1
index 33332360e..9f477ff05 100644
@@ -145,7 +145,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
 
 # Provide a default set of stock linux early initrd images.
Signature · 1 line
2.20.1