* [PATCH] bash: add alternative configuration for bin/sh -> /bin/bash @ 2009-03-27 20:50 Tim Harvey 2009-03-27 21:02 ` Chris Larson 0 siblings, 1 reply; 7+ messages in thread From: Tim Harvey @ 2009-03-27 20:50 UTC (permalink / raw) To: openembedded-devel Add alternative configuration for /bin/sh -> /bin/bash so that for example bash can exist (and override) as shell if busybox is also installed diff --git a/recipes/bash/bash.inc b/recipes/bash/bash.inc index 4eba689..7c6122b 100644 --- a/recipes/bash/bash.inc +++ b/recipes/bash/bash.inc @@ -4,7 +4,7 @@ DEPENDS = "ncurses" SECTION = "base/shell" LICENSE = "GPL" -inherit autotools gettext +inherit autotools gettext update-alternatives PARALLEL_MAKE = "" @@ -33,3 +33,8 @@ pkg_postinst () { grep -q "bin/bash" $D${sysconfdir}/shells || echo /bin/bash >> $D${sysconfdir}/shells grep -q "bin/sh" $D${sysconfdir}/shells || echo /bin/sh >> $D${sysconfdir}/shells } + +ALTERNATIVE_NAME = "sh" +ALTERNATIVE_LINK = "${base_bindir}/sh" +ALTERNATIVE_PATH = "${base_bindir}/bash" +ALTERNATIVE_PRIORITY = "90" diff --git a/recipes/bash/bash_3.0.bb b/recipes/bash/bash_3.0.bb index e23887a..8165d07 100644 --- a/recipes/bash/bash_3.0.bb +++ b/recipes/bash/bash_3.0.bb @@ -1,5 +1,5 @@ require bash.inc -PR = "r11" +PR = "r12" SRC_URI += "\ file://bash-3.0-fixes.patch;patch=1 \ diff --git a/recipes/bash/bash_3.2.bb b/recipes/bash/bash_3.2.bb index 6a48a4b..e175467 100644 --- a/recipes/bash/bash_3.2.bb +++ b/recipes/bash/bash_3.2.bb @@ -1,6 +1,6 @@ require bash.inc -PR = "r7" +PR = "r8" SRC_URI += "\ file://builtins.patch;patch=1 \ ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] bash: add alternative configuration for bin/sh -> /bin/bash 2009-03-27 20:50 [PATCH] bash: add alternative configuration for bin/sh -> /bin/bash Tim Harvey @ 2009-03-27 21:02 ` Chris Larson 2009-03-27 22:51 ` Koen Kooi 2009-04-01 16:26 ` Tim Harvey 0 siblings, 2 replies; 7+ messages in thread From: Chris Larson @ 2009-03-27 21:02 UTC (permalink / raw) To: openembedded-devel Be very careful with this. Specifically, be sure to thoroughly test installing bash onto a system that currently has busybox, and the upgrade paths for both busybox and bash. You never want to get into a state, due to pre/post rm/install script execution order, where /bin/sh doesn't exist. If that happens, you won't be able to execute the next script to fix it :) On Fri, Mar 27, 2009 at 1:50 PM, Tim Harvey <tharvey@irobot.com> wrote: > Add alternative configuration for /bin/sh -> /bin/bash so that for example > bash can exist (and override) as shell if busybox is also installed > > diff --git a/recipes/bash/bash.inc b/recipes/bash/bash.inc > index 4eba689..7c6122b 100644 > --- a/recipes/bash/bash.inc > +++ b/recipes/bash/bash.inc > @@ -4,7 +4,7 @@ DEPENDS = "ncurses" > SECTION = "base/shell" > LICENSE = "GPL" > > -inherit autotools gettext > +inherit autotools gettext update-alternatives > > PARALLEL_MAKE = "" > > @@ -33,3 +33,8 @@ pkg_postinst () { > grep -q "bin/bash" $D${sysconfdir}/shells || echo /bin/bash >> > $D${sysconfdir}/shells > grep -q "bin/sh" $D${sysconfdir}/shells || echo /bin/sh >> > $D${sysconfdir}/shells > } > + > +ALTERNATIVE_NAME = "sh" > +ALTERNATIVE_LINK = "${base_bindir}/sh" > +ALTERNATIVE_PATH = "${base_bindir}/bash" > +ALTERNATIVE_PRIORITY = "90" > diff --git a/recipes/bash/bash_3.0.bb b/recipes/bash/bash_3.0.bb > index e23887a..8165d07 100644 > --- a/recipes/bash/bash_3.0.bb > +++ b/recipes/bash/bash_3.0.bb > @@ -1,5 +1,5 @@ > require bash.inc > -PR = "r11" > +PR = "r12" > > SRC_URI += "\ > file://bash-3.0-fixes.patch;patch=1 \ > diff --git a/recipes/bash/bash_3.2.bb b/recipes/bash/bash_3.2.bb > index 6a48a4b..e175467 100644 > --- a/recipes/bash/bash_3.2.bb > +++ b/recipes/bash/bash_3.2.bb > @@ -1,6 +1,6 @@ > require bash.inc > > -PR = "r7" > +PR = "r8" > > SRC_URI += "\ > file://builtins.patch;patch=1 \ > > > _______________________________________________ > Openembedded-devel mailing list > Openembedded-devel@lists.openembedded.org > http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel > -- Chris Larson clarson at kergoth dot com clarson at mvista dot com Founder - BitBake, OpenEmbedded, OpenZaurus Maintainer - Tslib Software Engineer MontaVista Software, Inc. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] bash: add alternative configuration for bin/sh -> /bin/bash 2009-03-27 21:02 ` Chris Larson @ 2009-03-27 22:51 ` Koen Kooi 2009-04-01 16:26 ` Tim Harvey 1 sibling, 0 replies; 7+ messages in thread From: Koen Kooi @ 2009-03-27 22:51 UTC (permalink / raw) To: openembedded-devel On 27-03-09 22:02, Chris Larson wrote: > Be very careful with this. Specifically, be sure to thoroughly test > installing bash onto a system that currently has busybox, and the > upgrade paths for both busybox and bash. You never want to get into a > state, due to pre/post rm/install script execution order, where > /bin/sh doesn't exist. If that happens, you won't be able to execute > the next script to fix it :) And we actually have busyboxisms in some scripts, you can't launch e-wm due to the OE wrapper script (which isn't needed anymore, btw) breaking with bash. regards, Koen > > On Fri, Mar 27, 2009 at 1:50 PM, Tim Harvey<tharvey@irobot.com> wrote: >> Add alternative configuration for /bin/sh -> /bin/bash so that for example >> bash can exist (and override) as shell if busybox is also installed >> >> diff --git a/recipes/bash/bash.inc b/recipes/bash/bash.inc >> index 4eba689..7c6122b 100644 >> --- a/recipes/bash/bash.inc >> +++ b/recipes/bash/bash.inc >> @@ -4,7 +4,7 @@ DEPENDS = "ncurses" >> SECTION = "base/shell" >> LICENSE = "GPL" >> >> -inherit autotools gettext >> +inherit autotools gettext update-alternatives >> >> PARALLEL_MAKE = "" >> >> @@ -33,3 +33,8 @@ pkg_postinst () { >> grep -q "bin/bash" $D${sysconfdir}/shells || echo /bin/bash>> >> $D${sysconfdir}/shells >> grep -q "bin/sh" $D${sysconfdir}/shells || echo /bin/sh>> >> $D${sysconfdir}/shells >> } >> + >> +ALTERNATIVE_NAME = "sh" >> +ALTERNATIVE_LINK = "${base_bindir}/sh" >> +ALTERNATIVE_PATH = "${base_bindir}/bash" >> +ALTERNATIVE_PRIORITY = "90" >> diff --git a/recipes/bash/bash_3.0.bb b/recipes/bash/bash_3.0.bb >> index e23887a..8165d07 100644 >> --- a/recipes/bash/bash_3.0.bb >> +++ b/recipes/bash/bash_3.0.bb >> @@ -1,5 +1,5 @@ >> require bash.inc >> -PR = "r11" >> +PR = "r12" >> >> SRC_URI += "\ >> file://bash-3.0-fixes.patch;patch=1 \ >> diff --git a/recipes/bash/bash_3.2.bb b/recipes/bash/bash_3.2.bb >> index 6a48a4b..e175467 100644 >> --- a/recipes/bash/bash_3.2.bb >> +++ b/recipes/bash/bash_3.2.bb >> @@ -1,6 +1,6 @@ >> require bash.inc >> >> -PR = "r7" >> +PR = "r8" >> >> SRC_URI += "\ >> file://builtins.patch;patch=1 \ >> >> >> _______________________________________________ >> Openembedded-devel mailing list >> Openembedded-devel@lists.openembedded.org >> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel >> > > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] bash: add alternative configuration for bin/sh -> /bin/bash 2009-03-27 21:02 ` Chris Larson 2009-03-27 22:51 ` Koen Kooi @ 2009-04-01 16:26 ` Tim Harvey 2009-04-01 16:52 ` Chris Larson 1 sibling, 1 reply; 7+ messages in thread From: Tim Harvey @ 2009-04-01 16:26 UTC (permalink / raw) To: openembedded-devel Chris Larson wrote: > Be very careful with this. Specifically, be sure to thoroughly test > installing bash onto a system that currently has busybox, and the > upgrade paths for both busybox and bash. You never want to get into a > state, due to pre/post rm/install script execution order, where > /bin/sh doesn't exist. If that happens, you won't be able to execute > the next script to fix it :) > in my case, I have both bash and busybox installed and I want bash to take priority as the /bin/sh which it otherwise does not. attempting to remove the package that contains your shell is something you need to be careful as anyway. This seems to me to be a prime example of where alternatives should be used? Tim > On Fri, Mar 27, 2009 at 1:50 PM, Tim Harvey <tharvey@irobot.com> wrote: > >> Add alternative configuration for /bin/sh -> /bin/bash so that for example >> bash can exist (and override) as shell if busybox is also installed >> >> diff --git a/recipes/bash/bash.inc b/recipes/bash/bash.inc >> index 4eba689..7c6122b 100644 >> --- a/recipes/bash/bash.inc >> +++ b/recipes/bash/bash.inc >> @@ -4,7 +4,7 @@ DEPENDS = "ncurses" >> SECTION = "base/shell" >> LICENSE = "GPL" >> >> -inherit autotools gettext >> +inherit autotools gettext update-alternatives >> >> PARALLEL_MAKE = "" >> >> @@ -33,3 +33,8 @@ pkg_postinst () { >> grep -q "bin/bash" $D${sysconfdir}/shells || echo /bin/bash >> >> $D${sysconfdir}/shells >> grep -q "bin/sh" $D${sysconfdir}/shells || echo /bin/sh >> >> $D${sysconfdir}/shells >> } >> + >> +ALTERNATIVE_NAME = "sh" >> +ALTERNATIVE_LINK = "${base_bindir}/sh" >> +ALTERNATIVE_PATH = "${base_bindir}/bash" >> +ALTERNATIVE_PRIORITY = "90" >> diff --git a/recipes/bash/bash_3.0.bb b/recipes/bash/bash_3.0.bb >> index e23887a..8165d07 100644 >> --- a/recipes/bash/bash_3.0.bb >> +++ b/recipes/bash/bash_3.0.bb >> @@ -1,5 +1,5 @@ >> require bash.inc >> -PR = "r11" >> +PR = "r12" >> >> SRC_URI += "\ >> file://bash-3.0-fixes.patch;patch=1 \ >> diff --git a/recipes/bash/bash_3.2.bb b/recipes/bash/bash_3.2.bb >> index 6a48a4b..e175467 100644 >> --- a/recipes/bash/bash_3.2.bb >> +++ b/recipes/bash/bash_3.2.bb >> @@ -1,6 +1,6 @@ >> require bash.inc >> >> -PR = "r7" >> +PR = "r8" >> >> SRC_URI += "\ >> file://builtins.patch;patch=1 \ >> >> >> _______________________________________________ >> Openembedded-devel mailing list >> Openembedded-devel@lists.openembedded.org >> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel >> >> > > > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] bash: add alternative configuration for bin/sh -> /bin/bash 2009-04-01 16:26 ` Tim Harvey @ 2009-04-01 16:52 ` Chris Larson 2009-04-01 17:01 ` Koen Kooi 0 siblings, 1 reply; 7+ messages in thread From: Chris Larson @ 2009-04-01 16:52 UTC (permalink / raw) To: openembedded-devel On Wed, Apr 1, 2009 at 9:26 AM, Tim Harvey <tharvey@irobot.com> wrote: > Chris Larson wrote: >> >> Be very careful with this. Specifically, be sure to thoroughly test >> installing bash onto a system that currently has busybox, and the >> upgrade paths for both busybox and bash. You never want to get into a >> state, due to pre/post rm/install script execution order, where >> /bin/sh doesn't exist. If that happens, you won't be able to execute >> the next script to fix it :) >> > > in my case, I have both bash and busybox installed and I want bash to take > priority as the /bin/sh which it otherwise does not. > > attempting to remove the package that contains your shell is something you > need to be careful as anyway. > > This seems to me to be a prime example of where alternatives should be used? You missed my point, it seems. I was talking about update-alternatives. Depending on how update-alternatives is implemented, there could be issues similar to what I mentioned in the previous email. Consider: if it uses system(), which calls /bin/sh, to remove the old /bin/sh link, and then calls system() again to create the new, it will fail. Speculation, but again, it's something you always need to keep in mind if you're messing with /bin/sh in any way. -- Chris Larson clarson at kergoth dot com clarson at mvista dot com Founder - BitBake, OpenEmbedded, OpenZaurus Maintainer - Tslib Software Engineer MontaVista Software, Inc. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] bash: add alternative configuration for bin/sh -> /bin/bash 2009-04-01 16:52 ` Chris Larson @ 2009-04-01 17:01 ` Koen Kooi 2009-04-01 17:12 ` Chris Larson 0 siblings, 1 reply; 7+ messages in thread From: Koen Kooi @ 2009-04-01 17:01 UTC (permalink / raw) To: openembedded-devel On 01-04-09 18:52, Chris Larson wrote: > On Wed, Apr 1, 2009 at 9:26 AM, Tim Harvey<tharvey@irobot.com> wrote: >> Chris Larson wrote: >>> >>> Be very careful with this. Specifically, be sure to thoroughly test >>> installing bash onto a system that currently has busybox, and the >>> upgrade paths for both busybox and bash. You never want to get into a >>> state, due to pre/post rm/install script execution order, where >>> /bin/sh doesn't exist. If that happens, you won't be able to execute >>> the next script to fix it :) >>> >> >> in my case, I have both bash and busybox installed and I want bash to take >> priority as the /bin/sh which it otherwise does not. >> >> attempting to remove the package that contains your shell is something you >> need to be careful as anyway. >> >> This seems to me to be a prime example of where alternatives should be used? > > You missed my point, it seems. I was talking about > update-alternatives. Depending on how update-alternatives is > implemented, there could be issues similar to what I mentioned in the > previous email. Consider: if it uses system(), which calls /bin/sh, > to remove the old /bin/sh link, and then calls system() again to > create the new, it will fail. Speculation, but again, it's something > you always need to keep in mind if you're messing with /bin/sh in any > way. IIRC our default u-a is a shell script, the other version is a perl script. Correct me if I'm wrong, it has been some years since I looked at it :) regards, Koen ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] bash: add alternative configuration for bin/sh -> /bin/bash 2009-04-01 17:01 ` Koen Kooi @ 2009-04-01 17:12 ` Chris Larson 0 siblings, 0 replies; 7+ messages in thread From: Chris Larson @ 2009-04-01 17:12 UTC (permalink / raw) To: openembedded-devel; +Cc: openembedded-devel On Wed, Apr 1, 2009 at 10:01 AM, Koen Kooi <k.kooi@student.utwente.nl> wrote: > On 01-04-09 18:52, Chris Larson wrote: >> >> On Wed, Apr 1, 2009 at 9:26 AM, Tim Harvey<tharvey@irobot.com> wrote: >>> >>> Chris Larson wrote: >>>> >>>> Be very careful with this. Specifically, be sure to thoroughly test >>>> installing bash onto a system that currently has busybox, and the >>>> upgrade paths for both busybox and bash. You never want to get into a >>>> state, due to pre/post rm/install script execution order, where >>>> /bin/sh doesn't exist. If that happens, you won't be able to execute >>>> the next script to fix it :) >>>> >>> >>> in my case, I have both bash and busybox installed and I want bash to >>> take >>> priority as the /bin/sh which it otherwise does not. >>> >>> attempting to remove the package that contains your shell is something >>> you >>> need to be careful as anyway. >>> >>> This seems to me to be a prime example of where alternatives should be >>> used? >> >> You missed my point, it seems. I was talking about >> update-alternatives. Depending on how update-alternatives is >> implemented, there could be issues similar to what I mentioned in the >> previous email. Consider: if it uses system(), which calls /bin/sh, >> to remove the old /bin/sh link, and then calls system() again to >> create the new, it will fail. Speculation, but again, it's something >> you always need to keep in mind if you're messing with /bin/sh in any >> way. > > IIRC our default u-a is a shell script, the other version is a perl script. > Correct me if I'm wrong, it has been some years since I looked at it :) That reminds me, one of my coworkers pointed me to a C implementation. If you grab the chkconfig srpm from centos 5.2, or another redhat based distribution, you'll find an alternatives.c written by redhat, whose syntax is the same as debian update-alternatives. Might be worth looking at. -- Chris Larson clarson at kergoth dot com clarson at mvista dot com Founder - BitBake, OpenEmbedded, OpenZaurus Maintainer - Tslib Software Engineer MontaVista Software, Inc. ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-04-01 17:15 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-03-27 20:50 [PATCH] bash: add alternative configuration for bin/sh -> /bin/bash Tim Harvey 2009-03-27 21:02 ` Chris Larson 2009-03-27 22:51 ` Koen Kooi 2009-04-01 16:26 ` Tim Harvey 2009-04-01 16:52 ` Chris Larson 2009-04-01 17:01 ` Koen Kooi 2009-04-01 17:12 ` Chris Larson
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.