Quantcast
Channel: Linux Device Hacking - Debian
Viewing all 26665 articles
Browse latest View live

Re: NSA 325 V2 Debian Is Possible!

$
0
0
I would like to make use of the copy button to run a simple bash copy command. Tried the script from the first post but didnt work. Does anyone have any other solution?


Also, i would take the opportunity to again thank bodhi so much for helping me out with the installation process. You should know that taking your time as you do here really makes people happy and bring some lights to the world. :-)

Re: NSA 325 V2 Debian Is Possible!

$
0
0
Hi fgh,

> I would like to make use of the copy button to run
> a simple bash copy command. Tried the script from
> the first post but didnt work. Does anyone have
> any other solution?

We use the esekeyd on these boxes.

It is listed in the Wiki thread

Quote

Key daemon (button control)

Multimedia keyboard daemon for Linux

> Also, i would take the opportunity to again thank
> bodhi so much for helping me out with the
> installation process. You should know that taking
> your time as you do here really makes people happy
> and bring some lights to the world. :-)

My pleasure :)

Re: GPIO keys daemon setup

$
0
0
Ok, to save dumb people as me some time:

root@kerstin:~$ 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

Then:
root@kerstin:~$ cat /etc/esekeyd.conf
KEY_116:/usr/bin/logger -s -i "POWER button pushed"
RESTART:/usr/bin/logger -s -i "RESTART button pushed"
KEY_133:/usr/bin/logger -s -i "COPY Button pushed"

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

$
0
0
Had same issue on pogoplug pro, this change corrected the issue: Many Thanks!

 [OLD] /etc/fstab:
tmpfs        /tmp        tmpfs        defaults                        0       0
[NEW] /etc/fstab:
tmpfs        /run        tmpfs        nosuid,noexec,size=32M,nr_inodes=4096   0       0

Re: Buffalo Terastation III TS-X4.0L/r5 (Sakura) From Stock 1.71(Buffalo Latest FW) ==>Debian Jessie/Stretch

$
0
0
I was able to get an initrd to execute successfully without needing to modify uboot in anyway.

The process is basically to pad the front of the initrd with zeros to get the the actual archive loaded to a suitable offset and then compiling that offset into the kernel cmdline. I'm still working to cleanup/script that process (as well as looking at some other less hacky options). Either way this should leave me with something workable that I should be able to have run automatically after flash-kernel (using the same hook flash-kernel uses).

This leaves me with a TS-WXL running Debian Stretch with most of the important hardware working (NAND-Flash, SPI-NOR and probably some other things I haven't thought of will take some work).

I believe I know what the issue is compiling the Buster Kernel and will work on that more once I get the process cleaned up a bit more.

I still haven't had any luck getting the SATA working on the TS-XL (4-bay device), the SoC sata works just fine for the TS-WXL (2 bay device) but the PCI connected Marvell 88SX7042 isn't being recognized properly. I think the PCI ports aren't being initialized properly but I have no idea if i'll be able to correct that or not.

Re: Dell Appliance

$
0
0
The bad news is similar HighMem errors still exist in the latest kernel (5.2.8). It happens less often than in previous kernel version, though. Similar problem has been reported to mainline last year, but looks like the devs don't like to spend much time on ARMV5 (armel) anymore.

The Kirkwood kernel we have will run this M300 box with 768K RAM. So if anybody is having OOM running Dockstar or other Kirkwood plugs, perhaps you should start using this box with 768K for now.

I think I will need to build a different kernel for this box. Not giving up yet :)

NSA325v2 no network (eth0 missing)

$
0
0
I've sucessfully managed to boot kernel 5.1.11 with Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi, thanks Bodhi!
Uboot is U-Boot 2017.07-tld-1, I'm using USB drive with ext4 filesystem. Uboot is simple for me:
setenv bootargs_linux 'console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=nand_mtd:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2) earlyprintk=serial'
setenv bootcmd_linux 'setenv bootargs $bootargs_linux; mw.l f1010100 0020c000; usb reset; ext4load usb 0:1 0x800000 /boot/uImage; ext4load usb 0:1 0x02100000 /boot/uInitrd; ext4load usb 0:1 0x1c00000 /boot/dts/kirkwood-dns325.dtb; bootm 0x800000 0x02100000 0x1c00000'


But there is some problem (maybe with DTB?) with ethernet, I can see kernel message:
[    8.450525] mdio_bus f1072004.mdio-bus-mii: MDIO device at address 8 is missing.
[    8.458797] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
[    8.466686] mv643xx_eth_port mv643xx_eth_port.0: DMA mask not set
And eth0 is completely missing...

Re: NSA325v2 no network (eth0 missing)

$
0
0
rufik,

> setenv bootargs_linux 'console=ttyS0,115200
> root=LABEL=rootfs rootdelay=10 mtdparts=nand_mtd:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2)

Should be

setenv bootargs_linux 'console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2)

> $bootargs_linux; mw.l f1010100 0020c000; usb
> reset; ext4load usb 0:1 0x800000 /boot/uImage;
> ext4load usb 0:1 0x02100000 /boot/uInitrd;
> ext4load usb 0:1 0x1c00000
> /boot/dts/kirkwood-dns325.dtb; bootm 0x800000
> 0x02100000 0x1c00000'

No need to set it like that, U-Boot 2017.07-tld-1 envs are already set up to boot the NSA325 correctly.

> And eth0 is completely missing...

Please post the entire serial console log.

Re: NSA325v2 no network (eth0 missing)

Re: NSA325v2 no network (eth0 missing)

$
0
0
rufik,

dtb_file=/boot/dts/kirkwood-dns325.dtb

That was the wrong DTB. It should be:
dtb_file=/boot/dts/kirkwood-nsa325.dtb

I did not regconize it in your log above either :) they look almost identical !

Re: Linux Kernel 5.1.11 Kirkwood package and Debian rootfs

$
0
0
Kernel linux-5.2.9-kirkwood-tld-1 package has been uploaded. There are important updates in this version.

Please see 1st post for download link.

Re: NSA325v2 no network (eth0 missing)

$
0
0
Thanks a lot, it did the trick! :)
I don't really know why I put dns325 instead of nsa325, really...

Re: Buffalo Terastation III TS-X4.0L/r5 (Sakura) From Stock 1.71(Buffalo Latest FW) ==>Debian Jessie/Stretch

$
0
0
I dug into the issue with the 4.19 kernel, I'm fairly sure it's the same as this one:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=908712

It looks like a fix is already pending, I'll try it out in the coming days.

In the meantime I've been working on a Debian Installer image for this device which sets up the kernel/startup scripts/initramfs hooks etc. I'm still working out exactly how I want to package/host all this.

once I get it all to a state where I'm comfortable posting it I'll make it all available. After that I'll see if I can do anything for the PCI support and other hardware components.

Re: Buffalo Terastation III TS-X4.0L/r5 (Sakura) From Stock 1.71(Buffalo Latest FW) ==>Debian Jessie/Stretch

$
0
0
Sorry for the late reply, I ended up being overwelmed with my house renovation work.

Great news that you got the 4.19 compiled, do you mind sharing you .config here so we can work on the same basis? (also your Debian Stretch kernel 4.9 .config if you have it).


On my side, I got to review how to write a DT file so I can make this go forward for any future kernel.

As I only have a TS-WXL, and the the null-modem port offers read only data, I am having some issue when trying a vanilla 4.x as the machine type of my machine, doesn't match the automatically generated machine type of a kernel.

Can you provide me you machine type for the TS-WXL to see if the machine types on those models are somewhat equivalent or not?

For this patch to work properly, the first step is to ensure that anyone can compile the kernel with "Multiple machine support". That would be a great step to try to hit while I am trying a DT support.

Cheers,

Re: Buffalo Terastation III TS-X4.0L/r5 (Sakura) From Stock 1.71(Buffalo Latest FW) ==>Debian Jessie/Stretch

$
0
0
Sounds good!

I'm testing my latest installer image today, assuming it works as expected I'll try and get everything posted on github to provide a good starting point.

Until then, here is the diff between Debian's config and the one I have working:

