Quantcast
Channel: Linux Device Hacking
Viewing all 46983 articles
Browse latest View live

Re: Debian installation on Netgear RN102

$
0
0
Here is the updated DTB (and also the DTS for reference). Copy the armada-370-netgear-rn102.dtb file to /boot/dts on your box (backup the current DTB for keepsake first).

Please comment out all the echo statements to control the LEDs that you might have currently. Reboot the box and observe the LEDs behaviors. They should be what I described in the above post.

Re: Debian installation on Netgear RN102

$
0
0
Hei bodhi,

I have two RN102 units now and can thus test alternative solutions against each other for performance or other behavior. I will keep the vendor's firmware on the second one for some time to be able to compare Debian against stock. Later I will be able to compare Debian against Debian.

I notice that the stock kernel uses the u-boot environment variable 'eth1addr' for setting the mac address:
Marvell>> printenv eth1addr
eth1addr=12:34:56:78:90:AB
Marvell>>
After booting Debian and logging in:
ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 12:34:56:78:90:ab  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:532 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:26
As well as for setting the default 'hostname':
cat /etc/hostname
nas-78-90-AB

I like the idea of giving each unit a (more or less) unique 'hostname', but I think using a part of the u-boot environment variable 'SerialNum' would be a better solution than using a part of the mach address. My serial number is a sting of 13 characters consisting of digits and upper case letters only. Following Netgear's example, including the last, say, 4 characters in the hostname is one possibility.

Regards,
Trond Melen

Re: Debian on Netgear RN102

$
0
0
Hi bodhi,

Following up this post, I have performed a fresh install of your latest Debian version, but with Linux kernel 4.20.6 and the modified device tree for the ReadyNAS RN102. Complete procedure follows mainly for my own later reference.

On my Ubuntu 20.04 laptop, I downloaded the input files to /tmp/bodhi. The md5 sums were:
/tmp/bodhi
md5sum *
ffe6bb6a1d591b06be1f3a55273bc236  armada-370-netgear-rn102.dtb
ffa864878dd797241c0bea05d563239a  Debian-5.2.9-mvebu-tld-1-rootfs-bodhi.tar.bz2
8cf3d08dee09d000cf8b50b2df2f4047  linux-4.20.6-mvebu-mirabox-tld-12-bodhi.tar.bz2

Disabled auto mounting and lanched 'gparted':
sudo systemctl stop udisks2.service
sudo gparted

Plugged in the USB-stick and did Refresh Devices. Selected the newly added device in the upper right pull-down menu, created a 'msdos' partition table and formatted the USB-stick with a single partition labeled 'rootfs' containing an 'ext3' file system, and applied the pending operations. Made a screenshot (attached) and closed 'gparted'.

Mounted the USB stick on /mnt and, following your instructions, extracted the input files onto it:
sudo su -
lsblk
mount /dev/sda1 /mnt
cd /mnt
tar xf /tmp/bodhi/Debian-5.2.9-mvebu-tld-1-rootfs-bodhi.tar.bz2
ls -alF

total 96
drwxrwxrwx 21 root root  4096 jan.  20  2017 ./
drwxr-xr-x 20 root root  4096 aug.  21 12:35 ../
drwxr-xr-x  2 root root  4096 aug.  26  2019 bin/
drwxr-xr-x  3 root root  4096 sep.   5  2019 boot/
drwxr-xr-x  4 root root  4096 jan.   2  2017 dev/
drwxr-xr-x 70 root root  4096 sep.   5  2019 etc/
drwxr-xr-x  2 root root  4096 sep.  12  2016 home/
drwxr-xr-x 13 root root  4096 aug.  26  2019 lib/
drwx------  2 root root 16384 jan.   9  2017 lost+found/
drwxr-xr-x  2 root root  4096 jan.  20  2017 media/
drwxr-xr-x  2 root root  4096 jan.   2  2017 mnt/
drwxr-xr-x  2 root root  4096 jan.   2  2017 opt/
drwxr-xr-x  2 root root  4096 sep.  12  2016 proc/
drwx------  5 root root  4096 sep.  10  2019 root/
drwxr-xr-x  8 root root  4096 aug.  25  2019 run/
drwxr-xr-x  2 root root  4096 aug.  26  2019 sbin/
drwxr-xr-x  2 root root  4096 jan.   2  2017 srv/
drwxr-xr-x  2 root root  4096 april  6  2015 sys/
drwxrwxrwt  2 root root  4096 sep.   5  2019 tmp/
drwxr-xr-x 10 root root  4096 jan.   2  2017 usr/
drwxr-xr-x 11 root root  4096 jan.   2  2017 var/

mkdir usr/src/mirabox && cd usr/src/mirabox
tar xf /tmp/bodhi/linux-4.20.6-mvebu-mirabox-tld-12-bodhi.tar.bz2
ls -alF

total 34204
drwxr-xr-x 2 root root     4096 aug.  28 08:03 ./
drwxr-xr-x 3 root root     4096 aug.  28 08:03 ../
-rw-r--r-- 1 root root   174254 mars  13  2019 config-4.20.6-mvebu-mirabox-tld-12
-rw-r--r-- 1 root root    67443 feb.   7  2019 linux-4.20.6-mvebu-tld-1.patch
-rw-r--r-- 1 root root   921600 mars  13  2019 linux-dtb-4.20.6-mvebu-mirabox-tld-12.tar
-rw-r--r-- 1 root root  9431996 mars  13  2019 linux-headers-4.20.6-mvebu-mirabox-tld-12_12.0_armhf.deb
-rw-r--r-- 1 root root 20292840 mars  13  2019 linux-image-4.20.6-mvebu-mirabox-tld-12_12.0_armhf.deb
-rwxr-xr-x 1 root root  4062176 mars  13  2019 zImage-4.20.6-mvebu-mirabox-tld-12*

mkdir dts
cp -a /tmp/bodhi/armada-370-netgear-rn102.dt? dts/
cat dts/armada-370-netgear-rn102.dtb >> zImage.fdt
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-4.20.6-mvebu-mirabox-tld-12 -d zImage.fdt uImage

Image Name:   Linux-4.20.6-mvebu-mirabox-tld-1
Created:      Fri Aug 28 08:09:11 2020
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    4076820 Bytes = 3981.27 KiB = 3.89 MiB
Load Address: 00008000
Entry Point:  00008000

cp -a uImage ../../../boot/
ls -alF ../../../boot/

total 50272
drwxr-xr-x  3 root root    4096 aug.  28 08:10 ./
drwxrwxrwx 21 root root    4096 jan.  20  2017 ../
-rw-r--r--  1 root root  183639 aug.  19  2019 config-5.2.9-mvebu-tld-1
drwxr-xr-x  2 root root    4096 aug.  20  2019 dts/
-rw-r--r--  1 root root 9488554 aug.  26  2019 initrd.img-5.2.9-mvebu-tld-1
-rw-r--r--  1 root root 9676808 aug.  19  2019 linux-headers-5.2.9-mvebu-tld-1_1.0_armhf.deb
-rw-------  1 root root 3266081 aug.  19  2019 System.map-5.2.9-mvebu-tld-1
-rw-r--r--  1 root root 4076884 aug.  28 08:09 uImage
-rw-r--r--  1 root root 9488618 aug.  26  2019 uInitrd
-rw-------  1 root root 5057632 aug.  19  2019 vmlinuz-5.2.9-mvebu-tld-1
-rwxr-xr-x  1 root root 5057632 aug.  19  2019 zImage*
-rwxr-xr-x  1 root root 5057632 aug.  19  2019 zImage-5.2.9-mvebu-tld-1*

sync
cd
umount /mnt
exit

Plugged the USB-stick into the ReadyNAS RN102, connected power, hit the power button, interrupted u-boot, did 'printenv' and then 'boot'. This is the serial console boot log:

BootROM 1.08
Booting from NAND flash


General initialization - Version: 1.0.0

High speed PHY - Version: 2.1.4 (COM-PHY-V20) 
Update PEX Device ID 0x6710
High speed PHY - Ended Successfully
0001
DDR3 Training Sequence - Ver 5.7.1
DDR3 Training Sequence - Run without PBS.
DDR3 Training Sequence - Ended Successfully 
BootROM: Image checksum verification PASSED

 __   __                      _ _
