Changeset View
Changeset View
Standalone View
Standalone View
files/0003-Support-an-alternative-bash-build-than-the-default.patch
| From f74aa1da64448a8cb3b991c819e6facb9e611f61 Mon Sep 17 00:00:00 2001 | From f74aa1da64448a8cb3b991c819e6facb9e611f61 Mon Sep 17 00:00:00 2001 | ||||
| From: Ikey Doherty <ikey@solus-project.com> | From: Ikey Doherty <ikey@solus-project.com> | ||||
| Date: Tue, 21 Nov 2017 08:05:38 +0000 | Date: Tue, 21 Nov 2017 08:05:38 +0000 | ||||
| Subject: [PATCH 3/3] Support an alternative bash build than the default | Subject: [PATCH 3/3] Support an alternative bash build than the default | ||||
| This change will have dracut use a specialised build of bash from the | This change will have dracut use a specialised build of bash from the | ||||
| new `bash-recovery` package in Solus within the initramfs as opposed to | new `bash-recovery` package in Solus within the initramfs as opposed to | ||||
| the full fat glibc-based bash binary. | the full fat glibc-based bash binary. | ||||
| Signed-off-by: Ikey Doherty <ikey@solus-project.com> | Signed-off-by: Ikey Doherty <ikey@solus-project.com> | ||||
| --- | --- | ||||
| modules.d/00bash/module-setup.sh | 9 +++++++-- | modules.d/00bash/module-setup.sh | 9 +++++++-- | ||||
| 1 file changed, 7 insertions(+), 2 deletions(-) | 1 file changed, 7 insertions(+), 2 deletions(-) | ||||
| diff --git a/modules.d/00bash/module-setup.sh b/modules.d/00bash/module-setup.sh | diff --git a/modules.d/00bash/module-setup.sh b/modules.d/00bash/module-setup.sh | ||||
| index 6dc73cf..e890cd8 100755 | index 89ef654..96a1dbb 100755 | ||||
| --- a/modules.d/00bash/module-setup.sh | --- a/modules.d/00bash/module-setup.sh | ||||
| +++ b/modules.d/00bash/module-setup.sh | +++ b/modules.d/00bash/module-setup.sh | ||||
| @@ -15,7 +15,12 @@ install() { | @@ -26,7 +26,12 @@ install() { | ||||
| # If another shell is already installed, do not use bash | |||||
| [[ -x $initdir/bin/sh ]] && return | |||||
| - # Prefer bash as /bin/sh if it is available. | inst /bin/bash | ||||
| - inst /bin/bash && ln -sf bash "${initdir}/bin/sh" | |||||
| - # Prefer bash as default shell if no other shell is preferred. | |||||
| - [[ -L $initdir/bin/sh ]] || ln -sf bash "${initdir}/bin/sh" | |||||
| + # Prefer bash.recovery binary due to smaller size | + # Prefer bash.recovery binary due to smaller size | ||||
| + if [[ -x /bin/bash.recovery ]]; then | + if [[ -x /bin/bash.recovery ]]; then | ||||
| + inst /bin/bash.recovery && ln -sf bash.recovery "${initdir}/bin/sh" && ln -sf bash.recovery "${initdir}/bin/bash" | + inst /bin/bash.recovery && ln -sf bash.recovery "${initdir}/bin/sh" && ln -sf bash.recovery "${initdir}/bin/bash" | ||||
| + else | + else | ||||
| + # Prefer bash as /bin/sh if it is available. | + # Prefer bash as default shell if no other shell is preferred. | ||||
| + inst /bin/bash && ln -sf bash "${initdir}/bin/sh" | + [[ -L $initdir/bin/sh ]] || ln -sf bash "${initdir}/bin/sh" | ||||
| + fi | + fi | ||||
| } | |||||
| } | |||||
| -- | -- | ||||
| 2.15.0 | 2.33.1 | ||||
Copyright © 2015-2021 Solus Project. The Solus logo is Copyright © 2016-2021 Solus Project. All Rights Reserved.