OpenWrt Forum Archive

Topic: First time compiling openwrt assistance

The content of this topic has been archived on 26 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi guys:

I'm compiling OpenWRT for the first time as I would need the .img to fit into a F6D4230-4 v1 (which has CPU Ralink RT3050, a flash size of 2 MiB and RAM size of 8 MiB). Since the firmwares available for RT3050 are 3 MB, I was trying to get rid of some packages so as to make the image as small as possible.

So far I've ran the below commands:

sudo apt-get -y install git openssl python libssl-dev unzip build-essential binutils flex bison autoconf gettext texinfo sharutils subversion libncurses5-dev ncurses-term zlib1g-dev gawk
git clone git://git.openwrt.org/15.05/openwrt.git
cd openwrt
./scripts/feeds update -a
./scripts/feeds install -a
make prereq
make menuconfig

The menu shows up all right but I just want to know which packages are essential (I just wanna repeat WiFi just over IPv4 and a telnet server to log in and do some configuration changes just in case, and if possible, have a DHCP server and NATting, but I can use a DHCP relay). Which packages do I need?

The easy and honest answer is that it's not going to work. Neither 2 MB flash, nor 8 MB RAM are going to work without the very serious effort (way beyond just configuring stuff). Even twice than (4/16 MB) that would present you with quite a hurdle and very limited functionality, with RAM being the biggest problem - your really want strictly more than 32 MB RAM (and more than 4 MB flash) these days. But even if you go back in time,  8 MB RAM devices were never supportable.

(Last edited by slh on 20 Mar 2017, 20:14)

slh wrote:

The easy and honest answer is that it's not going to work. Neither 2 MB flash, nor 8 MB RAM are going to work without the very serious effort (way beyond just configuring stuff). Even twice than (4/16 MB) that would present you with quite a hurdle and very limited functionality, with RAM being the biggest problem - your really want strictly more than 32 MB RAM (and more than 4 MB flash) these days. But even if you go back in time,  8 MB RAM devices were never supportable.

Since I have had the router lying around for a few years now, I just wanna give it a try and by the way, learn something.

Hi guys:

I'm building a custom image for my Belkin F6D4230-4 v1 (which has CPU Ralink RT3050, a flash size of 2 MiB and RAM size of 8 MiB), so I downloaded http://downloads.openwrt.org/chaos_calm … 64.tar.bz2 and run the following commands:

root@PC:/mnt/c/Users/user/openwrt# tar -xvjf OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64.tar.bz2
root@PC:/mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/include# cat target.mk | grep -i default
# default device type
# Default packages - the really basic set
DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools
DEFAULT_PACKAGES.nas:=block-mount fdisk lsblk mdadm
DEFAULT_PACKAGES.router:=dnsmasq iptables ip6tables ppp ppp-mod-pppoe kmod-nf-nathelper firewall odhcpd odhcp6c
root@PC:/mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64# make image PROFILE=F5D8235V2
make[1]: Entering directory `/mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64'
echo 'Building images for ramips - Belkin F5D8235 v2'
Building images for ramips - Belkin F5D8235 v2
echo 'Packages: base-files busybox dnsmasq dropbear firewall fstools ip6tables iptables kernel kmod-gpio-button-hotplug kmod-leds-gpio kmod-ledtrig-usbdev kmod-nf-nathelper kmod-rt2800-soc kmod-swconfig kmod-switch-rtl8366rb kmod-usb-core kmod-usb-dwc2 libc libgcc mtd netifd odhcp6c odhcpd opkg ppp ppp-mod-pppoe swconfig uci wpad-mini'

root@PC:/mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64# make image PROFILE=F5D8235V2 PACKAGES="base-files busybox dnsmasq dropbear -firewall fstools -ip6tables iptables kernel -kmod-gpio-button-hotplug kmod-leds-gpio -kmod-ledtrig-usbdev kmod-nf-nathelper -kmod-rt2800-soc -kmod-swconfig -kmod-switch-rtl8366rb -kmod-usb-core -kmod-usb-dwc2 libc libgcc mtd netifd -odhcp6c odhcpd opkg -ppp -ppp-mod-pppoe swconfig uci wpad-mini"

Should the resulting image work?

While building the image, I got the below error:

root@PC:/mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64# make image PROFILE=Default PACKAGES="-ip6tables -ppp -ppp-mod-pppoe -firewall -odhcp6c -kmod-usb-core -kmod-usb-dwc2 -kmod-ledtrig-usbdev"
make[1]: Entering directory `/mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64'
echo 'Building images for ramips - Default Profile'
Building images for ramips - Default Profile
echo 'Packages: base-files busybox dnsmasq dropbear fstools iptables kernel kmod-gpio-button-hotplug kmod-leds-gpio kmod-nf-nathelper kmod-rt2800-soc libc libgcc mtd netifd odhcpd opkg swconfig uci wpad-mini'
Packages: base-files busybox dnsmasq dropbear fstools iptables kernel kmod-gpio-button-hotplug kmod-leds-gpio kmod-nf-nathelper kmod-rt2800-soc libc libgcc mtd netifd odhcpd opkg swconfig uci wpad-mini
echo