|  \/  | __ _ _ ____   _____| | |
| |\/| |/ _` | '__\ \ / / _ \ | |
| |  | | (_| | |   \ V /  __/ | |
|_|  |_|\__,_|_|    \_/ \___|_|_|
         _   _     ____              _
        | | | |   | __ )  ___   ___ | |_ 
        | | | |___|  _ \ / _ \ / _ \| __| 
        | |_| |___| |_) | (_) | (_) | |_ 
         \___/    |____/ \___/ \___/ \__| 
 ** LOADER **


U-Boot 2011.12-gec25d27-dirty (Oct 26 2015 - 16:53:05) Marvell version: v2011.12 2014_T2.0p1 
06/23/2015 ReadyNAS-102 V2.0

Board: DB-88F6710-BP
SoC:   MV6710 A1
CPU:   Marvell PJ4B v7 UP (Rev 1) LE
       CPU    @ 1200 [MHz]
       L2     @ 600 [MHz]
       TClock @ 200 [MHz]
       DDR    @ 600 [MHz]
       DDR 16Bit Width, FastPath Memory Access
DRAM:  512 MiB

Map:   Code:            0x1feef000:0x1ff9ef34
       BSS:             0x1ffef0a0
       Stack:           0x1f9eeef8
       Heap:            0x1f9ef000:0x1feef000

NAND:  (ID 0xf1ad)      128 MiB
MMC:   MRVL_MMC: 0
Bad block table found at page 65472, version 0x01
Bad block table found at page 65408, version 0x01
nand_read_bbt: Bad block at 0x000001820000
nand_read_bbt: Bad block at 0x000001f00000

Initialize and scan all PCI interfaces
PEX unit.port(active IF[-first bus]):
------------------------------------------
PEX 0: Root Complex Interface, Detected Link X1, GEN 2.0
PEX 1: Root Complex Interface, Detected Link X1, GEN 2.0
FPU not initialized
USB 0: Host Mode
USB 1: Host Mode
Shutting down unused interfaces:
       GBE0
       SDIO
       AUDIO
       TDM
Modules/Interfaces Detected:
       RGMII1 Phy
       PEX0 (Lane 0)
       PEX1 (Lane 1)
       SATA0 (Lane 2)
       SATA1 (Lane 3)
Net:   , egiga1 [PRIME]
Power supply plug on, please press power button!


BootROM 1.08
Booting from NAND flash


General initialization - Version: 1.0.0

High speed PHY - Version: 2.1.4 (COM-PHY-V20) 
Update PEX Device ID 0x6710
High speed PHY - Ended Successfully
0000
DDR3 Training Sequence - Ver 5.7.1
DDR3 Training Sequence - Run without PBS.
DDR3 Training Sequence - Ended Successfully 
BootROM: Image checksum verification PASSED

 __   __                      _ _
|  \/  | __ _ _ ____   _____| | |
| |\/| |/ _` | '__\ \ / / _ \ | |
| |  | | (_| | |   \ V /  __/ | |
|_|  |_|\__,_|_|    \_/ \___|_|_|
         _   _     ____              _
        | | | |   | __ )  ___   ___ | |_ 
        | | | |___|  _ \ / _ \ / _ \| __| 
        | |_| |___| |_) | (_) | (_) | |_ 
         \___/    |____/ \___/ \___/ \__| 
 ** LOADER **


U-Boot 2011.12-gec25d27-dirty (Oct 26 2015 - 16:53:05) Marvell version: v2011.12 2014_T2.0p1 
06/23/2015 ReadyNAS-102 V2.0

Board: DB-88F6710-BP
SoC:   MV6710 A1
CPU:   Marvell PJ4B v7 UP (Rev 1) LE
       CPU    @ 1200 [MHz]
       L2     @ 600 [MHz]
       TClock @ 200 [MHz]
       DDR    @ 600 [MHz]
       DDR 16Bit Width, FastPath Memory Access
DRAM:  512 MiB

Map:   Code:            0x1feef000:0x1ff9ef34
       BSS:             0x1ffef0a0
       Stack:           0x1f9eeef8
       Heap:            0x1f9ef000:0x1feef000

NAND:  (ID 0xf1ad)      128 MiB
MMC:   MRVL_MMC: 0
Bad block table found at page 65472, version 0x01
Bad block table found at page 65408, version 0x01
nand_read_bbt: Bad block at 0x000001820000
nand_read_bbt: Bad block at 0x000001f00000

Initialize and scan all PCI interfaces
PEX unit.port(active IF[-first bus]):
------------------------------------------
PEX 0: Root Complex Interface, Detected Link X1, GEN 2.0
PEX 1: Root Complex Interface, Detected Link X1, GEN 2.0
FPU not initialized
USB 0: Host Mode
USB 1: Host Mode
Shutting down unused interfaces:
       GBE0
       SDIO
       AUDIO
       TDM
Modules/Interfaces Detected:
       RGMII1 Phy
       PEX0 (Lane 0)
       PEX1 (Lane 1)
       SATA0 (Lane 2)
       SATA1 (Lane 3)
Net:   , egiga1 [PRIME]
Power On!

FDT loaded successfully
Hit any key to stop autoboot:  0 
Marvell>> printenv
AC_Power_fail_detect=open
CASset=min
HW_version=MVT
MALLOC_len=5
Manufacturer=NETGEAR
Product=ReadyNAS 102
SKUNum=RN102
SerialNum=MASKERAD
Startup=Normal
UUID=31774368-b4c7-11e2-bfbc-28c68e347394
Version=V1.0
autoload=no
bootargs=console=ttyS0,115200
bootargs_end=:10.4.50.254:255.255.255.0:KW40:eth0:none
bootargs_root=root=/dev/nfs rw
bootcmd=usb start; run usb_bootcmd; usb stop; reset
bootcmd_fdt=tftpboot 0x2000000 $image_name;tftpboot $fdtaddr $fdtfile;setenv bootargs $console $mtdparts $bootargs_root nfsroot=$se
rverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.l
cd_panel=$lcd_panel; bootz 0x2000000 - $fdtaddr;
bootcmd_ubi=ubi part ubifs; ubifsmount rootfs; ubifsload 0x2000000 kernel; ubifsload 0x3000000 initrd.gz; bootm 0x2000000 0x3000000
 0x1000000
bootdelay=3
cacheShare=no
console=console=ttyS0,115200
disL2Cache=yes
disaMvPnp=no
eeeEnable=no
enaAutoRecovery=yes
enaClockGating=yes
enaExtDisk=no
enaFPU=no
enaMonExt=no
enaWrAllo=no
envver=3
eth1addr=MASKERAD
eth1mtu=1500
ethact=egiga1
ethaddr=MASKERAD
ethmtu=1500
ethprime=egiga1
fdt_skip_update=yes
fdtaddr=0x1000000
fdtfile=armada-370-db.dtb
image_name=uImage
initrd_name=uInitrd
load_addr=0x02000000
load_uimage=ext2load usb 0:1 0x2000000 /boot/uImage
load_uinitrd=ext2load usb 0:1 0x3000000 /boot/uInitrd
loadaddr=0x02000000
mtdids=nand0=armada-nand
mtdparts=mtdparts=pxa3xx_nand-0:0x180000@0(u-boot),0x20000@0x180000(u-boot-env),0x600000@0x200000(uImage),0x400000@0x800000(miniroo
tfs),-(ubifs)
mvNetConfig=mv_net_config=1,(MASKERAD,0:1:2:3:4),mtu=1500
mv_pon_addr=MASKERAD
nandEcc=1bit
netbsd_en=no
netretry=no
pcieTune=no
pexMode=rc
pxe_files_load=:default.arm-armada370-db:default.arm-armadaxp:default.arm
pxefile_addr_r=3100000
rcvrip=169.254.100.100
sata_delay_reset=0
sata_dma_mode=yes
setL2CacheWT=no
standalone=fsload $load_addr $image_name;setenv bootargs $console $mtdparts root=/dev/mtdblock0 rw ip=$ipaddr:$serverip$bootargs_en
d; bootm $load_addr;
stderr=serial
stdin=serial
stdout=serial
usb0Mode=host
usb1Mode=host
usb2Mode=device
usbActive=0
usb_boot=run load_uimage; if run load_uinitrd; then bootm 0x2000000 0x3000000; else bootm 0x2000000; fi
usb_bootcmd=run usb_set_bootargs; run usb_boot
usb_set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial
vxworks_en=no
yuk_ethaddr=MASKERAD

Environment size: 2606/131068 bytes
Marvell>> boot
(Re)start USB...
USB:   Active port:     0
Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 2 USB Device(s) found
       scanning bus for storage devices... 1 Storage Device(s) found
