On 2015-10-14 at 20:41 "'Davide Libenzi' via Akaros"
<
aka...@googlegroups.com> wrote:
> Did not have time to dig into it, by trying to replicate yet.
> Glancing at the code, in sysfile.c, there is something which needs
> fixing, though, I am not sure that is the culprit.
> We do like:
>
> int fd = somefunc(...); // somefunc returns >= 0 if OK, or
> -Esomething in case of error
>
> if (fd < 0)
> error(fd, "blah ...");
>
> Should be error(-fd, ...).
Yeah, that seems a little weird. There might be other cases floating
around where errno is set by a function (now with set_errno()), and
then we come along later and want to do an error() without changing
errno.
> What exact error do you get from cpio?
/ $ ash ifconfig
Welcome to QEMU!
/etc/network/local not found
bind #cons -> /dev flag 1
bind #proc -> /proc flag 1
bind #srv -> /srv flag 1
bind #ip -> /net flag 2
bind #ether.0 -> /net flag 2
I am 10.0.2.15, default route 10.0.2.2
cs hasn't created #srv/cs yet, sleeping until it does...
bind #kprof -> /prof/ flag 2
ifconfig complete
/ $ ash root
bin hello-go somefile
go_get_html initramfs.cpio
/ $ cd dir1
/dir1/ $ cpio -d -i < /mnt/init
/dir1/ $ cpio -d -i < /mnt/initramfs.cpio
cpio: can't stat old file: No such device, No such device
The repeating of "No such device" twice is due to using
errno_to_errstring in error(), such that we're saying ENODEV, "No such
device". Userspace doesn't know that errstr is a copy of the text of
ENODEV, so it does its own strerror, followed by a verbatim dump of
errstr.
The "can't stat old file" comes from busybox itself.
Barret