$ diff config-4.9.0-9-marvell linux-4.9.168/.config
377c377,380
< # CONFIG_ARCH_MV78XX0 is not set
---
> CONFIG_ARCH_MV78XX0=y
> # CONFIG_MACH_DB78X00_BP is not set
> # CONFIG_MACH_RD78X00_MASA is not set
> CONFIG_MACH_TERASTATION_WXL=y
564,568c567,571
< CONFIG_ARM_APPENDED_DTB=y
< CONFIG_ARM_ATAG_DTB_COMPAT=y
< CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y
< # CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND is not set
< CONFIG_CMDLINE=""
---
> # CONFIG_ARM_APPENDED_DTB is not set
> CONFIG_CMDLINE="console=ttyS0,115200 initrd=0x02700040,50M panic=5"
> # CONFIG_CMDLINE_FROM_BOOTLOADER is not set
> # CONFIG_CMDLINE_EXTEND is not set
> CONFIG_CMDLINE_FORCE=y
2968c2971
< CONFIG_SERIAL_8250_RUNTIME_UARTS=2
---
> CONFIG_SERIAL_8250_RUNTIME_UARTS=4

here are the commands I'm using to build it, generate the machineID and create a uImage:
                            

prefix="/usr/local/bin/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-"
gcc="$prefix""gcc"

kernel_ver="4.9.168"

cd linux-$kernel_ver
##add V=1 for errors
make -j12 ARCH=arm KBUILD_DEBARCH=armel CROSS_COMPILE="$prefix" bindeb-pkg

cd ..
devio 'wl 0xe3a01c0a,4' 'wl 0xe3811089,4' > machtype
cat machtype linux-$kernel_ver/arch/arm/boot/zImage > katkern
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n  custom-$kernel_ver -d  katkern uImage.buffalo
rm katkern

here is the code I'm using to pack my installer at the offset I hardcoded in the kernel cmdline (becasue I can't get the one uboot passes to work):
dd if=/dev/null of=frontpad bs=1 seek=24117184
cat frontpad uImage.buffalo > padkern
rm frontpad
dd if=/dev/null of=padkern bs=1M seek=30
cat padkern initrd.gz > installer-initrd.img
rm padkern
mkimage -A arm -O linux -T ramdisk -C gzip -a 0x0 -e 0x0 -n installer-initrd.gz initrd.buffalo

I'll upload all the files/scripts used to generate the installer as well as a working image to a git repo and provide a link once it's ready.

let me know if you have any questions.

Re: Buffalo Terastation III TS-X4.0L/r5 (Sakura) From Stock 1.71(Buffalo Latest FW) ==>Debian Jessie/Stretch

$
0
0
My installer image worked and my ts-wxl is running again.

I went ahead and created a repository and will start committing my build scripts as I get things streamlined. The url is:
https://github.com/1000001101000/Terastation-III-research

I uploaded my current installer images as Stretch/installer_files.zip. You can use this to install Debian Stretch on the device along with my kernel, my microcontroller scripts (disable watchdog, shutdown, restart, lcd_init) and the script for padding the initrd/kernel to proper offsets (triggered by update-initramfs similar to flash-kernel).

To install:
1. unpack installer_files.zip
2. replace initrd.buffalo and uImage.buffalo with the files from the zip
3. reboot the device, after a few minutes it will finish booting and start an ssh server. it should also display "debian installer" on the lcd
4. connect using the credentials
username: installer
password: install
5. run through the debian install, select manual formatting
6. setup the old /boot volume as follows:
use as: ext3
format: no, keep existing data
mount point: /boot
7. set the remaining partitions however you prefer.
8. run through the rest of the install normally, when the device reboots it should work normally.

let me know if you run into any problems.

Zyxel NAS326 HDD booting issue

$
0
0
Zyxel NAS326 HDD booting issue


Note: you don't have to worry about this issue if you are booting with USB rootfs.

Here is what I found from reading the GPL source to trouble shoot the issue of booting the NAS326 with 2 HDDs, with the rootfs is on one HDD.

NAS326 stock u-boot uses an old AHCI driver. This old version set the link detection timeou to a very small value of 4 ms. This interval is apparently too small. In the latest version of this AHCI driver, it is set to 200 ms.

Since I have not started building new u-boot (because of UART booting issue with this box), we cannot update this u-boot, or replace it with a better one.

So at the moment, we can only work around it.

