Skip to content

Instantly share code, notes, and snippets.

@probonopd
Last active April 16, 2023 17:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save probonopd/50ea8065b7d9397f8ec0d762f475f89c to your computer and use it in GitHub Desktop.
Save probonopd/50ea8065b7d9397f8ec0d762f475f89c to your computer and use it in GitHub Desktop.

Custom OpenWRT for Raspberry Pi 1

OpenWRT now has a hosted firmware image builder that can be used to add custom packages and configuration. Neat! I feel that OpenWRT is a much more suitable operating system for the Raspberry Pi 1 than the bigger Raspberry Pi OS images.

https://firmware-selector.openwrt.org/?version=22.03.4&target=bcm27xx%2Fbcm2708&id=rpi

Add avahi-daemon, remove dnsmasq

#!/bin/sh

# Configure Ethernet port as DHCP client
uci set network.lan.proto=dhcp
uci commit network
/etc/init.d/network restart

# Enable SSH login
uci set dropbear.@dropbear[0].PasswordAuth='on'
uci set dropbear.@dropbear[0].RootLogin='1'
uci commit dropbear
/etc/init.d/dropbear restart

# Announce SSH via Zeroconf
uci set avahi-daemon.@avahi-daemon[0].host_name=$(uci get system.@system[0].hostname)
uci set avahi-daemon.@avahi-daemon[0].domain_name='local'
uci set avahi-daemon.@avahi-daemon[0].enable_reflector='yes'
uci set avahi-daemon.@avahi-service[0]=service
uci set avahi-daemon.@avahi-service[0].type='_ssh._tcp'
uci set avahi-daemon.@avahi-service[0].port='22'
uci set avahi-daemon.@avahi-service[0].txtvers='1'
uci set avahi-daemon.@avahi-service[0].txt_record='model=Raspberry Pi'
uci commit avahi-daemon
/etc/init.d/avahi-daemon restart

Ends up with this error, official and customized images: openwrt/openwrt#10689

No filesystem could mount root, tried:
squashfs
ext4

Boot loop.

Hence trying https://firmware-selector.openwrt.org/?version=21.02.6&target=bcm27xx%2Fbcm2708&id=rpi

On helloSystem (FreeBSD):

gunzip openwrt-21.02.6-4cf9b09b48e2-bcm27xx-bcm2708-rpi-squashfs-factory.img.gz
sudo umount /media/boot 
sudo dd if=openwrt-21.02.6-4cf9b09b48e2-bcm27xx-bcm2708-rpi-squashfs-factory.img of=/dev/daX bs=8M status=progress

Same boot loop.

Giving up. Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment