[U-Boot] image-fit: switch ENOLINK to ENOENT

Tom Rini trini at konsulko.com
Thu Sep 8 17:17:12 CEST 2016


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?

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160908/57b989a2/attachment.sig>


More information about the U-Boot mailing list