[U-Boot] image-fit: switch ENOLINK to ENOENT
Jonathan Gray
jsg at jsg.id.au
Thu Sep 8 17:54:12 CEST 2016
On Thu, Sep 08, 2016 at 11:17:12AM -0400, Tom Rini wrote:
> On Thu, Sep 08, 2016 at 11:53:48PM +1000, Jonathan Gray wrote:
> > On Thu, Sep 08, 2016 at 09:15:45AM -0400, Tom Rini wrote:
> > > On Thu, Sep 08, 2016 at 11:06:34PM +1000, Jonathan Gray wrote:
> > > > On Thu, Sep 08, 2016 at 08:48:53AM -0400, Tom Rini wrote:
> > > > > On Thu, Sep 08, 2016 at 10:01:52PM +1000, Jonathan Gray wrote:
> > > > > > On Wed, Sep 07, 2016 at 02:00:19PM -0400, Tom Rini wrote:
> > > > > > > On Sat, Sep 03, 2016 at 08:30:14AM +1000, Jonathan Gray wrote:
> > > > > > >
> > > > > > > > ENOLINK is not required by POSIX and does not exist on OpenBSD
> > > > > > > > and likely other systems.
> > > > > > > >
> > > > > > > > Signed-off-by: Jonathan Gray <jsg at jsg.id.au>
> > > > > > >
> > > > > > > Applied to u-boot/master, thanks!
> > > > > >
> > > > > > Thanks for applying this and the other patch.
> > > > > >
> > > > > > In tools/kwboot.c I've also locally changed EPROTO and EBADMSG as they
> > > > > > aren't on OpenBSD either.
> > > > > >
> > > > > > They are in POSIX however so I am trying to get them into OpenBSD,
> > > > > > but it will need some time to be scheduled as introducing errnos
> > > > > > involves cranking the major version of libc due to the size of the array
> > > > > > with errno strings changing.
> > > > > >
> > > > > > I wasn't sure if the following would be accepted for that reason,
> > > > > > thoughts?
> > > > >
> > > > > Well, looking over the code in question, we're talking about error
> > > > > handling during xmodem transfers. What are the errno values that get
> > > > > used there by xmodem tools? Thanks!
> > > >
> > > > I don't see how xmodem tools would use those errno values themselves?
> > > > From what I understood, kwboot attaches directly to serial /dev devices
> > > > and handles xmodem and terminal emulation itself.
> > > >
> > > > In the kwboot case nothing in the return path seems to check for
> > > > specific errno values. The return sequence looks like
> > > >
> > > > kwboot_xm_sendblock
> > > > kwboot_xmodem
> > > > main
> > > > perror("xmodem");
> > >
> > > Right. But we're also using it to indicate to the caller that there was
> > > a problem. I can see using EIO for unknown error but I don't like
> > > ECONNREFUSED for an explicit NAK. So what I'm asking is, what's passed
> > > around in other tools when you get a NAK reply in xmodem?
> >
> > I haven't found any that display an errno based string
> >
> > http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/usr.bin/cu/xmodem.c?rev=HEAD&content-type=text/plain
> >
> > lrzsz src/lsz.c
> > zperr(_("NAK on sector")); (prints to stderr non-fatally without errno)
> >
> > kermit code seems to be quite hard to follow...
> >
> > The list of errnos currently implemented on OpenBSD can be found here:
> > http://man.openbsd.org/OpenBSD-current/man2/intro.2
> >
> > The strings perror/strerror(errno) use can be found here
> > http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/lib/libc/gen/errlist.c?rev=HEAD&content-type=text/plain
> > And in the above manual page.
> >
> > ENOMSG "No message of desired type." might work
> >
> > Though it is documented as
> >
> > "An IPC message queue does not contain a message of the desired type,
> > or a message catalog does not contain the requested message."
> >
> > on OpenBSD and in POSIX as
> >
> > "No message of the desired type. The message queue does not contain a
> > message of the required type during XSI interprocess communication."
> >
> > Neither EBADMSG or ENOMSG appear to be documented in glibc beyond
> > mentioning that they are valid values?
> >
> > https://www.gnu.org/software/libc/manual/html_node/Error-Codes.html
>
> EBADMSG and ENOMSG just fall back to POSIX.1. Is it really hard to
> carry a patch to U-Boot in OpenBSD until the libc can be updated for
> some POSIX errno values?
Having the patch until then is fine.
We already carry patches to convert a few targets to support
distro_bootcmd so our efi bootloader gets loaded automatically.
Mostly taken from looking at patches linux distributions have,
though some of these are marked as incomplete and I'm not clear
on which have been properly proposed on the u-boot list.
cm-fx6/utilite
http://pkgs.fedoraproject.org/cgit/rpms/uboot-tools.git/tree/port-utilite-to-distro-generic-boot-commands.patch
omap3 beagle
https://github.com/openSUSE/u-boot/commit/8ea945ff9d5f57f626167d41b1c59d9518fb60b2.patch
omap5/beagleboard x15
https://anonscm.debian.org/git/collab-maint/u-boot.git/tree/debian/patches/am57xx/omap5_distro_bootcmd?h=experimental-2016.09
others not yet used:
odroid x2/u3
https://anonscm.debian.org/git/collab-maint/u-boot.git/tree/debian/patches/odroid/0001-Convert-odroid-to-use-distro_bootcmd.patch?h=experimental-2016.09
mvebu/clearfog
http://pkgs.fedoraproject.org/cgit/rpms/uboot-tools.git/tree/mvebu-enable-generic-distro-boot-config.patch
nitrogen6x/sabre lite
http://lists.denx.de/pipermail/u-boot/2016-August/262674.html
More information about the U-Boot
mailing list