developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 1 | inherit rdk-image |
| 2 | |
| 3 | IMAGE_FEATURES_remove = "read-only-rootfs" |
developer | feea77e | 2022-07-11 18:10:33 +0800 | [diff] [blame] | 4 | IMAGE_FSTYPES_remove= "tar.gz" |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 5 | SYSTEMD_TOOLS = "systemd-analyze systemd-bootchart" |
| 6 | # systemd-bootchart doesn't currently build with musl libc |
| 7 | SYSTEMD_TOOLS_remove_libc-musl = "systemd-bootchart" |
| 8 | |
developer | 3d785cd | 2022-05-05 16:20:47 +0800 | [diff] [blame] | 9 | IMAGE_INSTALL += " packagegroup-filogic-core \ |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 10 | ${SYSTEMD_TOOLS} \ |
developer | b76f9f3 | 2022-10-31 14:09:44 +0800 | [diff] [blame] | 11 | 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 \ |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 25 | network-hotplug \ |
| 26 | libmcrypt \ |
developer | 3d785cd | 2022-05-05 16:20:47 +0800 | [diff] [blame] | 27 | coreutils \ |
| 28 | util-linux-readprofile \ |
| 29 | iputils \ |
| 30 | bc \ |
| 31 | python-core \ |
| 32 | dosfstools \ |
| 33 | pptp-linux \ |
| 34 | rp-pppoe \ |
developer | 08970cc | 2022-07-26 15:13:11 +0800 | [diff] [blame] | 35 | xl2tpd \ |
developer | a66c201 | 2022-11-01 19:16:16 +0800 | [diff] [blame] | 36 | strongswan \ |
| 37 | libpcap \ |
developer | 761278a | 2022-11-01 19:27:22 +0800 | [diff] [blame] | 38 | tcpdump \ |
| 39 | perf \ |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 40 | " |
developer | 2bf53a9 | 2022-06-06 12:08:58 +0800 | [diff] [blame] | 41 | #IMAGE_INSTALL += " opensync openvswitch mesh-agent e2fsprogs " |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 42 | |
developer | ec94159 | 2022-11-18 14:34:39 +0800 | [diff] [blame^] | 43 | IMAGE_INSTALL_append_mt7988 += " marvell-eth-firmware " |
| 44 | |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 45 | BB_HASH_IGNORE_MISMATCH = "1" |
| 46 | IMAGE_NAME[vardepsexclude] = "DATETIME" |
| 47 | |
| 48 | #ESDK-CHANGES |
| 49 | do_populate_sdk_ext_prepend() { |
| 50 | builddir = d.getVar('TOPDIR') |
| 51 | if os.path.exists(builddir + '/conf/templateconf.cfg'): |
| 52 | with open(builddir + '/conf/templateconf.cfg', 'w') as f: |
| 53 | f.write('meta/conf\n') |
| 54 | } |
| 55 | |
| 56 | sdk_ext_postinst_append() { |
| 57 | echo "ln -s $target_sdk_dir/layers/openembedded-core/meta-rdk $target_sdk_dir/layers/openembedded-core/../meta-rdk \n" >> $env_setup_script |
| 58 | } |
| 59 | |
| 60 | PRSERV_HOST = "localhost:0" |
| 61 | INHERIT += "buildhistory" |
| 62 | BUILDHISTORY_COMMIT = "1" |
| 63 | |
| 64 | |
| 65 | |
| 66 | require image-exclude-files.inc |
| 67 | |
| 68 | remove_unused_file() { |
| 69 | for i in ${REMOVED_FILE_LIST} ; do rm -rf ${IMAGE_ROOTFS}/$i ; done |
| 70 | } |
| 71 | |
| 72 | ROOTFS_POSTPROCESS_COMMAND_append = "remove_unused_file; " |
developer | 23de003 | 2022-06-01 19:34:29 +0800 | [diff] [blame] | 73 | |
| 74 | do_filogic_gen_image(){ |
| 75 | if ${@bb.utils.contains('DISTRO_FEATURES','kernel_in_ubi','true','false',d)}; then |
developer | 23de003 | 2022-06-01 19:34:29 +0800 | [diff] [blame] | 76 | # create sysupgrade image align to openwrt |
| 77 | |
| 78 | rm -rf ${IMGDEPLOYDIR}/sysupgrade-${PN}-${MACHINE} |
| 79 | rm -rf ${IMGDEPLOYDIR}/${PN}-${MACHINE}-sysupgrade.bin |
| 80 | |
| 81 | mkdir ${IMGDEPLOYDIR}/sysupgrade-${PN}-${MACHINE} |
| 82 | |
| 83 | cp ${DEPLOY_DIR_IMAGE}/fitImage ${IMGDEPLOYDIR}/sysupgrade-${PN}-${MACHINE}/kernel |
| 84 | cp ${IMGDEPLOYDIR}/${PN}-${MACHINE}.squashfs-xz ${IMGDEPLOYDIR}/sysupgrade-${PN}-${MACHINE}/root |
| 85 | |
| 86 | cd ${IMGDEPLOYDIR} |
| 87 | tar cvf ${PN}-${MACHINE}-sysupgrade.bin sysupgrade-${PN}-${MACHINE} |
| 88 | mv ${PN}-${MACHINE}-sysupgrade.bin ${DEPLOY_DIR_IMAGE}/ |
| 89 | else |
| 90 | rm -f ${NAND_FILE} |
| 91 | |
| 92 | # 1. dump fitImage into firmware |
| 93 | dd if=${DEPLOY_DIR_IMAGE}/fitImage >> ${NAND_FILE} |
| 94 | |
| 95 | # 2. pad to 256K |
| 96 | dd if=${NAND_FILE} of=${NAND_FILE}.new bs=256k conv=sync |
| 97 | mv -f ${NAND_FILE}.new ${NAND_FILE} |
| 98 | |
| 99 | # 3. pad to kernel size = 0x800000 = 8388608 |
| 100 | dd if=${NAND_FILE} of=${NAND_FILE}.new bs=8388608 conv=sync |
| 101 | mv -f ${NAND_FILE}.new ${NAND_FILE} |
| 102 | |
| 103 | # 4. dump filesystem into firmware |
| 104 | dd if=${IMGDEPLOYDIR}/${PN}-${MACHINE}.${NAND_ROOTFS_TYPE} >> ${NAND_FILE} |
| 105 | mv ${NAND_FILE} ${DEPLOY_DIR_IMAGE}/ |
| 106 | fi |
| 107 | |
| 108 | } |
| 109 | addtask filogic_gen_image after do_image_complete before do_populate_lic_deploy |