We've added bash to our buildroot configuration and would now like to make it the default shell for the root user. I'd prefer not to add a passwd file to our overlay so is there some way through buildroot's config to make the root shell default to /bin/bash rather than /bin/sh?
You can set the shell for all users to bash by setting BR2_SYSTEM_BIN_SH_BASH, i.e. in menuconfig set System configuration -> /bin/sh to bash. This will generate /bin/sh as a symlink to bash.
To set it for the root user only, you'll need a post-build script such as:
#!/bin/sh
sed -i '/^root:/s,:/bin/sh$,:/bin/bash,' ${TARGET_DIR}/etc/passwd
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With