create U-Boot environment during build

Signed-off-by: Michel Stempin <michel.stempin@wanadoo.fr>
This commit is contained in:
Michel Stempin 2020-10-17 18:36:22 +02:00
parent fb18542bef
commit 80991cbc01
3 changed files with 18 additions and 28 deletions

View File

@ -1,7 +1,7 @@
image sdcard.img { image sdcard.img {
hdimage { hdimage {
gpt = true gpt = true
gpt-location = 800K # 688128 # 672K gpt-location = 800K
} }
# partition gpt-header { # partition gpt-header {
@ -17,17 +17,12 @@ image sdcard.img {
size = 536K # 544KB - 8KB size = 536K # 544KB - 8KB
} }
# partition u-boot-env { partition u-boot-env {
# in-partition-table = "no" in-partition-table = "no"
# offset = 544K offset = 544K
# size = 128K size = 128K
# } image = "u-boot-env.img"
}
# partition u-boot_alt-env {
# in-partition-table = "no"
# offset = 672K
# size = 128K
# }
# partition gpt-table { # partition gpt-table {
# in-partition-table = "no" # in-partition-table = "no"

View File

@ -13,3 +13,6 @@ rm -f ${TARGET_DIR}/etc/init.d/S01syslogd ${TARGET_DIR}/etc/init.d/S02klogd
# Change dropbear init sequence # Change dropbear init sequence
mv ${TARGET_DIR}/etc/init.d/S50dropbear ${TARGET_DIR}/etc/init.d/S42dropbear mv ${TARGET_DIR}/etc/init.d/S50dropbear ${TARGET_DIR}/etc/init.d/S42dropbear
# Generate U-Boot environment
${HOST_DIR}/bin/mkenvimage -p 0x0 -s 0x20000 -o ${BINARIES_DIR}/u-boot-env.img ${TARGET_DIR}/etc/u-boot.env

View File

@ -72,11 +72,6 @@ resize_rootfs_filesystem () {
return 0 return 0
} }
write_bootloader_env () {
fw_saveenv /etc/u-boot.env || die 11 "cannot write bootloader inevrionment, aborting"
return 0
}
create_swap_file () { create_swap_file () {
local root_part_line=$(df | grep /dev/root) local root_part_line=$(df | grep /dev/root)
set ${root_part_line} set ${root_part_line}
@ -137,31 +132,28 @@ notif "First boot detected!"
check_swap check_swap
check_root_id check_root_id
notif "1/9 Resize root partition" notif "1/8 Resize root partition"
resize_rootfs_partition resize_rootfs_partition
notif "2/9 Reload partition table" notif "2/8 Reload partition table"
reload_partition_table reload_partition_table
notif "3/9 Resize root filsystem" notif "3/8 Resize root filsystem"
resize_rootfs_filesystem resize_rootfs_filesystem
notif "4/9 Write boot environment" notif "4/8 Create swap"
write_bootloader_env
notif "5/9 Create swap"
create_swap_file create_swap_file
notif "6/9 Enable swap" notif "5/8 Enable swap"
enable_swap_file enable_swap_file
notif "6/9 Create share partition" notif "6/8 Create share partition"
create_backing_store_partition create_backing_store_partition
notif "8/9 Reload partition table" notif "7/8 Reload partition table"
reload_partition_table reload_partition_table
notif "9/9 Format share partition" notif "8/8 Format share partition"
format_backing_store_partition format_backing_store_partition
notif "First boot setup finished!" notif "First boot setup finished!"