diff --git a/laphone/BUILD.gn b/laphone/BUILD.gn index b0e37a527ecffe9cee0898f2f77779fe0bf14ea0..08ddaf2841f081d64823987e72d21760d4daa95b 100644 --- a/laphone/BUILD.gn +++ b/laphone/BUILD.gn @@ -42,8 +42,21 @@ action("make_custom_image") { # must build after make_images deps = [ "//build/ohos/images:make_images", + ":make_boot_images", # also must wait make boot image # "kernel:make_boot_image", # "kernel:make_boot_updater_image" ] } + +# 开发者手机特殊镜像打包 +# ramdisk存在于boot与vendor_boot中 +# updater存在于boot-updater与vendor_boot_updater中 +# 重新打包镜像使改动得以生效 +action("make_boot_images") { + script = "pac/make_boot.sh" + package_path = "${root_out_dir}/packages/phone/images" + target_path = "make_boot_images" + args = [ rebase_path(package_path) ] + outputs = [ "${package_path}/${target_path}" ] +} diff --git a/laphone/pac/dtb b/laphone/pac/dtb new file mode 100755 index 0000000000000000000000000000000000000000..c1f4951d72ad446a64f3036b09ca5f83f9337f2b Binary files /dev/null and b/laphone/pac/dtb differ diff --git a/laphone/pac/kernel b/laphone/pac/kernel new file mode 100755 index 0000000000000000000000000000000000000000..4fae9d87f7d4070d6e570e67dbccf18419bbde8d Binary files /dev/null and b/laphone/pac/kernel differ diff --git a/laphone/pac/make_boot.sh b/laphone/pac/make_boot.sh new file mode 100755 index 0000000000000000000000000000000000000000..0dc1155d3488c5f80c6772febbab79b2b2ec4551 --- /dev/null +++ b/laphone/pac/make_boot.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +curr=$(pwd -P) + +if [[ $# -ge 1 ]]; then +package_path=$1 +else +package_path=`cd ../../../../../out/laphone/packages/phone/images; pwd` +fi + +basepath=$(cd `dirname $0`; pwd) + +# some prebuild img here +work_path=$basepath/ImageFiles/ + +echo curr path: $curr +echo package path: $package_path +echo out path: $work_path + +# boot.img +$basepath/mkbootimg \ + --os_version "13.0.0" --os_patch_level "2023-03" --header_version "4" \ + --cmdline "console=ttyS1,115200n8 buildvariant=userdebug" --kernel $basepath/kernel \ + --ramdisk $package_path/ramdisk.img \ + -o $work_path/boot.img + +# boot-updater.img +$basepath/mkbootimg \ + --os_version "13.0.0" --os_patch_level "2023-03" --header_version "4" \ + --cmdline "console=ttyS1,115200n8 buildvariant=userdebug" --kernel $basepath/kernel \ + --ramdisk $package_path/updater.img \ + -o $work_path/boot-updater.img + +# vendor_boot.img +$basepath/mkbootimg \ + --header_version 4 --pagesize 0x00001000 --base 0x00000000 \ + --kernel_offset 0x00008000 --ramdisk_offset 0x05400000 \ + --vendor_cmdline "console=ttyS1,115200n8 buildvariant=userdebug" \ + --dtb $basepath/dtb --vendor_ramdisk $package_path/ramdisk.img \ + --vendor_boot $work_path/vendor_boot.img + +# vendor_boot_updater.img +$basepath/mkbootimg \ + --header_version 4 --pagesize 0x00001000 --base 0x00000000 \ + --kernel_offset 0x00008000 --ramdisk_offset 0x05400000 \ + --vendor_cmdline "console=ttyS1,115200n8 buildvariant=userdebug" \ + --dtb $basepath/dtb --vendor_ramdisk $package_path/updater.img \ + --vendor_boot $work_path/vendor_boot_updater.img diff --git a/laphone/pac/mkbootimg b/laphone/pac/mkbootimg new file mode 100755 index 0000000000000000000000000000000000000000..68a5a0944e97dbabe2630102e4fe2d1e79304a59 Binary files /dev/null and b/laphone/pac/mkbootimg differ