!33 添加自定义boot分区大小的配置参数

From: @chainsx 
Reviewed-by: @jianminw 
Signed-off-by: @jianminw
This commit is contained in:
openeuler-ci-bot 2025-09-09 08:29:52 +00:00 committed by Gitee
commit e243f3edf5
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
17 changed files with 25 additions and 8 deletions

View File

@ -112,7 +112,11 @@ POST_BOARD_OVERLAY() {
- msdos: allwinner
6. POST_BOARD_OVERLAY()
6. boot_size
开发板系统镜像的大小单位为MB。
7. POST_BOARD_OVERLAY()
`POST_BOARD_OVERLAY()` 是执行复制 firmware 文件到根目录以及对目标开发板根目录执行特定操作的函数,其使用的变量与 [build_rootfs.sh](../../scripts/build_rootfs.sh) 相同,通常包含以下两个变量:

View File

@ -5,6 +5,7 @@ platform=rockchip
soc_name=rk3576
arch=arm64
part_table=gpt
boot_size=512
POST_BOARD_OVERLAY() {
echo "Put ${board} firmware into rootfs..."

View File

@ -5,6 +5,7 @@ platform=rockchip
soc_name=rk3588
arch=arm64
part_table=gpt
boot_size=256
POST_BOARD_OVERLAY() {
echo "Put ${board} firmware into rootfs..."

View File

@ -4,6 +4,7 @@ platform=rockchip
soc_name=rk3399
arch=arm64
part_table=gpt
boot_size=256
POST_BOARD_OVERLAY() {
echo "Put ${board} firmware into rootfs..."

View File

@ -5,6 +5,7 @@ platform=rockchip
soc_name=rk3566
arch=arm64
part_table=gpt
boot_size=256
POST_BOARD_OVERLAY() {
echo "Put ${board} firmware into rootfs..."

View File

@ -5,6 +5,7 @@ platform=rockchip
soc_name=rk3568
arch=arm64
part_table=gpt
boot_size=256
POST_BOARD_OVERLAY() {
echo "Put ${board} firmware into rootfs..."

View File

@ -5,6 +5,7 @@ platform=rockchip
soc_name=rk3568
arch=arm64
part_table=gpt
boot_size=256
POST_BOARD_OVERLAY() {
echo "Put ${board} firmware into rootfs..."

View File

@ -5,6 +5,7 @@ platform=rockchip
soc_name=rk3588
arch=arm64
part_table=gpt
boot_size=256
POST_BOARD_OVERLAY() {
echo "Put ${board} firmware into rootfs..."

View File

@ -5,6 +5,7 @@ platform=allwinner
soc_name=h618
arch=arm64
part_table=msdos
boot_size=256
POST_BOARD_OVERLAY() {
echo "Put ${board} firmware into rootfs..."

View File

@ -5,6 +5,7 @@ platform=allwinner
soc_name=h616
arch=arm64
part_table=msdos
boot_size=256
POST_BOARD_OVERLAY() {
echo "Put ${board} firmware into rootfs..."

View File

@ -5,6 +5,7 @@ platform=phytium
soc_name=e2000q
arch=arm64
part_table=gpt
boot_size=256
POST_BOARD_OVERLAY() {
echo "Put ${board} firmware into rootfs..."

View File

@ -5,6 +5,7 @@ platform=rockchip
soc_name=rk3588
arch=arm64
part_table=gpt
boot_size=256
POST_BOARD_OVERLAY() {
echo "Put ${board} firmware into rootfs..."

View File

@ -4,6 +4,7 @@ platform=rockchip
soc_name=rk3399
arch=arm64
part_table=gpt
boot_size=256
POST_BOARD_OVERLAY() {
echo "Put ${board} firmware into rootfs..."

View File

@ -4,6 +4,7 @@ platform=broadcom
soc_name=
arch=arm64
part_table=msdos
boot_size=512
POST_BOARD_OVERLAY() {
echo "Put ${board} firmware into rootfs..."

View File

@ -4,6 +4,7 @@ platform=rockchip #Required! The platform of target board, which defaults to ro
soc_name=rk3399
arch=arm64
part_table=gpt
boot_size=256
POST_BOARD_OVERLAY() {
echo "Put ${board} firmware into rootfs..."

View File

@ -264,7 +264,6 @@ mk_boot() {
dracut --no-kernel ${boot_dir}/initrd.img
LOG "gen initrd done."
dtb_name=$(ls ${boot_dir} | grep dtb)
LOG "gen extlinux config for $dtb_name"
if [ "${platform}" == "rockchip" ];then
bootargs=${rockchip_bootargs}
@ -279,13 +278,13 @@ mk_boot() {
echo "label openEuler
kernel /Image
initrd /initrd.img
fdt /${dtb_name}
fdt /${dtb_name}.dtb
append ${bootargs}" \
> ${boot_dir}/extlinux/extlinux.conf
LOG "gen extlinux config done."
fi
dd if=/dev/zero of=${workdir}/boot.img bs=1M count=240 status=progress
dd if=/dev/zero of=${workdir}/boot.img bs=1M count=${boot_size} status=progress
mkfs.vfat -n boot ${workdir}/boot.img
if [ -d ${workdir}/boot_emmc ];then rm -rf ${workdir}/boot_emmc; fi
mkdir ${workdir}/boot_emmc

View File

@ -144,8 +144,8 @@ make_img(){
device=""
LOSETUP_D_IMG
size=`ls -l --block-size=1MiB ${workdir}/rootfs.img | awk '{ print $5 }'`
size=$(($size+1100))
root_size=`ls -l --block-size=1MiB ${workdir}/rootfs.img | awk '{ print $5 }'`
size=$((${root_size}+${boot_size}+880))
losetup -D
img_file=${workdir}/${name}.img
LOG create ${img_file} size of ${size}MiB
@ -154,11 +154,11 @@ make_img(){
LOG "create ${part_table} partition table."
if [ "x${board}" == "xraspberrypi" ]; then
section1_start=16384
section1_end=1064959
else
section1_start=32768
section1_end=524287
fi
section1_end=$((${section1_start}+(${boot_size}*2048)-1))
parted ${img_file} mklabel ${part_table} mkpart primary fat32 ${section1_start}s ${section1_end}s
parted ${img_file} -s set 1 boot on
parted ${img_file} mkpart primary ext4 $(($section1_end+1))s 100%