Loading file "/boot/uImage" from usb device 0:1 (usbda1)
4076884 bytes read
Loading file "/boot/uInitrd" from usb device 0:1 (usbda1)
9488618 bytes read
## Booting kernel from Legacy Image at 02000000 ...
   Image Name:   Linux-4.20.6-mvebu-mirabox-tld-1
   Created:      2020-08-28   6:09:11 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4076820 Bytes = 3.9 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 03000000 ...
   Image Name:   initramfs-5.2.9-mvebu-tld-1
   Created:      2019-08-26  11:03:27 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    9488554 Bytes = 9 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.20.6-mvebu-mirabox-tld-12 (root@tldDebianVM) (gcc version 7.3.0 (Ubuntu/Linaro 7.3.0-27ubuntu1~18.04
)) #6 SMP PREEMPT Wed Mar 13 14:43:16 PDT 2019
[    0.000000] CPU: ARMv7 Processor [561f5811] revision 1 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
[    0.000000] OF: fdt: Machine model: NETGEAR ReadyNAS 102
[    0.000000] printk: bootconsole [earlycon0] enabled
[    0.000000] Memory policy: Data cache writeback
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] random: get_random_bytes called from start_kernel+0x78/0x4c4 with crng_init=0
[    0.000000] percpu: Embedded 18 pages/cpu @(ptrval) s41548 r8192 d23988 u73728
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 130048
[    0.000000] Kernel command line: console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=pxa3xx_nand-0:0x180000@0(u-boot),0
x20000@0x180000(u-boot-env),0x600000@0x200000(uImage),0x400000@0x800000(minirootfs),-(ubifs) earlyprintk=serial mtdparts=pxa3xx_nan
d-0:0x180000@0(u-boot),0x20000@0x180000(u-boot-env),0x600000@0x200000(uImage),0x400000@0x800000(minirootfs),-(ubifs) reason=normal 
bdtype=rn102
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Memory: 497004K/524288K available (8192K kernel code, 731K rwdata, 2072K rodata, 1024K init, 320K bss, 27284K reserv
ed, 0K cma-reserved, 0K highmem)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xe0800000 - 0xff800000   ( 496 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0x(ptrval) - 0x(ptrval)   (9184 kB)
[    0.000000]       .init : 0x(ptrval) - 0x(ptrval)   (1024 kB)
[    0.000000]       .data : 0x(ptrval) - 0x(ptrval)   ( 732 kB)
[    0.000000]        .bss : 0x(ptrval) - 0x(ptrval)   ( 321 kB)
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=1.
[    0.000000]  Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] L2C: DT/platform modifies aux control register: 0x12086300 -> 0x1a086302
[    0.000000] Aurora cache controller enabled, 4 ways, 256 kB
[    0.000000] Aurora: CACHE_ID 0x00000100, AUX_CTRL 0x1a086302
[    0.000000] Switching to timer-based delay loop, resolution 53ns
[    0.000007] sched_clock: 32 bits at 18MHz, resolution 53ns, wraps every 114537122277ns
[    0.007239] clocksource: armada_370_xp_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 101938038664 ns
[    0.018006] Console: colour dummy device 80x30
[    0.022089] Calibrating delay loop (skipped), value calculated using timer frequency.. 37.49 BogoMIPS (lpj=187492)
[    0.031582] pid_max: default: 32768 minimum: 301
[    0.035961] LSM: Security Framework initializing
[    0.040288] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.046331] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.053616] CPU: Testing write buffer coherency: ok
[    0.058437] CPU0: thread -1, cpu 0, socket -1, mpidr 0
[    0.117366] Setting up static identity map for 0x100000 - 0x100060
[    0.123336] mvebu-soc-id: MVEBU SoC ID=0x6710, Rev=0x1
[    0.128189] mvebu-pmsu: Initializing Power Management Service Unit
[    0.147298] rcu: Hierarchical SRCU implementation.
[    0.187300] smp: Bringing up secondary CPUs ...
[    0.191445] smp: Brought up 1 node, 1 CPU
[    0.195104] SMP: Total of 1 processors activated (37.49 BogoMIPS).
[    0.200777] CPU: All CPU(s) started in SVC mode.
[    0.205794] devtmpfs: initialized
[    0.217546] VFP support v0.3: implementor 56 architecture 2 part 20 variant 9 rev 6
[    0.225100] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.234395] futex hash table entries: 256 (order: 2, 16384 bytes)
[    0.240287] prandom: seed boundary self test passed
[    0.247182] prandom: 100 self tests passed
[    0.251100] pinctrl core: initialized pinctrl subsystem
[    0.258038] NET: Registered protocol family 16
[    0.262845] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.270408] audit: initializing netlink subsys (disabled)
[    0.275663] audit: type=2000 audit(0.250:1): state=initialized audit_enabled=0 res=1
[    0.284723] cpuidle: using governor ladder
[    0.289668] cpuidle: using governor menu
[    0.293507] hw-breakpoint: debug architecture 0x4 unsupported.
[    0.388344] vgaarb: loaded
[    0.391143] SCSI subsystem initialized
[    0.398072] usbcore: registered new interface driver usbfs
[    0.403131] usbcore: registered new interface driver hub
[    0.409503] usbcore: registered new device driver usb
[    0.415235] pps_core: LinuxPPS API ver. 1 registered
[    0.420346] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.428931] PTP clock support registered
[    0.435076] clocksource: Switched to clocksource armada_370_xp_clocksource
[    0.496240] VFS: Disk quotas dquot_6.6.0
[    0.499901] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.531299] NET: Registered protocol family 2
[    0.537182] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes)
[    0.544189] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[    0.551029] TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
[    0.557118] TCP: Hash tables configured (established 4096 bind 4096)
[    0.563045] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.568451] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.574380] NET: Registered protocol family 1
[    0.609265] RPC: Registered named UNIX socket transport module.
[    0.614674] RPC: Registered udp transport module.
[    0.619058] RPC: Registered tcp transport module.
[    0.623352] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.629476] Unpacking initramfs...
[    1.141558] Freeing initrd memory: 9268K
[    1.145497] NetWinder Floating Point Emulator V0.97 (double precision)
[    1.151803] hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
[    1.162445] Initialise system trusted keyrings
[    1.168007] Key type blacklist registered
[    1.171887] workingset: timestamp_bits=30 max_order=17 bucket_order=0
[    1.178022] zbud: loaded
[    1.191314] NFS: Registering the id_resolver key type
[    1.196171] Key type id_resolver registered
[    1.199991] Key type id_legacy registered
[    1.203661] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    1.209874] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[    1.556510] Key type asymmetric registered
[    1.560259] Asymmetric key parser 'x509' registered
[    1.565237] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 248)
[    1.572001] io scheduler noop registered
[    1.575734] io scheduler deadline registered
[    1.579676] io scheduler cfq registered (default)
[    1.586642] armada-370-pinctrl d0018000.pin-ctrl: registered pinctrl driver
[    1.601521] mvebu-pcie soc:pcie@82000000: PCI host bridge to bus 0000:00
[    1.608175] pci_bus 0000:00: root bus resource [bus 00-ff]
[    1.613189] pci_bus 0000:00: root bus resource [mem 0xf8000000-0xffdfffff]
[    1.619794] pci_bus 0000:00: root bus resource [io  0x1000-0xeffff]
[    1.627682] PCI: bus0: Fast back to back transfers disabled
[    1.632783] pci 0000:00:01.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    1.640431] pci 0000:00:02.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    1.648667] pci 0000:00:01.0: ASPM: current common clock configuration is broken, reconfiguring
[    1.686176] PCI: bus1: Fast back to back transfers disabled
[    1.692139] pci 0000:00:02.0: ASPM: current common clock configuration is broken, reconfiguring
[    1.726202] PCI: bus2: Fast back to back transfers disabled
[    1.731390] pci 0000:00:01.0: BAR 14: assigned [mem 0xf8000000-0xf80fffff]
[    1.737745] pci 0000:00:01.0: BAR 15: assigned [mem 0xf8100000-0xf81fffff pref]
[    1.744420] pci 0000:00:02.0: BAR 14: assigned [mem 0xf8200000-0xf82fffff]
[    1.750744] pci 0000:00:01.0: BAR 13: assigned [io  0x10000-0x10fff]
[    1.756590] pci 0000:00:01.0: BAR 6: assigned [mem 0xf8300000-0xf83007ff pref]
[    1.763187] pci 0000:00:02.0: BAR 6: assigned [mem 0xf8400000-0xf84007ff pref]
[    1.769808] pci 0000:01:00.0: BAR 6: assigned [mem 0xf8100000-0xf810ffff pref]
[    1.776421] pci 0000:01:00.0: BAR 5: assigned [mem 0xf8000000-0xf80001ff]
[    1.782622] pci 0000:01:00.0: BAR 4: assigned [io  0x10000-0x1000f]
[    1.788364] pci 0000:01:00.0: BAR 0: assigned [io  0x10010-0x10017]
[    1.794088] pci 0000:01:00.0: BAR 2: assigned [io  0x10018-0x1001f]
[    1.799829] pci 0000:01:00.0: BAR 1: assigned [io  0x10020-0x10023]
[    1.805570] pci 0000:01:00.0: BAR 3: assigned [io  0x10024-0x10027]
[    1.811294] pci 0000:00:01.0: PCI bridge to [bus 01]
[    1.815845] pci 0000:00:01.0:   bridge window [io  0x10000-0x10fff]
[    1.821570] pci 0000:00:01.0:   bridge window [mem 0xf8000000-0xf80fffff]
[    1.827784] pci 0000:00:01.0:   bridge window [mem 0xf8100000-0xf81fffff pref]
[    1.834384] pci 0000:02:00.0: BAR 0: assigned [mem 0xf8200000-0xf820ffff 64bit]
[    1.841082] pci 0000:02:00.0: BAR 2: assigned [mem 0xf8210000-0xf8210fff 64bit]
[    1.847779] pci 0000:02:00.0: BAR 4: assigned [mem 0xf8211000-0xf8211fff 64bit]
[    1.854458] pci 0000:00:02.0: PCI bridge to [bus 02]
[    1.859009] pci 0000:00:02.0:   bridge window [mem 0xf8200000-0xf82fffff]
[    1.865342] pcieport 0000:00:01.0: enabling device (0140 -> 0143)
[    1.871191] pcieport 0000:00:02.0: enabling device (0140 -> 0142)
[    1.878141] mv_xor d0060800.xor: Marvell shared XOR driver
[    1.946208] mv_xor d0060800.xor: Marvell XOR (Registers Mode): ( xor cpy intr )
[    1.953362] mv_xor d0060900.xor: Marvell shared XOR driver
[    2.016198] mv_xor d0060900.xor: Marvell XOR (Registers Mode): ( xor cpy intr )
[    2.186552] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    2.195790] printk: console [ttyS0] disabled
[    2.220957] d0012000.serial: ttyS0 at MMIO 0xd0012000 (irq = 19, base_baud = 12500000) is a 16550A
[    2.229376] printk: console [ttyS0] enabled
[    2.229376] printk: console [ttyS0] enabled
[    2.237135] printk: bootconsole [earlycon0] disabled
[    2.237135] printk: bootconsole [earlycon0] disabled
[    2.248229] ahci 0000:01:00.0: enabling device (0146 -> 0147)
[    2.253766] ahci 0000:01:00.0: AHCI 0001.0000 32 slots 2 ports 6 Gbps 0x3 impl SATA mode
[    2.262036] ahci 0000:01:00.0: flags: 64bit ncq sntf led only pmp fbs pio slum part sxs 
[    2.282435] scsi host0: ahci
[    2.296303] scsi host1: ahci
[    2.299418] ata1: SATA max UDMA/133 abar m512@0xf8000000 port 0xf8000100 irq 42
[    2.306518] ata2: SATA max UDMA/133 abar m512@0xf8000000 port 0xf8000180 irq 42
[    2.314182] sata_mv d00a0000.sata: slots 32 ports 1
[    2.330031] scsi host2: sata_mv
[    2.333374] ata3: SATA max UDMA/133 irq 27
[    2.338907] nand: device found, Manufacturer ID: 0xad, Chip ID: 0xf1
[    2.344767] nand: Hynix H27U1G8F2BTR-BC
[    2.348521] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    2.356233] Bad block table found at page 65472, version 0x01
[    2.361836] Bad block table found at page 65408, version 0x01
[    2.367976] nand_read_bbt: bad block at 0x000001820000
[    2.372715] nand_read_bbt: bad block at 0x000001f00000
[    2.377580] 5 cmdlinepart partitions found on MTD device pxa3xx_nand-0
[    2.383593] Creating 5 MTD partitions on "pxa3xx_nand-0":
[    2.388662] 0x000000000000-0x000000180000 : "u-boot"
[    2.394967] 0x000000180000-0x0000001a0000 : "u-boot-env"
[    2.402169] 0x000000200000-0x000000800000 : "uImage"
[    2.408961] 0x000000800000-0x000000c00000 : "minirootfs"
[    2.416027] 0x000000c00000-0x000008000000 : "ubifs"
[    2.427770] libphy: Fixed MDIO Bus: probed
[    2.435986] libphy: orion_mdio_bus: probed
[    2.454518] mvneta d0074000.ethernet eth0: Using random mac address 92:bd:58:46:1f:64
[    2.466166] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    2.472215] ehci-pci: EHCI PCI platform driver
[    2.477206] ehci-orion: EHCI orion driver
[    2.481113] orion-ehci d0050000.usb: EHCI Host Controller
[    2.486443] orion-ehci d0050000.usb: new USB bus registered, assigned bus number 1
[    2.493659] orion-ehci d0050000.usb: irq 25, io mem 0xd0050000
[    2.525103] orion-ehci d0050000.usb: USB 2.0 started, EHCI 1.00
[    2.530853] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.20
[    2.538553] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.545261] usb usb1: Product: EHCI Host Controller
[    2.549757] usb usb1: Manufacturer: Linux 4.20.6-mvebu-mirabox-tld-12 ehci_hcd
[    2.556481] usb usb1: SerialNumber: d0050000.usb
[    2.561641] hub 1-0:1.0: USB hub found
[    2.565452] hub 1-0:1.0: 1 port detected
[    2.570332] xhci_hcd 0000:02:00.0: xHCI Host Controller
[    2.575709] xhci_hcd 0000:02:00.0: new USB bus registered, assigned bus number 2
[    2.583289] xhci_hcd 0000:02:00.0: hcc params 0x200073a1 hci version 0x100 quirks 0x0000000000080010
[    2.592586] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.20
[    2.600419] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.607162] usb usb2: Product: xHCI Host Controller
[    2.611659] usb usb2: Manufacturer: Linux 4.20.6-mvebu-mirabox-tld-12 xhci-hcd
[    2.618396] usb usb2: SerialNumber: 0000:02:00.0
[    2.623563] hub 2-0:1.0: USB hub found
[    2.627390] hub 2-0:1.0: 2 ports detected
[    2.631881] xhci_hcd 0000:02:00.0: xHCI Host Controller
[    2.637060] xhci_hcd 0000:02:00.0: new USB bus registered, assigned bus number 3
[    2.643957] xhci_hcd 0000:02:00.0: Host supports USB 3.0  SuperSpeed
[    2.649898] ata2: SATA link down (SStatus 0 SControl 300)
[    2.655174] usb usb3: We don't know the algorithms for LPM for this host, disabling LPM.
[    2.662833] usb usb3: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 4.20
[    2.670553] ata3: SATA link down (SStatus 0 SControl F300)
[    2.675777] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.682432] usb usb3: Product: xHCI Host Controller
[    2.687033] usb usb3: Manufacturer: Linux 4.20.6-mvebu-mirabox-tld-12 xhci-hcd
[    2.693689] usb usb3: SerialNumber: 0000:02:00.0
[    2.698805] hub 3-0:1.0: USB hub found
[    2.702526] hub 3-0:1.0: 2 ports detected
[    2.707841] usbcore: registered new interface driver usblp
[    2.713715] usbcore: registered new interface driver usb-storage
[    2.720072] mousedev: PS/2 mouse device common for all mice
[    2.726998] i2c /dev entries driver
[    2.734227] rtc-ds1307 0-0068: 'wakeup-source' is set, request for an IRQ is disabled!
[    2.746171] rtc-ds1307 0-0068: registered as rtc0
[    2.776558] orion_wdt: Initial timeout 229 sec
[    2.835232] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[    2.846027] ata1.00: ATA-8: ST2000DL003-9VT166, CC32, max UDMA/133
[    2.851733] ata1.00: 3907029168 sectors, multi 0: LBA48 NCQ (depth 32)
[    2.860596] ata1.00: configured for UDMA/133
[    2.885647] scsi 0:0:0:0: Direct-Access     ATA      ST2000DL003-9VT1 CC32 PQ: 0 ANSI: 5
[    2.895849] sd 0:0:0:0: [sda] 3907029168 512-byte logical blocks: (2.00 TB/1.82 TiB)
[    2.913947] sd 0:0:0:0: [sda] Write Protect is off
[    2.918808] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    2.935218] usb 1-1: new high-speed USB device number 2 using orion-ehci
[    2.941714]  sda: sda1
[    2.952101] sd 0:0:0:0: [sda] Attached SCSI removable disk
[    2.990930] marvell-cesa d0090000.crypto: CESA device successfully registered
[    2.998317] hidraw: raw HID events driver (C) Jiri Kosina
[    3.004418] usbcore: registered new interface driver usbhid
[    3.010069] usbhid: USB HID core driver
[    3.014083] drop_monitor: Initializing network drop monitor service
[    3.020743] NET: Registered protocol family 10
[    3.036220] Segment Routing with IPv6
[    3.039677] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    3.047372] NET: Registered protocol family 17
[    3.062478] 8021q: 802.1Q VLAN Support v1.8
[    3.066684] Key type dns_resolver registered
[    3.070878] ThumbEE CPU extension supported.
[    3.074828] Registering SWP/SWPB emulation handler
[    3.081722] registered taskstats version 1
[    3.086453] Loading compiled-in X.509 certificates
[    3.091027] zswap: loaded using pool lzo/zbud
[    3.169555] usb 1-1: New USB device found, idVendor=196d, idProduct=0201, bcdDevice=11.20
[    3.185357] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    3.191949] usb 1-1: Product: USB Drive 3SE
[    3.204434] usb 1-1: Manufacturer: Innodisk
[    3.215250] usb 1-1: SerialNumber: 20190831AA101F845011
[    3.225849] usb-storage 1-1:1.0: USB Mass Storage device detected
[    3.239305] Key type big_key registered
[    3.255431] scsi host3: usb-storage 1-1:1.0
[    3.303032] Key type encrypted registered
[    3.311624] input: gpio-keys as /devices/platform/gpio-keys/input/input0
[    3.321014] rtc-ds1307 0-0068: setting system clock to 2020-08-28 05:37:15 UTC (1598593035)
[    3.331975] Freeing unused kernel memory: 1024K
[    3.346918] Checked W+X mappings: passed, no W+X pages found
[    3.352153] Run /init as init process
Loading, please wait...
Starting version 241
[    4.453436] scsi 3:0:0:0: Direct-Access     Innodisk USB Drive 3SE    1120 PQ: 0 ANSI: 6
[    4.500374] sd 3:0:0:0: [sdb] 7905280 512-byte logical blocks: (4.05 GB/3.77 GiB)
[    4.514227] sd 3:0:0:0: [sdb] Write Protect is off
[    4.527634] sd 3:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[    4.560951]  sdb: sdb1
[    4.578971] sd 3:0:0:0: [sdb] Attached SCSI removable disk
[    4.838409] random: fast init done
Begin: Loading essential drivers ... done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... done.
Begin: Will now check root file system ... fsck from util-linux 2.33.1
[/sbin/fsck.ext3 (1) -- /dev/sdb1] fsck.ext3 -a -C0 /dev/sdb1 
rootfs: Superblock last mount time is in the future.
        (by less than a day, probably due to the hardware clock being incorrectly set)
