libubootenv: adapt recipe for read-only-rootfs
The config file /etc/fw_env.config is generated dynamically basing on the partition table and, in the case of NAND-based SOMs, on the NAND geometry. This is done on a postinst script that modifies the file on the first boot of the target. Since this is not allowed on read-only-rootfs, this commit adds a default fw_env.config file to use instead when read-only-rootfs is enabled. Signed-off-by: Hector Palacios <hector.palacios@digi.com> https://onedigi.atlassian.net/browse/DEL-7708
This commit is contained in:
parent
c89a66480b
commit
7cd57a40e3
|
|
@ -0,0 +1,9 @@
|
||||||
|
# Configuration file for fw_(printenv/setenv) utility.
|
||||||
|
# Up to two entries are valid, in this case the redundant
|
||||||
|
# environment sector is assumed present.
|
||||||
|
# If both copies are set to the same offset, an automatic mechanism will
|
||||||
|
# determine the first good sectors where each copy lives, skipping bad blocks.
|
||||||
|
|
||||||
|
# Device name Offset Size Erase-size No.Blocks
|
||||||
|
/dev/mtd1 0x0 0x20000 0x20000 8
|
||||||
|
/dev/mtd1 0x0 0x20000 0x20000 8
|
||||||
|
|
@ -2,8 +2,17 @@
|
||||||
|
|
||||||
FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
|
FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
|
||||||
|
|
||||||
|
# Chose a between a default hard-coded config file (for read-only rootfs)
|
||||||
|
# or a dynamically generated one (with a postinst script)
|
||||||
|
FW_CONFIG_FILE = "${@bb.utils.contains('STORAGE_MEDIA', 'mtd', \
|
||||||
|
bb.utils.contains('IMAGE_FEATURES', 'read-only-rootfs', \
|
||||||
|
'${STORAGE_MEDIA}/fw_env.config_default', \
|
||||||
|
'${STORAGE_MEDIA}/fw_env.config', d), \
|
||||||
|
'${STORAGE_MEDIA}/fw_env.config', \
|
||||||
|
d)}"
|
||||||
|
|
||||||
SRC_URI += " \
|
SRC_URI += " \
|
||||||
file://${STORAGE_MEDIA}/fw_env.config \
|
file://${FW_CONFIG_FILE} \
|
||||||
file://0001-Implement-support-for-environment-encryption-by-CAAM.patch \
|
file://0001-Implement-support-for-environment-encryption-by-CAAM.patch \
|
||||||
file://0002-Implement-U-Boot-environment-access-functions.patch \
|
file://0002-Implement-U-Boot-environment-access-functions.patch \
|
||||||
file://0003-tools-env-add-support-to-set-dynamic-location-of-env.patch \
|
file://0003-tools-env-add-support-to-set-dynamic-location-of-env.patch \
|
||||||
|
|
@ -11,7 +20,7 @@ SRC_URI += " \
|
||||||
|
|
||||||
do_install_append() {
|
do_install_append() {
|
||||||
install -d ${D}${sysconfdir}
|
install -d ${D}${sysconfdir}
|
||||||
install -m 0644 ${WORKDIR}/${STORAGE_MEDIA}/fw_env.config ${D}${sysconfdir}/
|
install -m 0644 ${WORKDIR}/${FW_CONFIG_FILE} ${D}${sysconfdir}/fw_env.config
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg_postinst_ontarget_${PN}() {
|
pkg_postinst_ontarget_${PN}() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue