Welcome! Log In Create A New Profile

Advanced

LEDE on a dockstar device with now openwrt - Question

Posted by Menno K 
I try to install LEDE on my dockstar. The following commands are executed:

1. I download the most recent Lede software: download lede-17.01.2-kirkwood-dockstar-squashfs-sysupgrade.tar
2. I unzip these files (kernel + root) to my tftpserver
3. I made some new partitions and uboot commands:

setenv mtdparts 'mtdparts=orion_nand:1M(u-boot),4M(uImage),-(rootfs)'
setenv bootargs_root 'root=/dev/mtdblock2 rootfstype=squashfs ro'
setenv bootcmd 'setenv bootargs ${console} ${mtdparts} ${bootargs_root}; nand read.e 0x800000 0x100000 0x400000; bootm 0x800000'
saveenv

4. I download the kernel from my tftp server and format the partition:
tftpboot 0x6400000 kernel
nand erase.part uImage
nand write.e 0x6400000 0x100000 ${filesize}

5. I download the root files from my tftp server and format the partition

tftp 0x6400000 root
nand erase.part rootfs
nand write.e 0x6400000 rootfs ${filesize}

6. I start the dockstar succesfully and change some passwords. This works well and without problems.

But there is one issue! Changing network parameters (from the luci gui) or the autostart of some modules doesn't work! I think the problem is that the rootfs_data partition is not availible when the device start up. The device use the rom settings and overwrite the /etc/config/network config. But the partition is after booting availible.

Is there anybody who can help me with this problem?

