AP152 reff board squashfs-sysupgrade.bin is not getting generated

i have downloaded build from
"git clone https://git.openwrt.org/openwrt/openwrt.git".
i updated feed by ./scripts update -a && ./scripts install -a .
in make menuconfig i selected AP152 16mb device. and did make -j4.
but i dont find squashfs-sysupgrade.bin in bin directory.
Please help me

After analyzing more, i found that kernel 4.14 becomes 1585172 Bytes = 1.5 MB which doesnt allow to create squashfs-sysupgrade.bin. what can i do?

Hi tirth21, I noticed the same when trying to build the image with the current code on the master branch. I managed to compile using the 18.06-1 stable release and the kernel size is really close to the maximum.

Not sure If we could change the mtd layout of the board and adapt to our image.mk. I'm no experto on this so I'd like to hear someone's opinion.

If anyone is willing to look at it here's the output of my make -j1 V=s.

Image Name:   MIPS OpenWrt Linux-4.14.97
Created:      Thu Feb  7 12:06:23 2019
Image Type:   MIPS Linux Kernel Image (lzma compressed)
Data Size:    1584759 Bytes = 1547.62 KiB = 1.51 MiB
Load Address: 80060000
Entry Point:  80060000
if [ 14876672 -eq 0 ]; then filename="/home/joao/dev/snapshot/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/vmlinux-ap152-16M.uImage"; fstype=${filename##*\.}; case "${fstype}" in *) bs=`stat -c%s /home/joao/dev/snapshot/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/root.squashfs-64k`;; esac; ( dd if=/home/joao/dev/snapshot/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/root.squashfs-64k bs=${bs} conv=sync;  cat /home/joao/dev/snapshot/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/vmlinux-ap152-16M.uImage ) > /home/joao/dev/snapshot/bin/targets/ar71xx/generic/openwrt-ar71xx-generic-ap152-16M-squashfs-sysupgrade.bin; if [ -n "" ]; then case "${fstype}" in squashfs*) padjffs2 /home/joao/dev/snapshot/bin/targets/ar71xx/generic/openwrt-ar71xx-generic-ap152-16M-squashfs-sysupgrade.bin ; ;; esac; fi; if [ `stat -c%s /home/joao/dev/snapshot/bin/targets/ar71xx/generic/openwrt-ar71xx-generic-ap152-16M-squashfs-sysupgrade.bin` -gt 1507328 ]; then echo "Warning: /home/joao/dev/snapshot/bin/targets/ar71xx/generic/openwrt-ar71xx-generic-ap152-16M-squashfs-sysupgrade.bin is too big (> 1507328 bytes)" >&2; rm -f /home/joao/dev/snapshot/bin/targets/ar71xx/generic/openwrt-ar71xx-generic-ap152-16M-squashfs-sysupgrade.bin; fi; else if [ 14876672 -gt 262144 ]; then if [ `stat -c%s "/home/joao/dev/snapshot/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/root.squashfs-64k"` -gt 14876672 ]; then echo "Warning: /home/joao/dev/snapshot/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/root.squashfs-64k is too big (> 14876672 bytes)" >&2; else if [ `stat -c%s /home/joao/dev/snapshot/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/vmlinux-ap152-16M.uImage` -gt 1507328 ]; then echo "Warning: /home/joao/dev/snapshot/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/vmlinux-ap152-16M.uImage is too big (> 1507328 bytes)" >&2; else ( dd if=/home/joao/dev/snapshot/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/root.squashfs-64k bs=14876672 conv=sync; dd if=/home/joao/dev/snapshot/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/vmlinux-ap152-16M.uImage ) > /home/joao/dev/snapshot/bin/targets/ar71xx/generic/openwrt-ar71xx-generic-ap152-16M-squashfs-sysupgrade.bin; fi; fi; else ( dd if=/home/joao/dev/snapshot/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/root.squashfs-64k bs=14876672 conv=sync; dd if=/home/joao/dev/snapshot/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/vmlinux-ap152-16M.uImage ) > /home/joao/dev/snapshot/bin/targets/ar71xx/generic/openwrt-ar71xx-generic-ap152-16M-squashfs-sysupgrade.bin; if [ `stat -c%s /home/joao/dev/snapshot/bin/targets/ar71xx/generic/openwrt-ar71xx-generic-ap152-16M-squashfs-sysupgrade.bin` -gt 1507328 ]; then echo "Warning: /home/joao/dev/snapshot/bin/targets/ar71xx/generic/openwrt-ar71xx-generic-ap152-16M-squashfs-sysupgrade.bin is too big (> 1507328 bytes)" >&2; rm -f /home/joao/dev/snapshot/bin/targets/ar71xx/generic/openwrt-ar71xx-generic-ap152-16M-squashfs-sysupgrade.bin; fi; fi; fi
Warning: /home/joao/dev/snapshot/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/vmlinux-ap152-16M.uImage is too big (> 1507328 bytes)
make[6]: Leaving directory '/home/joao/dev/snapshot/target/linux/ar71xx/image'
IPKG_NO_SCRIPT=1 IPKG_INSTROOT=/home/joao/dev/snapshot/build_dir/target-mips_24kc_musl/root.orig-ar71xx TMPDIR=/home/joao/dev/snapshot/build_dir/target-mips_24kc_musl/root.orig-ar71xx/tmp /home/joao/dev/snapshot/staging_dir/host/bin/opkg --offline-root /home/joao/dev/snapshot/build_dir/target-mips_24kc_musl/root.orig-ar71xx --force-postinstall --add-dest root:/ --add-arch all:100 --add-arch mips_24kc:200 list-installed > /home/joao/dev/snapshot/bin/targets/ar71xx/generic/openwrt-ar71xx-generic-device-ap152-16m.manifest
make[5]: Leaving directory '/home/joao/dev/snapshot/target/linux/ar71xx/image'
make[4]: Leaving directory '/home/joao/dev/snapshot/target/linux/ar71xx'
make[3]: Leaving directory '/home/joao/dev/snapshot/target/linux'
time: target/linux/install#17.50#2.53#31.85
make[2]: Leaving directory '/home/joao/dev/snapshot'
export MAKEFLAGS= ;make -w -r package/index
make[2]: Entering directory '/home/joao/dev/snapshot'
Generating package index...

Hello joaohcca, i am also facing same issue

mkimage -A mips -O linux -T kernel -a 0x80060000 -C lzma  -e 0x80060000 -n 'MIPS OpenWrt Linux-4.14.97' -d /test2/test2/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/vmlinux-ap152-16M.bin.lzma /test2/test2/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/vmlinux-ap152-16M.uImage
Image Name:   MIPS OpenWrt Linux-4.14.97
Created:      Thu Feb  7 10:15:11 2019
Image Type:   MIPS Linux Kernel Image (lzma compressed)
Data Size:    1582470 Bytes = 1545.38 KiB = 1.51 MiB
Load Address: 80060000
Entry Point:  80060000
if [ 14876672 -eq 0 ]; then filename="/test2/test2/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/vmlinux-ap152-16M.uImage"; fstype=${filename##*\.}; case "${fstype}" in *) bs=`stat -c%s /test2/test2/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/root.squashfs-64k`;; esac; ( dd if=/test2/test2/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/root.squashfs-64k bs=${bs} conv=sync;  cat /test2/test2/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/vmlinux-ap152-16M.uImage ) > /test2/test2/bin/targets/ar71xx/generic/openwrt-ar71xx-generic-ap152-16M-squashfs-sysupgrade.bin; if [ -n "" ]; then case "${fstype}" in squashfs*) padjffs2 /test2/test2/bin/targets/ar71xx/generic/openwrt-ar71xx-generic-ap152-16M-squashfs-sysupgrade.bin ; ;; esac; fi; if [ `stat -c%s /test2/test2/bin/targets/ar71xx/generic/openwrt-ar71xx-generic-ap152-16M-squashfs-sysupgrade.bin` -gt 1507328 ]; then echo "Warning: /test2/test2/bin/targets/ar71xx/generic/openwrt-ar71xx-generic-ap152-16M-squashfs-sysupgrade.bin is too big (> 1507328 bytes)" >&2; rm -f /test2/test2/bin/targets/ar71xx/generic/openwrt-ar71xx-generic-ap152-16M-squashfs-sysupgrade.bin; fi; else if [ 14876672 -gt 262144 ]; then if [ `stat -c%s "/test2/test2/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/root.squashfs-64k"` -gt 14876672 ]; then echo "Warning: /test2/test2/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/root.squashfs-64k is too big (> 14876672 bytes)" >&2; else if [ `stat -c%s /test2/test2/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/vmlinux-ap152-16M.uImage` -gt 1507328 ]; then echo "Warning: /test2/test2/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/vmlinux-ap152-16M.uImage is too big (> 1507328 bytes)" >&2; else ( dd if=/test2/test2/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/root.squashfs-64k bs=14876672 conv=sync; dd if=/test2/test2/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/vmlinux-ap152-16M.uImage ) > /test2/test2/bin/targets/ar71xx/generic/openwrt-ar71xx-generic-ap152-16M-squashfs-sysupgrade.bin; fi; fi; else ( dd if=/test2/test2/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/root.squashfs-64k bs=14876672 conv=sync; dd if=/test2/test2/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/vmlinux-ap152-16M.uImage ) > /test2/test2/bin/targets/ar71xx/generic/openwrt-ar71xx-generic-ap152-16M-squashfs-sysupgrade.bin; if [ `stat -c%s /test2/test2/bin/targets/ar71xx/generic/openwrt-ar71xx-generic-ap152-16M-squashfs-sysupgrade.bin` -gt 1507328 ]; then echo "Warning: /test2/test2/bin/targets/ar71xx/generic/openwrt-ar71xx-generic-ap152-16M-squashfs-sysupgrade.bin is too big (> 1507328 bytes)" >&2; rm -f /test2/test2/bin/targets/ar71xx/generic/openwrt-ar71xx-generic-ap152-16M-squashfs-sysupgrade.bin; fi; fi; fi
Warning: /test2/test2/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/vmlinux-ap152-16M.uImage is too big (> 1507328 bytes)

mtd partitions of this model are configured in image/legacy.mk as follows:

ap152_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k@0x50000(firmware)

According to this, since the kernel partition exists after the rootfs partition, it seems that the size is restricted to 1472 KiB.

Although you can get rid of this restriction by changing the configuration of the mtd partition, but just doing it will cause the u-boot fail to find the kernel and will not be able to boot it. So, you will need to modify the bootloader environment variable as well.

Previously, I faced the same problem in BHR-4GRV2 in ath79 target and made this change:

Hi musashino,
I figured we could be able to do something along those lines, thanks for the feedback.

I agree that updating the bootcmd address on the bootloader enviroment could do the trick.

i have tried it by changing mtd parts size but it didnt work on device. it shows bad magic number

I tried porting to ath79 target. Can you try booting with the initramfs image and provide the bootlog?

https://taiha.net/jenkins/job/OpenWrt-master-multi-target/11/

can i have legacy.mk ?

There is no legacy.mk in ath79 target.

And, I tried to rewrite build code to current code in ar71xx target.

Compile tested, but not run tested (I don't have this device).