diff mbox series

[1/1] fs: Change default fakeroot shell to bash

Message ID 20220309230745.143885-1-clayton.shotwell@rockwellcollins.com
State Rejected
Headers show
Series [1/1] fs: Change default fakeroot shell to bash | expand

Commit Message

Clayton Shotwell March 9, 2022, 11:07 p.m. UTC
From: Clayton Shotwell <clayton.shotwell@collins.com>

The addition of the removal of the /run and /tmp contents using a
non-POSIX pattern causes the file system creation to fail on systems
where /bin/sh does not default to bash. Switching the fakeroot script
to a bash shell addresses the problem.

Fixes:
https://bugs.buildroot.org/show_bug.cgi?id=14661

Signed-off-by: Clayton Shotwell <clayton.shotwell@collins.com>
---
 fs/common.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Laight March 10, 2022, 7:40 a.m. UTC | #1
From: clayton.shotwell
> Sent: 09 March 2022 23:08
> 
> The addition of the removal of the /run and /tmp contents using a
> non-POSIX pattern causes the file system creation to fail on systems
> where /bin/sh does not default to bash. Switching the fakeroot script
> to a bash shell addresses the problem.

I'm not sure you can rely on /bin/bash existing.

Better to fix the script to not need bashisms.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Maier, Brandon L Collins via buildroot March 10, 2022, 3:06 p.m. UTC | #2
David,

> -----Original Message-----
> From: David Laight <David.Laight@ACULAB.COM> 
> Sent: Thursday, March 10, 2022 1:41 AM
> To: Shotwell, Clayton L Collins <Clayton.Shotwell@collins.com>; buildroot@buildroot.org
> Cc: Shotwell, Clayton L Collins <Clayton.Shotwell@collins.com>; Weber, Matthew L Collins <Matthew.Weber@collins.com>
> Subject: [External] RE: [Buildroot] [PATCH 1/1] fs: Change default fakeroot shell to bash
>
> From: clayton.shotwell
> > Sent: 09 March 2022 23:08
> > 
> > The addition of the removal of the /run and /tmp contents using a 
> > non-POSIX pattern causes the file system creation to fail on systems 
> > where /bin/sh does not default to bash. Switching the fakeroot script 
> > to a bash shell addresses the problem.
>
> I'm not sure you can rely on /bin/bash existing.
>
> Better to fix the script to not need bashisms.

Bash is a required tool of Buildroot (according to the manual anyway) but I agree fixing the bashism would be the better
option. I see others have already pushed a fix so I will mark this patch as Rejected.

https://patchwork.ozlabs.org/project/buildroot/patch/20220310120256.GA11974@parad0x.org/

Thanks,
Clayton
diff mbox series

Patch

diff --git a/fs/common.mk b/fs/common.mk
index 45beb5ae7b..09edf41c21 100644
--- a/fs/common.mk
+++ b/fs/common.mk
@@ -172,7 +172,7 @@  $$(BINARIES_DIR)/$$(ROOTFS_$(2)_FINAL_IMAGE_NAME): $$(ROOTFS_$(2)_DEPENDENCIES)
 		$$(BASE_TARGET_DIR)/ \
 		$$(TARGET_DIR)
 
-	echo '#!/bin/sh' > $$(FAKEROOT_SCRIPT)
+	echo '#!/bin/bash' > $$(FAKEROOT_SCRIPT)
 	echo "set -e" >> $$(FAKEROOT_SCRIPT)
 
 	echo "chown -h -R 0:0 $$(TARGET_DIR)" >> $$(FAKEROOT_SCRIPT)