[elbe-devel] [PATCH] Fix silent command error in cpio examples
Torben Hohn
torben.hohn at linutronix.de
Tue Jul 2 09:26:56 CEST 2019
On Tue, Jul 02, 2019 at 08:45:58AM +0200, John Ogness wrote:
> Hi Bastian,
>
> On 2019-07-01, bage at linutronix.de wrote:
> > From: Bastian Germann <bage at linutronix.de>
> >
> > The *cpio.xml examples do not write the rcS file because the commands fails
> > silently:
> >
> > running cmd +chroot /var/cache/elbe/eec456e0-0fd1-45c9-b92f-e9a5616a1c50/target /bin/sh with STDIN echo "#!/bin/sh" | tee /etc/init.d/rcS+
> > ------------------------------------------------------------------------------
> > ------------------------------------------------------------------------------
> >
> > Command failed with errorcode 1
> > Finetuning Error, trying to continue anyways
> > running cmd +chroot /var/cache/elbe/eec456e0-0fd1-45c9-b92f-e9a5616a1c50/target /bin/sh with STDIN echo "mount -a" | tee -a /etc/init.d/rcS+
> > ------------------------------------------------------------------------------
> > qemu: unknown option 'a'
> > ------------------------------------------------------------------------------
>
> This is actually a problem relating to qemu. For some reason it is does
> not call tee correctly. It seems it does not find it in the path
> somehow. (More comments about this below...)
>
> > Command failed with errorcode 1
> > Finetuning Error, trying to continue anyways
> > running cmd +chroot /var/cache/elbe/eec456e0-0fd1-45c9-b92f-e9a5616a1c50/target /bin/sh with STDIN chmod +x /etc/init.d/rcS+
> > ------------------------------------------------------------------------------
> > chmod: /etc/init.d/rcS: No such file or directory
> > ------------------------------------------------------------------------------
> >
> > Command failed with errorcode 1
> > Finetuning Error, trying to continue anyways
> >
> > Signed-off-by: Bastian Germann <bage at linutronix.de>
> > ---
> > examples/armel-rescue-busybox-cpio.xml | 4 ++--
> > examples/x86_64-pc-rescue-busybox-dyn-cpio.xml | 4 ++--
> > 2 files changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/examples/armel-rescue-busybox-cpio.xml b/examples/armel-rescue-busybox-cpio.xml
> > index 4b30d89d..657aea4c 100644
> > --- a/examples/armel-rescue-busybox-cpio.xml
> > +++ b/examples/armel-rescue-busybox-cpio.xml
> > @@ -69,8 +69,8 @@
> > <mknod opts="c 5 1">/dev/console</mknod>
> > <mknod opts="c 1 3">/dev/null</mknod>
> > <!-- Add start script (may be moved to archive) -->
> > - <command>echo "#!/bin/sh" | tee /etc/init.d/rcS</command>
> > - <command>echo "mount -a" | tee -a /etc/init.d/rcS</command>
> > + <command>echo "#!/bin/sh" > /etc/init.d/rcS</command>
> > + <command>echo "mount -a" >> /etc/init.d/rcS</command>
> > <command>chmod +x /etc/init.d/rcS</command>
>
> Changing "tee" to "/usr/bin/tee" will also fix the problem. I am curious
> why qemu (started via binfmt) has a problem finding binaries started via
> pipe. I guess I should open an issue about this.
>
> If you want to fix using shell redirects instead, I recommend using
> ">" instead of ">" so that the XML is "cleaner". (This is my personal
> preference. I really don't care if anyone wants to sign off this patch
> as it is.)
errm... we have <file> now.
so, the recommended way of doing this is:
<file dst="/etc/init.d/rcS">
#!/bin/sh
mount -a
</file>
however, we whould really find out, what is wrong here.
--
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99
Hinweise zum Datenschutz finden Sie hier (Informations on data privacy
can be found here): https://linutronix.de/kontakt/Datenschutz.php
Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen |
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner
More information about the elbe-devel
mailing list