Boot logs:
root@LEDE:/rom/etc# dmesg
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.4.50 (buildbot@builds-02.infra.lede-project.org) (gcc version 5.4.0 (LEDE GCC 5.4.0 r3103-1b51a49) ) #0 Mon Feb 20 15:02:54 2017
[    0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] Machine model: Seagate FreeAgent Dockstar
[    0.000000] Memory policy: Data cache writeback
[    0.000000] On node 0 totalpages: 32768
[    0.000000] free_area_init_node: node 0, pgdat c04d973c, node_mem_map c7efa000
[    0.000000]   Normal zone: 256 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 32768 pages, LIFO batch:7
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: ttyS0,115200 mtdparts=orion_nand:1M(u-boot),4M(uImage),-(rootfs) root=/dev/mtdblock2 rootfstype=squashfs rw
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Memory: 124560K/131072K available (4074K kernel code, 142K rwdata, 652K rodata, 176K init, 201K bss, 6512K reserved, 0K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xc8800000 - 0xff800000   ( 880 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .text : 0xc0008000 - 0xc04a5db4   (4728 kB)
[    0.000000]       .init : 0xc04a6000 - 0xc04d2000   ( 176 kB)
[    0.000000]       .data : 0xc04d2000 - 0xc04f5ac8   ( 143 kB)
[    0.000000]        .bss : 0xc04f5ac8 - 0xc05281bc   ( 202 kB)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] clocksource: orion_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302233 ns
[    0.000008] sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 10737418237ns
[    0.000081] Calibrating delay loop... 1191.11 BogoMIPS (lpj=5955584)
[    0.090087] pid_max: default: 32768 minimum: 301
[    0.090203] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.090223] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.090790] CPU: Testing write buffer coherency: ok
[    0.091144] Setting up static identity map for 0x81e0 - 0x821c
[    0.091388] mvebu-soc-id: MVEBU SoC ID=0x6281, Rev=0x2
[    0.095861] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.095933] pinctrl core: initialized pinctrl subsystem
[    0.096986] NET: Registered protocol family 16
[    0.097392] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.098127] cpuidle: using governor ladder
[    0.098488] Feroceon L2: Enabling L2
[    0.098533] Feroceon L2: Cache support initialised.
[    0.098806] [Firmware Info]: /ocp@f1000000/ethernet-controller@72000/ethernet0-port@0: local-mac-address is not set
[    0.116268] SCSI subsystem initialized
[    0.116685] libata version 3.00 loaded.
[    0.116989] usbcore: registered new interface driver usbfs
[    0.117065] usbcore: registered new interface driver hub
[    0.117131] usbcore: registered new device driver usb
[    0.117970] clocksource: Switched to clocksource orion_clocksource
[    0.118852] NET: Registered protocol family 2
[    0.119453] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.119477] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.119496] TCP: Hash tables configured (established 1024 bind 1024)
[    0.119553] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.119575] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.119721] NET: Registered protocol family 1
[    0.119752] PCI: CLS 0 bytes, default 32
[    0.120526] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.120574] Crashlog allocated RAM at address 0x3f00000
[    0.135256] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.135271] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.137929] io scheduler noop registered
[    0.137942] io scheduler deadline registered (default)
[    0.139115] kirkwood-pinctrl f1010000.pin-controller: registered pinctrl driver
[    0.139680] irq: Cannot allocate irq_descs @ IRQ32, assuming pre-allocated
[    0.140028] irq: Cannot allocate irq_descs @ IRQ64, assuming pre-allocated
[    0.171415] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.174415] console [ttyS0] disabled
[    0.174488] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 25, base_baud = 12500000) is a 16550A
[    5.119232] console [ttyS0] enabled
[    5.162381] nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xda
[    5.238494] nand: Micron MT29F2G08AAD
[    5.282329] nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    5.373059] Scanning device for bad blocks
[    5.454033] Bad eraseblock 419 at 0x000003460000
[    5.519901] Bad eraseblock 559 at 0x0000045e0000
[    5.621887] Bad eraseblock 1173 at 0x0000092a0000
[    5.716220] Bad eraseblock 1673 at 0x00000d120000
[    5.800960] 3 cmdlinepart partitions found on MTD device orion_nand
[    5.876041] Creating 3 MTD partitions on "orion_nand":
[    5.937603] 0x000000000000-0x000000100000 : "u-boot"
[    5.998811] 0x000000100000-0x000000500000 : "uImage"
[    6.059336] 0x000000500000-0x000010000000 : "rootfs"
[    6.120278] mtd: device 2 (rootfs) set to be root filesystem
[    6.188213] 1 squashfs-split partitions found on MTD device rootfs
[    6.262272] 0x000000680000-0x000010000000 : "rootfs_data"
[    6.329049] libphy: orion_mdio_bus: probed
[    6.378996] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
[    6.461773] mv643xx_eth_port mv643xx_eth_port.0 eth0: port 0 with MAC address XX:XX:XX:XX:XX:XX
[    6.566057] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    6.644223] ehci-pci: EHCI PCI platform driver
[    6.697508] ehci-platform: EHCI generic platform driver
[    6.760177] ehci-orion: EHCI orion driver
[    6.808326] orion-ehci f1050000.ehci: EHCI Host Controller
[    6.874033] orion-ehci f1050000.ehci: new USB bus registered, assigned bus number 1
[    6.965892] orion-ehci f1050000.ehci: irq 29, io mem 0xf1050000
[    7.047987] orion-ehci f1050000.ehci: USB 2.0 started, EHCI 1.00
[    7.120612] hub 1-0:1.0: USB hub found
[    7.165629] hub 1-0:1.0: 1 port detected
[    7.213086] usbcore: registered new interface driver usb-storage
[    7.527984] usb 1-1: new high-speed USB device number 2 using orion-ehci
[    7.760058] hub 1-1:1.0: USB hub found
[    7.805158] hub 1-1:1.0: 4 ports detected
[    8.127982] usb 1-1.4: new high-speed USB device number 3 using orion-ehci
[    8.287980] rtc-mv f1010300.rtc: internal RTC not ticking
[    8.352758] i2c /dev entries driver
[    8.395249] orion_wdt: Initial timeout 21 sec
[    8.450898] marvell-cesa f1030000.crypto: CESA device successfully registered
[    8.537465] NET: Registered protocol family 10
[    8.592449] NET: Registered protocol family 17
[    8.645724] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[    8.796800] 8021q: 802.1Q VLAN Support v1.8
[    8.849884] hctosys: unable to open rtc device (rtc0)
[    8.916981] VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
[    9.002045] Freeing unused kernel memory: 176K (c04a6000 - c04d2000)
[    9.582539] init: Console is alive
[    9.623437] init: - watchdog -
[    9.729026] init: - preinit -
[   10.143997] random: jshn: uninitialized urandom read (4 bytes read, 8 bits of entropy available)
[   10.310762] random: jshn: uninitialized urandom read (4 bytes read, 8 bits of entropy available)
[   10.438841] random: jshn: uninitialized urandom read (4 bytes read, 8 bits of entropy available)
[   10.567056] random: jshn: uninitialized urandom read (4 bytes read, 8 bits of entropy available)
[   10.692876] random: jshn: uninitialized urandom read (4 bytes read, 8 bits of entropy available)
[   10.818466] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled
[   10.936268] mv643xx_eth_port mv643xx_eth_port.0 eth0: link down
[   11.008362] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   11.093160] random: procd: uninitialized urandom read (4 bytes read, 9 bits of entropy available)
[   13.870808] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled
[   13.988589] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   14.363970] mount_root: no usable overlay filesystem found, using tmpfs overlay
[   14.454441] urandom-seed: Seed file not found (/etc/urandom.seed)
[   14.584943] procd: - early -
[   14.619932] procd: - watchdog -
[   15.472683] procd: - ubus -
[   15.536734] random: ubusd: uninitialized urandom read (4 bytes read, 16 bits of entropy available)
[   15.645054] random: ubusd: uninitialized urandom read (4 bytes read, 16 bits of entropy available)
[   15.752747] random: ubusd: uninitialized urandom read (4 bytes read, 16 bits of entropy available)
[   15.860148] random: ubusd: uninitialized urandom read (4 bytes read, 16 bits of entropy available)
[   15.968530] procd: - init -
[   16.137412] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   16.208490] ip_tables: (C) 2000-2006 Netfilter Core Team
[   16.276239] nf_conntrack version 0.5.0 (1949 buckets, 7796 max)
[   16.365308] xt_time: kernel timezone is -0000
[   16.423909] PPP generic driver version 2.4.2
[   16.476664] NET: Registered protocol family 24
[   20.949029] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled
[   21.389307] device eth0 entered promiscuous mode
[   21.559831] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   21.900430] br-lan: port 1(eth0) entered forwarding state
[   21.965168] br-lan: port 1(eth0) entered forwarding state
[   22.428470] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   23.958008] br-lan: port 1(eth0) entered forwarding state
[   24.984875] jffs2: notice: (1892) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[   73.358011] random: nonblocking pool is initialized