rootfs: Superblock last write time is in the future.
        (by less than a day, probably due to the hardware clock being incorrectly set)
rootfs: clean, 24109/247008 files, 217229/987904 blocks
done.
[   18.664877] EXT4-fs (sdb1): mounting ext3 file system using the ext4 subsystem
[   18.696183] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null)
done.
Begin: Running /scripts/local-bottom ... done.
Begin: Running /scripts/init-bottom ... done.
INIT: version 2.93 booting
[info] Using makefile-style concurrent boot in runlevel S.
[....] Starting hotplug events dispatcher: systemd-udevd. ok 
[....] Synthesizing the initial hotplug events (subsystems)...done.
[....] Synthesizing the initial hotplug events (devices)...[   22.708880] systemd-udevd[1570]: could not open moddep file '/lib/mod
ules/4.20.6-mvebu-mirabox-tld-12/modules.dep.bin'
[   22.837659] systemd-udevd[1570]: could not open moddep file '/lib/modules/4.20.6-mvebu-mirabox-tld-12/modules.dep.bin'
done.
[....] Waiting for /dev to be fully populated...[   23.458720] systemd-udevd[1578]: Using default interface naming scheme 'v240'.
[   23.529962] systemd-udevd[1579]: could not open moddep file '/lib/modules/4.20.6-mvebu-mirabox-tld-12/modules.dep.bin'
[   23.568273] systemd-udevd[1578]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
[   23.689400] systemd-udevd[1578]: Could not generate persistent MAC address for eth0: No such file or directory
[   23.946938] systemd-udevd[1568]: could not open moddep file '/lib/modules/4.20.6-mvebu-mirabox-tld-12/modules.dep.bin'
[   24.234608] random: crng init done
[   24.276587] systemd-udevd[1582]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
[   24.309538] systemd-udevd[1580]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
[   24.328520] systemd-udevd[1569]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
done.
[....] Setting hostname to 'debian'...done.
[....] Activating swap:. ok 
[   28.436413] EXT4-fs (sdb1): re-mounted. Opts: errors=remount-ro
[info] Will now check all file systems.
fsck from util-linux 2.33.1
Checking all file systems.
LABEL=rootfs is mounted
[....] Done checking file systems. A log is being saved in /var/log/fsck/checkfs if that location is writable.. ok 
[....] Cleaning up temporary files...[....] Cleaning /tmp...done.
 /tmp. ok 
