[PATCH 1/8] base-files: Remove nand.sh dependency from emmc upgrade

Christian Marangi ansuelsmth at gmail.com
Fri Jan 6 06:54:23 PST 2023


On Wed, Jan 04, 2023 at 06:26:28PM -0800, Brian Norris wrote:
> Hi Christian,
> 
> On Wed, Jan 04, 2023 at 01:40:57PM +0100, Christian Marangi wrote:
> > On Mon, Jan 02, 2023 at 03:25:27PM -0800, Brian Norris wrote:
> > > --- a/package/base-files/files/lib/upgrade/common.sh
> > > +++ b/package/base-files/files/lib/upgrade/common.sh
> > > @@ -127,6 +127,33 @@ get_magic_fat32() {
> > >  	(get_image "$@" | dd bs=1 count=5 skip=82) 2>/dev/null
> > >  }
> > >  
> > > +identify_magic_long() {
> ...
> 
> > > diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh
> > > index a8e3cab0b8b1..a1dbd6e2663d 100644
> > > --- a/package/base-files/files/lib/upgrade/nand.sh
> > > +++ b/package/base-files/files/lib/upgrade/nand.sh
> > > @@ -65,40 +65,12 @@ get_magic_long_tar() {
> 
> > >  identify() {
> > > -	identify_magic $(nand_get_magic_long "$@")
> > > +	identify_magic_long $(nand_get_magic_long "$@")
> > 
> > Should we really change the name from identify_magic to
> > identify_magic_long?
> 
> I was trying to match the conventions of common.sh, where I moved the
> helper to. common.sh has get_magic_word() and get_magic_long() (and
> other suffixed helpers for specific purposes), and it's important the
> caller uses the correct ones. While this identify function could
> partially work (it can identify "combined" and "gzip") with just a
> 'word' of data, it would be misleading.
> 
> Is there a reason *not* to change the name?
> 

One of the reason was that change name of old function may cause some
problem on downstream project...

But looking at the script is full of inconsistency... Wonder If we
should care to fix that.

Anyway for me the name change it's OK. They are internal script so
downstream project should update their script if they ever care to
update to a new openwrt base. And no package should use the /lib/upgrade
scripts to do stuff...

-- 
	Ansuel



More information about the openwrt-devel mailing list