optimize kernel build and packer

Signed-off-by: minjie.yu <minjie.yu@unionman.com.cn>
This commit is contained in:
minjie.yu 2022-07-19 15:57:16 +08:00
parent d5e99f20e1
commit 3de3eadca1
7 changed files with 15 additions and 50 deletions

View File

@ -105,7 +105,7 @@ Note:If the text contains special characters, please escape them according to th
<filteritem type="filepath" name="unionpi_tiger/hardware/audio_alsa/BUILD.gn" desc=""/>
</filefilter>
<filefilter name="binaryFileTypePolicyFilter" desc="Filters for binary file policies">
<filteritem type="filename" name="*.png|*.jpg" desc="desc files"/>
<filteritem type="filename" name="*.png|*.jpg|*.hap" desc="desc files"/>
<filteritem type="filepath" name="unionpi_tiger/bootloader/images/u-boot.bin" desc="desc files"/>
<filteritem type="filepath" name="unionpi_tiger/resource/bootanimation/bootanimation-800x480.raw" desc="desc files"/>
</filefilter>

View File

@ -23,6 +23,7 @@ ${root_src_dir}/device/board/unionman/unionpi_tiger/common/tools/linux/img2simg
mv ${root_src_dir}/out/unionpi_tiger/packages/phone/images/vendor.img2simg ${root_src_dir}/out/unionpi_tiger/packages/phone/images/vendor.img
${root_src_dir}/device/board/unionman/unionpi_tiger/common/tools/linux/img2simg ${root_src_dir}/out/unionpi_tiger/packages/phone/images/userdata.img ${root_src_dir}/out/unionpi_tiger/packages/phone/images/userdata.img2simg
mv ${root_src_dir}/out/unionpi_tiger/packages/phone/images/userdata.img2simg ${root_src_dir}/out/unionpi_tiger/packages/phone/images/userdata.img
${root_src_dir}/device/board/unionman/unionpi_tiger/common/tools/linux/mkbootimg --kernel ${root_src_dir}/out/kernel/src_tmp/linux-5.10/unionpi_tiger/Image.gz --base 0x0 --kernel_offset 0x1080000 --cmdline "" --ramdisk ${root_src_dir}/out/unionpi_tiger/packages/phone/images/ramdisk.img --second ${root_src_dir}/out/unionpi_tiger/packages/phone/images/dtb.img --output ${root_src_dir}/out/unionpi_tiger/packages/phone/images/boot.img > /dev/null
${root_src_dir}/device/board/unionman/unionpi_tiger/common/tools/linux/aml_image_v2_packer -r ${root_src_dir}/out/unionpi_tiger/packages/phone/images/openharmony.conf ${root_src_dir}/out/unionpi_tiger/packages/phone/images/ ${root_src_dir}/out/unionpi_tiger/packages/phone/images/OpenHarmony.img
rm -rf ${root_src_dir}/out/unionpi_tiger/packages/phone/images/openharmony.conf
rm -rf ${root_src_dir}/out/unionpi_tiger/packages/phone/images/platform.conf

View File