[....] Will now mount local filesystems:. ok 
[....] Will now activate swapfile swap:done.
[....] Checking minimum space in /tmp...done.
[....] Cleaning up temporary files.... ok 
[....] Starting Setting kernel variables: sysctl. ok 
[....] Initializing random number generator...done.
[....] Configuring network interfaces...Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

[   33.109309] mvneta d0074000.ethernet eth0: PHY [d0072004.mdio-mii:00] driver [Marvell 88E1318S]
[   33.117891] mvneta d0074000.ethernet eth0: configuring for phy/rgmii-id link mode
[   33.126313] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
Listening on LPF/eth0/92:bd:58:46:1f:64
Sending on   LPF/eth0/92:bd:58:46:1f:64
Sending on   Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3
[   36.266053] mvneta d0074000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[   36.273470] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
DHCPOFFER of 192.168.1.190 from 192.168.1.1
DHCPREQUEST for 192.168.1.190 on eth0 to 255.255.255.255 port 67
DHCPACK of 192.168.1.190 from 192.168.1.1
bound to 192.168.1.190 -- renewal in 33799 seconds.
done.
[....] Starting RPC port mapper daemon: rpcbind. ok 
[....] Starting NFS common utilities: statd idmapd. ok 
[....] Cleaning up temporary files.... ok 
INIT: Entering runlevel: 2
[info] Using makefile-style concurrent boot in runlevel 2.
[....] Starting busybox' syslogd implementation : syslogdStarting /sbin/syslogd...
2531 (syslogd)
. ok 
[....] Starting busybox' klogd implementation : klogdStarting /sbin/klogd...
2558 (klogd)
. ok 
[....] Not starting NFS kernel daemon: no exports. ... (warning).
[....] Starting periodic command scheduler: cron. ok 
[....] Starting system message bus: dbus. ok 
[....] Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon. ok 
[....] Starting NTP server: ntpd. ok 
[....] Starting OpenBSD Secure Shell server: sshd. ok 
[....] Running local boot scripts (/etc/rc.local)Cannot read bad block mark: Invalid argument
<13>Aug 27 22:38:08 root[2767]: Cannot read u-boot env ethaddr
. ok 

Debian GNU/Linux 10 debian ttyS0

debian login:

Loging in on the console:
debian login: root
Password: 
Last login: Thu Sep  5 01:58:44 PDT 2019 from 192.168.0.100 on pts/0
Linux debian 4.20.6-mvebu-mirabox-tld-12 #6 SMP PREEMPT Wed Mar 13 14:43:16 PDT 2019 armv7l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
debian
192.168.1.190
NETGEAR ReadyNAS 102
Linux version 4.20.6-mvebu-mirabox-tld-12 (root@tldDebianVM) (gcc version 7.3.0 (Ubuntu/Linaro 7.3.0-27ubuntu1~18.04)) #6 SMP PREEM
PT Wed Mar 13 14:43:16 PDT 2019
Debian 10.0
Thu Aug 27 22:38:19 PDT 2020 up 0 minutes
root@debian:~# /root/set_persistent_mac_address
Cannot read bad block mark: Invalid argument
<13>Aug 27 22:50:20 root[2812]: Cannot read u-boot env ethaddr
root@debian:~# fw_printenv
Cannot read bad block mark: Invalid argument
root@debian:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00180000 00020000 "u-boot"
mtd1: 00020000 00020000 "u-boot-env"
mtd2: 00600000 00020000 "uImage"
mtd3: 00400000 00020000 "minirootfs"
mtd4: 07400000 00020000 "ubifs"
root@debian:~# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.190  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::90bd:58ff:fe46:1f64  prefixlen 64  scopeid 0x20<link>
        ether 92:bd:58:46:1f:64  txqueuelen 1024  (Ethernet)
        RX packets 119  bytes 11783 (11.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 155  bytes 13919 (13.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 26  

root@debian:~#
There seems to be an issue with accessing the mtd block containing the u-boot environment variables? (The mac address is a random one.)

During boot, the LEDs behaved like this: Before hitting the power button there was no light. After hitting the power button, all LEDs were off, except the Power LED, which blinked at, say, 2 Hz, and the Activity and Sata1 LEDs, which were on (because a HDD was present in the first disk compartment). 3 seconds into the kernel boot, both the Power LED and the Backup LED went steady on, while the Sata1 LED went off and started showing disk activity. This remained so until reboot (or power off).

The device tree patch is clearly an enhancement. The Backup LED configuration was left untouched by the patch, but I assume you just overlooked modifying it consistently with the Power LED?

Did you consider initializing the Power LED with 'hearbeat', i.e. load dependent double blinking? Then the Power LED may have one signature during u-boot, another during Linux boot, and become steady on when the boot is finished (through an echo statement in /etc/rc.local.)

As mentioned, if there is no way to invert the behavior of the Activity LED driven by the sata controller, I prefer to turn the Power LED off in /etc/rc.local when the Activity led is on since one power indicator is enough:
if [ -d /sys/class/leds/rn102:blue:pwr ]; then

   # Switch the Power LED on, but off again if the Activity LED is on (one power indicator is enough)
   echo default-on > /sys/class/leds/rn102:blue:pwr/trigger
   if grep scsi1 /proc/scsi/scsi > /dev/null; then
      echo none > /sys/class/leds/rn102:blue:pwr/trigger
   fi
   if grep scsi2 /proc/scsi/scsi > /dev/null; then
      echo none > /sys/class/leds/rn102:blue:pwr/trigger
   fi
fi

One more little detail: You may want to exclude the lost+found directory in your next tarball.

Regards,
Trond Melen

Re: Debian on Netgear RN102

$
0
0
Trond,

Quote

There seems to be an issue with accessing the mtd block containing the u-boot environment variables? (The mac address is a random one.)

Quote

root@debian:~# /root/set_persistent_mac_address
Cannot read bad block mark: Invalid argument
<13>Aug 27 22:50:20 root[2812]: Cannot read u-boot env ethaddr
root@debian:~# fw_printenv
Cannot read bad block mark: Invalid argument
root@debian:~# cat /proc/mtd

Looks like you have missed the /etc/fw_env.config new definition.

cat /etc/fw_env.config 
# MTD device name	Device offset	Env. size	   Flash sector size	Number of sectors
/dev/mtd1                0x00000          0x20000           0x20000


Quote

The device tree patch is clearly an enhancement. The Backup LED configuration was left untouched by the patch, but I assume you just overlooked modifying it consistently with the Power LED?

Yes, I ovelooked that! Will make another update.

Quote

Did you consider initializing the Power LED with 'hearbeat', i.e. load dependent double blinking? Then the Power LED may have one signature during u-boot, another during Linux boot, and become steady on when the boot is finished (through an echo statement in /etc/rc.local.)

In fact, all my boxes have a LED heartbeat during boot. After the kernel has started, it is solid, and then start flashing the heartbeat until Debian finish booting (end of /etc/rc.local). And then it becomes solid again.

However, I wanted the rootfs to be a really basic rootfs with none of my personal preferences. So I let users learn how to do control the LEDs to tailor their system. Hence there is only a simple example in /etc/rc.local.

Note: since init scripts are multi-threaded, controlling the system LED with heartbeat should be implemented as a script to make sure it is in sync with the system LED ON. And it should be start in /etc/default/rcS to make it reflect the true booting time of sysvinit (this is the earliest, and also the last init script).

Quote

As mentioned, if there is no way to invert the behavior of the Activity LED driven by the sata controller, I prefer to turn the Power LED off in /etc/rc.local when the Activity led is on since one power indicator is enough:

I've looked into a similar issue. To make the SATA LEDs stay ON and then flash during activity, I will need to patch the driver code. Device tree does not have a way to handle this correctly. But this will change the default behavior that we have used for so long, I will need to make sure this change can be reversed back to old behavior in userland if anybody want to keep it (SATA LEDs stay OFF until there is activity).

Quote

One more little detail: You may want to exclude the lost+found directory in your next tarball.

Good point!

Re: Debian on Netgear RN102

$
0
0
Hi bodhi,

Quote
bodhi
Looks like you have missed the /etc/fw_env.config new definition.

Thanks a lot! I trusted you would spot the issue at a glance. Now it works. I will edit my previous post to include the 'fw_env.config' update. There still is a run away CR <13> character, but I recon we can live with that:
cat /etc/fw_env.config 
# MTD device name       Device offset   Env. size       Flash sector size       Number of sectors
/dev/mtd1               0x0000          0x80000         0x20000                 4

cp -a /etc/fw_env.config /etc/fw_env.config.orig
/bin/sh
cat <<EOF > /etc/fw_env.config
# MTD device name       Device offset   Env. size       Flash sector size       Number of sectors
/dev/mtd1               0x00000         0x20000         0x20000
EOF
exit  

fw_printenv ethaddr
ethaddr=00:50:43:00:02:02
fw_printenv eth1addr
eth1addr=12:34:56:78:90:AB

/root/set_persistent_mac_address
[50839.659892] Setting Persistent MAC address to 00:50:43:00:02:02
<13>Aug 29 07:27:23 root[3211]: Setting Persistent MAC address to 00:50:43:00:02:02
Killed old client process
Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/32:19:5b:9d:b8:9e
Sending on   LPF/eth0/32:19:5b:9d:b8:9e
Sending on   Socket/fallback
DHCPRELEASE of 192.168.1.190 on eth0 to 192.168.1.1 port 67
[50841.006030] mvneta d0074000.ethernet eth0: Link is Down
Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

[50841.321248] mvneta d0074000.ethernet eth0: PHY [d0072004.mdio-mii:00] driver [Marvell 88E1318S]
[50841.329783] mvneta d0074000.ethernet eth0: configuring for phy/rgmii-id link mode
[50841.338300] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
Listening on LPF/eth0/00:50:43:00:02:02
Sending on   LPF/eth0/00:50:43:00:02:02
Sending on   Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7
[50844.464952] mvneta d0074000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[50844.472373] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 10
DHCPOFFER of 192.168.1.190 from 192.168.1.1
DHCPREQUEST for 192.168.1.190 on eth0 to 255.255.255.255 port 67
DHCPACK of 192.168.1.190 from 192.168.1.1
bound to 192.168.1.190 -- renewal in 39511 seconds.

ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.190  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::250:43ff:fe00:202  prefixlen 64  scopeid 0x20<link>
        ether 00:50:43:00:02:02  txqueuelen 1024  (Ethernet)
        RX packets 3655  bytes 321602 (314.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3415  bytes 240752 (235.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 26  

fw_printenv Manufacturer
Manufacturer=NETGEAR
fw_printenv Product                                                                                                 
Product=ReadyNAS 102
The mac address 32:19:5b:9d:b8:9e is a random one while 00:50:43:00:02:02 was invented. The correct one is 12:34:56:78:90:AB stored in 'eth1addr' (and manipulated for this post). To keep the same mac address when upgrading from stock firmware to Debian, 'set_persistent_mac_address' should first poll 'eth1addr' for the mac address, and only if that fails poll 'ethaddr'. This behaviour may be made depending on 'Manufacturer' or 'Product' or both. (Btw, 'Number of sectors' is missing in the new 'fw_env.config', but maybe this is OK?).

Quote
bodhi
To make the SATA LEDs stay ON and then flash during activity, I will need to patch the driver code. Device tree does not have a way to handle this correctly.

Please don't bother. No light should indicate no activity. Besides, the Activity LED is brighter than the Sata1 and Sata2 LEDs, and almost outshines them. It is the Activity LED behavior that is broken. I believe it's driven by one of the 6 general purpose IO lines of the Marvell 88SE9170 sata controller, so in principle it should be possible to flip a bit or two in the controller's configuration. This controller may optionally have its own SPI eeprom, so maybe the configuration is stored there? Or maybe it is in a blob uploaded to the controller by the kernel when initializing it?

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

Something else: I have successfully compiled the latest stable kernel, but I'm stuck with an 'armel'/'armhf' issue. The RN102 has a fpu so it is an 'armhf', but the kernel uses no fpu instructions, so it shouldn't really matter. U-boot, however, refuse to start my kernel:
Error: unrecognized/unsupported processor variant (0x561f5811).
I had already been warned:
dpkg -i linux-image-5.8.5-kirkwood-tld-1_5.8.5-kirkwood-tld-1-1_armel.deb
dpkg: error processing archive linux-image-5.8.5-kirkwood-tld-1_5.8.5-kirkwood-tld-1-1_armel.deb (--install):
 package architecture (armel) does not match system (armhf)
which I overruled with the option '--force-architecture '. The commands I used when building the kernel were:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j $(nproc) bindeb-pkg
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage

So 'gnueabihf' doen't do what I want. What am I missing? And, can I tailor the kernel for RN102's specific flavor of 'arm'?

Regards,
Trond Melen

Re: Synology Diskstation DS414 Unbricking

$
0
0
Hello,

Your tutorial is awesome.

I have a 414j which is in the same state as your 414.

I am now stuck at the kwb step. Where can I find a custom kwb for the 414j ?

Any help would be welcome.

Gilles

Re: Synology Diskstation DS414 Unbricking

$
0
0
Hi Gilles,

Sorry to hear your 414j cannot boot. Hopefully you can fix as i did. Im pretty sure you can use the same 414 image as you only need it to boot into to follow the commands to restore the stock uboot. Follow all the steps above and try the u-boot-spl-2019.10-tld-1.ds414.kwb

Re: Debian on Netgear RN102

$
0
0
Trond,

Quote

The mac address 32:19:5b:9d:b8:9e is a random one while 00:50:43:00:02:02 was invented. The correct one is 12:34:56:78:90:AB stored in 'eth1addr' (and manipulated for this post). To keep the same mac address when upgrading from stock firmware to Debian, 'set_persistent_mac_address' should first poll 'eth1addr' for the mac address, and only if that fails poll 'ethaddr'. This behaviour may be made depending on 'Manufacturer' or 'Product' or both.

Since your box use eth1 (unlike most other boxes), then script set_persistent_mac_address should use ethaddr1 and eth1. And also your /etc/network/interfaces needs updated, too. It is default to eth0 in the rootfs (this was the reason for the dhcp to go back to eth0 in your log above).
auto lo eth0
iface lo inet loopback
iface eth0 inet dhcp

Quote

(Btw, 'Number of sectors' is missing in the new 'fw_env.config', but maybe this is OK?).

Yes, it is OK not to have "Number of sectors". We let the kernel figure that out from the bootargs.

Quote

Error: unrecognized/unsupported processor variant (0x561f5811).

U-boot does not care whether it is armhf or armel. So the error is something else. Most probably the kernel image was not built correctly

Quote

dpkg -i linux-image-5.8.5-kirkwood-tld-1_5.8.5-kirkwood-tld-1-1_armel.deb

The above was the error. Kirkwood kernel cannot be used on this box.

If you had used my config and patches from the release thread for Mirabox:
https://forum.doozan.com/read.php?2,92514

Then you could build an armel kernel or armhf kernel. Either one will work on armv7 (i.e. this box, Armada 370).

Re: Debian on Netgear RN102

$
0
0
Trond,

Here is the update DTB.

1. Test the solution for avoiding random MAC:

Comment out your invocation of set_persistent_mac_address in /etc/rc.local. And reboot, see if the MAC address will be the correct persistent one without the workaround.

2. The Backup LED should behave like the Power LED.

Note that I have not given much thought about this, so you need to try the button with esekeyd to see how the LED should be manipulated. I might need to revise the DTS again for this button LED.

Re: Howto: pi-hole ad-blocker on Seagate Dockstar

$
0
0
So I was looking through the pihole installer when I noticed they provide a pre-built armel compatible binary in their repository. The problem is the way they go about detecting your device architecture is somewhat flawed. It will only download the armel binary if it detects you're running the script from within a docker environment. These are the relevant variables:

machine=$(uname -m)
rev=$(uname -m | sed "s/[^0-9]//g;")
lib=$(ldd /bin/ls | grep -E '^\s*/lib' | awk '{ print $1 }')

The script itself has no direct checks that I could see for an armel environment it just downloads pihole-FTL-arm-linux-gnueabi (hard float?) by default once it checks the $rev variable is not greater than "6". It's meant to handle anything that's ARMv6 and lower. If you add this bit here after line 2425 it should detect things correctly and download the correct binary:

        elif [[ "${lib}" == "/lib/ld-linux.so.3" ]]; then
            #
            if [[ "${rev}" -lt 6 ]]; then
                printf "%b  %b Detected ARM soft float architecture\\n" "${OVER}" "${TICK}"
                # set the binary to be used
                l_binary="pihole-FTL-armel-native"
            fi

I've tested this already on a fresh Debian Stretch install running SysVinit and can confirm it works. If you're on systemd the script fails at the "restarting lighttpd service" step. Not entirely sure why that is.

Re: apt-get upgrade, systemd refuses to reload daemons

$
0
0
Also: For when you get hit by this systemd 'feature', it seems remounting the tmpfs /run filesys is a work-around for a running system:

sudo mount -t tmpfs tmpfs /run -o remount,size=20M,rw,nosuid,noexec,relatime,mode=755

I copied the existing mount info, adding the 'remount' option and setting the size to 20M. This let me then do a successful daemon reload.

Re: Debian on Netgear RN102

$
0
0
Thanks bodhi,

I have edited my post above and added the missing modification of the 'fw_env.config' file.

Quote

Since your box use eth1 (unlike most other boxes), then script set_persistent_mac_address should use ethaddr1 and eth1. And also your /etc/network/interfaces needs updated, too. It is default to eth0 in the rootfs (this was the reason for the dhcp to go back to eth0 in your log above).

Good observation! The stock u-boot environment of my first RN102 included:
eth1addr=AA:AA:AA:AA:AA:AA
eth1mtu=1500
ethact=egiga1
ethaddr=BB:BB:BB:BB:BB:BB:BB
ethmtu=1500
ethprime=egiga1
The RN104 is very similar to the RN102, the main differences being:
  • 2 Gb Ethernet interfaces instead of 1 on RN102
  • 4 SATA bays (using a 88SE9215 SATA controller) instead of 2 on RN102
  • A front 16x2 characters Winstar WH1602G LCD
Currently, my hypothesis is: Probably the circuit design is very similar too, and internally maybe RN102 also has 2 Ethernet interfaces, although only one is equipped with a connector. This one is labeled 'egiga1', while 'egiga0' is unconnected.

RN104 has 2 Ethernet entries in its device tree file ('ethernet@70000' and 'ethernet@74000'), while RN102 only has the latter one (diff attached). The fact that it's the second entry that is shared supports the hypothesis. The fact that 'phy = <&phy1>;' for RN104 is 'phy = <&phy0>;' for RN102 weakens the hypothesis. If 'ethprime' is 'egiga0' on the RN104, that would support the hypothesis. What do you make of this?

I tried to check that my second (and less hacked) RN102 also gets its mac address from 'eth1addr', but I failed. Sorry! I connected the 3 leads of my USB-to-TTL adapter into the 4 pin header connector for the console on the rear panel, and powered up the box. No output in the console window, so I checked the connections and realized that I had swapped GND with RX or TX. Correcting the connections, I got serial console output, but no input. Hopefully, it was only the adapter that died from my carelessness. I will order a new one. For the time being, I cannot enter commands on the serial console.

I have no Linux boxes with two Ethernet connectors laying around, so I don't know what to expect in a 'interfaces' file for the RN104.

Quote

Kirkwood kernel cannot be used on this box.

Thanks! This should help me get further.

Preparing for the tests, I downloaded your dts files to /tmp and did:
sudo su -
cd /tmp 
md5sum *
73bc2df36a483d0a80170f2d3764045d  armada-370-netgear-rn102.dtb
1ac4b3b52a71ca50c6782cf0fc3f8643  armada-370-netgear-rn102.dts
da626ebfe1535f03f96fec005e43beef  armada-370-netgear-rn102.dts.orig
deb08f1be54abf1d04ab263d41552453  Debian-4.12.4-mvebu-tld-1-rootfs-bodhi.tar.bz2
8cf3d08dee09d000cf8b50b2df2f4047  linux-4.20.6-mvebu-mirabox-tld-12-bodhi.tar.bz2

diff -U 1 armada-370-netgear-rn102.dts.orig armada-370-netgear-rn102.dts
--- armada-370-netgear-rn102.dts.orig	2020-08-28 14:43:41.917848030 +0200
+++ armada-370-netgear-rn102.dts	2020-08-30 15:09:12.294897002 +0200
@@ -4,2 +4,5 @@
  *
+ * Copyright (C) 2020 bodhi <mibodhi@gmail.com>
+ *
+ * Based on
  * Copyright (C) 2013, Arnaud EBALARD <arno@natisbad.org>
@@ -17,2 +20,7 @@
 
+	aliases {
+		ethernet0 = &eth0;
+		ethernet1 = &eth1;
+	};
+
 	chosen {
@@ -105,3 +113,3 @@
 			gpios = <&gpio1 25 GPIO_ACTIVE_LOW>;
-			default-state = "keep";
+			linux,default-trigger = "default-on";
 		};
@@ -111,3 +119,3 @@
 			gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
-			default-state = "on";
+			linux,default-trigger = "ide-disk1";
 		};
@@ -117,3 +125,3 @@
 			gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
-			default-state = "on";
+			linux,default-trigger = "ide-disk2";
 		};
@@ -123,3 +131,3 @@
 			gpios = <&gpio1 24 GPIO_ACTIVE_LOW>;
-			default-state = "on";
+			linux,default-trigger = "default-on";
 		};
@@ -249,3 +257,2 @@
 				reg = <0x0000000 0x180000>;  /* 1.5MB */
-				read-only;
 			};

