**文書の過去の版を表示しています。**
目次
ReadyNAS Duo v2 の Open-WRT化(再トライ編)
概要
Open-WRT は 主にブロードバンドルーター向けの Linuxディストリビューション。
コミュニティの情報によればNETGEAR の NAS box ReadyNAS Duo v2 にもインストールできる。
ReadyNAS Duo v2は、製造から10年近く経過しており、すでに公式サポートも終了。
中のOSも相当古くなっているので、Open-WRTに入れ替えることで延命を図る。
イメージの入手
上のリンクからKERNELとSYSUPGRADEをダウンロードする。
KERNEL:openwrt-kirkwood-netgear_readynas-duo-v2-initramfs-uImage
SYSUPGRADE:openwrt-kirkwood-netgear_readynas-duo-v2-squashfs-sysupgrade.bin
私のあやふやな理解
KERNEL 最初にReadyNASのNANDフラッシュに書き込む必要最小限の内容だけのイメージ
SYSUPGRADE KERNELで起動した上で、sysupgrade(上書き更新?)して使うフル版のイメージ
準備
- ReadyNASとPCをシリアル接続できるようにしておく
- FAT32でフォーマットしたUSBメモリに KERNELイメージを保存しておく
手順
ここにざっくり書かれている
Installation by USB + serial:
- Copy initramfs image to fat32 usb drive
- Connect pendrive to USB 2.0 front socket
- Connect serial console
- Stop booting in u-boot
- Do:
usb reset setenv bootargs 'console=ttyS0,115200n8 earlyprintk' setenv bootcmd 'nand read.e 0x1200000 0x200000 0x600000;bootm 0x1200000' saveenv fatload usb 0:1 0x1200000 openwrt-kirkwood-netgear_readynas-duo-v2-initramfs-uImage bootm 0x1200000
- copy sysupgrade image via ssh.
- run sysupgrade
実際
OpenWRTのインストール
- USBメモリに「openwrt-kirkwood-netgear_readynas-duo-v2-initramfs-uImage」をコピー
- このUSBメモリをReadyNASの前面USBポートに接続
- USB-シリアル変換ケーブルで、ReadyNASとPCで繋ぎ、TeraTermやRLoginなどの端末エミュレーターで接続待機しておく
- ReadyNASの電源を入れ、キーボートで何かキーを叩く
- 端末エミュレーターに Marvell» プロンプトが表示されるので、手順のDoの内容を打ち込む
__ __ _ _ | \/ | __ _ _ ____ _____| | | | |\/| |/ _` | '__\ \ / / _ \ | | | | | | (_| | | \ V / __/ | | |_| |_|\__,_|_| \_/ \___|_|_| _ _ ____ _ | | | | | __ ) ___ ___ | |_ | | | |___| _ \ / _ \ / _ \| __| | |_| |___| |_) | (_) | (_) | |_ \___/ |____/ \___/ \___/ \__| ** MARVELL BOARD: DB-88F6282A-BP LE U-Boot 1.1.4 (Jun 29 2012 - 16:06:40) Marvell version: 3.4.27 Netgear version: Uboot-1_1_4-NetgearDUOV3-V1009 U-Boot code: 00600000 -> 0067FFF0 BSS: -> 006D0120 Soc: MV88F1155 Rev 1 (DDR3) CPU running @ 1600Mhz L2 running @ 533Mhz SysClock = 533Mhz , TClock = 200Mhz DRAM unknown CAL tRP = 8 tRAS = 20 tRCD=8 DRAM CS[0] base 0x00000000 size 256MB DRAM Total size 256MB 16bit width Addresses 8M - 0M are saved for the U-Boot usage. Mem malloc Initialization (8M - 7M): Done NAND:128 MB Flash: 0 kB CPU : Marvell Feroceon (Rev 1) Streaming disabled Write allocate disabled USB 0: host mode PEX 0: PCI Express Root Complex Interface PEX interface detected Link X1 Switch On ! Net: egiga0 [PRIME] Hit any key to stop autoboot: 3 0 Marvell>> usb reset (Re)start USB... USB: scanning bus for devices... 2 USB Device(s) found Waiting for storage device(s) to settle before scanning... 1 Storage Device(s) found Marvell>> setenv bootargs 'console=ttyS0,115200n8 earlyprintk' Marvell>> setenv bootcmd 'nand read.e 0x1200000 0x200000 0x600000;bootm 0x1200000' Marvell>> saveenv Saving Environment to NAND... Erasing Nand...Writing to Nand... done Marvell>> fatload usb 0:1 0x1200000 openwrt-kirkwood-netgear_readynas-duo-v2-initramfs-uImage reading openwrt-kirkwood-netgear_readynas-duo-v2-initramfs-uImage .......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... 4860334 bytes read Marvell>> bootm 0x1200000 ## Booting image at 01200000 ... Image Name: ARM OpenWrt Linux-5.10.115 Created: 2022-05-20 19:00:24 UTC Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 4860270 Bytes = 4.6 MB Load Address: 00008000 Entry Point: 00008000 Verifying Checksum ... OK OK Starting kernel ... [ 0.000000] Booting Linux on physical CPU 0x0 [ 0.000000] Linux version 5.10.115 (builder@buildhost) (arm-openwrt-linux-muslgnueabi-gcc (OpenWrt GCC 11.2.0 r19689-19ef3b54f4) 11.2.0, GNU ld (GNU Binutils) 2.37) #0 Fri May 20 19:00:24 2022 [ 0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397f [ 0.000000] CPU: VIVT data cache, VIVT instruction cache [ 0.000000] OF: fdt: Machine model: NETGEAR ReadyNAS Duo v2 [ 0.000000] Memory policy: Data cache writeback [ 0.000000] Zone ranges: [ 0.000000] Normal [mem 0x0000000000000000-0x000000000fffffff] [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000000000000-0x000000000fffffff] [ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000000fffffff] [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 64960 [ 0.000000] Kernel command line: console=ttyS0,115200n8 earlyprintk [ 0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes, linear) [ 0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes, linear) [ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off [ 0.000000] Memory: 243348K/262144K available (5978K kernel code, 597K rwdata, 1548K rodata, 7168K init, 214K bss, 18796K reserved, 0K cma-reserved) [ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16 [ 0.000000] random: get_random_bytes called from start_kernel+0x330/0x560 with crng_init=0 [ 0.000000] clocksource: orion_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302233 ns [ 0.000006] sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 10737418237ns [ 0.000031] Switching to timer-based delay loop, resolution 5ns [ 0.000098] Calibrating delay loop (skipped), value calculated using timer frequency.. 400.00 BogoMIPS (lpj=2000000) [ 0.000119] pid_max: default: 32768 minimum: 301 [ 0.000258] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) [ 0.000277] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) [ 0.000991] CPU: Testing write buffer coherency: ok [ 0.001693] Setting up static identity map for 0x100000 - 0x10003c [ 0.001882] mvebu-soc-id: MVEBU SoC ID=0x6282, Rev=0x1 [ 0.002020] dyndbg: Ignore empty _ddebug table in a CONFIG_DYNAMIC_DEBUG_CORE build [ 0.004573] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns [ 0.004597] futex hash table entries: 256 (order: -1, 3072 bytes, linear) [ 0.004695] pinctrl core: initialized pinctrl subsystem [ 0.005530] NET: Registered protocol family 16 [ 0.005835] DMA: preallocated 256 KiB pool for atomic coherent allocations [ 0.006628] thermal_sys: Registered thermal governor 'step_wise' [ 0.006699] cpuidle: using governor ladder [ 0.006943] Feroceon L2: Enabling L2 [ 0.006978] Feroceon L2: Cache support initialised. [ 0.015181] No ATAGs? [ 0.050726] SCSI subsystem initialized [ 0.051848] usbcore: registered new interface driver usbfs [ 0.051891] usbcore: registered new interface driver hub [ 0.051929] usbcore: registered new device driver usb [ 0.056246] clocksource: Switched to clocksource orion_clocksource [ 0.056872] NET: Registered protocol family 2 [ 0.056975] IP idents hash table entries: 4096 (order: 3, 32768 bytes, linear) [ 0.057477] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear) [ 0.057512] TCP established hash table entries: 2048 (order: 1, 8192 bytes, linear) [ 0.057544] TCP bind hash table entries: 2048 (order: 1, 8192 bytes, linear) [ 0.057573] TCP: Hash tables configured (established 2048 bind 2048) [ 0.057638] UDP hash table entries: 256 (order: 0, 4096 bytes, linear) [ 0.057661] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear) [ 0.057765] NET: Registered protocol family 1 [ 0.057789] PCI: CLS 0 bytes, default 32 [ 0.117299] workingset: timestamp_bits=14 max_order=16 bucket_order=2 [ 0.120282] squashfs: version 4.0 (2009/01/31) Phillip Lougher [ 0.120296] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc. [ 0.120858] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251) [ 0.122797] kirkwood-pinctrl f1010000.pin-controller: registered pinctrl driver [ 0.123767] mvebu-pcie mbus@f1000000:pcie@82000000: host bridge /mbus@f1000000/pcie@82000000 ranges: [ 0.123802] mvebu-pcie mbus@f1000000:pcie@82000000: MEM 0x00f1040000..0x00f1041fff -> 0x0000040000 [ 0.123823] mvebu-pcie mbus@f1000000:pcie@82000000: MEM 0x00f1044000..0x00f1045fff -> 0x0000044000 [ 0.123841] mvebu-pcie mbus@f1000000:pcie@82000000: MEM 0x00f1080000..0x00f1081fff -> 0x0000080000 [ 0.123860] mvebu-pcie mbus@f1000000:pcie@82000000: MEM 0xffffffffffffffff..0x00fffffffe -> 0x0100000000 [ 0.123877] mvebu-pcie mbus@f1000000:pcie@82000000: IO 0xffffffffffffffff..0x00fffffffe -> 0x0100000000 [ 0.123894] mvebu-pcie mbus@f1000000:pcie@82000000: MEM 0xffffffffffffffff..0x00fffffffe -> 0x0200000000 [ 0.123907] mvebu-pcie mbus@f1000000:pcie@82000000: IO 0xffffffffffffffff..0x00fffffffe -> 0x0200000000 [ 0.124062] mvebu-pcie mbus@f1000000:pcie@82000000: PCI host bridge to bus 0000:00 [ 0.124077] pci_bus 0000:00: root bus resource [bus 00-ff] [ 0.124089] pci_bus 0000:00: root bus resource [mem 0xf1040000-0xf1041fff] (bus address [0x00040000-0x00041fff]) [ 0.124100] pci_bus 0000:00: root bus resource [mem 0xf1044000-0xf1045fff] (bus address [0x00044000-0x00045fff]) [ 0.124110] pci_bus 0000:00: root bus resource [mem 0xf1080000-0xf1081fff] (bus address [0x00080000-0x00081fff]) [ 0.124119] pci_bus 0000:00: root bus resource [mem 0xe0000000-0xefffffff] [ 0.124128] pci_bus 0000:00: root bus resource [io 0x1000-0xeffff] [ 0.124207] pci 0000:00:01.0: [11ab:6282] type 01 class 0x060400 [ 0.125158] PCI: bus0: Fast back to back transfers disabled [ 0.125172] pci 0000:00:01.0: bridge configuration invalid ([bus 00-00]), reconfiguring [ 0.125291] pci 0000:01:00.0: [1033:0194] type 00 class 0x0c0330 [ 0.125328] pci 0000:01:00.0: reg 0x10: [mem 0x40000000-0x40001fff 64bit] [ 0.125463] pci 0000:01:00.0: PME# supported from D0 D3hot D3cold [ 0.125502] pci 0000:01: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) [ 0.126372] PCI: bus1: Fast back to back transfers disabled [ 0.126387] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01 [ 0.126532] pci 0000:00:01.0: BAR 8: assigned [mem 0xe0000000-0xe00fffff] [ 0.126547] pci 0000:01:00.0: BAR 0: assigned [mem 0xe0000000-0xe0001fff 64bit] [ 0.126566] pci 0000:00:01.0: PCI bridge to [bus 01] [ 0.126577] pci 0000:00:01.0: bridge window [mem 0xe0000000-0xe00fffff] [ 0.126619] pci 0000:00:01.0: enabling device (0140 -> 0142) [ 0.131888] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled [ 0.133168] printk: console [ttyS0] disabled [ 0.133245] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 26, base_baud = 12500000) is a 16550A [ 0.790459] printk: console [ttyS0] enabled [ 0.795166] Loading iSCSI transport class v2.0-870. [ 0.803697] nand: device found, Manufacturer ID: 0xad, Chip ID: 0xf1 [ 0.810105] nand: Hynix H27U1G8F2BTR-BC [ 0.813954] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64 [ 0.821586] Scanning device for bad blocks [ 0.902422] 4 fixed-partitions partitions found on MTD device orion_nand [ 0.909159] Creating 4 MTD partitions on "orion_nand": [ 0.914322] 0x000000000000-0x000000180000 : "u-boot" [ 0.921109] 0x000000180000-0x0000001a0000 : "u-boot-env" [ 0.926860] 0x000000200000-0x000000800000 : "kernel" [ 0.933204] 0x000000800000-0x000008000000 : "ubi" [ 0.954622] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4 [ 0.964461] mv643xx_eth_port mv643xx_eth_port.0 eth0: port 0 with MAC address 2c:b0:5d:bf:0d:35 [ 2.006252] rtc-mv f1010300.rtc: internal RTC not ticking [ 2.011753] i2c /dev entries driver [ 2.016550] orion_wdt: Initial timeout 21 sec [ 2.028485] marvell-cesa f1030000.crypto: CESA device successfully registered [ 2.036382] NET: Registered protocol family 10 [ 2.042410] Segment Routing with IPv6 [ 2.046145] NET: Registered protocol family 17 [ 2.050675] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this. [ 2.063809] 8021q: 802.1Q VLAN Support v1.8 [ 2.071477] UBI: auto-attach mtd3 [ 2.074819] ubi0: attaching mtd3 [ 2.219953] ubi0: scanning is finished [ 2.234281] ubi0: attached mtd3 (name "ubi", size 120 MiB) [ 2.239819] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes [ 2.246734] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512 [ 2.253459] ubi0: VID header offset: 512 (aligned 512), data offset: 2048 [ 2.260279] ubi0: good PEBs: 960, bad PEBs: 0, corrupted PEBs: 0 [ 2.266323] ubi0: user volume: 2, internal volumes: 1, max. volumes count: 128 [ 2.273577] ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 534925369 [ 2.282670] ubi0: available PEBs: 0, total reserved PEBs: 960, PEBs reserved for bad PEB handling: 20 [ 2.292184] ubi0: background thread "ubi_bgt0d" started, PID 465 [ 2.298895] block ubiblock0_0: created from ubi0:0(rootfs) [ 2.304411] ubiblock: device ubiblock0_0 (rootfs) set to be root filesystem [ 2.332472] Freeing unused kernel memory: 7168K [ 2.337081] Run /init as init process [ 2.446271] random: fast init done [ 2.519945] init: Console is alive [ 2.523529] init: - watchdog - [ 2.532586] kmodloader: loading kernel modules from /etc/modules-boot.d/* [ 2.540999] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver [ 2.549980] ehci-fsl: Freescale EHCI Host controller driver [ 2.558405] ehci-orion: EHCI orion driver [ 2.562591] orion-ehci f1050000.ehci: EHCI Host Controller [ 2.568140] orion-ehci f1050000.ehci: new USB bus registered, assigned bus number 1 [ 2.575942] orion-ehci f1050000.ehci: irq 30, io mem 0xf1050000 [ 2.606263] orion-ehci f1050000.ehci: USB 2.0 started, EHCI 1.00 [ 2.612767] hub 1-0:1.0: USB hub found [ 2.617064] hub 1-0:1.0: 1 port detected [ 2.623836] ehci-platform: EHCI generic platform driver [ 2.634799] kmodloader: done loading kernel modules from /etc/modules-boot.d/* [ 2.644901] init: - preinit - [ 2.784825] random: jshn: uninitialized urandom read (4 bytes read) [ 2.822813] random: jshn: uninitialized urandom read (4 bytes read) [ 2.843697] random: jshn: uninitialized urandom read (4 bytes read) [ 2.906302] usb 1-1: new high-speed USB device number 2 using orion-ehci Press the [f] key and hit [enter] to enter failsafe mode Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level [ 7.062118] procd: - early - [ 7.065120] procd: - watchdog - [ 7.622420] procd: - watchdog - [ 7.625787] procd: - ubus - [ 7.680918] procd: - init - Please press Enter to activate this console. [ 8.011265] kmodloader: loading kernel modules from /etc/modules.d/* [ 8.041132] urngd: v1.0.2 started. [ 8.139414] PPP generic driver version 2.4.2 [ 8.146759] NET: Registered protocol family 24 [ 8.178921] kmodloader: done loading kernel modules from /etc/modules.d/* [ 8.203124] random: crng init done [ 8.206576] random: 7 urandom warning(s) missed due to ratelimiting [ 18.421326] br-lan: port 1(eth0) entered blocking state [ 18.426610] br-lan: port 1(eth0) entered disabled state [ 18.432047] device eth0 entered promiscuous mode BusyBox v1.35.0 (2022-05-20 19:00:24 UTC) built-in shell (ash) _______ ________ __ | |.-----.-----.-----.| | | |.----.| |_ | - || _ | -__| || | | || _|| _| |_______|| __|_____|__|__||________||__| |____| |__| W I R E L E S S F R E E D O M ----------------------------------------------------- OpenWrt SNAPSHOT, r19689-19ef3b54f4 ----------------------------------------------------- === WARNING! ===================================== There is no root password defined on this device! Use the "passwd" command to set up a new password in order to prevent unauthorized SSH logins. -------------------------------------------------- root@OpenWrt:/#
- WinSCPを使って SYSUPGRADEイメージ「openwrt-kirkwood-netgear%%_%%readynas-duo-v2-squashfs-sysupgrade.bin」をReadyNASに転送する (転送プロトコルはSCP、接続先のIPアドレスはDHCPで勝手に振られるのでスマホアプリNetwork Analyzerで調べた。ユーザーroot、パスワードは無し)
- sysupgrade
sysupgrade openwrt-kirkwood-netgear_readynas-duo-v2-squashfs-sysupgrade.bin
ネットワーク設定の変更
失敗編の反省から
Open-WRTは、無線LANブロードバンドルーターをメインターゲットとしたOSであるため、ネットワーク設定もデフォルトではルーター用に都合のよい設定になっているみたいだ。
ReadyNAS Duo v2はネットワークにLANポート一基のみ搭載したシンプルなNASであるため、Bridgeなどのややこしいネットワーク構成はいらない。
そこで、まず最初にネットワーク設定をシンプルなものに変更した。
同時にIPアドレスをDHCPでもらってくるのではなく、静的IP(192.168.10.2)となるようにした。
ついでにDNSもここで我が家のブロードバンドルーター(192.168.10.1)に設定した。
変更前
変更後
Web設定 LuCI のインストール
TeraTermでもRloginでもWLS2のUbuntuからでも何でもよいが、SSHで ReadyNAS 192.168.10.2 に接続
ネットワーク設定をちゃんとしたので、今回はopkgコマンドがIPv6で困った、なんてことはなく、すんなり入った。