base-files: clean up nand tar sysupgrade code
authorRodrigo Balerdi <lanchon@gmail.com>
Fri, 15 Apr 2022 09:31:24 +0000 (06:31 -0300)
committerDaniel Golle <daniel@makrotopia.org>
Tue, 19 Apr 2022 15:28:25 +0000 (16:28 +0100)
commit264d9483025c9604709879094810f25e6c9fac38
tree3539c2aa2ab002d0eade28f8381e8b6741bc9a84
parentecbcc0b595516d059092b89efbef69b93cf97f6a
base-files: clean up nand tar sysupgrade code

Prepares code for ubirename-based safe sysupgrade implementation.

Fixes several issues:
- the special CI_KERNPART value "none" is ignored if an MTD partition
  named "none" exists
- misleading variable names (such as has_kernel to mean "tar has kernel
  and it should not be written to an MTD partition but a UBI volume")
- inconsistent treatment of zero-length tar member files
- inconsistent meaning of "0" and "" variable values
- redundant operations (unneeded untaring, repeated untaring, unneeded
  partition lookups)
- inconsistent variable quoting

Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
package/base-files/files/lib/upgrade/nand.sh