lsblk
mount /dev/sdc1 /mnt
cd /mnt
rm -rf *
tar -xjf /tmp/Debian-4.12.4-mvebu-tld-1-rootfs-bodhi.tar.bz2

cd etc
cp -a fw_env.config fw_env.config.orig
/bin/sh
cat <<EOF > fw_env.config
# MTD device name       Device offset   Env. size       Flash sector size       Number of sectors
/dev/mtd1               0x00000         0x20000         0x20000
EOF
exit

mkdir usr/src/mirabox && cd ../usr/src/mirabox
tar xf /tmp/linux-4.20.6-mvebu-mirabox-tld-12-bodhi.tar.bz2
ls -alF
total 34204
drwxr-xr-x 2 root root     4096 aug.  30 15:13 ./
drwxr-xr-x 3 root root     4096 aug.  30 15:13 ../
-rw-r--r-- 1 root root   174254 mars  13  2019 config-4.20.6-mvebu-mirabox-tld-12
-rw-r--r-- 1 root root    67443 feb.   7  2019 linux-4.20.6-mvebu-tld-1.patch
-rw-r--r-- 1 root root   921600 mars  13  2019 linux-dtb-4.20.6-mvebu-mirabox-tld-12.tar
-rw-r--r-- 1 root root  9431996 mars  13  2019 linux-headers-4.20.6-mvebu-mirabox-tld-12_12.0_armhf.deb
-rw-r--r-- 1 root root 20292840 mars  13  2019 linux-image-4.20.6-mvebu-mirabox-tld-12_12.0_armhf.deb
-rwxr-xr-x 1 root root  4062176 mars  13  2019 zImage-4.20.6-mvebu-mirabox-tld-12*

cp -a zImage-4.20.6-mvebu-mirabox-tld-12 zImage.fdt
cat /tmp/armada-370-netgear-rn102.dtb >> zImage.fdt
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-4.20.6-mvebu-mirabox-tld-12 -d zImage.fdt uImage

cd ../../../boot/
cp -a uImage uImage.bak
cp -a ../usr/src/mirabox/uImage .
cd
sync && umount /mnt


1. Test the solution for avoiding random MAC.

Moved the USB-stick over to the RN102, attached power and hit the Power button. The complete boot log as well as the 'fw_printenv' output are attached. Logged in with 'ssh' and did:
cat /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

