chroot: failed to run command 'sh': No such file or directory

Hello Experts ,

I have configured observer [not obslightserver] on Opensuse 12.3 .

I gave the build and got below error like

4s] running rpm-x86-arm postinstall script
4s] chroot: failed to run command 'sh': No such file or directory
4s] running rpm-libs-x86-arm postinstall script
4s] chroot: failed to run command 'sh': No such file or directory
4s] running tizen-accelerator postinstall script
4s] chroot: failed to run command 'sh': No such file or directory
4s] running bash-x86-arm postinstall script
4s] chroot: failed to run command 'sh': No such file or directory
4s] initializing rpm db...
4s] chroot: failed to run command '/usr/bin/rpmdb': No such file or directory

My worker is chroot type .

Even I have created the rootfs as per https://en.opensuse.org/openSUSE:OpenSUSE_on_your_ARM_board

Still same error , Please help me .

Thanks ,
Ram Patnaik
Senior Engineer

First,
Since we’re running on systemd, be aware you also now have a very similar but more secure alternative

systemd-nspawn

The command to invoke and run is very similar to chroot, but you won’t have to do a lot of the optional things that are highly recommended. The idea is fairly simple, systemd-nspawn uses a namespace argument/attribute to further isolate the environment.

So,
Just sayin… If you can find a similar script that invokes a systemd-nspawn instead of chroot, you’d be better off…

OK,
Now specifically your situation…
Seems to me you’re running some kind of generic “postinstall” script, probably written for some other distro. The problem with generic scripts is that they often assume things that aren’t true of all distros.

So, you’ll have to take a look at the innards of the script to see how chroot is being invoked.

Next, it looks like this is a script intended to run on ARM. You need to identify and inspect your OS image. Many ARM images are JeOS, so won’t include “extras” like chroot. If it’s missing, then you need to install. Of course, if you’re not even running an ARM image, then you’re not running an appropriate script.

Also, be aware you need to run this script either in a root console (likely best) or with sudo (may or may not cause issues).

You’ll need to locate the line that invokes chroot and inspect it for accuracy and whether it tries to apply special permissions. Install mlocate (locate) if necessary to determine where chroot (or any other file) is on your system.

HTH,
TSU

Hello ,

let me give you clear update here . I have installed OBS 2.4 on Opensuse 12.3 .
my VM_TYPE = ‘none’ , . I am using VM_TYPE is chroot .

So when I am giving build in OBS server , my build is looking for
BUILD_ARCH=i686
BUILD_ARCH=armv7l:armv6l:armv5tel
INITVM_NAME=initvm.i586

and getting bellow error
4s] chroot: failed to run command ‘sh’: No such file or directory

but when i have installed build-initvm-i586 , i was getting many more errors .

So i used below changes which is working fine like

++++++++++++++++++++++++++++++++++++++++
local path dest

echo "copying qemu"


mkdir -p $BUILD_ROOT/usr/bin

for path in /usr/bin/qemu-; do
if file $path | grep -q static; then
dest="$BUILD_ROOT/usr/bin/${path##
/}"
if -f “$path” -a ! -x “$dest” ]; then
echo -n " $path" # report copy
#echo install -m755 “$path” “$dest”
install -m755 “$path” “$dest”
fi
fi
done
++++++++++++++++++++++++++++++++++++++++++++++++++++++++

if am coping copying qemu to build/root/qemu* files from /usr/bin … there wil no issues . Build is success .

So can you tell me is there any package or configuration I am missing ???
which the qemu* files are not coping to /build_dir/root/user/bin ??

i dont want to keep my changes . so please tell me how to fix this or how the script will copy qemu to build/root/qemu* files from /usr/bin

I see you found the OBS:Development forum and have posted there, it looks like your error is likely an OBS script error invoking chroot, not chroot itself.

TSU