WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 2bf89f8

Browse files
committed
change create image name
1 parent 359fe56 commit 2bf89f8

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

create-seperated-image.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
set -e
2+
set -ex
33
image_name=$1
44
efi_start_sector=$(gdisk -l ./${image_name}|grep efi|awk '{print $2}')
55
efi_end_sector=$(gdisk -l ./${image_name}|grep efi|awk '{print $3}')
@@ -16,9 +16,9 @@ old_rootfs_image_uuid=$(blkid -s UUID -o value ${old_rootfs_image})
1616
old_esp_image=esp.img
1717
old_esp_image_mount_dir=esp
1818
old_esp_image_uuid=$(blkid -s UUID -o value ${old_esp_image})
19-
new_rootfs_image=rootfs-new.img
19+
new_rootfs_image=${image_name%*.img}-rootfs.img
2020
new_rootfs_image_mount_dir=rootfs-new
21-
new_esp_image=esp-new.img
21+
new_esp_image=${image_name%*.img}-esp.img
2222
new_esp_image_mount_dir=esp-new
2323
mkdir -p ${old_rootfs_image_mount_dir} ${old_esp_image_mount_dir} ${new_rootfs_image_mount_dir} ${new_esp_image_mount_dir}
2424
truncate --size=8192M ${new_rootfs_image}
@@ -38,9 +38,11 @@ sudo cp -rfp ${old_rootfs_image_mount_dir}/* ${new_rootfs_image_mount_dir}/
3838
sudo sed -i "s|${old_rootfs_image_uuid}|${new_rootfs_image_uuid}|g" ${new_rootfs_image_mount_dir}/etc/fstab
3939
sudo sed -i "s|${old_esp_image_uuid}|${new_esp_image_uuid}|g" ${new_rootfs_image_mount_dir}/etc/fstab
4040
gzip -c ./${new_rootfs_image_mount_dir}/boot/vmlinuz-*-sm8250-arm64 > Image.gz
41-
cat Image.gz ./${new_rootfs_image_mount_dir}/boot/armbian-dtb-*-sm8250-arm64 > Image.gz-dtb
41+
for panel_type in boe csot
42+
do
43+
cat Image.gz ./${new_rootfs_image_mount_dir}/usr/lib/linux-image-*-sm8250-arm64/qcom/sm8250-xiaomi-elish-${panel_type}.dtb > Image.gz-dtb-${panel_type}
4244
./mkbootimg.py \
43-
--kernel Image.gz-dtb \
45+
--kernel Image.gz-dtb-${panel_type} \
4446
--ramdisk ./${new_rootfs_image_mount_dir}/boot/initrd.img-*-sm8250-arm64 \
4547
--base 0x0 \
4648
--second_offset 0x00f00000 \
@@ -49,7 +51,8 @@ cat Image.gz ./${new_rootfs_image_mount_dir}/boot/armbian-dtb-*-sm8250-arm64 > I
4951
--ramdisk_offset 0x1000000 \
5052
--tags_offset 0x100 \
5153
--pagesize 4096 \
52-
-o armbian-kernel.img
54+
-o armbian-kernel-${panel_type}.img
55+
done
5356
sudo umount ${new_rootfs_image_mount_dir}
5457
sudo umount ${old_rootfs_image_mount_dir}
5558
e2fsck -p -f ${new_rootfs_image}

0 commit comments

Comments
 (0)