rm -rf /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/root-ramips
mkdir -p /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/root-ramips /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/bin/ramips /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/tmp /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/dl
if [ ! -f "/mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/packages/Packages" ] || [ ! -f "/mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/packages/Packages.gz" ] || [ "`find /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/packages -cnewer /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/packages/Packages.gz`" ]; then \
                echo "Package list missing or not up-to-date, generating it.";\
                make package_index; \
        else \
                mkdir -p /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/root-ramips/tmp; \
                IPKG_NO_SCRIPT=1 IPKG_TMP="/mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/tmp/ipkgtmp" IPKG_INSTROOT="/mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/root-ramips" IPKG_CONF_DIR="/mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/tmp" IPKG_OFFLINE_ROOT="/mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/root-ramips" /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/staging_dir/host/bin/opkg -f /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/repositories.conf --force-depends --force-overwrite --force-postinstall --cache /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/dl --offline-root /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/root-ramips --add-dest root:/ --add-arch all:100 --add-arch ramips_24kec:200 update || true; \
        fi
Package list missing or not up-to-date, generating it.
make[2]: Entering directory `/mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64'

Building package index...
(cd /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/packages; /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/scripts/ipkg-make-index.sh . > Packages && \
                gzip -9c Packages > Packages.gz \
        ) >/dev/null 2>/dev/null
IPKG_NO_SCRIPT=1 IPKG_TMP="/mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/tmp/ipkgtmp" IPKG_INSTROOT="/mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/root-ramips" IPKG_CONF_DIR="/mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/tmp" IPKG_OFFLINE_ROOT="/mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/root-ramips" /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/staging_dir/host/bin/opkg -f /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/repositories.conf --force-depends --force-overwrite --force-postinstall --cache /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/dl --offline-root /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/root-ramips --add-dest root:/ --add-arch all:100 --add-arch ramips_24kec:200 update || true
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/rt305x/packages/base/Packages.gz.
Updated list of available packages in /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/root-ramips//usr/lib/opkg/lists/chaos_calmer_base.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/rt305x/packages/luci/Packages.gz.
Updated list of available packages in /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/root-ramips//usr/lib/opkg/lists/chaos_calmer_luci.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/rt305x/packages/packages/Packages.gz.
Updated list of available packages in /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/root-ramips//usr/lib/opkg/lists/chaos_calmer_packages.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/rt305x/packages/routing/Packages.gz.
Updated list of available packages in /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/root-ramips//usr/lib/opkg/lists/chaos_calmer_routing.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/rt305x/packages/telephony/Packages.gz.
Updated list of available packages in /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/root-ramips//usr/lib/opkg/lists/chaos_calmer_telephony.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/rt305x/packages/management/Packages.gz.
Updated list of available packages in /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/root-ramips//usr/lib/opkg/lists/chaos_calmer_management.
Downloading file:packages/Packages.
Updated list of available packages in /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/root-ramips//usr/lib/opkg/lists/imagebuilder.
make[2]: Leaving directory `/mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64'
make package_install
make[2]: Entering directory `/mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64'

Installing packages...
IPKG_NO_SCRIPT=1 IPKG_TMP="/mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/tmp/ipkgtmp" IPKG_INSTROOT="/mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/root-ramips" IPKG_CONF_DIR="/mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/tmp" IPKG_OFFLINE_ROOT="/mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/root-ramips" /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/staging_dir/host/bin/opkg -f /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/repositories.conf --force-depends --force-overwrite --force-postinstall --cache /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/dl --offline-root /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/root-ramips --add-dest root:/ --add-arch all:100 --add-arch ramips_24kec:200 install /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/packages/base/libc_0.9.33.2-1_ramips_24kec.ipk
Installing libc (0.9.33.2-1) to root...
Installing libgcc (4.8-linaro-1) to root...
Copying /mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64/dl/libgcc_4.8-linaro-1_ramips_24kec.ipk.
make[2]: *** [package_install] Segmentation fault (core dumped)
make[2]: Leaving directory `/mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64'
make[1]: *** [_call_image] Error 2
make[1]: Leaving directory `/mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64'
make: *** [image] Error 2
root@PC:/mnt/c/Users/user/openwrt/OpenWrt-ImageBuilder-15.05.1-ramips-rt305x.Linux-x86_64#

What could possibly be going on?

I tried getting 15.05 on a (the most) well supported device with 4/16MB.

http://techfindings.one/archives/2075

Not even that works. When customizing the build the device boots, but as soon as you start doing things it breaks.
Things have gotten (a little bit) bigger with every version, even for OpenWRT.
Starting to work on a 10 year old version of OpenWRT to get a smaller base probably makes very little sense.

My honest advice is to get a Raspberry Pi or a well supported router, and a USB-Serial cable, and start building and customizing firmware for that. When you know how to break it and fix it for something supported you can think about doing it for something very-hard-to-support.

zo0ok wrote:

I tried getting 15.05 on a (the most) well supported device with 4/16MB.

http://techfindings.one/archives/2075

Not even that works. When customizing the build the device boots, but as soon as you start doing things it breaks.
Things have gotten (a little bit) bigger with every version, even for OpenWRT.
Starting to work on a 10 year old version of OpenWRT to get a smaller base probably makes very little sense.

My honest advice is to get a Raspberry Pi or a well supported router, and a USB-Serial cable, and start building and customizing firmware for that. When you know how to break it and fix it for something supported you can think about doing it for something very-hard-to-support.

The oldest OpenWRT available for my router's chipset is 14.07 so I'll give it a shot with that.

There has never been an OpenWrt version for your device (SOC support itself is a precondition, but not sufficient), nor any device with just 8 MB RAM or 2 MB flash. As mentioned before already, it will be very tough to slim OpenWrt down to 2 MB flash, but it's close to impossible to get it boot up at all (even in a severely degraded fashion) with 8 MB RAM.

(Last edited by slh on 22 Mar 2017, 23:04)

The discussion might have continued from here.