mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* barebox bug, sh [ -c /dev/nand0.var.ubi.blablablub ] returns |true| even if there is no "blablablub" partition on "var" volume
@ 2019-09-02  9:40 Mainz, Roland
  2019-09-02 12:08 ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Mainz, Roland @ 2019-09-02  9:40 UTC (permalink / raw)
  To: customers.eckelmann, barebox
  Cc: Arne Wichmann (arne.wichmann@thinventions.de), Uwe Kleine-König


Hi!

----

Quick&dirty bug report:

- Version: barebox 2018.05.0-20190221-1-EAG_3.00-gf70df96 #1 Mon Sep 2 09:03:05 CEST 2019
- Hardware: Eckelmann/EAG Quantron

Problem:
The barebox sh's "test"/"[" shell builtin returns "true" for /dev/nand0.var.ubi.blablablub even if there is no "blablablub" partition on the "var" volume.

Example:
-------- snip --------
barebox:/ ls -l /dev
crw-------         153600 fb0
cr--------              0 full
crw-------             32 imx_iim_bank0
crw-------             32 imx_iim_bank1
crw-------             32 imx_iim_bank2
crw-------            256 mc34704
crw-------     4294967295 mem
crw-------      134217728 nand0
crw-------        1048576 nand0.barebox
crw-------        1048576 nand0.barebox.bb
crw-------      133955584 nand0.bb
crw-------        1048576 nand0.environment
crw-------        1048576 nand0.environment.bb
cr--------        4194304 nand0.oob
crw-------      138412032 nand0.raw
crw-------       83886080 nand0.root
crw-------       83886080 nand0.root.bb
crw-------       45744128 nand0.var
crw-------       45481984 nand0.var.bb
c---------              0 nand0.var.ubi
crw-------       23617536 nand0.var.ubi.rw
crw-------       15110144 nand0.var.ubi.stat
c-w-------              0 null
cr--------              0 prng
crw-------      134217728 ram0
c-w-------              0 serial4-1
cr--------              0 zero
barebox:/ ls -l /dev/nand0.var.ubi.blablablub                                               
ls: /dev/nand0.var.ubi.blablablub: No such file or directory
barebox:/ ls -l /dev/nand0.var.ubi.blablablub                        
ls: /dev/nand0.var.ubi.blablablub: No such file or directory
barebox:/ if [ -c /dev/nand0.var.ubi.blablablub ] ; then echo wrong ; else echo "right" ; fi
wrong
barebox:/ if [ -f /dev/nand0.var.ubi.blablablub ] ; then echo wrong ; else echo "right" ; fi
right
-------- snip --------

----

Mfg,
Roland Mainz
-- 
Roland Mainz, MAA/CAS
Eckelmann AG, Berliner Str. 161, 65205 Wiesbaden
Telefon +49/611/7103-661, Fax +49/611/7103-133
r.mainz@eckelmann.de

Eckelmann Group - Source of inspiration



_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: barebox bug, sh [ -c /dev/nand0.var.ubi.blablablub ] returns |true| even if there is no "blablablub" partition on "var" volume
  2019-09-02  9:40 barebox bug, sh [ -c /dev/nand0.var.ubi.blablablub ] returns |true| even if there is no "blablablub" partition on "var" volume Mainz, Roland
@ 2019-09-02 12:08 ` Sascha Hauer
  2019-09-02 12:37   ` Mainz, Roland
  0 siblings, 1 reply; 4+ messages in thread
From: Sascha Hauer @ 2019-09-02 12:08 UTC (permalink / raw)
  To: Mainz, Roland
  Cc: customers.eckelmann,
	Arne Wichmann (arne.wichmann@thinventions.de),
	Uwe Kleine-König, barebox

Hi Roland,

On Mon, Sep 02, 2019 at 09:40:26AM +0000, Mainz, Roland wrote:
> 
> Hi!
> 
> ----
> 
> Quick&dirty bug report:
> 
> - Version: barebox 2018.05.0-20190221-1-EAG_3.00-gf70df96 #1 Mon Sep 2 09:03:05 CEST 2019
> - Hardware: Eckelmann/EAG Quantron
> 
> barebox:/ ls -l /dev/nand0.var.ubi.blablablub                                               
> ls: /dev/nand0.var.ubi.blablablub: No such file or directory
> barebox:/ ls -l /dev/nand0.var.ubi.blablablub                        
> ls: /dev/nand0.var.ubi.blablablub: No such file or directory
> barebox:/ if [ -c /dev/nand0.var.ubi.blablablub ] ; then echo wrong ; else echo "right" ; fi
> wrong
> barebox:/ if [ -f /dev/nand0.var.ubi.blablablub ] ; then echo wrong ; else echo "right" ; fi
> right

