blob: 2089b3d461acef05377962c3a300b4e300c4e93a [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} \
developerb76f9f32022-10-31 14:09:44 +080011 ethtool \
12 ebtables \
13 regs \
14 mii-mgr \
15 mtd \
16 smp \
17 mtk-factory-rw \
18 ${@bb.utils.contains('DISTRO_FEATURES','switch_gsw_mode','switch','',d)} \
19 mtd-utils-ubifs \
20 u-boot-fw-utils \
21 fw-upgrade \
22 init-filogic \
23 mac-sec \
24 mtkhnat-util \
developer15a43312022-04-12 11:23:23 +080025 network-hotplug \
26 libmcrypt \
developer3d785cd2022-05-05 16:20:47 +080027 coreutils \
28 util-linux-readprofile \
29 iputils \
30 bc \
31 python-core \
32 pptp-linux \
33 rp-pppoe \
developer60f0c3a2022-04-28 17:10:17 +080034 procps \
developer15a43312022-04-12 11:23:23 +080035 "
36
37BB_HASH_IGNORE_MISMATCH = "1"
38IMAGE_NAME[vardepsexclude] = "DATETIME"
39
40#ESDK-CHANGES
41do_populate_sdk_ext_prepend() {
42 builddir = d.getVar('TOPDIR')
43 if os.path.exists(builddir + '/conf/templateconf.cfg'):
44 with open(builddir + '/conf/templateconf.cfg', 'w') as f:
45 f.write('meta/conf\n')
46}
47
48sdk_ext_postinst_append() {
49 echo "ln -s $target_sdk_dir/layers/openembedded-core/meta-rdk $target_sdk_dir/layers/openembedded-core/../meta-rdk \n" >> $env_setup_script
50}
51
52PRSERV_HOST = "localhost:0"
53INHERIT += "buildhistory"
54BUILDHISTORY_COMMIT = "1"
55
56require image-exclude-files.inc
57
58remove_unused_file() {
59 for i in ${REMOVED_FILE_LIST} ; do rm -rf ${IMAGE_ROOTFS}/$i ; done
60}
61
62ROOTFS_POSTPROCESS_COMMAND_append = "remove_unused_file; "
developer23de0032022-06-01 19:34:29 +080063
64do_filogic_gen_image(){
65 if ${@bb.utils.contains('DISTRO_FEATURES','kernel_in_ubi','true','false',d)}; then
developer23de0032022-06-01 19:34:29 +080066 # create sysupgrade image align to openwrt
67
68 rm -rf ${IMGDEPLOYDIR}/sysupgrade-${PN}-${MACHINE}
69 rm -rf ${IMGDEPLOYDIR}/${PN}-${MACHINE}-sysupgrade.bin
70
71 mkdir ${IMGDEPLOYDIR}/sysupgrade-${PN}-${MACHINE}
72
73 cp ${DEPLOY_DIR_IMAGE}/fitImage ${IMGDEPLOYDIR}/sysupgrade-${PN}-${MACHINE}/kernel
74 cp ${IMGDEPLOYDIR}/${PN}-${MACHINE}.squashfs-xz ${IMGDEPLOYDIR}/sysupgrade-${PN}-${MACHINE}/root
75
76 cd ${IMGDEPLOYDIR}
77 tar cvf ${PN}-${MACHINE}-sysupgrade.bin sysupgrade-${PN}-${MACHINE}
78 mv ${PN}-${MACHINE}-sysupgrade.bin ${DEPLOY_DIR_IMAGE}/
79 else
80 rm -f ${NAND_FILE}
81
82 # 1. dump fitImage into firmware
83 dd if=${DEPLOY_DIR_IMAGE}/fitImage >> ${NAND_FILE}
84
85 # 2. pad to 256K
86 dd if=${NAND_FILE} of=${NAND_FILE}.new bs=256k conv=sync
87 mv -f ${NAND_FILE}.new ${NAND_FILE}
88
89 # 3. pad to kernel size = 0x800000 = 8388608
90 dd if=${NAND_FILE} of=${NAND_FILE}.new bs=8388608 conv=sync
91 mv -f ${NAND_FILE}.new ${NAND_FILE}
92
93 # 4. dump filesystem into firmware
94 dd if=${IMGDEPLOYDIR}/${PN}-${MACHINE}.${NAND_ROOTFS_TYPE} >> ${NAND_FILE}
95 mv ${NAND_FILE} ${DEPLOY_DIR_IMAGE}/
96 fi
97
98}
developerb76f9f32022-10-31 14:09:44 +080099addtask filogic_gen_image after do_image_complete before do_populate_lic_deploy