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