root@LEDE:/rom/etc# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00100000 00020000 "u-boot"
mtd1: 00400000 00020000 "uImage"
mtd2: 0fb00000 00020000 "rootfs"
mtd3: 0f980000 00020000 "rootfs_data"



root@LEDE:/rom/etc# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root                 1536      1536         0 100% /rom
tmpfs                    62368       324     62044   1% /tmp
tmpfs                    62368        52     62316   0% /tmp/root
tmpfs                      512         0       512   0% /dev
/dev/mtdblock3          255488      6208    249280   2% /overlay
overlayfs:/overlay      255488      6208    249280   2% /
root@LEDE:/rom/etc#



Edited 1 time(s). Last edit at 06/17/2017 02:56PM by bodhi.
Menno K
LEDE on a dockstar device with now openwrt
June 10, 2017 05:50AM
For now i using a dockstar as WIFI accespoint with openwrt version 15.05 with the installation steps on https://wiki.openwrt.org/toh/seagate/dockstar with uboot version U-Boot 2016.05-tld-1 (Jun 12 2016 - 13:34:27 -0700)

This works great but i can't upgrade this to a new version (upgrade tab is not availible). For security and safety i want to upgrade this to a new LEDE version. How can i do that because the lede version has no zimage , ubs and dtb files (and maybe also another partitioning format).

Can anybody give me the exact steps to upgrade this to a new lede version? Currently i have serial access on this device.

Thanks for your help!
Menno K
Re: LEDE on a dockstar device with now openwrt
June 10, 2017 06:19AM
Extra information:

root@OpenWrt:~# cat /proc/mtd
dev: size erasesize name
mtd0: 000e0000 00020000 "uboot"
mtd1: 00020000 00020000 "uboot_env"
mtd2: 00100000 00020000 "second_stage_uboot"
mtd3: 0fe00000 00020000 "root"

The available files from lede:

[F] lede-kirkwood-dockstar-initramfs-uImage
[F] lede-kirkwood-dockstar-squashfs-factory.bin
[F] lede-kirkwood-dockstar-squashfs-sysupgrade.tar
[F] lede-kirkwood-dockstar-uImage
Re: LEDE on a dockstar device with now openwrt
June 17, 2017 02:38AM
@Menno K
LEDE uses kernel and rootfs in UBI for kirkwoods now, so what you did won't work. (admittedly there is no documentation yet as the wiki is still under construction, and there is a re-merge underway, sorry for that)

