Only 32MB of RAM, still works for simple tasks

First time i couldn't update via image in /tmp. Whatever i've tried memory was too low. So, USB storage might be needed from now on to update.

If you're on 23.05.4 without USB support you need some files from here:

kmod-fs-exfat_5.15.162-1_mips_24kc.ipk
kmod-scsi-core_5.15.162-1_mips_24kc.ipk
kmod-scsi-generic_5.15.162-1_mips_24kc.ipk
kmod-usb-storage_5.15.162-1_mips_24kc.ipk

This is for exfat only. Add/replace other formats if needed.

Same as script (change ssh ip beforehand):

#!/bin/bash

wget https://downloads.openwrt.org/releases/23.05.4/targets/ath79/generic/kmods/5.15.162-1-da89f936189e8280762513898b74a850/kmod-fs-exfat_5.15.162-1_mips_24kc.ipk \
 https://downloads.openwrt.org/releases/23.05.4/targets/ath79/generic/kmods/5.15.162-1-da89f936189e8280762513898b74a850/kmod-scsi-core_5.15.162-1_mips_24kc.ipk \
 https://downloads.openwrt.org/releases/23.05.4/targets/ath79/generic/kmods/5.15.162-1-da89f936189e8280762513898b74a850/kmod-scsi-generic_5.15.162-1_mips_24kc.ipk \
 https://downloads.openwrt.org/releases/23.05.4/targets/ath79/generic/kmods/5.15.162-1-da89f936189e8280762513898b74a850/kmod-usb-storage_5.15.162-1_mips_24kc.ipk

for i in *.ipk; do 
	tar xf "$i"
	tar xf data.tar.gz 
done

tar czf - lib |ssh root@192.168.1.2 -- "tar xzf - -C /tmp"

Then find the files in /tmp/lib/modules and insert them manually with 'insmod'. Order might be important. Just try until it works. Then insert USB stick and check with dmesg |tail if it got registered as /dev/sda.


Imagebuilder-23.05.5:

  • USB support added (exfat only, add more formats manually)
  • Insert 'files' folder after image extraction from here for low-memory tweaks
#!/bin/bash

BUILDER="https://downloads.openwrt.org/releases/23.05.5/targets/ath79/generic/openwrt-imagebuilder-23.05.5-ath79-generic.Linux-x86_64.tar.xz"

# download image builder
if [ ! -f "${BUILDER##*/}" ]; then
	wget "$BUILDER"
	tar xJvf "${BUILDER##*/}"
fi

cd openwrt-*/

if [[ ! -d files ]]; then
    echo -e "\nIf you have a \"files\" folder put it into folder now."
    read -p "Press enter to continue"
fi

# list all targets for this image builder, consider 'make help' as well
#make info

# clean previous images
make clean

# Packages are added if no prefix is given, '-packagename' does not integrate/removes a package
make image  PROFILE="tplink_tl-wr1043nd-v1" \
            FILES="files" \
            PACKAGES="-firewall -kmod-ip6tables -kmod-ipt-conntrack \
                     -kmod-ipt-core -kmod-ipt-nat -kmod-ipt-offload kmod-mac80211 kmod-nf-conntrack -kmod-nf-conntrack6 -kmod-nf-flow -kmod-nf-ipt \
                     -kmod-nf-ipt6 -kmod-nf-nat -kmod-nf-reject -kmod-nf-reject6 -kmod-ppp -kmod-pppoe -kmod-pppox -ppp -luci-proto-ppp -luci-proto-ipv6 -luci-app-firewall \
                     -ppp -ppp-mod-pppoe \
                     -ip6tables -odhcp6c -kmod-ipv6 -kmod-ip6tables -odhcpd-ipv6only \
                     -odhcpd \
                     -iptables \
                     -opkg \
                     zram-swap kmod-lib-lzo kmod-lib-lz4 kmod-lib-zstd kmod-crypto-acompress \
                     uhttpd uhttpd-mod-ubus libiwinfo-lua luci-base luci-mod-admin-full luci-theme-bootstrap \
                     -wpad-basic-wolfssl -wpad-wolfssl \
                     kmod-fs-exfat kmod-usb-storage kmod-scsi-generic \
                     htop"

exit 0
2 Likes

Imagebuilder-24.10.0-rc2:

  • Image url updated
  • tar - forced xz extraction removed so it can autodetect new zst format.
  • "files" folder detection. If a "files" folder is present aside the script it will be softlinked into the openwrt-* folder.
  • 'files' folder for low-memory tweaks is here
  • [Bug] WiFi not working (ath9k: probe of 180c0000.wmac failed with error -5)

Edit: Looks like WiFi is not working yet.
Edit2: Bug report

#!/bin/bash

set -e

BUILDER="https://downloads.openwrt.org/releases/24.10.0-rc2/targets/ath79/generic/openwrt-imagebuilder-24.10.0-rc2-ath79-generic.Linux-x86_64.tar.zst"

# download image builder
if [[ ! -f "${BUILDER##*/}" ]]; then
	wget "$BUILDER"
	tar xJvf "${BUILDER##*/}"
fi

cd openwrt-*/

if [[ ! -d files ]]; then
   if [[ -d "../files" ]]; then
      ln -s ../files files
      echo -e "\nExisting \"files\" folder found and linked."
   else
      echo -e "\nIf you have custom files put them into \"files\" folder now."
      read -p "Press enter to continue"
   fi
fi

# list all targets for this image builder, consider 'make help' as well
#make info

# clean previous images
make clean

# Packages are added if no prefix is given, '-packagename' does not integrate/removes a package
make image  PROFILE="tplink_tl-wr1043nd-v1" \
            FILES="files" \
            PACKAGES="-firewall -kmod-ip6tables -kmod-ipt-conntrack \
                     -kmod-ipt-core -kmod-ipt-nat -kmod-ipt-offload kmod-mac80211 kmod-nf-conntrack -kmod-nf-conntrack6 -kmod-nf-flow -kmod-nf-ipt \
                     -kmod-nf-ipt6 -kmod-nf-nat -kmod-nf-reject -kmod-nf-reject6 -kmod-ppp -kmod-pppoe -kmod-pppox -ppp -luci-proto-ppp -luci-proto-ipv6 -luci-app-firewall \
                     -ppp -ppp-mod-pppoe \
                     -ip6tables -odhcp6c -kmod-ipv6 -kmod-ip6tables -odhcpd-ipv6only \
                     -odhcpd \
                     -iptables \
                     -opkg \
                     zram-swap kmod-lib-lzo kmod-lib-lz4 kmod-lib-zstd kmod-crypto-acompress \
                     uhttpd uhttpd-mod-ubus libiwinfo-lua luci-base luci-mod-admin-full luci-theme-bootstrap \
                     -wpad-basic-wolfssl -wpad-wolfssl \
                     kmod-fs-exfat kmod-usb-storage kmod-scsi-generic \
                     htop"

exit 0
3 Likes