if [ -d /sys/class/leds/nsa326:white:sys ]; then
   echo default-on  > /sys/class/leds/nsa326:white:sys/trigger
   echo none        > /sys/class/leds/nsa326:red:sys/trigger
   echo ide-disk1  > /sys/class/leds/nsa326:white:sata1/trigger
   echo ide-disk2  > /sys/class/leds/nsa326:white:sata2/trigger
   echo usb-host > /sys/class/leds/nsa326:white:usb/trigger
fi

exit 0

fw_printenv | grep eth
bootargs_end=:10.4.50.254:255.255.255.0:KW40:eth0:none
eth1addr=12:34:56:78:90:AB
eth1mtu=1500
ethact=egiga1
ethaddr=00:50:43:00:02:02
ethmtu=1500
ethprime=egiga1
yuk_ethaddr=00:00:00:EE:51:81

ifconfig | grep eth
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether d2:c0:d8:ec:7d:1f  txqueuelen 1024  (Ethernet)

reboot
ifconfig | grep eth
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 2a:a7:7c:56:58:c2  txqueuelen 1024  (Ethernet)
reboot
ifconfig | grep eth
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 56:ca:86:d1:19:63  txqueuelen 1024  (Ethernet)
So the patch seems to have no effect and the mac address is still random.


2. The Backup LED should behave like the Power LED.

The Power LED behaves as before. About 3 seconds into kernel booting, it goes from blinking at, say, 2 Hz to steady on. The Backup LED now behaves as the Power LED. Very well!


Installed 'esekeyd', launched 'keytest', hit and released the power button, hit and released the backup button, hit and released the reset button and hit Cntr-C on the keyboard:
apt install -y esekeyd
keytest
keytest (ESE Key Deamon 1.2.7, SVN-r63)

(input device name as 1st option override autodetection)

Pres ANY (fun)key... or Ctrl-C to exit...

KEY_116 KEY_116 KEY_133 KEY_133 KEY_408 KEY_408 ^C

Caught signal 2, exiting...
So the outstanding task is to write an 'esekeyd' configuration file that executes 'shutdown -h now' when KEY_116 has been received twice, with, say, between 5 and 10 seconds between the two events and else do nothing. The tarball includes 3 simple examples, but none involves timing. Last entry in the change log is dated 2010-07-04. A tiny tutorial here. Maybe I'll be inspired to try implementing it some day.

Regards,
Trond Melen

Re: Debian on Netgear RN102

$
0
0
Hi again Bodhi and Trond,
My trip is over so i had some time with my box and tried your LED scripts and DTS files.LED behavior is fine for me except ACT led is constant on. Below is Tronds rc.local config:

if [ -d /sys/class/leds/rn102:blue:pwr ]; then

   # Switch all the LEDs on to bring driver's shadow variables in sync with the LEDs
   echo default-on > /sys/class/leds/rn102:blue:pwr/trigger
   echo default-on > /sys/class/leds/rn102:blue:sata1/trigger
   echo default-on > /sys/class/leds/rn102:blue:sata2/trigger
   echo default-on > /sys/class/leds/rn102:blue:backup/trigger

   # Switch the Power LED off if the Activity LED is on (one power indicator is enough)
   if grep scsi1 /proc/scsi/scsi > /dev/null; then
      echo none    > /sys/class/leds/rn102:blue:pwr/trigger
   fi
   if grep scsi2 /proc/scsi/scsi > /dev/null; then
      echo none    > /sys/class/leds/rn102:blue:pwr/trigger
   fi

   # Make Sata1 and Sata2 LEDs indicate disk activity
   echo ide-disk1  > /sys/class/leds/rn102:blue:sata1/trigger
   echo ide-disk2  > /sys/class/leds/rn102:blue:sata2/trigger

   # Switch the Backup LED off
   echo none       > /sys/class/leds/rn102:blue:backup/trigger
fi

Power and act leds are constantly on.I also agree to trond about one led is enough to determine if power is on.

Driver of g762 fan control chip seems not included in kernel i guess.In driver folder seems all below:

root@debian:~# ls /sys/bus/i2c/drivers/
.  ..  at24  dummy  pca953x  rtc-ds1307  rtc-pcf8563  rtc-s35390a  tcpci

Since i could not find driver for g762, fancontrol is not working.Do i have to compile kernel aganist it?
Will test mac stuff tomorrow.
Suggestions are welcome.

Re: Debian on Netgear RN102

$
0
0
Trond,

> Currently, my hypothesis is: Probably the circuit
> design is very similar too, and internally maybe
> RN102 also has 2 Ethernet interfaces, although
> only one is equipped with a connector. This one is
> labeled 'egiga1', while 'egiga0' is unconnected.

Correct. This is the normal behavior for some boxes. It could be either eth0 or eth1 port, depending on how the manufacturer implemented it.

>
> RN104 has 2 Ethernet entries in its device tree
> file ('ethernet@70000' and 'ethernet@74000'),
> while RN102 only has the latter one (diff
> attached). The fact that it's the second entry
> that is shared supports the hypothesis. The fact
> that 'phy = <&phy1>;' for RN104 is 'phy =
> <&phy0>;' for RN102 weakens the hypothesis. If
> 'ethprime' is 'egiga0' on the RN104, that would
> support the hypothesis. What do you make of this?

As I said above, these 2 interfaces are internally support by the SoC. So the logical connections are always there. The physical connection to each port is what make it live. Same thing for SATA ports.

> 1. Test the solution for avoiding random MAC.
> So the patch seems to have no effect and the mac
> address is still random.

Too bad! this solution worked for a majority of MVEBU boxes. But this box is one of those that need to be examined further. The NAS326 (Armada 380) has the same issue. But I have not got enough time to sit down and do a close reading of all relevant DTS files.

> when KEY_116 has been received twice, with, say,
> between 5 and 10 seconds between the two events
> and else do nothing.

OK. So looks like I will need to revisit esekeyd configuration someday. In the mean time, using key number is a good workaround. The correct usage with key names (POWER, RESET, COPY...) are standard Linux so it should work , we are seeing either esekeyd or some mis-configuration.

Re: Debian on Netgear RN102

$
0
0
whitepawn,

With the latest DTB I've uploaded in previous post, there is no need to use echo in /etc/rc.local. But it does not hurt to set them explicitly like we always do.

> Driver of g762 fan control chip seems not included
> in kernel i guess.In driver folder seems all
> below:

Let me find out more.

Since I will build new kernel for this, you could wait a bit. I would like you and Trond install and test my kernel at least once (either before or after you build your own kernel if you want to do so).

Re: Debian on Netgear RN102

$
0
0
Thanks bodhi.
One more issue:BTRFS seems not included in kernel.I have existing drives with BTRFS with 8TB data on it so i really wanted to use with it.

root@debian:~#  cat /proc/filesystems
nodev	sysfs
nodev	rootfs
nodev	ramfs
nodev	bdev
nodev	proc
nodev	cpuset
nodev	cgroup
nodev	cgroup2
nodev	tmpfs
nodev	devtmpfs
nodev	debugfs
nodev	tracefs
nodev	securityfs
nodev	sockfs
nodev	bpf
nodev	pipefs
nodev	rpc_pipefs
nodev	devpts
	ext3
	ext4
nodev	nfs
nodev	nfs4
nodev	nfsd
nodev	autofs
nodev	mqueue
root@debian:~# lsmod | grep btrfs
root@debian:~# modprobe btrfs
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.20.6-mvebu-mirabox-tld-12/modules.dep.bin'
modprobe: FATAL: Module btrfs not found in directory /lib/modules/4.20.6-mvebu-mirabox-tld-12

I will be patient and wait your kernel release to fancontrol:)
Can test your new kernel anytime.

Re: Debian on Netgear RN102

$
0
0
Hi bodhi,

A minor suggestion for your '/etc/rc.local' script: If you use -x rather than -f when testing for '/root/set_persistent_mac_address', one may disable and exnable this script with 'chmod -x' and 'chmod -x'. Nifty?

EDIT: Fixed typo. Substituted -e with -x.

Regards,
Trond Melen

Re: Debian on Netgear RN102

$
0
0
Hi bodhi,

Being able to build my own kernel, and boot it, would make it much easier to assist you in supporting the RT102. I solved the 'armel/armhf' issue above, but failed to make my kernel run. After u-boot wispers "Starting kernel ...", nothing happens. The error message about unrecognized/unsupported processor variant is replaced by silence. Hardly a step forward. I'm comfortable with the configuration and build steps, the hard part is what to do with the results. Is there a thread on how you assemble your kernel tarballs? Or will you make one? Or should I start one, and let you fill in the gaps?

I'm eager to test any new root file systems or kernels, both for the RT102 and the NetgearStora.

Regards,
Trond Melen

Re: Debian on Netgear RN102

$
0
0
I'm going to release 2 new kernels sometime today. One for the general MVEBU boxes, and a special one for this RN102 and Mirabox.

Re: Linux Kernel 5.5.3 MVEBU package and Debian armhf rootfs

$
0
0
Kernel 5.8.5-mvebu-tld-1 package has been uploaded. Please 1st post for download link.
Viewing all 46983 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>