barebox doesn't implement -c for test. You'll have to use -e or -f to
test for existence.
Arguably we should throw an error for this unsupported option rather
than doing something undefined.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: barebox bug, sh [ -c /dev/nand0.var.ubi.blablablub ] returns |true| even if there is no "blablablub" partition on "var" volume
  2019-09-02 12:08 ` Sascha Hauer
@ 2019-09-02 12:37   ` Mainz, Roland
  2019-09-02 21:30     ` Robert Schwebel
  0 siblings, 1 reply; 4+ messages in thread
From: Mainz, Roland @ 2019-09-02 12:37 UTC (permalink / raw)
  To: Sascha Hauer
  Cc: Mainz, Roland, customers.eckelmann,
	Arne Wichmann (arne.wichmann@thinventions.de),
	Uwe Kleine-König, barebox





> -----Original Message-----
> From: Sascha Hauer [mailto:s.hauer@pengutronix.de]
> Sent: Monday, September 2, 2019 2:08 PM
> To: Mainz, Roland <R.Mainz@eckelmann.de>
> Cc: customers.eckelmann@pengutronix.de; barebox@lists.infradead.org;
> Arne Wichmann (arne.wichmann@thinventions.de)
> <arne.wichmann@thinventions.de>; Uwe Kleine-König <u.kleine-
> koenig@pengutronix.de>
> Subject: Re: barebox bug, sh [ -c /dev/nand0.var.ubi.blablablub ] returns
> |true| even if there is no "blablablub" partition on "var" volume
> 
> Hi Roland,
> 
> On Mon, Sep 02, 2019 at 09:40:26AM +0000, Mainz, Roland wrote:
> >
> > Hi!
> >
> > ----
> >
> > Quick&dirty bug report:
> >
> > - Version: barebox 2018.05.0-20190221-1-EAG_3.00-gf70df96 #1 Mon Sep
> 2
> > 09:03:05 CEST 2019
> > - Hardware: Eckelmann/EAG Quantron
> >
> > barebox:/ ls -l /dev/nand0.var.ubi.blablablub
> > ls: /dev/nand0.var.ubi.blablablub: No such file or directory
> > barebox:/ ls -l /dev/nand0.var.ubi.blablablub
> > ls: /dev/nand0.var.ubi.blablablub: No such file or directory barebox:/
> > if [ -c /dev/nand0.var.ubi.blablablub ] ; then echo wrong ; else echo
> > "right" ; fi wrong barebox:/ if [ -f /dev/nand0.var.ubi.blablablub ] ;
> > then echo wrong ; else echo "right" ; fi right
> 
> barebox doesn't implement -c for test. You'll have to use -e or -f to test for
> existence.
> Arguably we should throw an error for this unsupported option rather than
> doing something undefined.

Could you *please* implement test(1) -b/-c ? Since barebox ls(1) is able to distinguish files from devices it shouldn't be hard, and there are cases (like our update script) where telling the difference between file and device is important (the alternative is to write hideous workarounds...).

----

Mfg,
Roland Mainz 
-- 
Roland Mainz, MAA/CAS
Eckelmann AG, Berliner Str. 161, 65205 Wiesbaden
Telefon +49/611/7103-661, Fax +49/611/7103-133
r.mainz@eckelmann.de

Eckelmann Group - Source of inspiration

> 
> Sascha
> 
> --
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: barebox bug, sh [ -c /dev/nand0.var.ubi.blablablub ] returns |true| even if there is no "blablablub" partition on "var" volume
  2019-09-02 12:37   ` Mainz, Roland
@ 2019-09-02 21:30     ` Robert Schwebel
  0 siblings, 0 replies; 4+ messages in thread
From: Robert Schwebel @ 2019-09-02 21:30 UTC (permalink / raw)
  To: barebox

Roland,

On Mon, Sep 02, 2019 at 12:37:37PM +0000, Mainz, Roland wrote:
> Could you *please* implement test(1) -b/-c ? Since barebox ls(1) is
> able to distinguish files from devices it shouldn't be hard, and there
> are cases (like our update script) where telling the difference
> between file and device is important (the alternative is to write
> hideous workarounds...).

This is a public community mailing list. In this context, you are free
to send a patch if you want to see a feature in barebox.

As you also sent this mail to your support mailinglist, the colleagues
responsible for that project will handle the request there.

Thanks,
Robert
-- 
Pengutronix e.K.                           | Dipl.-Ing. Robert Schwebel  |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-09-02 21:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-02  9:40 barebox bug, sh [ -c /dev/nand0.var.ubi.blablablub ] returns |true| even if there is no "blablablub" partition on "var" volume Mainz, Roland
2019-09-02 12:08 ` Sascha Hauer
2019-09-02 12:37   ` Mainz, Roland
2019-09-02 21:30     ` Robert Schwebel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox