1
0
forked from dan/liminix
Go to file
Arnout Engelen 2c83a2bb77
re-package image with update dtb for tftp
the additional kernel parameters seem to get picked up:

```
Kernel command line: liminix console=ttyS0,115200 console=ttyS0,115200 panic=10 oops=panic init=/bin/init loglevel=8 root=ubi0:liminix rootfstype=squashfs fw_devlink=off mtdparts=phram0:4980736(rootfs) phram.phram=phram0,2252341248,4980736,65536 root=/dev/mtdblock0
```

and the (a?) squashfs is mounted, but cannot load init yet. Is it OK that there are multiple `root=` parameters?

```

============================================

Ralink UBoot Version: 5.0.0.0

--------------------------------------------

ASIC MT7621A DualCore (MAC to MT7530 Mode)

DRAM_CONF_FROM: Auto-Detection

DRAM_TYPE: DDR3

DRAM bus: 16 bit

Xtal Mode=3 OCP Ratio=1/3

Flash component: SPI Flash

Date:Feb 16 2022  Time:16:26:34

============================================

THIS IS uboot

icache: sets:256, ways:4, linesz:32 ,total:32768

dcache: sets:256, ways:4, linesz:32 ,total:32768


 ##### The CPU freq = 880 MHZ ####

 estimate memory size =128 Mbytes


Press '4' or 't' to break the booting process


Press 'x' to enter recovery web server

 0

#Reset_MT7530

set LAN/WAN LLLLW


4: System Enter Boot Command Line Interface.


U-Boot 1.1.3 (Feb 16 2022 - 16:26:34)

MT7621 # t tftpboot 0x868c3000 result/image


 NetLoop,call eth_halt !


 NetLoop,call eth_init !

Trying Eth0 (10/100-M)


 Waitting for RX_DMA_BUSY status Start... done


 ETH_STATE_ACTIVE!!

TFTP from server 192.168.0.5; our IP address is 192.168.0.1

Filename 'result/image'.


 TIMEOUT_COUNT=10,Load address: 0x868c3000

Loading: *Got ARP REPLY, set server/gtwy eth addr (f8:e4:3b:37:bb:82)

Got it

#################################################################

	 #################################################################

	 #################################################################

	 #################################################################

	 ######################################Got ARP REQUEST, return our IP

###########################

	 #################################################################

	 #################################################################

	 #################################################################

	 ###############################

done

Bytes transferred = 2820714 (2b0a6a hex)

LoadAddr=868c3000 NetBootFileXferSize= 002b0a6a

MT7621 # tftpboot 0x86400000 result/rootfs


 NetLoop,call eth_halt !


 NetLoop,call eth_init !

Trying Eth0 (10/100-M)


 ETH_STATE_ACTIVE!!

TFTP from server 192.168.0.5; our IP address is 192.168.0.1

Filename 'result/rootfs'.


 TIMEOUT_COUNT=10,Load address: 0x86400000

Loading: *Got ARP REPLY, set server/gtwy eth addr (f8:e4:3b:37:bb:82)

Got it

#################################################################

	 #################################################################

	 #################################################################

	 #################################################################

	 #################################################################

	 #################################################################

	 #################################################################

	 #################################################################

	 #################################################################

	 #################################################################

	 #################################################################

	 #################################################################

	 #################################################################

	 #################################################################

	 #########################################################

done

Bytes transferred = 4947968 (4b8000 hex)

LoadAddr=86400000 NetBootFileXferSize= 004b8000

MT7621 # bootm 0x868c3000

## Booting image at 868c3000 ...

   Image Name:   MIPS Liminix Linux

   Image Type:   MIPS Linux Kernel Image (lzma compressed)

   Data Size:    2820650 Bytes =  2.7 MB

   Load Address: 80001000

   Entry Point:  80001000

   Verifying Checksum ... OK

   Uncompressing Kernel Image ... OK

No initrd

nm_init:791

nm_initFwupPtnStruct:276

nm_lib_readPtnTable:738

[NM_Debug](nm_lib_readPtnTable) 00743: NM_PTN_TABLE_BASE = 0xfe0000

[NM_Debug](nm_lib_readPtnFromNvram) 00569: partition_used_len = 1054, requried len = 8192

[NM_Debug](nm_lib_readPtnTable) 00751: Reading Partition Table from NVRAM ... OK


[NM_Debug](nm_lib_readPtnTable) 00759: Parsing Partition Table ... OK


[NM_Debug](nm_lib_readPtnFromNvram) 00569: partition_used_len = 3, requried len = 3

[NM_Error](nm_api_checkTestMode) 00417: factory boot check testmode flag is not 1.


### test_mode=disable,boot_args:console=ttyS1,115200 root=/dev/mtdblock2 rootfstype=squashfs init=/etc/preinit mtdparts=raspi:256k(uboot),4096k(uImage),11968k@0x440000(rootfs),64k@0xff0000(ART) mem=128M test_mode=disable

## Transferring control to Linux (at address 80001000) ...

## Giving linux memsize in MB, 128


Starting kernel ...


Linux version 5.15.137 (nixbld@liminix.builder) (mips-unknown-linux-musl-gcc (GCC) 13.2.0, GNU ld (GNU Binutils) 2.40) #1 SMP Sat Jan 27 10:24:12 UTC 2024
SoC Type: MediaTek MT7621 ver:1 eco:4
printk: bootconsole [early0] enabled
CPU0 revision is: 0001992f (MIPS 1004Kc)
MIPS: machine is TP-Link Archer AX23 v1
VPE topology {2,2} total 4
Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
Zone ranges:
  Normal   [mem 0x0000000000000000-0x0000000007ffffff]
Movable zone start for each node
Early memory node ranges
  node   0: [mem 0x0000000000000000-0x0000000007ffffff]
Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
percpu: Embedded 11 pages/cpu s14544 r8192 d22320 u45056
pcpu-alloc: s14544 r8192 d22320 u45056 alloc=11*4096
pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
Built 1 zonelists, mobility grouping on.  Total pages: 32512
Kernel command line: liminix console=ttyS0,115200 console=ttyS0,115200 panic=10 oops=panic init=/bin/init loglevel=8 root=ubi0:liminix rootfstype=squashfs fw_devlink=off mtdparts=phram0:4980736(rootfs) phram.phram=phram0,2252341248,4980736,65536 root=/dev/mtdblock0
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
Writing ErrCtl register=0003003d
Readback ErrCtl register=0003003d
mem auto-init: stack:all(zero), heap alloc:off, heap free:off
Memory: 119816K/131072K available (6564K kernel code, 622K rwdata, 1244K rodata, 1220K init, 217K bss, 11256K reserved, 0K cma-reserved)
SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
rcu: Hierarchical RCU implementation.
rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
NR_IRQS: 256
clocksource: GIC: mask: 0xffffffffffffffff max_cycles: 0xcaf478abb4, max_idle_ns: 440795247997 ns
sched_clock: 64 bits at 880MHz, resolution 1ns, wraps every 4398046511103ns
Console: colour dummy device 80x25
Calibrating delay loop... 583.68 BogoMIPS (lpj=1167360)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
rcu: Hierarchical SRCU implementation.
smp: Bringing up secondary CPUs ...
Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
CPU1 revision is: 0001992f (MIPS 1004Kc)
Synchronize counters for CPU 1: done.
Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
CPU2 revision is: 0001992f (MIPS 1004Kc)
Synchronize counters for CPU 2: done.
Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
CPU3 revision is: 0001992f (MIPS 1004Kc)
Synchronize counters for CPU 3: done.
smp: Brought up 1 node, 4 CPUs
devtmpfs: initialized
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
futex hash table entries: 1024 (order: 3, 32768 bytes, linear)
pinctrl core: initialized pinctrl subsystem
NET: Registered PF_NETLINK/PF_ROUTE protocol family
FPU Affinity set after 4688 emulations
vgaarb: loaded
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
PTP clock support registered
clocksource: Switched to clocksource GIC
NET: Registered PF_INET protocol family
IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
TCP bind hash table entries: 1024 (order: 1, 8192 bytes, linear)
TCP: Hash tables configured (established 1024 bind 1024)
UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
NET: Registered PF_UNIX/PF_LOCAL protocol family
PCI: CLS 0 bytes, default 32
Initialise system trusted keyrings
workingset: timestamp_bits=30 max_order=15 bucket_order=0
squashfs: version 4.0 (2009/01/31) Phillip Lougher
Key type asymmetric registered
Asymmetric key parser 'x509' registered
io scheduler mq-deadline registered
io scheduler kyber registered
mt7621_gpio 1e000600.gpio: registering 32 gpios
mt7621_gpio 1e000600.gpio: registering 32 gpios
mt7621_gpio 1e000600.gpio: registering 32 gpios
mt7621-pci 1e140000.pcie: host bridge /pcie@1e140000 ranges:
mt7621-pci 1e140000.pcie:   No bus range found for /pcie@1e140000, using [bus 00-ff]
mt7621-pci 1e140000.pcie:      MEM 0x0060000000..0x006fffffff -> 0x0060000000
mt7621-pci 1e140000.pcie:       IO 0x001e160000..0x001e16ffff -> 0x0000000000
mt7621-pci 1e140000.pcie: pcie2 no card, disable it (RST & CLK)
mt7621-pci 1e140000.pcie: PCIE0 enabled
mt7621-pci 1e140000.pcie: PCIE1 enabled
PCI coherence region base: 0x60000000, mask/settings: 0xf0000002
mt7621-pci 1e140000.pcie: PCI host bridge to bus 0000:00
pci_bus 0000:00: root bus resource [bus 00-ff]
pci_bus 0000:00: root bus resource [mem 0x60000000-0x6fffffff]
pci_bus 0000:00: root bus resource [io  0x0000-0xffff]
pci 0000:00:00.0: [0e8d:0801] type 01 class 0x060400
pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x7fffffff]
pci 0000:00:00.0: reg 0x14: [mem 0x00000000-0x0000ffff]
pci 0000:00:00.0: supports D1
pci 0000:00:00.0: PME# supported from D0 D1 D3hot
pci 0000:00:01.0: [0e8d:0801] type 01 class 0x060400
pci 0000:00:01.0: reg 0x10: [mem 0x00000000-0x7fffffff]
pci 0000:00:01.0: reg 0x14: [mem 0x00000000-0x0000ffff]
pci 0000:00:01.0: supports D1
pci 0000:00:01.0: PME# supported from D0 D1 D3hot
pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
pci 0000:00:01.0: bridge configuration invalid ([bus 00-00]), reconfiguring
pci 0000:01:00.0: [14c3:7916] type 00 class 0x000280
pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x000fffff 64bit pref]
pci 0000:01:00.0: reg 0x18: [mem 0x00000000-0x00003fff 64bit pref]
pci 0000:01:00.0: reg 0x20: [mem 0x00000000-0x00000fff 64bit pref]
pci 0000:01:00.0: supports D1 D2
pci 0000:01:00.0: PME# supported from D0 D1 D2 D3hot D3cold
pci 0000:01:00.0: 2.000 Gb/s available PCIe bandwidth, limited by 2.5 GT/s PCIe x1 link at 0000:00:00.0 (capable of 4.000 Gb/s with 5.0 GT/s PCIe x1 link)
pci 0000:00:00.0: PCI bridge to [bus 01-ff]
pci 0000:00:00.0:   bridge window [io  0x0000-0x0fff]
pci 0000:00:00.0:   bridge window [mem 0x00000000-0x000fffff]
pci 0000:00:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
pci 0000:02:00.0: [14c3:7915] type 00 class 0x000280
pci 0000:02:00.0: reg 0x10: [mem 0x00000000-0x000fffff 64bit pref]
pci 0000:02:00.0: reg 0x18: [mem 0x00000000-0x00003fff 64bit pref]
pci 0000:02:00.0: reg 0x20: [mem 0x00000000-0x00000fff 64bit pref]
pci 0000:02:00.0: supports D1 D2
pci 0000:02:00.0: PME# supported from D0 D1 D2 D3hot D3cold
pci 0000:02:00.0: 2.000 Gb/s available PCIe bandwidth, limited by 2.5 GT/s PCIe x1 link at 0000:00:01.0 (capable of 4.000 Gb/s with 5.0 GT/s PCIe x1 link)
pci 0000:00:01.0: PCI bridge to [bus 02-ff]
pci 0000:00:01.0:   bridge window [io  0x0000-0x0fff]
pci 0000:00:01.0:   bridge window [mem 0x00000000-0x000fffff]
pci 0000:00:01.0:   bridge window [mem 0x00000000-0x000fffff pref]
pci_bus 0000:02: busn_res: [bus 02-ff] end is updated to 02
pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
pci 0000:00:01.0: BAR 0: no space for [mem size 0x80000000]
pci 0000:00:01.0: BAR 0: failed to assign [mem size 0x80000000]
pci 0000:00:00.0: BAR 8: assigned [mem 0x60000000-0x600fffff]
pci 0000:00:00.0: BAR 9: assigned [mem 0x60100000-0x602fffff pref]
pci 0000:00:01.0: BAR 8: assigned [mem 0x60300000-0x603fffff]
pci 0000:00:01.0: BAR 9: assigned [mem 0x60400000-0x605fffff pref]
pci 0000:00:00.0: BAR 1: assigned [mem 0x60600000-0x6060ffff]
pci 0000:00:01.0: BAR 1: assigned [mem 0x60610000-0x6061ffff]
pci 0000:00:00.0: BAR 7: assigned [io  0x0000-0x0fff]
pci 0000:00:01.0: BAR 7: assigned [io  0x1000-0x1fff]
pci 0000:01:00.0: BAR 0: assigned [mem 0x60100000-0x601fffff 64bit pref]
pci 0000:01:00.0: BAR 2: assigned [mem 0x60200000-0x60203fff 64bit pref]
pci 0000:01:00.0: BAR 4: assigned [mem 0x60204000-0x60204fff 64bit pref]
pci 0000:00:00.0: PCI bridge to [bus 01]
pci 0000:00:00.0:   bridge window [io  0x0000-0x0fff]
pci 0000:00:00.0:   bridge window [mem 0x60000000-0x600fffff]
pci 0000:00:00.0:   bridge window [mem 0x60100000-0x602fffff pref]
pci 0000:02:00.0: BAR 0: assigned [mem 0x60400000-0x604fffff 64bit pref]
pci 0000:02:00.0: BAR 2: assigned [mem 0x60500000-0x60503fff 64bit pref]
pci 0000:02:00.0: BAR 4: assigned [mem 0x60504000-0x60504fff 64bit pref]
pci 0000:00:01.0: PCI bridge to [bus 02]
pci 0000:00:01.0:   bridge window [io  0x1000-0x1fff]
pci 0000:00:01.0:   bridge window [mem 0x60300000-0x603fffff]
pci 0000:00:01.0:   bridge window [mem 0x60400000-0x605fffff pref]
Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
1e000c00.uartlite: ttyS0 at MMIO 0x1e000c00 (irq = 19, base_baud = 3125000) is a 16550A
1 cmdlinepart partitions found on MTD device phram0
Creating 1 MTD partitions on "phram0":
0x000000000000-0x0000004c0000 : "rootfs"
mtd: setting mtd0 (rootfs) as root device
phram: phram0 device: 0x4c0000 at 0x86400000 for erasesize 0x10000
spi-mt7621 1e000b00.spi: sys_freq: 220000000
spi-nor spi0.0: en25qh128 (16384 Kbytes)
5 fixed-partitions partitions found on MTD device spi0.0
OF: Bad cell count for /palmbus@1e000000/spi@b00/flash@0/partitions
OF: Bad cell count for /palmbus@1e000000/spi@b00/flash@0/partitions
OF: Bad cell count for /palmbus@1e000000/spi@b00/flash@0/partitions
OF: Bad cell count for /palmbus@1e000000/spi@b00/flash@0/partitions
Creating 5 MTD partitions on "spi0.0":
0x000000000000-0x000000040000 : "u-boot"
0x000000040000-0x000000fa0000 : "firmware"
2 uimage-fw partitions found on MTD device firmware
Creating 2 MTD partitions on "firmware":
0x000000000000-0x000000400000 : "kernel"
0x000000400000-0x000000f60000 : "rootfs"
0x000000fa0000-0x000000fb0000 : "config"
0x000000fb0000-0x000000ff0000 : "tplink"
0x000000ff0000-0x000001000000 : "radio"
mt7530-mdio mdio-bus:1f: MT7530 adapts as multi-chip module
mtk_soc_eth 1e100000.ethernet eth0: mediatek frame engine at 0xbe100000, irq 21
mtk_soc_eth 1e100000.ethernet wan: mediatek frame engine at 0xbe100000, irq 21
i2c_dev: i2c /dev entries driver
NET: Registered PF_INET6 protocol family
Segment Routing with IPv6
In-situ OAM (IOAM) with IPv6
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered PF_PACKET protocol family
8021q: 802.1Q VLAN Support v1.8
Loading compiled-in X.509 certificates
Loaded X.509 cert 'Build time autogenerated kernel key: b6b976e6f5e4a2a6f94be9b1bd7920d81a61fb4b'
Problem parsing in-kernel X.509 certificate list
mt7530-mdio mdio-bus:1f: MT7530 adapts as multi-chip module
mt7530-mdio mdio-bus:1f: configuring for fixed/rgmii link mode
mt7530-mdio mdio-bus:1f: Link is Up - 1Gbps/Full - flow control rx/tx
mt7530-mdio mdio-bus:1f lan1 (uninitialized): PHY [mt7530-0:00] driver [MediaTek MT7530 PHY] (irq=23)
mt7530-mdio mdio-bus:1f lan2 (uninitialized): PHY [mt7530-0:01] driver [MediaTek MT7530 PHY] (irq=24)
mt7530-mdio mdio-bus:1f lan3 (uninitialized): PHY [mt7530-0:02] driver [MediaTek MT7530 PHY] (irq=25)
mt7530-mdio mdio-bus:1f lan4 (uninitialized): PHY [mt7530-0:03] driver [MediaTek MT7530 PHY] (irq=26)
DSA: tree 0 setup
Warning: unable to open an initial console.
VFS: Mounted root (squashfs filesystem) readonly on device 31:0.
Freeing unused kernel image (initmem) memory: 1220K
This architecture does not have kernel memory protection.
Run /bin/init as init process
  with arguments:
    /bin/init
  with environment:
    HOME=/
    TERM=linux
Kernel panic - not syncing: Requested init /bin/init failed (error -8).
Rebooting in 10 seconds..
```
2024-01-27 16:11:19 +01:00
devices Correctly load DTB 2024-01-27 15:59:46 +01:00
doc rename flashimage to mtdimage 2023-12-11 19:09:18 +00:00
examples Add support for TP-Link Archer AX32 2024-01-27 15:59:43 +01:00
modules re-package image with update dtb for tftp 2024-01-27 16:11:19 +01:00
pkgs openwrt: update to v23.05.2 2024-01-25 12:29:03 +01:00
tests tftpboot: don't rely on hostname being set 2024-01-03 19:40:00 +00:00
.gitignore static leases for rotuer 2023-09-04 23:07:13 +01:00
bordervm-configuration.nix bordervm: build wireshark without qt 2024-01-03 17:02:31 +00:00
bordervm.conf-example.nix support USB ethernet in bordervm 2023-05-09 22:58:56 +01:00
ci.nix rename flashimage to mtdimage 2023-12-11 19:09:18 +00:00
CODE-OF-CONDUCT.md link to CoC, mention IRC 2023-02-22 18:14:40 +00:00
CONTRIBUTING.md fix spelling, remove dead file 2023-02-05 22:42:41 +00:00
default.nix add lzma to buildenv 2024-01-26 22:46:36 +00:00
LICENSE licence: remove accidental punctuation, update copyright year 2023-01-29 16:39:50 +00:00
nat.nft example config for ppoe router 2023-02-25 23:12:55 +00:00
NEWS NEWS: we now expect Liminix 23.11 2024-01-03 19:44:49 +00:00
overlay.nix add btrfs-progs 2024-01-04 09:33:44 +00:00
README.md link to NEWS file 2023-12-11 20:18:28 +00:00
shell.nix set FENNEL_PATH using absolute paths 2023-09-08 21:01:39 +01:00
STYLE.md explain package/module distinction, add notes on side tracks 2022-09-27 14:11:23 +01:00
THOUGHTS.txt think 2024-01-26 22:46:36 +00:00
vanilla-configuration.nix move output module imports example -> device 2023-12-10 16:38:53 +00:00

Liminix

A Nix-based system for configuring consumer wifi routers or IoT device devices, of the kind that OpenWrt or DD-WRT or Gargoyle or Tomato run on. It's a reboot/restart/rewrite of NixWRT.

This is not NixOS-on-your-router: it's aimed at devices that are underpowered for the full NixOS experience. It uses busybox tools, musl instead of GNU libc, and s6-rc instead of systemd.

The Liminix name comes from Liminis, in Latin the genitive declension of "limen", or "of the threshold". Your router stands at the threshold of your (online) home and everything you send to/receive from the outside word goes across it.

Current status (does it work yet?)

Liminix is pre-1.0. We are still finding new and better ways to do things, and there is no attempt to maintain backward compatibility with the old ways.

The NEWS file (available wherever you found this README) is a high-level overview of breaking changes.

Development mostly happens on the main branch, which is therefore not guaranteed to build or to work on every commit. For the latest functioning version, see the CI system and pick a revision with all jobs green.

Documentation

Documentation is in the doc directory. You can build it by running

nix-shell -p sphinx --run "make -C doc html"

Rendered documentation corresponding to the latest commit on main is published to https://www.liminix.org/doc/

Extremely online

There is a #liminix IRC channel on the OFTC network in which you are welcome. You can also connect with a Matrix client by joining the room #_oftc_#liminix:matrix.org.

In the IRC channel, as in all Liminix project venues, please conduct yourself according to the Liminix Code of Conduct.