@ -82,23 +82,9 @@ ohos_prebuilt_etc("selinux_config") {
install_enable = true
}
if (enable_ramdisk) {
ohos_copy("fstab.required") {
sources = [ "fstab.A311D" ]
outputs = [ "$root_build_dir/fstab.required" ]
}
ohos_copy("ramdisk_resource_config.ini") {
sources = [ "ramdisk_resource_config.ini" ]
outputs = [ "$product_output_dir/phone/ramdisk_resource_config.ini" ]
}
} else {
ohos_prebuilt_etc("fstab.required") {
source = "fstab.required"
part_name = "unionman_products"
install_images = [ "system" ]
install_enable = true
}
ohos_copy("fstab.required") {
sources = [ "fstab.A311D" ]
outputs = [ "$root_build_dir/fstab.required" ]
}
group("init_configs") {
@ -113,8 +99,4 @@ group("init_configs") {
":selinux_config",
":udisk_mount.sh",
]
if (enable_ramdisk) {
deps += [ ":ramdisk_resource_config.ini" ]
}
}

View File

@ -1,26 +0,0 @@
# Modification and deletion of section name is not allowed
# fstab.required path config, The fstab is device related
[fstab_required_path]
source_path = ./fstab.required
target_path = ./packages/phone/ramdisk/etc/fstab.required
# dtc_419 path config
[dtc_419_path]
source_path = ../../out/KERNEL_OBJ/kernel/src_tmp/linux-4.19/scripts/dtc/dtc
target_path = ../../third_party/e2fsprogs/prebuilt/host/bin/dtc
# dtc_510 path config
[dtc_510_path]
source_path = ../../out/kernel/src_tmp/linux-5.10/scripts/dtc/dtc
target_path = ../../third_party/e2fsprogs/prebuilt/host/bin/dtc
# mkimage path config
[mkimage_path]
source_path = ../../device/board/hisilicon/hispark_taurus/uboot/prebuilts/mkimage
target_path = ../../third_party/e2fsprogs/prebuilt/host/bin/mkimage
[board]
boot_type = two_stages
source_path = ../../out/kernel/src_tmp/linux-5.10/vendor/amlogic/make-boot.sh
target_path = ./packages/phone/make-boot.sh

View File

@ -25,4 +25,8 @@ export RAMDISK_ENABLE=$6
mkdir -p ${2}
mkdir -p ${3}
make -f ${4}/kernel/build/kernel.mk
../kernel/src_tmp/linux-5.10/vendor/amlogic/make-boot.sh ..
if [ -f ${2}/kernel/src_tmp/linux-5.10/arch/arm64/boot/Image.gz ]; then
mkdir -p ${2}/kernel/src_tmp/linux-5.10/unionpi_tiger
cp -rf ${2}/kernel/src_tmp/linux-5.10/arch/arm64/boot/Image.gz ${2}/kernel/src_tmp/linux-5.10/unionpi_tiger/
fi

View File

@ -90,7 +90,6 @@ $(KERNEL_IMAGE_FILE):
@$(DEVICE_PATH)/common/tools/linux/dtbTool -o $(IMAGES_PATH)/dtb.img $(KERNEL_OBJ_TMP_PATH)/arch/arm64/boot/dts/amlogic/ > /dev/null
@gzip $(IMAGES_PATH)/dtb.img
@mv $(IMAGES_PATH)/dtb.img.gz $(IMAGES_PATH)/dtb.img
@chmod 777 $(KERNEL_OBJ_TMP_PATH)/vendor/amlogic/make-boot.sh
ifeq ($(RAMDISK_ENABLE), false)
@$(DEVICE_PATH)/tools/linux/mkbootimg --kernel $(KERNEL_OBJ_TMP_PATH)/arch/arm64/boot/Image.gz --base 0x0 --kernel_offset 0x1080000 --cmdline "" --ramdisk $(DEVICE_PATH)/tools/linux/rootfs.cpio.gz --second $(IMAGES_PATH)/dtb.img --output $(IMAGES_PATH)/boot.img > /dev/null
endif

View File

@ -16,18 +16,21 @@ import("//build/ohos.gni")
ohos_prebuilt_etc("updater_init.cfg") {
source = "init.cfg"
install_images = [ "updater" ]
install_enable = true
part_name = "unionman_products"
}
ohos_prebuilt_etc("updater_usb_init.cfg") {
source = "init.usb.cfg"
install_images = [ "updater" ]
install_enable = true
part_name = "unionman_products"
}
ohos_prebuilt_etc("updater_init_usb_configfs.cfg") {
source = "init.usb.configfs.cfg"
install_images = [ "updater" ]
install_enable = true
part_name = "unionman_products"
}
@ -35,12 +38,14 @@ ohos_prebuilt_etc("signing_cert.crt") {
source = "signing_cert.crt"
module_install_dir = "certificate"
install_images = [ "updater" ]
install_enable = true
part_name = "unionman_products"
}
ohos_prebuilt_etc("fstab.updater") {
source = "fstab.updater"
install_images = [ "updater" ]
install_enable = true
part_name = "unionman_products"
}