mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-25 00:11:13 +00:00
uboot-envtools: check for config prior to append
In the rare event a pre-populated fw_env.config exists in the rootfs prior to firstboot, calling fw_setenv after the system has initialised will annihilate the devices environment due to two identical lines in fw_env.config. Check for existence prior to blind appendage. Signed-off-by: Imran Khan <gururug@gmail.com> Signed-off-by: Daniel Golle <daniel@makrotopia.org> [daniel@makrotopia.org: fixed patch format, improved grep, cosmetics]
This commit is contained in:
parent
f45a16dead
commit
27d69d2561
@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
PKG_NAME:=uboot-envtools
|
PKG_NAME:=uboot-envtools
|
||||||
PKG_DISTNAME:=u-boot
|
PKG_DISTNAME:=u-boot
|
||||||
PKG_VERSION:=2019.07
|
PKG_VERSION:=2019.07
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.xz
|
PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.xz
|
||||||
|
@ -31,6 +31,6 @@ ubootenv_add_app_config() {
|
|||||||
config_get envsize "$1" envsize
|
config_get envsize "$1" envsize
|
||||||
config_get secsize "$1" secsize
|
config_get secsize "$1" secsize
|
||||||
config_get numsec "$1" numsec
|
config_get numsec "$1" numsec
|
||||||
echo "$dev $offset $envsize $secsize $numsec" >>/etc/fw_env.config
|
grep -q "^[[:space:]]*${dev}[[:space:]]*${offset}" /etc/fw_env.config || echo "$dev $offset $envsize $secsize $numsec" >>/etc/fw_env.config
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user