[PATCH] scripts: gen_image_generic: allow FAT fs on kernel partition for non-GPT targets

Elliott Mitchell ehem+openwrt at m5p.com
Fri Mar 29 11:08:50 PDT 2024


On Fri, Mar 29, 2024 at 04:32:18PM +0100, Paul D wrote:
> Recommend avoiding -a and -o params.
> 
> Use instead e.g.
> 
> [ -n "$GUID" ] || [ "$KERNELPARTTYPE" = "6" ] || [ "$KERNELPARTTYPE" = "c" ]
> 
> https://www.shellcheck.net/wiki/SC2166

The examples pointed to amounted to "be careful with untrusted input to
shell scripts".  Build systems must already be pretty much 100% trusted.
If someone slips something problematic into one there is pretty much
nothing to be done about it.


I've been getting the feeling the whole community is slowly trying to
recreate SunOS 5.7^WSolaris 2.7^WSoliaris 7 (used to be a Sun Thiing,
but now everyone's version numbers tend to be inflated).  Where
/bin/false, /bin/true and /bin/test were all Korne Shell scripts.

This nominally saved development work since Korne shell has
implementations of all these internally.  Problem is this killed
performance for any shell script /not/ written in a shell with those as
built-in.  While Korne shell is very fast once it has finished parsing
its input, it is slow at parsing its scripts.

Having `gunzip` be a shell script seems headed in this direction.  The
above seems a similar sort of situation, adding an extra fork()/execve()
to avoid warnings.

I'm placing SC2166 on my disregard list.  Yes, this is nominally not well
defined, but unlike most warnings this one has a major impact on
performance.

(fork()/execve() are the two most expensive routinely used system calls)


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg at m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445





More information about the openwrt-devel mailing list