The installation works by changing uboot settings (and also uboot because stock uboot can't boot from ubi, you seem to have bodhi's uboot, that's ok, it can boot LEDE too) booting a initramfs image and then doing a sysupgrade.

set the uboot like this (I've also double-checked your device's flash partitions from the dts patch in LEDE source here https://github.com/lede-project/source/tree/master/target/linux/kirkwood/patches-4.4 to make sure it was correct)

setenv mtdparts=mtdparts=orion_nand:0x0xe0000(uboot),0x100000(u-boot environment),0x0x200000(second stage u-boot),0x0xfe00000(ubi)
setenv bootargs_lede ''
setenv bootcmd 'run bootargs_lede; ubi part ubi; ubi read 0x800000 kernel; bootm 0x800000'
setenv console=console=ttyS0,115200
setenv ethaddr 00:00:00:00:00 (put your mac address instead of the example one)
setenv mtdids=nand0=orion_nand
saveenv

If you want multiboot setup you can make a bootcmd_lede instead of changing the bootcmd, and append the bootcmd_lede to the bootcmd so that if it does not find debian or arch it will boot LEDE

setenv bootcmd run bootcmd_something; run bootcmd_something_else; run bootcmd_lede;

Then you download and place the lede-kirkwood-dockstar-initramfs-uImage on a USB flash drive formatted with FAT32 and insert it in the device then fro uboot write

usb reset; fatload usb 0 0x800000 lede-kirkwood-dockstar-initramfs-uImage; bootm 0x800000


Also tftp works fine, but don't flash that image, only bootm.

That file is a LEDE system image that runs from RAM, and you will only use that to do a sysupgrade as normal with lede-kirkwood-dockstar-squashfs-sysupgrade.tar. It will reformat flash if needed, deal with any bad blocks and so on.

@bodhi Could you move his post in that thread into this? It is not about the recovery. He is asking how to install current LEDE on his device.
Menno K
Re: LEDE on a dockstar device with now openwrt
June 18, 2017 03:01AM
Thanks for your help! I did the following things:

1. I upgrade the Uboot to most recent bodhi version
2. I set the new parameters to ( i change some things because the mtdparts string was in my opinion not correct):
setenv mtdparts mtdparts=orion_nand:0x0xe0000(uboot),0x100000(uboot_env),0x0x200000(second_stage_uboot),0x0xfe00000(ubi)
setenv bootargs_lede ''
setenv bootcmd 'run bootargs_lede; ubi part ubi; ubi read 0x800000 kernel; bootm 0x800000'
setenv console=console=ttyS0,115200
setenv ethaddr 00:00:00:00:00
setenv mtdids=nand0=orion_nand
saveenv
3. I run the following code for starting the proces:
usb reset; fatload usb 0 0x800000 lede-kirkwood-dockstar-initramfs-uImage; bootm 0x800000
4. I logging to the ssh dockstar session and i put the following commands to the commandline:
cd /tmp
wget http://downloads.lede-project.org/releases/17.01.2/targets/kirkwood/generic/lede-17.01.2-kirkwood-dockstar-squashfs-sysupgrade.tar
sysupgrade lede-17.01.2-kirkwood-dockstar-squashfs-sysupgrade.tar

The dockstar restart and i get the following message from the serial connection:

U-Boot 2016.05-tld-1 (Jun 12 2016 - 13:34:27 -0700)
Seagate FreeAgent DockStar

SoC:   Kirkwood 88F6281_A0
DRAM:  128 MiB
WARNING: Caches not enabled
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
88E1116 Initialized on egiga0
Hit any key to stop autoboot:  0
## Error: "bootargs_lede" not defined
ubi0: attaching mtd1
ubi0: scanning is finished
ubi0: attached mtd1 (name "mtd=3", size 254 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512
ubi0: VID header offset: 512 (aligned 512), data offset: 2048
ubi0: good PEBs: 2028, bad PEBs: 4, corrupted PEBs: 0
ubi0: user volume: 3, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 80                                                  4999891
ubi0: available PEBs: 0, total reserved PEBs: 2028, PEBs reserved for bad PEB ha                                                  ndling: 36
Read 0 bytes from volume kernel to 800000
No size specified -> Using max size (1935360)
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   ARM LEDE Linux-4.4.71
   Created:      2017-06-08  21:02:37 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1808348 Bytes = 1.7 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...

After +-10 seconds the dockstar restart again and again. What do i wrong?
Fixed!!

I forget to run (to save the new param):
setenv bootargs ${console} ${mtdparts}
saveenv
Extra information, the variable line of the mtd is not correct. The correct string is:
setenv mtdparts mtdparts=orion_nand:0xe0000@0x0(uboot),0x20000@0xe0000(uboot_env),0x100000@0x100000(second_stage_uboot),-@0x200000(ubi)

Also when you add the new partition layout you need to erase the ubi nand first before new install:
nand erase.part ubi

Thanks for your help it works perfect now. And i hope that this information can be used for the dockstar manual :)
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: