blob: 8e2a56bb71836e164c6c10fbeec670afa365f07b [file] [log] [blame]
developer15a43312022-04-12 11:23:23 +08001inherit rdk-image
2
3IMAGE_FEATURES_remove = "read-only-rootfs"
developerfeea77e2022-07-11 18:10:33 +08004IMAGE_FSTYPES_remove= "tar.gz"
developer15a43312022-04-12 11:23:23 +08005SYSTEMD_TOOLS = "systemd-analyze systemd-bootchart"
6# systemd-bootchart doesn't currently build with musl libc
7SYSTEMD_TOOLS_remove_libc-musl = "systemd-bootchart"
8
developer3d785cd2022-05-05 16:20:47 +08009IMAGE_INSTALL += " packagegroup-filogic-core \
developer15a43312022-04-12 11:23:23 +080010 ${SYSTEMD_TOOLS} \
developer15a43312022-04-12 11:23:23 +080011 network-hotplug \
12 libmcrypt \
developer3d785cd2022-05-05 16:20:47 +080013 coreutils \
14 util-linux-readprofile \
15 iputils \
16 bc \
17 python-core \
18 dosfstools \
19 pptp-linux \
20 rp-pppoe \
developer15a43312022-04-12 11:23:23 +080021 "
developer2bf53a92022-06-06 12:08:58 +080022#IMAGE_INSTALL += " opensync openvswitch mesh-agent e2fsprogs "
developer15a43312022-04-12 11:23:23 +080023
24BB_HASH_IGNORE_MISMATCH = "1"
25IMAGE_NAME[vardepsexclude] = "DATETIME"
26
27#ESDK-CHANGES
28do_populate_sdk_ext_prepend() {
29 builddir = d.getVar('TOPDIR')
30 if os.path.exists(builddir + '/conf/templateconf.cfg'):
31 with open(builddir + '/conf/templateconf.cfg', 'w') as f:
32 f.write('meta/conf\n')
33}
34
35sdk_ext_postinst_append() {
36 echo "ln -s $target_sdk_dir/layers/openembedded-core/meta-rdk $target_sdk_dir/layers/openembedded-core/../meta-rdk \n" >> $env_setup_script
37}
38
39PRSERV_HOST = "localhost:0"
40INHERIT += "buildhistory"
41BUILDHISTORY_COMMIT = "1"
42
43
44
45require image-exclude-files.inc
46
47remove_unused_file() {
48 for i in ${REMOVED_FILE_LIST} ; do rm -rf ${IMAGE_ROOTFS}/$i ; done
49}
50
51ROOTFS_POSTPROCESS_COMMAND_append = "remove_unused_file; "
developer23de0032022-06-01 19:34:29 +080052
53do_filogic_gen_image(){
54 if ${@bb.utils.contains('DISTRO_FEATURES','kernel_in_ubi','true','false',d)}; then
developer23de0032022-06-01 19:34:29 +080055 # create sysupgrade image align to openwrt
56
57 rm -rf ${IMGDEPLOYDIR}/sysupgrade-${PN}-${MACHINE}
58 rm -rf ${IMGDEPLOYDIR}/${PN}-${MACHINE}-sysupgrade.bin
59
60 mkdir ${IMGDEPLOYDIR}/sysupgrade-${PN}-${MACHINE}
61
62 cp ${DEPLOY_DIR_IMAGE}/fitImage ${IMGDEPLOYDIR}/sysupgrade-${PN}-${MACHINE}/kernel
63 cp ${IMGDEPLOYDIR}/${PN}-${MACHINE}.squashfs-xz ${IMGDEPLOYDIR}/sysupgrade-${PN}-${MACHINE}/root
64
65 cd ${IMGDEPLOYDIR}
66 tar cvf ${PN}-${MACHINE}-sysupgrade.bin sysupgrade-${PN}-${MACHINE}
67 mv ${PN}-${MACHINE}-sysupgrade.bin ${DEPLOY_DIR_IMAGE}/
68 else
69 rm -f ${NAND_FILE}
70
71 # 1. dump fitImage into firmware
72 dd if=${DEPLOY_DIR_IMAGE}/fitImage >> ${NAND_FILE}
73
74 # 2. pad to 256K
75 dd if=${NAND_FILE} of=${NAND_FILE}.new bs=256k conv=sync
76 mv -f ${NAND_FILE}.new ${NAND_FILE}
77
78 # 3. pad to kernel size = 0x800000 = 8388608
79 dd if=${NAND_FILE} of=${NAND_FILE}.new bs=8388608 conv=sync
80 mv -f ${NAND_FILE}.new ${NAND_FILE}
81
82 # 4. dump filesystem into firmware
83 dd if=${IMGDEPLOYDIR}/${PN}-${MACHINE}.${NAND_ROOTFS_TYPE} >> ${NAND_FILE}
84 mv ${NAND_FILE} ${DEPLOY_DIR_IMAGE}/
85 fi
86
87}
88addtask filogic_gen_image after do_image_complete before do_populate_lic_deploy