Overview

Request 798881 accepted

No description set
Loading...

Dominique Leuenberger's avatar

Nasty:

[   10s] running bash postinstall script
[   10s] chroot: failed to run command 'sh': No such file or directory

the post script uses /bin/sh to run update-alternatives that actually defines what /bin/sh is.The sanest will likely be for %post -p /usr/bin/bash here; we know /usr/bin/bash exists and is capable of running its own post script


Dr. Werner Fink's avatar

I see in the build log

[   13s] running aaa_base preinstall script
[   13s] chroot: failed to run command 'sh': No such file or directory
[   13s] running aaa_base postinstall script
[   13s] chroot: failed to run command 'sh': No such file or directory
[   13s] initializing rpm db...

Dr. Werner Fink's avatar

Ohmm ... from spec file

%post -p /bin/bash
%{_sbindir}/update-alternatives --quiet --force \
        --install %{_bindir}/sh sh %{_bindir}/bash 10100

%preun -p /bin/bash
if test "$1" = 0; then
        %{_sbindir}/update-alternatives --quiet --remove sh %{_bindir}/bash
fi

Dominique Leuenberger's avatar

hm.. interesting.. then I rather think the build script is doing something weird here. the script does what I'd expect to be ok.


Dominique Leuenberger's avatar

the rpm scriptlet does what I'd expect to be ok


Dr. Werner Fink's avatar

It could be that if the root is not default root then rpm uses chroot() with default SHELL for installing or updating ... maybe there would help to export the SHELL variable with existing shell like the bash


Dr. Werner Fink's avatar

From manual page of rpm:

       --root DIRECTORY
              Use the file system tree rooted at DIRECTORY for all operations.  Note that this means the  database
              within  DIRECTORY will  be  used  for dependency checks and any scriptlet(s) (e.g.  %post if installing,
              or %prep if building, a package will be run after a chroot(2) to DIRECTORY.

Thorsten Kukuk's avatar

/.build/build-recipe: /bin/egrep: /bin/sh: bad interpreter: No such file or directory

So the scripts inside the build directory are using /bin/sh, but if you look at the list of installed packages before, bash gets installed, but not update-alternatives. So /bin/sh cannot be available.

We need to fix the list of RPMs which needs to be pre-installed if we use /bin/sh that early.


Dominique Leuenberger's avatar

Adrian and mls are looking into this. The usage of 'egrep' can easily be changed to grep -E (which is what egrep does anyway - so we can get away here without sh).


Dr. Werner Fink's avatar

As in the spec file of bash we have

BuildRequires:  update-alternatives
Requires(post): update-alternatives
Requires(preun): update-alternatives

the update-alternatives seems to be missed in preinstalled build image

[    1s] [1/33] preinstalling filesystem...
[    1s] [2/33] preinstalling permissions...
[    1s] [3/33] preinstalling glibc...
[    2s] [4/33] preinstalling fillup...
[    2s] [5/33] preinstalling libacl1...
[    2s] [6/33] preinstalling libattr1...
[    2s] [7/33] preinstalling libbz2-1...
[    2s] [8/33] preinstalling libcap2...
[    2s] [9/33] preinstalling libgcc_s1...
[    2s] [10/33] preinstalling libgpg-error0...
[    2s] [11/33] preinstalling liblua5_3-5...
[    2s] [12/33] preinstalling liblzma5...
[    2s] [13/33] preinstalling libpcre1...
[    2s] [14/33] preinstalling libpopt0...
[    2s] [15/33] preinstalling libz1...
[    2s] [16/33] preinstalling libzstd1...
[    2s] [17/33] preinstalling attr...
[    2s] [18/33] preinstalling libelf1...
[    2s] [19/33] preinstalling libgcrypt20...
[    2s] [20/33] preinstalling libncurses6...
[    2s] [21/33] preinstalling libselinux1...
[    2s] [22/33] preinstalling libreadline7...
[    2s] [23/33] preinstalling libreadline8...
[    2s] [24/33] preinstalling tar...
[    2s] [25/33] preinstalling bash...
[    2s] [26/33] preinstalling diffutils...
[    2s] [27/33] preinstalling grep...
[    2s] [28/33] preinstalling pam...
[    3s] [29/33] preinstalling sed...
[    3s] [30/33] preinstalling coreutils...
[    3s] [31/33] preinstalling aaa_base...
[    3s] [32/33] preinstalling rpm-config-SUSE...
[    3s] [33/33] preinstalling rpm...

Dominique Leuenberger's avatar

@kukuk can you please accept the review on your name here?

Obs has been fixed; it ignored the - p parameter for post scripts and assumed /bin/sh. Staging:C now looks good


Dr. Werner Fink's avatar

I wonder about installation from DVD/CD/Blu-Ray as there is also a minimal setup ... wouldn't be a simple ln -sf /usr/bin/bash /bin/sh from host system into the chroot environment to get the initial /bin/sh working


Dominique Leuenberger's avatar

The regular installer already used the post script with the defined interpreter (i.e. bash, as defined; and then uses update-alternatives to properly link up /bin/sh -> usr/bin/sh -> /etc/alternatives/sh -> /usr/bin/bash. For OBS this simply did not work because it ignored the -p flag to use bash and made wrong assumptions.

Request History
Dr. Werner Fink's avatar

WernerFink created request


Factory Auto's avatar

factory-auto added opensuse-review-team as a reviewer

Please review sources


Factory Auto's avatar

factory-auto accepted review

Check script succeeded


Saul Goodman's avatar

licensedigger accepted review

ok


Dominique Leuenberger's avatar

dimstar accepted review


Dominique Leuenberger's avatar

dimstar_suse set openSUSE:Factory:Staging:C as a staging project

Being evaluated by staging project "openSUSE:Factory:Staging:C"


Dominique Leuenberger's avatar

dimstar_suse accepted review

Picked "openSUSE:Factory:Staging:C"


Dr. Werner Fink's avatar

WernerFink added kukuk as a reviewer

The temporary remove of the link /bin/sh and/or /usr/bin/sh cause trouble during builf and installation


Thorsten Kukuk's avatar

kukuk accepted review


Dominique Leuenberger's avatar

dimstar_suse accepted review

Staging Project openSUSE:Factory:Staging:C got accepted.


Dominique Leuenberger's avatar

dimstar_suse approved review

Staging Project openSUSE:Factory:Staging:C got accepted.


Dominique Leuenberger's avatar

dimstar_suse accepted request

Staging Project openSUSE:Factory:Staging:C got accepted.

openSUSE Build Service is sponsored by