I will do some testing to see if we can pick a good work around to enable the SATA link up before we try to initialize the SATA port for booting the kernel on HDD.

Update:

- Here is a work around that seems to do the trick consistently for me and heiko: Whenever the box needs to be rebooted, just shutdown and power up again. Then both HDDs will be initialized OK.

Zyxel NAS326 Installation

$
0
0
Zyxel NAS326 Installation
Updated 20 Aug 2019

Note: for HHD booting issues after your installation, see this thread.

Installation for NAS326 box can be done with serial console connected (section A), or inside stock OS and without serial console (section B for USB rootfs, section C for SATA rootfs). Note: for section A and B, the USB rootfs must be inserted to the front USB port (USB 2.0).


A. Instruction for the booting the NAS326 with a USB rootfs (serial console setup)

A1. Requirements

1. Serial console connected during set up (which should be removed later during normal operation).

2. Download either the latest ARM32 version or the x86-64 version of kwboot. Use it depending on the architecture of serial console converter host. Please see this post for ARM32 kwboot. (I'll need to recompile the x86-64 version and reupload).

3. Prepare the rootfs Debian-4.9.0-mvebu-tld-12-rootfs-bodhi.tar.bz2 as described in the Debian rootfs release section (right below):

Quote

Updated 04 Feb 2017:

This Debian-4.9.0-mvebu-tld-12-rootfs-bodhi.tar.bz2 has been uploaded.

A2. Installation

Warning: Step 4 in the instruction in this section uses a "env/code injection" to replace the Zyxel NAS326 stock u-boot bootcmd with a different command during boot. It's a simple trick that change u-boot env bootcmd (it does not touch u-boot binary in NAND). However, this hack should not be used on a different MVEBU box (any box other than the NAS326). Doing this without examining your box's stock u-boot source code could likely messing up your u-boot envs and prevent booting, or in the worse case bricking it. Please post questions regarding installation for other MVEBU boxes, it might be possible to do this.

1. Start kwboot on the serial console host

For ARM32 kwboot:
./kwboot -t -B 115200 /dev/ttyUSB0 -d

For x86-64 kwboot:
./kwboot -t -B 115200 /dev/ttyUSB0


2. Power up the NAS326, and wait at serial console, observe kwboot spinning / while waiting for handshake.

3. After a period of time, the NAS326 will time out and start booting its stock u-boot. Interrupt u-boot at countdown. Get a listing of your current u-boot envs, and save it to a notepad in case you want to restore it later.

printenv


4. Enter the following commands (copy/paste each line to the u-boot prompt).

setenv curr_bootfrom 1
setenv next_bootfrom 1
setenv load_dtb_addr 0x1000000
setenv load_initrd_addr 0x2900000
setenv load_image_addr 0x02000000
setenv usb_init 'mw.l f1018100 20420000; mw.l f1018140 003E8800; sleep 3; usb start'
setenv set_bootargs_stock 'setenv bootargs "console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2"'
setenv bootcmd_stock_1 'run set_bootargs_stock; echo Booting from NAND kernel 1 ...; nand read 0x2000000 0x00E00000 0xF00000 && bootz 0x2000000'
setenv bootcmd_stock_2 'run set_bootargs_stock; echo Booting from NAND kernel 2 ...; nand read 0x2000000 0x08700000 0xF00000 && bootz 0x2000000'
setenv usb_set_bootargs 'setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"'
setenv usb_bootcmd 'echo Booting from USB ...; setenv fdt_skip_update yes; run usb_init; ext2load usb 0:1 $load_image_addr /boot/zImage; ext2load usb 0:1 $load_dtb_addr /boot/dts/armada-380-zyxel-nas326.dtb; ext2load usb 0:1 $load_initrd_addr /boot/uInitrd; run usb_set_bootargs; bootz $load_image_addr $load_initrd_addr $load_dtb_addr'
setenv bootcmd_custom 'if run usb_bootcmd; then; else if run bootcmd_stock_1; then; else run bootcmd_stock_2; reset; fi; fi'
setenv kernel_addr_1 '0x00000000; run bootcmd_custom; '
saveenv


5. Reset the NAS326, exit kwboot.

reset
And then press "Control \ c" to exit kwboot

6. Start kwboot again on the serial console host (use the same command as in step 1)

7. After a period of time, the NAS326 will time out and start booting its stock u-boot. Observe kernel loading and booting until seeing the Debian prompt. At this point we can either login directly with serial console, or by SHH. If login is through SSH, find the NAS:

ping debian.local

When the ping returns successful response, then login (root password is root);
ssh root@debian.local


If for whatever reason (e.g. firewall), the NAS326 cannot be found as debian.local, then find its IP in the router webpage. Or use a scanning app such as Linux nmap or IOS Fing to find the IP.

8. DONE.


A3. Normal Operation

The USB rootfs should be plugged in permanently, and the serial console module should be removed.

1. Whenever the NAS326 is rebooted or cold started, to boot without manual intervention, the serial console module must be unplugged from the NAS326. If the serial console module is plugged in, then step 1 in the installation instruction A2 must be executed (so that the NAS326 will continue booting when it detected the serial console present). Note that reboot in some instance will work with serial console plugged in.

2. If you want to boot back to stock OS in NAND, just shutdown the box, unplug the USB and power up the box. It will boot the kernel 1 in NAND and then if not successful, it will try kernel 2.

This also serves as a rescue system. Whenever the rootfs on USB has problem and cannot boot (the effect is just like the USB drive is not plugged in), the NAS326 will fall back to booting the kernel 1 or 2 in NAND. When this occurs, the u-boot envs in step 4 must be reentered at serial console again to allow booting back to USB rootfs.


A4. Reverse to stock OS permanently

To reverse the setup, and boot back to stock NAND kernel permanently, execute the following instructions at serial console:

setenv kernel_addr_1 0x00E00000
setenv bootargs 'console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2'
saveenv
boot


B. Instruction for booting the NAS326 with a USB rootfs (setup without serial console)

B1. Requirements

1. Prepare the rootfs Debian-4.9.0-mvebu-tld-12-rootfs-bodhi.tar.bz2 as described in the Debian rootfs release section (right below):

Quote

Updated 04 Feb 2017:

This Debian-4.9.0-mvebu-tld-12-rootfs-bodhi.tar.bz2 has been uploaded.

B2. Installation

Warning: Step 4 in the instruction in this section uses a "env/code injection" to replace the Zyxel NAS326 stock u-boot bootcmd with a different command during boot. It's a simple trick that change u-boot env bootcmd (it does not touch u-boot binary in NAND). However, this hack should not be used on a different MVEBU box (any box other than the NAS326). Doing this without examining your box's stock u-boot source code could likely messing up your u-boot envs and prevent booting, or in the worse case bricking it. Please post questions regarding installation for other MVEBU boxes, it might be possible to do this.

1. Gain SSH to the NAS326 box.

Use the Zyxel NAS326 instruction (came with the box) for logging as admin user through the web page of the box, set password, and Enable SSH.

2. Open a termimal and connect to the NAS326 with SSH, and login to the box as root user.

3. After logging in, get a listing of your current u-boot envs, and save it to a notepad in case you want to restore it later.

fw_printenv


4. Enter the following commands (copy/paste each line to the stock OS command line).

fw_setenv curr_bootfrom 1
fw_setenv next_bootfrom 1
fw_setenv load_dtb_addr 0x1000000
fw_setenv load_initrd_addr 0x2900000
fw_setenv load_image_addr 0x02000000
fw_setenv usb_init 'mw.l f1018100 20420000; mw.l f1018140 003E8800; sleep 3; usb start'
fw_setenv set_bootargs_stock 'setenv bootargs "console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2"'
fw_setenv bootcmd_stock_1 'run set_bootargs_stock; echo Booting from NAND kernel 1 ...; nand read 0x2000000 0x00E00000 0xF00000 && bootz 0x2000000'
fw_setenv bootcmd_stock_2 'run set_bootargs_stock; echo Booting from NAND kernel 2 ...; nand read 0x2000000 0x08700000 0xF00000 && bootz 0x2000000'
fw_setenv usb_set_bootargs 'setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"'
fw_setenv usb_bootcmd 'echo Booting from USB ...; setenv fdt_skip_update yes; run usb_init; ext2load usb 0:1 $load_image_addr /boot/zImage; ext2load usb 0:1 $load_dtb_addr /boot/dts/armada-380-zyxel-nas326.dtb; ext2load usb 0:1 $load_initrd_addr /boot/uInitrd; run usb_set_bootargs; bootz $load_image_addr $load_initrd_addr $load_dtb_addr'
fw_setenv bootcmd_custom 'if run usb_bootcmd; then; else if run bootcmd_stock_1; then; else run bootcmd_stock_2; reset; fi; fi'
fw_setenv kernel_addr_1 '0x00000000; run bootcmd_custom; '
fw_setenv change_boot_part 1

And then list the u-boot envs again, and save it to a notepad in case there is problem with booting and it needs to be referenced.
fw_printenv


5. Plug in the USB rootfs Debian-4.9.0-mvebu-tld-12-rootfs-bodhi.tar.bz2, and reboot

sync
sync
/sbin/reboot

7. After a period of time, the NAS326 will start rebooting. Wait for about 30 seconds and login through SSH.

To find the NAS:
ping debian.local

When the ping returns successful response, then login (root password is root);
ssh root@debian.local

If for whatever reason (e.g. firewall), the NAS326 cannot be found as debian.local, then find its IP in the router webpage. Or use a scanning app such as Linux nmap or IOS Fing to find the IP.

8. DONE.


B3. Normal Operation

The USB rootfs should be plugged in permanently, and if there is serial console module attached before then it should be removed during booting.

1. Whenever the NAS326 is rebooted or cold started, to boot without manual intervention, the serial console module must be unplugged from the NAS326. If the serial console module is plugged in, then step 1 in the Section A2 installation instruction must be executed (so that the NAS326 will continue booting when it detected the serial console present). Note that reboot in some instance will work with serial console plugged in.

2. If you want to boot back to stock OS in NAND, just shutdown the box, unplug the USB and power up the box. It will boot the kernel 1 in NAND and then if not successful, it will try kernel 2.

This also serves as a rescue system. Whenever the rootfs on USB has problem and cannot boot (the effect is just like the USB drive is not plugged in), the NAS326 will fall back to booting the kernel 1 or 2 in NAND. When this occurs, the u-boot envs in step 4 must be reentered at Debian command line again to allow booting back to USB rootfs.

B4. Reverse to stock OS permanently

To reverse the setup, and boot back to stock NAND kernel permanently, execute the following instructions at the Debian command line:

fw_setenv kernel_addr_1 0x00E00000
fw_setenv bootargs 'console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2'
and then reboot
sync
shutdown -r now

C. Instruction for booting the NAS326 with rootfs on internal HDD (setup without serial console)

C1. Requirements

1. Prepare the rootfs Debian-4.9.0-mvebu-tld-12-rootfs-bodhi.tar.bz2, using one of the internal HDD, as described in the Debian rootfs release section (right below):

Quote

Updated 04 Feb 2017:

This Debian-4.9.0-mvebu-tld-12-rootfs-bodhi.tar.bz2 has been uploaded.

C2. Installation

Warning: Step 4 in the instruction in this section uses a "env/code injection" to replace the Zyxel NAS326 stock u-boot bootcmd with a different command during boot. It's a simple trick that change u-boot env bootcmd (it does not touch u-boot binary in NAND). However, this hack should not be used on a different MVEBU box (any box other than the NAS326). Doing this without examining your box's stock u-boot source code could likely messing up your u-boot envs and prevent booting, or in the worse case bricking it. Please post questions regarding installation for other MVEBU boxes, it might be possible to do this.

1. Gain SSH to the NAS326 box.

Use the Zyxel NAS326 instruction (came with the box) for logging as admin user through the web page of the box, set password, and Enable SSH.

2. Open a termimal and connect to the NAS326 with SSH, and login to the box as root user.

3. After logging in, get a listing of your current u-boot envs, and save it to a notepad in case you want to restore it later.

fw_printenv


4. Enter the following commands (copy/paste each line to the stock OS command line).

fw_setenv curr_bootfrom 1
fw_setenv next_bootfrom 1
fw_setenv load_dtb_addr 0x1000000
fw_setenv load_initrd_addr 0x2900000
fw_setenv load_image_addr 0x02000000
fw_setenv set_bootargs_stock 'setenv bootargs "console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2"'
fw_setenv bootcmd_stock_1 'run set_bootargs_stock; echo Booting from NAND kernel 1 ...; nand read 0x2000000 0x00E00000 0xF00000 && bootz 0x2000000'
fw_setenv bootcmd_stock_2 'run set_bootargs_stock; echo Booting from NAND kernel 2 ...; nand read 0x2000000 0x08700000 0xF00000 && bootz 0x2000000'

fw_setenv sata_init 'mw.l f1018100 20420000; mw.l f1018140 003ca800; sleep 3; scsi init'
fw_setenv sata_bootcmd 'echo Booting from SATA ...; setenv fdt_skip_update yes; run sata_init; ext2load scsi 0:1 $load_image_addr /boot/zImage; ext2load scsi 0:1 $load_dtb_addr /boot/dts/armada-380-zyxel-nas326.dtb; ext2load scsi 0:1 $load_initrd_addr /boot/uInitrd; run sata_set_bootargs; bootz $load_image_addr $load_initrd_addr $load_dtb_addr'
fw_setenv sata_set_bootargs 'setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"'
fw_setenv bootcmd_custom_sata 'if run sata_bootcmd; then; else if run bootcmd_stock_1; then; else run bootcmd_stock_2; reset; fi; fi'
fw_setenv bootcmd_custom 'run bootcmd_custom_sata'
fw_setenv kernel_addr_1 '0x00000000; run bootcmd_custom; '

And then list the u-boot envs again, and save it to a notepad in case there is problem with booting and it needs to be referenced.
fw_printenv


5. Insert the HDD with rootfs Debian-4.9.0-mvebu-tld-12-rootfs-bodhi.tar.bz2, if not already inside the box, and reboot

sync
sync
/sbin/reboot

7. After a period of time, the NAS326 will start rebooting. Wait for about 30 seconds and login through SSH.

To find the NAS:
ping debian.local

When the ping returns successful response, then login (root password is root);
ssh root@debian.local

If for whatever reason (e.g. firewall), the NAS326 cannot be found as debian.local, then find its IP in the router webpage. Or use a scanning app such as Linux nmap or IOS Fing to find the IP.

8. DONE.


C3. Normal Operation

The HDD rootfs should be plugged in permanently, and if there is serial console module attached before then it should be removed during booting.

1. Whenever the NAS326 is rebooted or cold started, to boot without manual intervention, the serial console module must be unplugged from the NAS326. If the serial console module is plugged in, then step 1 in the Section A2 installation instruction must be executed (so that the NAS326 will continue booting when it detected the serial console present). Note that reboot in some instance will work with serial console plugged in.

2. If you want to boot back to stock OS in NAND, just shutdown the box, remove the HDD rootfs and power up the box. It will boot the kernel 1 in NAND and then if not successful, it will try kernel 2.

This also serves as a rescue system. Whenever the rootfs on HDD has problem and cannot boot (the effect is just like the HDD drive is not plugged in), the NAS326 will fall back to booting the kernel 1 or 2 in NAND. When this occurs, the u-boot envs in step 4 must be reentered at Debian command line again to allow booting back to HDD rootfs.

C4. Reverse to stock OS permanently

To reverse the setup, and boot back to stock NAND kernel permanently, execute the following instructions at the Debian command line:

fw_setenv kernel_addr_1 0x00E00000
fw_setenv bootargs 'console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2'
and then reboot
sync
shutdown -r now

Re: Linux Kernel 5.2.9 MVEBU package and Debian armhf rootfs

$
0
0
Kernel linux-5.2.9-mvebu-tld-1 package has been uploaded. There are important updates in this release.

Note: please beware that the boot envs need to be changed in this kernel version (to boot with uImage). Please post question before you attempt to install this kernel image. I'm in the process of updating the NAS326 installation instruction as an example to all boxes.

Please see 1st post for download link.

Re: Buffalo Terastation III TS-X4.0L/r5 (Sakura) From Stock 1.71(Buffalo Latest FW) ==>Debian Jessie/Stretch

Viewing all 26665 articles
Browse latest View live


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