Welcome! Log In Create A New Profile

Advanced

Lenovo ix2-ng to put Debian Stretch and OMV4

Posted by codier 
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
July 03, 2021 10:55PM
It does.

root@ix2:/# cat /etc/fw_env.config
/dev/mtd1         0x0             0x1000          0x1000
/dev/mtd2         0x0             0x1000          0x1000
root@ix2:/# fw_printenv
baudrate=115200
loads_echo=0
rootpath=/srv/ubuntu
netmask=255.255.255.0
run_diag=yes
MALLOC_len=1
ethprime=egiga0
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvPhoneConfig); bootm 0x2000000;
lcd0_enable=0
lcd0_params=640x480-16@60
ethmtu=1500
mvPhoneConfig=mv_phone_config=dev[0]:fxs,dev[1]:fxo
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
usb0Mode=host
yuk_ethaddr=00:00:00:EE:51:81
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
image_multi=yes
ethact=egiga0
console=console=ttyS0,115200
bootargs_root=root=/dev/ram0
bootargs_mtd=mtdparts=spi_flash:0x7e000@0(u-boot),0x1000@0x7f000(env),0x1000@0x7e000(env2)
kernelimage=zImage
initrdimage=mfginitrd
ipaddr=192.168.1.2
mfgmodel=ix2
preroot_ver=0.0.2
bootcmd2=ide dev 1;ide read 0x40000 0x800 0x1800; ide read 0x900000 0x2000 0x1800; bootm 0x40000 0x900000;
stdin=serial
stdout=serial
stderr=serial
mainlineLinux=no
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
netbsd_en=no
vxworks_en=no
bootdelay=3
disaMvPnp=no
enaAutoRecovery=yes
pcieTune=no
pcieTune1=no
uboot_ver=0.0.8
serial_number=5563Y01001G4130044CJ0D1
ethaddr=00:D0:B8:28:76:76
serialNo=SM10G0885942200209
modelname=SM10G08859
fw_ver=4.0.8.23976
serialno=0,01fCt+rC6JS6RqbhasnbzGZRgdN+gIw6GJr8x5N2mfDwoThRpoo00APsDyzEtS72UY,SM10G0885942200209,
runintime=10800
ftpserver=192.168.43.4
testfile=100M
mfgtest_state=system_tested_ok
pre_path=IX2/1.1.0/download_runin.sh
pre_path_conf=IX2/1.1.0/download_runin.conf
pre_serverip=192.168.32.4
pre_user=ixxrunin
pre_passwd=123
pre_dirzi=IX2/1.1.0
serverip=192.168.32.4
bootcmd=ide reset; ide read 0x40000 0x800 0x1800; ide read 0x900000 0x2000 0x1800; setenv bootargs $(console) $(bootargs_root) $(bootargs_mtd) $(bootargs_end); bootm 0x40000 0x900000;run bootcmd2

Re: Lenovo ix2-ng to put Debian Stretch and OMV4
July 03, 2021 11:16PM
root@ix2:/# cat /etc/fw_env.config
/dev/mtd1         0x0             0x1000          0x1000
/dev/mtd2         0x0             0x1000          0x1000

So our 1st try was correct!

Quote
https://forum.doozan.com/read.php?2,122039,122439#msg-122439

setenv bootargs_mtd 'mtdparts=spi0.0:0x7e000@0(u-boot),0x1000@0x7f000(env),0x1000@0x7e000(env2)'
setenv usb_set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $(bootargs_mtd) earlyprintk=serial'

And repeat the other setenvs in serial console like before. And boot into Debian.


2. After booted into Debian, edit the fw_env.config file to have this conntent (this is same as posted before)
# MTD device name Device offset Env. size Flash sector size Number of sectors
/dev/mtd1 0x0 0x1000 0x1000

And then check the mtd partitions to see if they are what we expected (should be 3 mtds)
cat /proc/mtd

And try to list the envs
fw_printenv

If you can see the envs listed correctly like in serial console, then it's all good.

The error in dmesg was why you still see the CRC error.

[    8.310171][    T1] m25p80 spi0.0: mx25l8005 (1024 Kbytes)
[    8.315700][    T1] 3 cmdlinepart partitions found on MTD device spi0.0
[    8.322383][    T1] Creating 3 MTD partitions on "spi0.0":
[    8.327898][    T1] 0x000000000000-0x00000007e000 : "u-boot"
[    8.333596][    T1] mtd: partition "u-boot" doesn't end on an erase/write block -- force read-only
[    8.343631][    T1] 0x00000007f000-0x000000080000 : "env"
[    8.349093][    T1] mtd: partition "env" doesn't start on an erase/write block boundary -- force read-only
[    8.359761][    T1] 0x00000007e000-0x00000007f000 : "env2"
[    8.365269][    T1] mtd: partition "env2" doesn't start on an erase/write block boundary -- force read-only

Now the error above did not make any sense!

0x00000007e000 = 516096  = 126 * 4*1024

If the kernel thinks it is 4K sector then it would fit on 4K block boundary. The error indicates that the kernel thinks this SPI flash has 64KB sector, so it does not end on boundary

0x00000007e000 / 64 /1024 = 7.875
I need to take a look at the kernel code for this SPI flash

[    8.310171][    T1] m25p80 spi0.0: mx25l8005 (1024 Kbytes)

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
July 03, 2021 11:31PM
Codier,

So the kernel indeed does not know this SPI flash is 4K sector compatible. Note the last column for mx25l8005.

static const struct flash_info macronix_parts[] = {
        /* Macronix */
        { "mx25l512e",   INFO(0xc22010, 0, 64 * 1024,   1, SECT_4K) },
        { "mx25l2005a",  INFO(0xc22012, 0, 64 * 1024,   4, SECT_4K) },
        { "mx25l4005a",  INFO(0xc22013, 0, 64 * 1024,   8, SECT_4K | SPI_NOR_HAS_LOCK) },
        { "mx25l8005",   INFO(0xc22014, 0, 64 * 1024,  16, 0) },

....

The driver in stock OS apparently has this SPI flash driver patched to recognize 4K sector.

That was the rationale why I wanted to try to define the whole flash = mtd0 (I tried to get past the kernel check in case it thinks the flash is 64K sector). But apparently later that 64K-sector still come into play when you do fw_printenv.

Let's wait until I release the next kernel, I will patch the driver to have 4K sector

{ "mx25l8005",   INFO(0xc22014, 0, 64 * 1024,  16, SECT_4K) },


and then you can try again.

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 07/03/2021 11:32PM by bodhi.
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
July 03, 2021 11:58PM
Sounds good.

Thanks Bodhi. This is a nice lesson and I have learned alot.
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
July 05, 2021 08:56PM
Hi Bodhi,

Is there another way to set boot with systemd before your patch?

Thanks
Codier
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
July 06, 2021 12:26AM
See note2 in the installation instruction.

https://forum.doozan.com/read.php?2,12096

Quote

Updated 25 Aug 2019:

Basic Debian buster Kirkwood rootfs for most Kirwood plugs:

- tarball size: 209M
- install size: 536M
- The init system used in this rootfs is sysvinit . To boot with systemd, see note 2 below.
- Installed packages: nano, avahi, ntp, busybox-syslogd (log to RAM), htop, isc-dhcp-client, dialog, bzip2, nfs server/client, iperf, ethtool, sysvinit-core, sysvinit, sysvinit-utils, u-boot-tools, and mtd-utils.
- see LED controls in /etc/rc.local, and /etc/init.d/halt
- see some useful aliases in /root/.profile
- root password: root

Download at Dropbox:

Debian-5.2.9-kirkwood-tld-1-rootfs-bodhi.tar.bz2

md5:
cd8ad170aa1a9fdc2a0a1c43ab1c0721
sha256:
8ccbbced367b4c2bf3728262e882f8232aff0fecd1c0c767219a0cab49a0b9bf


And remember to check the hash of what you download, as always.

Installation:

Installation can be done on any Linux box, with a fresh USB drive (SD card or HDD would work fine too).

Note: all steps below must be done while logging in as root user (not sudo). If you are not the root user then don't continue, because the rootfs will not work.

1. Format a new USB drive with a single Ext3 partition, and label it rootfs.

2. Mount the drive on a Linux box. cd to top level directory and extract it. It is assuming the USB drive is mounted at /media/sdb1
cd /media/sdb1
tar -xjf Debian-5.2.9-kirkwood-tld-1-rootfs-bodhi.tar.bz2

3. Adjust fstab (optional).

Edit /media/sdb1/etc/fstab entry for root device to match the rootfstype of your rootfstype if you use Ext4 or Ext2. However, you can keep it as is without problem in booting since the kernel will figure out which file system the rootfs was formatted.

LABEL=rootfs / ext3 noatime,errors=remount-ro 0 1

4. Create uImage with embedded DTB for booting with older u-boots (2012 or earlier). Do not do this step if you have installed the latest U-Boot for Kirkwood (or are installing this u-boot at the same time).

Please replace kirkwood-goflexnet.dtb below with the correct DTB name for your box (see the folder /media/sdb1/boot/dts for the exact spelling of your Kirkwood box name).

Generate the uImage with DTB embedded inside:
cd /media/sdb1/boot
cp -a zImage-5.2.9-kirkwood-tld-1 zImage.fdt
cat dts/kirkwood-goflexnet.dtb >> zImage.fdt
mv uImage uImage.orig
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-5.2.9-kirkwood-tld-1 -d zImage.fdt uImage
sync

If your Linux box does not have mkimage, then install it

apt-get install u-boot-tools

5. Done. Take this USB rootfs to your plug and cold start. After booted into Debian, see Note1 and Note2 below. It is very important that you do Note1 steps to secure your box.

Note1:

After logging in this rootf the first time, remember to generate new SSH key to make it your own unique rootfs. And also update your rootfs to get the latest Debian package security updates:
rm /etc/ssh/ssh_host*
ssh-keygen -A

apt-get update
apt-get upgrade

Warning: Watch the apt-get upgrade progress. If the apt-get upgrade results in a new initramfs, the log would shows this message:

update-initramfs: Generating /boot/initrd.img-5.2.9-kirkwood-tld-1

Then you need to regenerate the uInitrd boot file:
cd /boot
mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-5.2.9-kirkwood-tld-1 -d initrd.img-5.2.9-kirkwood-tld-1 uInitrd

Note2:

To boot with systemd, add parameter init=/bin/systemd to your u-boot env bootargs (beware that in later Debian distribution, the location of systemd binary might have changed).

- For example,
fw_setenv set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts init=/bin/systemd'

- Or, if you are booting with my latest u-boot images you can also use the uEnv.txt capability to do this. In the default envs, custom_params is a variable that allows you to add extra bootargs. So add the following line to uEnv.txt:
custom_params=init=/bin/systemd

If that's still not possible to run systemd, you might want to install it again:
apt-get install systemd

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
July 06, 2021 10:33AM
Hi Bodhi,

According to my situation
root@debian:/media/omv5# fw_setenv set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts init=/bin/systemd'
Warning: Bad CRC, using default environment

Can I set it via serial by using following? then just boot it to test?
setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts init=/bin/systemd

Thanks
Codier



Edited 1 time(s). Last edit at 07/06/2021 10:34AM by codier.
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
July 06, 2021 03:45PM
Codier,

> Can I set it via serial by using following? then
> just boot it to test?

Yes, set it in serial console, but your current env is

usb_set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $(bootargs_mtd) earlyprintk=serial

so change it to

setenv usb_set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $(bootargs_mtd) earlyprintk=serial init=/bin/systemd'

andn then boot.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
July 07, 2021 11:03AM
Hi Bodhi,

The systemd was working on my system so I think the guide is still valid.

It stopped working after I installed OMV5 (Since your debian version is Buster now and only OMV5 can be installed). My USB is newly built so there is nothing. basically I will start from beginning and I will redo the steps to see if there is anything wrong.

Just want to know if I am safe to saveenv for the following variables.
setenv usb_set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $(bootargs_mtd) earlyprintk=serial init=/bin/systemd'
setenv load_uimage 'ext2load usb 0:1 0x800000 /boot/uImage'
setenv load_uinitrd 'ext2load usb 0:1 0x2100000 /boot/uInitrd'
setenv usb_boot 'mw 0x800000 0 1; run load_uimage; run load_uinitrd; bootm 0x800000 0x2100000'
setenv usb_bootcmd 'run usb_set_bootargs; run usb_boot'
setenv bootcmd 'usb start; run usb_bootcmd; usb stop; reset'

Thanks
Codier



Edited 2 time(s). Last edit at 07/07/2021 02:32PM by codier.
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
July 07, 2021 03:36PM
codier,

After testing these new envs and know that it works each time you boot the system, you'd want to set it up so stock OS can be run as rescue system. In case the USB drive is not attached or corrupted, it will boot into stock and then you can log in through SSH and repair it.

So redefine the stock boocmd as bootcmd_stock and then add it to the new bootcmd as a fallback system

setenv usb_set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $(bootargs_mtd) earlyprintk=serial init=/bin/systemd'
setenv load_uimage 'ext2load usb 0:1 0x800000 /boot/uImage'
setenv load_uinitrd 'ext2load usb 0:1 0x2100000 /boot/uInitrd'
setenv usb_boot 'mw 0x800000 0 1; run load_uimage; run load_uinitrd; bootm 0x800000 0x2100000'
setenv usb_bootcmd 'run usb_set_bootargs; run usb_boot'
setenv bootcmd_debian 'usb start; run usb_bootcmd; usb stop; reset'

setenv bootcmd_stock 'ide reset; ide read 0x40000 0x800 0x1800; ide read 0x900000 0x2000 0x1800; setenv bootargs $(console) $(bootargs_root) $(bootargs_mtd) $(bootargs_end); bootm 0x40000 0x900000;run bootcmd2'

setenv bootcmd 'run bootcmd_debian; run bootcmd_stock'

Test these envs a few times, booting alternatively Debian and stock OS (by removing the USB drive). And then after tesing, do a saveenv in serial console.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
July 07, 2021 11:41PM
Hi Bodhi,

The new set of envs didn't work.
Marvell>> setenv usb_set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $(bootargs_mtd) earlyprintk=serial init=/bin/systemd'
Marvell>> setenv load_uimage 'ext2load usb 0:1 0x800000 /boot/uImage'
Marvell>> setenv load_uinitrd 'ext2load usb 0:1 0x2100000 /boot/uInitrd'
Marvell>> setenv usb_boot 'mw 0x800000 0 1; run load_uimage; run load_uinitrd; bootm 0x800000 0x2100000'
Marvell>> setenv usb_bootcmd 'run usb_set_bootargs; run usb_boot'
Marvell>> setenv bootcmd_debian 'usb start; run usb_bootcmd; usb stop; reset'
Marvell>> setenv bootcmd_stock 'ide reset; ide read 0x40000 0x800 0x1800; ide read 0x900000 0x2000 0x1800; setenv bootargs $(console) $(bootargs_root) $(bootargs_mtd) $(bootargs_end); bootm 0x40000 0x900000;run bootcmd2'
Marvell>> setenv bootcmd 'run bootcmd_debian; run bootcmd_stock'
Marvell>> boot
(Re)start USB...
USB:   scanning bus for devices... 2 USB Device(s) found
Waiting for storage device(s) to settle before scanning...
T Device NOT ready
   Request Sense returned 00 00 00
1 Storage Device(s) found
** Bad partition 1 **
** Bad partition 1 **
## Booting image at 00800000 ...
Bad Magic Number
stopping USB..

         __  __                      _ _
        |  \/  | __ _ _ ____   _____| | |
        | |\/| |/ _` | '__\ \ / / _ \ | |
        | |  | | (_| | |   \ V /  __/ | |
        |_|  |_|\__,_|_|    \_/ \___|_|_|
 _   _     ____              _
| | | |   | __ )  ___   ___ | |_
| | | |___|  _ \ / _ \ / _ \| __|
| |_| |___| |_) | (_) | (_) | |_
 \___/    |____/ \___/ \___/ \__|  ** ix2-spi ** ** uboot_ver:0.0.8 **

 ** MARVELL BOARD: DB-88F6282A-BP LE

U-Boot 1.1.4 (Oct 28 2011 - 15:18:22) Marvell version: 3.6.1 - EMC

U-Boot code: 00600000 -> 0067FFF0  BSS: -> 006CD5A0

Soc: 88F6282 A1 CPU running @ 1600Mhz L2 running @ 533Mhz
SysClock = 533Mhz , TClock = 200Mhz

DRAM (DDR3) CAS Latency = 7 tRP = 7 tRAS = 20 tRCD=7
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
Found ADT7473, program PWM1 ... OK
[1024kB@f8000000] Flash:  1 MB

When I changed to the old sets it worked.
Marvell>> setenv usb_set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $(bootargs_mtd) earlyprintk=serial init=/bin/systemd'
Marvell>> setenv load_uimage 'ext2load usb 0:1 0x800000 /boot/uImage'
Marvell>> setenv load_uinitrd 'ext2load usb 0:1 0x2100000 /boot/uInitrd'
Marvell>> setenv usb_boot 'mw 0x800000 0 1; run load_uimage; run load_uinitrd; bootm 0x800000 0x2100000'
Marvell>> setenv usb_bootcmd 'run usb_set_bootargs; run usb_boot'
Marvell>> setenv bootcmd 'usb start; run usb_bootcmd; usb stop; reset'
Marvell>> boot
(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
....
.
......
............
.........................
...................................................
......................................................................................................
............................................................................................................................................................................................................
....
.......................................................................

4976325 bytes read
....
.
...................
.........................
...................................................
......................................................................................................
............................................................................................................................................................................................................
....
....................................................................................................................................................................................................................................................................................................................................................................................................................
....
............................................................................................................................

9713936 bytes read
## Booting image at 00800000 ...
   Image Name:   Linux-5.2.9-kirkwood-tld-1
   Created:      2021-07-08   4:02:13 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4976261 Bytes =  4.7 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK
## Loading Ramdisk Image at 02100000 ...
   Image Name:   initramfs-5.2.9-kirkwood-tld-1
   Created:      2019-08-25   2:22:50 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    9713872 Bytes =  9.3 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK

Starting kernel ...

[    8.251688][    T1] printk: console [ttyS0] enabled
[    8.261472][    T1] printk: bootconsole [earlycon0] disabled
[    8.278724][    T1] loop: module loaded
[    8.283039][    T1] sata_mv f1080000.sata: slots 32 ports 2
[    8.290761][    T1] scsi host0: sata_mv
[    8.295060][    T1] scsi host1: sata_mv
[    8.299187][    T1] ata1: SATA max UDMA/133 irq 34
[    8.303999][    T1] ata2: SATA max UDMA/133 irq 34
[    8.310229][    T1] m25p80 spi0.0: mx25l8005 (1024 Kbytes)
[    8.315776][    T1] 3 fixed-partitions partitions found on MTD device spi0.0
[    8.322895][    T1] Creating 3 MTD partitions on "spi0.0":
[    8.328410][    T1] 0x000000000000-0x00000007e000 : "u-boot"
[    8.334109][    T1] mtd: partition "u-boot" doesn't end on an erase/write block -- force read-only
[    8.344159][    T1] 0x00000007e000-0x00000007f000 : "u-boot env2"
[    8.350315][    T1] mtd: partition "u-boot env2" doesn't start on an erase/write block boundary -- force read-only
[    8.361700][    T1] 0x00000007f000-0x000000080000 : "u-boot env"
[    8.367733][    T1] mtd: partition "u-boot env" doesn't start on an erase/write block boundary -- force read-only
[    8.379966][    T1] libphy: Fixed MDIO Bus: probed
[    8.385381][    T1] libphy: orion_mdio_bus: probed
[    8.401173][    T1] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
[    8.409141][    T1] mv643xx_eth_port mv643xx_eth_port.0: DMA mask not set
[    8.416828][    T1] mv643xx_eth_port mv643xx_eth_port.0 eth0: port 0 with MAC address 00:d0:b8:28:76:76
[    8.426429][    T1] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    8.433784][    T1] ehci-pci: EHCI PCI platform driver
[    8.439031][    T1] ehci-orion: EHCI orion driver
[    8.443896][    T1] orion-ehci f1050000.ehci: EHCI Host Controller
[    8.450172][    T1] orion-ehci f1050000.ehci: new USB bus registered, assigned bus number 1
[    8.458729][    T1] orion-ehci f1050000.ehci: irq 31, io mem 0xf1050000
[    8.488600][    T1] orion-ehci f1050000.ehci: USB 2.0 started, EHCI 1.00
[    8.495537][    T1] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.02
[    8.504557][    T1] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    8.512528][    T1] usb usb1: Product: EHCI Host Controller
[    8.518128][    T1] usb usb1: Manufacturer: Linux 5.2.9-kirkwood-tld-1 ehci_hcd
[    8.525484][    T1] usb usb1: SerialNumber: f1050000.ehci
[    8.531402][    T1] hub 1-0:1.0: USB hub found
[    8.535894][    T1] hub 1-0:1.0: 1 port detected
[    8.541116][    T1] usbcore: registered new interface driver usb-storage
[    8.548149][    T1] mousedev: PS/2 mouse device common for all mice
[    8.554949][    T1] rtc-mv f1010300.rtc: registered as rtc0
[    8.560716][    T1] i2c /dev entries driver
[    8.566094][    T1] device-mapper: uevent: version 1.0.3
[    8.571736][    T1] device-mapper: ioctl: 4.40.0-ioctl (2019-01-18) initialised: dm-devel@redhat.com
[    8.581257][    T1] device-mapper: multipath round-robin: version 1.2.0 loaded
[    8.588549][    T1] device-mapper: multipath queue-length: version 0.2.0 loaded
[    8.595939][    T1] device-mapper: multipath service-time: version 0.3.0 loaded
[    8.603374][    T1] device-mapper: dm-log-userspace: version 1.3.0 loaded
[    8.610230][    T1] device-mapper: raid: Loading target version 1.14.0
[    8.617901][    T1] hidraw: raw HID events driver (C) Jiri Kosina
[    8.624319][    T1] drop_monitor: Initializing network drop monitor service
[    8.631591][    T1] NET: Registered protocol family 17
[    8.636970][    T1] Key type dns_resolver registered
[    8.642731][    T1] registered taskstats version 1
[    8.647548][    T1] Loading compiled-in X.509 certificates
[    8.653240][    T1] zswap: loaded using pool lzo/zbud
[    8.728187][    T1] Key type big_key registered
[    8.764837][    T1] Key type encrypted registered
[    8.771356][    T1] rtc-mv f1010300.rtc: setting system clock to 2021-07-08T04:32:09 UTC (1625718729)
[    8.808608][  T112] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl F300)
[    8.818067][  T112] ata1.00: ATA-9: WDC WD20EZRX-00D8PB0, 80.00A80, max UDMA/133
[    8.825523][  T112] ata1.00: 3907029168 sectors, multi 0: LBA48 NCQ (depth 31/32)
[    8.835569][  T112] ata1.00: configured for UDMA/133
[    8.851069][    T7] scsi 0:0:0:0: Direct-Access     ATA      WDC WD20EZRX-00D 0A80 PQ: 0 ANSI: 5
[    8.860667][  T116] sd 0:0:0:0: [sda] 3907029168 512-byte logical blocks: (2.00 TB/1.82 TiB)
[    8.869548][  T116] sd 0:0:0:0: [sda] 4096-byte physical blocks
[    8.875589][  T116] sd 0:0:0:0: [sda] Write Protect is off
[    8.881242][  T116] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    8.908601][   T15] usb 1-1: new high-speed USB device number 2 using orion-ehci
[    8.971209][  T116]  sda: sda1 sda2
[    8.976073][  T116] sd 0:0:0:0: [sda] Attached SCSI disk
[    9.112484][   T15] usb 1-1: New USB device found, idVendor=13fe, idProduct=4100, bcdDevice= 1.00
[    9.121437][   T15] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    9.129350][   T15] usb 1-1: Product: USB DISK 2.0
[    9.134161][   T15] usb 1-1: Manufacturer:
[    9.139095][   T15] usb 1-1: SerialNumber: 070239F129000800
[    9.145387][   T15] usb-storage 1-1:1.0: USB Mass Storage device detected
[    9.152601][   T15] scsi host2: usb-storage 1-1:1.0
[    9.368609][  T114] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl F300)
[    9.378022][  T114] ata2.00: ATA-9: WDC WD20EZRX-00D8PB0, 80.00A80, max UDMA/133
[    9.385478][  T114] ata2.00: 3907029168 sectors, multi 0: LBA48 NCQ (depth 31/32)
[    9.395522][  T114] ata2.00: configured for UDMA/133
[    9.410920][   T23] scsi 1:0:0:0: Direct-Access     ATA      WDC WD20EZRX-00D 0A80 PQ: 0 ANSI: 5
[    9.420493][  T116] sd 1:0:0:0: [sdb] 3907029168 512-byte logical blocks: (2.00 TB/1.82 TiB)
[    9.429262][  T116] sd 1:0:0:0: [sdb] 4096-byte physical blocks
[    9.435272][  T116] sd 1:0:0:0: [sdb] Write Protect is off
[    9.440904][  T116] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    9.518117][  T116] GPT:Primary header thinks Alt. header is not at the end of the disk.
[    9.526273][  T116] GPT:3907029166 != 3907029167
[    9.530923][  T116] GPT:Alternate GPT header not at the end of the disk.
[    9.537650][  T116] GPT:3907029166 != 3907029167
[    9.542295][  T116] GPT: Use GNU Parted to correct GPT errors.
[    9.548210][  T116]  sdb: sdb1 sdb2
[    9.553039][  T116] sd 1:0:0:0: [sdb] Attached SCSI disk
[    9.561347][    T1] Freeing unused kernel memory: 1024K
[    9.578995][    T1] Checked W+X mappings: passed, no W+X pages found
[    9.585376][    T1] Run /init as init process
Loading, please wait...
Starting version 241
[   10.181087][  T116] scsi 2:0:0:0: Direct-Access              USB DISK 2.0          PQ: 0 ANSI: 4
[   10.202034][   T23] sd 2:0:0:0: [sdc] 15124992 512-byte logical blocks: (7.74 GB/7.21 GiB)
[   10.224037][   T23] sd 2:0:0:0: [sdc] Write Protect is off
[   10.235030][   T23] sd 2:0:0:0: [sdc] No Caching mode page found
[   10.247197][   T23] sd 2:0:0:0: [sdc] Assuming drive cache: write through
[   10.264741][   T23]  sdc: sdc1
[   10.273027][   T23] sd 2:0:0:0: [sdc] Attached SCSI removable disk
[   10.360625][  T170] usbcore: registered new interface driver uas
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/sdc1] fsck.ext3 -a -C0 /dev/sdc1
rootfs: recovering journal
rootfs: clean, 15075/473280 files, 201821/1890304 blocks
done.
[   22.523527][  T195] EXT4-fs (sdc1): mounting ext3 file system using the ext4 subsystem
[   22.585357][  T195] EXT4-fs (sdc1): mounted filesystem with ordered data mode. Opts: (null)
done.
Begin: Running /scripts/local-bottom ... done.
Begin: Running /scripts/init-bottom ... done.
run-init: can't execute '/bin/systemd': No such file or directory
Target filesystem doesn't have requested /bin/systemd.
INIT: version 2.93 booting
[info] Using makefile-style concurrent boot in runlevel S.
[ ok ] Starting hotplug events dispatcher: systemd-udevd.
[....] Synthesizing the initial hotplug events (subsystems)...[   24.608645][    C0] random: crng init done
done.
[ ok ] Synthesizing the initial hotplug events (devices)...done.
[....] Waiting for /dev to be fully populated...[   25.387321][  T389] input: gpio-keys as /devices/platform/gpio-keys/input/input0
[   25.414589][  T388] systemd-udevd[388]: Using default interface naming scheme 'v240'.
[   25.484638][  T388] systemd-udevd[388]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
[   25.746753][  T386] watchdog: f1020300.watchdog-timer: driver supplied timeout (4294967295) out of range
[   25.781345][  T376] adt7475 0-002e: hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().
[   25.819417][  T386] watchdog: f1020300.watchdog-timer: falling back to default timeout (21)
[   25.891955][  T376] adt7475 0-002e: ADT7473 device, revision 0
[   25.909096][  T386] orion_wdt: Initial timeout 21 sec
[   25.931878][  T376] adt7475 0-002e: Optional features: fan4 pwm2
[   26.006463][  T385] marvell-cesa f1030000.crypto: CESA device successfully registered
[   26.029104][  T389] sd 0:0:0:0: Attached scsi generic sg0 type 0
[   26.063246][  T389] sd 1:0:0:0: Attached scsi generic sg1 type 0
[   26.090360][  T389] sd 2:0:0:0: Attached scsi generic sg2 type 0
[   26.322039][  T376] systemd-udevd[376]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
done.
[ ok ] Setting hostname to 'debian'...done.
[ ok ] Activating swap:.
[   27.973285][  T596] EXT4-fs (sdc1): 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
[ ok ] 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.
[ ok .
[ ok ] Will now mount local filesystems:.
[ ok ] Will now activate swapfile swap:done.
[ ok ] Checking minimum space in /tmp...done.
[ ok ] 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/

Listening on LPF/eth0/00:d0:b8:28:76:76
Sending on   LPF/eth0/00:d0:b8:28:76:76
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 6
[   33.832185][    C0] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 19
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 19
DHCPOFFER of 10.0.0.100 from 10.0.0.31
DHCPREQUEST for 10.0.0.100 on eth0 to 255.255.255.255 port 67
DHCPACK of 10.0.0.100 from 10.0.0.31
bound to 10.0.0.100 -- renewal in 328190 seconds.
[   60.856984][ T1150] NET: Registered protocol family 10
[   60.863671][ T1150] Segment Routing with IPv6
done.
[ ok ] Starting RPC port mapper daemon: rpcbind.
[ ok ] Starting NFS common utilities: statd idmapd.
[ ok ] Cleaning up temporary files....
INIT: Entering runlevel: 2
[info] Using makefile-style concurrent boot in runlevel 2.
[....] Starting busybox' syslogd implementation : syslogdStarting /sbin/syslogd...
1344 (syslogd)
. ok
[....] Starting busybox' klogd implementation : klogdStarting /sbin/klogd...
1371 (klogd)
. ok
[ ok ] Starting system message bus: dbus.
[ ok ] Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon.
[ ok ] Starting NFS common utilities: statd idmapd.
[warn] Not starting NFS kernel daemon: no exports. ... (warning).
[ ok ] Starting NTP server: ntpd.
[ ok ] Starting OpenBSD Secure Shell server: sshd.
[ ok ] Running local boot scripts (/etc/rc.local).

Debian GNU/Linux 10 debian ttyS0

Thanks
Codier
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
July 08, 2021 04:00AM
Codier,

The command is basically the same. But this time you have a USB drive problem.

Marvell>> setenv usb_set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $(bootargs_mtd) earlyprintk=serial init=/bin/systemd'
Marvell>> setenv load_uimage 'ext2load usb 0:1 0x800000 /boot/uImage'
Marvell>> setenv load_uinitrd 'ext2load usb 0:1 0x2100000 /boot/uInitrd'
Marvell>> setenv usb_boot 'mw 0x800000 0 1; run load_uimage; run load_uinitrd; bootm 0x800000 0x2100000'
Marvell>> setenv usb_bootcmd 'run usb_set_bootargs; run usb_boot'
Marvell>> setenv bootcmd_debian 'usb start; run usb_bootcmd; usb stop; reset'
Marvell>> setenv bootcmd_stock 'ide reset; ide read 0x40000 0x800 0x1800; ide read 0x900000 0x2000 0x1800; setenv bootargs $(console) $(bootargs_root) $(bootargs_mtd) $(bootargs_end); bootm 0x40000 0x900000;run bootcmd2'
Marvell>> setenv bootcmd 'run bootcmd_debian; run bootcmd_stock'
Marvell>> boot
(Re)start USB...
USB:   scanning bus for devices... 2 USB Device(s) found
Waiting for storage device(s) to settle before scanning...
T Device NOT ready
   Request Sense returned 00 00 00
1 Storage Device(s) found

Shutdown, unplug the power, and then power up, try again.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
July 08, 2021 11:03AM
Strange. I use the same USB drive but with different set of variables. Maybe it's the coincidence.

I changed to a new USB and confirmed the new envs are working.

Should I regenerate the uInitrd boot file everytime if I see the following message?

update-initramfs: Generating /boot/initrd.img-5.2.9-kirkwood-tld-1

Thanks
Codier



Edited 1 time(s). Last edit at 07/08/2021 11:42AM by codier.
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
July 08, 2021 03:42PM
codier,

> Strange. I use the same USB drive but with
> different set of variables. Maybe it's the
> coincidence.
>
> I changed to a new USB and confirmed the new envs
> are working.

Sometime the stock u-boot is flaky in "spinning up" the drive. To make sure it works with a certain USB drive you would do a cold boot.

>
> Should I regenerate the uInitrd boot file
> everytime if I see the following message?
>
>
> update-initramfs: Generating
> /boot/initrd.img-5.2.9-kirkwood-tld-1
>

Yes, you should. Eventhough you should be able to boot with the old initrd, but it does not have the latest hooks for things that you've installed (that change causes the message to show up).

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
July 08, 2021 04:52PM
Hi Bodhi,

Got ya.

I found an problem in my ix2-ng as there is always an extra USB device being detected. I have no clue what is this extra USB device.

When I insert the Uboot USB there shows totally 2 USB devices. This way works for booting up the USB uboot. Below is the success boot log
Marvell>> setenv usb_set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $(bootargs_mtd) earlyprintk=serial init=/bin/systemd'
Marvell>> setenv load_uimage 'ext2load usb 0:1 0x800000 /boot/uImage'
Marvell>> setenv load_uinitrd 'ext2load usb 0:1 0x2100000 /boot/uInitrd'
Marvell>> setenv usb_boot 'mw 0x800000 0 1; run load_uimage; run load_uinitrd; bootm 0x800000 0x2100000'
Marvell>> setenv usb_bootcmd 'run usb_set_bootargs; run usb_boot'
Marvell>> setenv bootcmd_debian 'usb start; run usb_bootcmd; usb stop; reset'
Marvell>> setenv bootcmd_stock 'ide reset; ide read 0x40000 0x800 0x1800; ide read 0x900000 0x2000 0x1800; setenv bootargs $(console) $(bootargs_root) $(bootargs_mtd) $(bootargs_end); bootm 0x40000 0x900000;run bootcmd2'
Marvell>> setenv bootcmd 'run bootcmd_debian; run bootcmd_stock'
Marvell>> boot
(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
....
.
......
............
.........................
...................................................
......................................................................................................
............................................................................................................................................................................................................
....
.......................................................................

4976325 bytes read
....
.
......
............
.........................
...................................................
......................................................................................................
............................................................................................................................................................................................................
....
....................................................................................................................................................................................................................................................................................................................................................................................................................
....
....................................................................................................................................

9790511 bytes read
## Booting image at 00800000 ...
   Image Name:   Linux-5.2.9-kirkwood-tld-1
   Created:      2021-07-08  16:01:07 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4976261 Bytes =  4.7 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK
## Loading Ramdisk Image at 02100000 ...
   Image Name:   initramfs-5.2.9-kirkwood-tld-1
   Created:      2021-07-08  16:39:51 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    9790447 Bytes =  9.3 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK

Starting kernel ...

[    8.251677][    T1] printk: console [ttyS0] enabled
[    8.261454][    T1] printk: bootconsole [earlycon0] disabled
[    8.278693][    T1] loop: module loaded
[    8.283013][    T1] sata_mv f1080000.sata: slots 32 ports 2
[    8.290747][    T1] scsi host0: sata_mv
[    8.295044][    T1] scsi host1: sata_mv
[    8.299170][    T1] ata1: SATA max UDMA/133 irq 34
[    8.303985][    T1] ata2: SATA max UDMA/133 irq 34
[    8.310196][    T1] m25p80 spi0.0: mx25l8005 (1024 Kbytes)
[    8.315744][    T1] 3 fixed-partitions partitions found on MTD device spi0.0
[    8.322864][    T1] Creating 3 MTD partitions on "spi0.0":
[    8.328379][    T1] 0x000000000000-0x00000007e000 : "u-boot"
[    8.334076][    T1] mtd: partition "u-boot" doesn't end on an erase/write block -- force read-only
[    8.344127][    T1] 0x00000007e000-0x00000007f000 : "u-boot env2"
[    8.350289][    T1] mtd: partition "u-boot env2" doesn't start on an erase/write block boundary -- force read-only
[    8.361672][    T1] 0x00000007f000-0x000000080000 : "u-boot env"
[    8.367710][    T1] mtd: partition "u-boot env" doesn't start on an erase/write block boundary -- force read-only
[    8.379943][    T1] libphy: Fixed MDIO Bus: probed
[    8.385359][    T1] libphy: orion_mdio_bus: probed
[    8.401273][    T1] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
[    8.409231][    T1] mv643xx_eth_port mv643xx_eth_port.0: DMA mask not set
[    8.416929][    T1] mv643xx_eth_port mv643xx_eth_port.0 eth0: port 0 with MAC address 00:d0:b8:28:76:76
[    8.426528][    T1] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    8.433891][    T1] ehci-pci: EHCI PCI platform driver
[    8.439139][    T1] ehci-orion: EHCI orion driver
[    8.444004][    T1] orion-ehci f1050000.ehci: EHCI Host Controller
[    8.450277][    T1] orion-ehci f1050000.ehci: new USB bus registered, assigned bus number 1
[    8.458833][    T1] orion-ehci f1050000.ehci: irq 31, io mem 0xf1050000
[    8.488613][    T1] orion-ehci f1050000.ehci: USB 2.0 started, EHCI 1.00
[    8.495550][    T1] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.02
[    8.504576][    T1] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    8.512540][    T1] usb usb1: Product: EHCI Host Controller
[    8.518140][    T1] usb usb1: Manufacturer: Linux 5.2.9-kirkwood-tld-1 ehci_hcd
[    8.525496][    T1] usb usb1: SerialNumber: f1050000.ehci
[    8.531422][    T1] hub 1-0:1.0: USB hub found
[    8.535912][    T1] hub 1-0:1.0: 1 port detected
[    8.541135][    T1] usbcore: registered new interface driver usb-storage
[    8.548163][    T1] mousedev: PS/2 mouse device common for all mice
[    8.554957][    T1] rtc-mv f1010300.rtc: registered as rtc0
[    8.560720][    T1] i2c /dev entries driver
[    8.566110][    T1] device-mapper: uevent: version 1.0.3
[    8.571759][    T1] device-mapper: ioctl: 4.40.0-ioctl (2019-01-18) initialised: dm-devel@redhat.com
[    8.581279][    T1] device-mapper: multipath round-robin: version 1.2.0 loaded
[    8.588570][    T1] device-mapper: multipath queue-length: version 0.2.0 loaded
[    8.595960][    T1] device-mapper: multipath service-time: version 0.3.0 loaded
[    8.603396][    T1] device-mapper: dm-log-userspace: version 1.3.0 loaded
[    8.610249][    T1] device-mapper: raid: Loading target version 1.14.0
[    8.617934][    T1] hidraw: raw HID events driver (C) Jiri Kosina
[    8.624359][    T1] drop_monitor: Initializing network drop monitor service
[    8.631625][    T1] NET: Registered protocol family 17
[    8.636998][    T1] Key type dns_resolver registered
[    8.642768][    T1] registered taskstats version 1
[    8.647577][    T1] Loading compiled-in X.509 certificates
[    8.653264][    T1] zswap: loaded using pool lzo/zbud
[    8.728318][    T1] Key type big_key registered
[    8.765100][    T1] Key type encrypted registered
[    8.771620][    T1] rtc-mv f1010300.rtc: setting system clock to 2021-07-08T18:29:42 UTC (1625768982)
[    8.808619][  T112] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl F300)
[    8.818074][  T112] ata1.00: ATA-9: WDC WD20EZRX-00D8PB0, 80.00A80, max UDMA/133
[    8.825526][  T112] ata1.00: 3907029168 sectors, multi 0: LBA48 NCQ (depth 31/32)
[    8.835587][  T112] ata1.00: configured for UDMA/133
[    8.851088][    T7] scsi 0:0:0:0: Direct-Access     ATA      WDC WD20EZRX-00D 0A80 PQ: 0 ANSI: 5
[    8.860691][  T116] sd 0:0:0:0: [sda] 3907029168 512-byte logical blocks: (2.00 TB/1.82 TiB)
[    8.869578][  T116] sd 0:0:0:0: [sda] 4096-byte physical blocks
[    8.875621][  T116] sd 0:0:0:0: [sda] Write Protect is off
[    8.881282][  T116] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    8.908612][   T15] usb 1-1: new high-speed USB device number 2 using orion-ehci
[    8.970819][  T116]  sda: sda1 sda2
[    8.975661][  T116] sd 0:0:0:0: [sda] Attached SCSI disk
[    9.110839][   T15] usb 1-1: New USB device found, idVendor=0930, idProduct=6544, bcdDevice= 1.00
[    9.119791][   T15] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    9.127692][   T15] usb 1-1: Product: DataTraveler SE9
[    9.132885][   T15] usb 1-1: Manufacturer: Kingston
[    9.137783][   T15] usb 1-1: SerialNumber: F46D04613D6BCCA029202460
[    9.144744][   T15] usb-storage 1-1:1.0: USB Mass Storage device detected
[    9.151953][   T15] scsi host2: usb-storage 1-1:1.0
[    9.368619][  T114] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl F300)
[    9.378034][  T114] ata2.00: ATA-9: WDC WD20EZRX-00D8PB0, 80.00A80, max UDMA/133
[    9.385488][  T114] ata2.00: 3907029168 sectors, multi 0: LBA48 NCQ (depth 31/32)
[    9.395533][  T114] ata2.00: configured for UDMA/133
[    9.410931][   T23] scsi 1:0:0:0: Direct-Access     ATA      WDC WD20EZRX-00D 0A80 PQ: 0 ANSI: 5
[    9.420516][  T116] sd 1:0:0:0: [sdb] 3907029168 512-byte logical blocks: (2.00 TB/1.82 TiB)
[    9.429290][  T116] sd 1:0:0:0: [sdb] 4096-byte physical blocks
[    9.435301][  T116] sd 1:0:0:0: [sdb] Write Protect is off
[    9.440931][  T116] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    9.513392][  T116] GPT:Primary header thinks Alt. header is not at the end of the disk.
[    9.521547][  T116] GPT:3907029166 != 3907029167
[    9.526185][  T116] GPT:Alternate GPT header not at the end of the disk.
[    9.532927][  T116] GPT:3907029166 != 3907029167
[    9.537565][  T116] GPT: Use GNU Parted to correct GPT errors.
[    9.543491][  T116]  sdb: sdb1 sdb2
[    9.548296][  T116] sd 1:0:0:0: [sdb] Attached SCSI disk
[    9.556621][    T1] Freeing unused kernel memory: 1024K
[    9.569011][    T1] Checked W+X mappings: passed, no W+X pages found
[    9.575394][    T1] Run /init as init process
Loading, please wait...
Starting version 241
[   10.127728][  T166] input: gpio-keys as /devices/platform/gpio-keys/input/input0
[   10.196443][  T116] scsi 2:0:0:0: Direct-Access     Kingston DataTraveler SE9 1.00 PQ: 0 ANSI: 4
[   10.215014][   T23] sd 2:0:0:0: [sdc] 15148608 512-byte logical blocks: (7.76 GB/7.22 GiB)
[   10.231764][   T23] sd 2:0:0:0: [sdc] Write Protect is off
[   10.243413][   T23] sd 2:0:0:0: [sdc] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[   10.267592][   T23]  sdc: sdc1
[   10.275630][   T23] sd 2:0:0:0: [sdc] Attached SCSI removable disk
[   10.328238][  T166] usbcore: registered new interface driver uas
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/sdc1] fsck.ext3 -a -C0 /dev/sdc1
rootfs: clean, 15968/473280 files, 284784/1893120 blocks
done.
[   21.148411][  T197] EXT4-fs (sdc1): mounting ext3 file system using the ext4 subsystem
[   21.319594][  T197] EXT4-fs (sdc1): mounted filesystem with ordered data mode. Opts: (null)
done.
Begin: Running /scripts/local-bottom ... done.
Begin: Running /scripts/init-bottom ... done.
[   22.554821][    T1] systemd[1]: Inserted module 'autofs4'
[   22.611728][    T1] NET: Registered protocol family 10
[   22.617867][    T1] Segment Routing with IPv6
[   22.661791][    T1] systemd[1]: systemd 241 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTM                                                                              P +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid)
[   22.687631][    T1] systemd[1]: Detected architecture arm.

Welcome to Debian GNU/Linux 10 (buster)!

[   22.729954][    T1] systemd[1]: Set hostname to <debian>.
[   23.799804][    T1] systemd[1]: File /lib/systemd/system/systemd-journald.service:12 configures an IP firewall (IPAddressDeny=                                                                              any), but the local system does not support BPF/cgroup based firewalling.
[   23.817741][    T1] systemd[1]: Proceeding WITHOUT firewalling in effect! (This warning is only shown for the first loaded uni                                                                              t using IP firewalling.)
[   23.837396][    C0] random: crng init done
[   24.268232][    T1] systemd[1]: /lib/systemd/system/rpc-statd.service:13: PIDFile= references path below legacy directory /var                                                                              /run/, updating /var/run/rpc.statd.pid → /run/rpc.statd.pid; please update the unit file accordingly.
[   24.373784][    T1] systemd[1]: Listening on Journal Audit Socket.
[  OK  ] Listening on Journal Audit Socket.
[   24.409457][    T1] systemd[1]: Listening on Journal Socket.
[  OK  ] Listening on Journal Socket.
[   24.448869][    T1] systemd[1]: Condition check resulted in Kernel Module supporting RPCSEC_GSS being skipped.
[   24.463613][    T1] systemd[1]: Mounting RPC Pipe File System...
         Mounting RPC Pipe File System...
[  OK  ] Created slice system-serial\x2dgetty.slice.
[  OK  ] Listening on initctl Compatibility Named Pipe.
[  OK  ] Created slice User and Session Slice.
[  OK  ] Reached target Slices.
         Mounting NFSD configuration filesystem...
[  OK  ] Reached target System Time Synchronized.
         Mounting Kernel Debug File System...
         Mounting POSIX Message Queue File System...
         Starting Load Kernel Modules...
[  OK  ] Listening on udev Control Socket.
[  OK  ] Created slice system-getty.slice.
[  OK  ] Reached target Swap.
[  OK  ] Set up automount Arbitrary…s File System Automount Point.
[  OK  ] Listening on udev Kernel Socket.
[  OK  ] Listening on Journal Socket (/dev/log).
         Starting Create list of re…odes for the current kernel...
[  OK  ] Started Forward Password R…uests to Wall Directory Watch.
[  OK  ] Listening on fsck to fsckd communication Socket.
         Starting Remount Root and Kernel File Systems...
         Starting Journal Service...
[  OK  ] Listening on RPCbind Server Activation Socket.
         Starting udev Coldplug all Devices...
[  OK  ] Started Dispatch Password …ts to Console Directory Watch.
[  OK  ] Reached target Paths.
[  OK     25.219780][  T233] EXT4-fs (sdc1): re-mounted. Opts: errors=remount-ro
m] Reached target Local Encrypted Volumes.
[  OK  ] Mounted RPC Pipe File System.
[  OK  ] Mounted NFSD configuration filesystem.
[  OK  ] Mounted Kernel Debug File System.
[  OK  ] Mounted POSIX Message Queue File System.
[  OK  ] Started Load Kernel Modules.
[  OK  ] Started Create list of req… nodes for the current kernel.
[  OK  ] Started Remount Root and Kernel File Systems.
[  OK  ] Started Journal Service.
         Starting Load/Save Random Seed...
         Starting Create System Users...
         Starting Flush Journal to Persistent Storage...
         Starting Apply Kernel Variables...
         Mounting FUSE Control File System...
         Starting pNFS block layout mapping daemon...
[  OK  ] Mounted FUSE Control File System.
[  OK  ] Started pNFS block layout mapping daemon.
[  OK  ] Started Load/Save Random Seed.
[  OK  ] Started Apply Kernel Variables.
[   26.070536][  T231] systemd-journald[231]: Received request to flush runtime journal from PID 1
[  OK  ] Started udev Coldplug all Devices.
         Starting Helper to synchronize boot up for ifupdown...
[  OK  ] Started Flush Journal to Persistent Storage.
[  OK  ] Started Create System Users.
         Starting Create Static Device Nodes in /dev...
[  OK  ] Started Create Static Device Nodes in /dev.
[  OK  ] Reached target Local File Systems (Pre).
         Mounting /tmp...
         Starting udev Kernel Device Manager...
[  OK  ] Mounted /tmp.
[  OK  ] Reached target Local File Systems.
         Starting Create Volatile Files and Directories...
         Starting Preprocess NFS configuration...
[  OK  ] Started udev Kernel Device Manager.
[  OK  ] Started Preprocess NFS configuration.
[  OK  ] Reached target NFS client services.
         Starting NFSv4 ID-name mapping service...
[  OK  ] Started NFSv4 ID-name mapping service.
[  OK  ] Started Create Volatile Files and Directories.
         Starting Update UTMP about System Boot/Shutdown...
         Starting RPC bind portmap service...
[  OK  ] Started RPC bind portmap service.
[  OK  ] Reached target RPC Port Mapper.
[  OK  ] Started Update UTMP about System Boot/Shutdown.
[  OK  ] Reached target System Initialization.
[  OK  ] Listening on Avahi mDNS/DNS-SD Stack Activation Socket.
[  OK  ] Started Daily man-db regeneration.
[  OK  ] Started Daily Cleanup of Temporary Directories.
[  OK  ] Started Daily apt download activities.
[  OK  ] Started Daily apt upgrade and clean activities.
[  OK  ] Reached target Timers.
[  OK  ] Listening on D-Bus System Message Bus Socket.
[  OK  ] Reached target Sockets.
[  OK  ] Reached target Basic System.
         Starting Avahi mDNS/DNS-SD Stack...
         Starting Login Service...
[  OK  ] Started D-Bus System Message Bus.
[   28.934331][  T264] watchdog: f1020300.watchdog-timer: driver supplied timeout (4294967295) out of range
[   29.052094][  T262] adt7475 0-002e: hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_regis                                                                              ter_with_info().
[   29.360033][  T264] watchdog: f1020300.watchdog-timer: falling back to default timeout (21)
[   29.409921][  T261] sd 0:0:0:0: Attached scsi generic sg0 type 0
[   29.434717][  T250] marvell-cesa f1030000.crypto: CESA device successfully registered
[   29.498802][  T262] adt7475 0-002e: ADT7473 device, revision 0
[   29.504671][  T262] adt7475 0-002e: Optional features: fan4 pwm2
[  OK  ] Found device /dev/ttyS0.
[   29.553305][  T264] orion_wdt: Initial timeout 21 sec
[  OK  ] Started    29.575452][  T261] sd 1:0:0:0: Attached scsi generic sg1 type 0
;39mLogin Service.
[  OK  ] Started Avahi mDNS/DNS-SD Stack.
[   29.682687][  T261] sd 2:0:0:0: Attached scsi generic sg2 type 0
[  OK  ] Started Helper to synchronize boot up for ifupdown.
         Starting Raise network interfaces...
[   34.533565][    C0] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled
[   34.544187][   T15] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[  OK  ] Started Raise network interfaces.
[  OK  ] Reached target Network.
         Starting /etc/rc.local Compatibility...
         Starting Network Time Service...
         Starting NFS Mount Daemon...
         Starting OpenBSD Secure Shell server...
[  OK  ] Started /etc/rc.local Compatibility.
[  OK  ] Started Network Time Service.
[  OK  ] Started OpenBSD Secure Shell server.
[  OK  ] Started NFS Mount Daemon.
         Starting NFS server and services...
[   44.600628][  T389] NFSD: Using UMH upcall client tracking operations.
[   44.607224][  T389] NFSD: starting 90-second grace period (net f000001c)
[  OK  ] Started NFS server and services.
[  OK  ] Reached target Remote File Systems (Pre).
[  OK  ] Reached target Remote File Systems.
         Starting Permit User Sessions...
         Starting LSB: Starts syslogd...
[  OK  ] Started Permit User Sessions.
[  OK  ] Started Serial Getty on ttyS0.
[  OK  ] Started Getty on tty1.
[  OK  ] Reached target Login Prompts.
[  OK  ] Started LSB: Starts syslogd.
         Starting LSB: Starts klogd...
[  OK  ] Started LSB: Starts klogd.
[  OK  ] Reached target Multi-User System.
[  OK  ] Reached target Graphical Interface.
         Starting Update UTMP about System Runlevel Changes...
[  OK  ] Started Update UTMP about System Runlevel Changes.

Debian GNU/Linux 10 debian ttyS0

When I unplug the USB drive(to test the if it could boot into the stock OS) then it still detects one USB. This way it doesn't boot into the stock uboot so I am wonder if I save the envs it will cause an endless loop. Below is the boot log. Is there a solution to solve it?

Marvell>> setenv usb_set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $(bootargs_mtd) earlyprintk=serial init=/bin/systemd'
Marvell>> setenv load_uimage 'ext2load usb 0:1 0x800000 /boot/uImage'
Marvell>> setenv load_uinitrd 'ext2load usb 0:1 0x2100000 /boot/uInitrd'
Marvell>>
Marvell>> setenv usb_boot 'mw 0x800000 0 1; run load_uimage; run load_uinitrd; bootm 0x800000 0x2100000'
Marvell>> setenv usb_bootcmd 'run usb_set_bootargs; run usb_boot'
Marvell>> setenv bootcmd_debian 'usb start; run usb_bootcmd; usb stop; reset'
Marvell>> setenv bootcmd_stock 'ide reset; ide read 0x40000 0x800 0x1800; ide read 0x900000 0x2000 0x1800; setenv bootargs $(console) $(bootargs_root) $(bootargs_mtd) $(bootargs_end); bootm 0x40000 0x900000;run bootcmd2'
Marvell>> setenv bootcmd 'run bootcmd_debian; run bootcmd_stock'
Marvell>> boot
(Re)start USB...
USB:   scanning bus for devices... 1 USB Device(s) found
Waiting for storage device(s) to settle before scanning...
0 Storage Device(s) found
** Bad partition 1 **
** Bad partition 1 **
## Booting image at 00800000 ...
Bad Magic Number
stopping USB..

         __  __                      _ _
        |  \/  | __ _ _ ____   _____| | |
        | |\/| |/ _` | '__\ \ / / _ \ | |
        | |  | | (_| | |   \ V /  __/ | |
        |_|  |_|\__,_|_|    \_/ \___|_|_|
 _   _     ____              _
| | | |   | __ )  ___   ___ | |_
| | | |___|  _ \ / _ \ / _ \| __|
| |_| |___| |_) | (_) | (_) | |_
 \___/    |____/ \___/ \___/ \__|  ** ix2-spi ** ** uboot_ver:0.0.8 **

 ** MARVELL BOARD: DB-88F6282A-BP LE

U-Boot 1.1.4 (Oct 28 2011 - 15:18:22) Marvell version: 3.6.1 - EMC

U-Boot code: 00600000 -> 0067FFF0  BSS: -> 006CD5A0

Soc: 88F6282 A1 CPU running @ 1600Mhz L2 running @ 533Mhz
SysClock = 533Mhz , TClock = 200Mhz

DRAM (DDR3) CAS Latency = 7 tRP = 7 tRAS = 20 tRCD=7
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
Found ADT7473, program PWM1 ... OK
[1024kB@f8000000] Flash:  1 MB

Thanks
Codier



Edited 1 time(s). Last edit at 07/08/2021 04:54PM by codier.
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
July 08, 2021 05:35PM
Codier,

The 2nd USB drive you saw was the USB hub. It's always there as a device. But not a storage device. So it was perfectly OK to see several errors before the reset.

But we need to change the logic a little bit. I'll come back later and post the fix for that.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
July 08, 2021 10:22PM
Codier,


OK, so we change 2 envs below. Move the reset from bootcmd_debian to bootcmd. And also add outputs to make it clear when each booting sequence starts.

Marvell>> setenv usb_set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $(bootargs_mtd) earlyprintk=serial init=/bin/systemd'
Marvell>> setenv load_uimage 'ext2load usb 0:1 0x800000 /boot/uImage'
Marvell>> setenv load_uinitrd 'ext2load usb 0:1 0x2100000 /boot/uInitrd'
Marvell>> setenv usb_boot 'mw 0x800000 0 1; run load_uimage; run load_uinitrd; bootm 0x800000 0x2100000'
Marvell>> setenv usb_bootcmd 'run usb_set_bootargs; run usb_boot'

setenv bootcmd_debian 'usb start; run usb_bootcmd; usb stop'

Marvell>> setenv bootcmd_stock 'ide reset; ide read 0x40000 0x800 0x1800; ide read 0x900000 0x2000 0x1800; setenv bootargs $(console) $(bootargs_root) $(bootargs_mtd) $(bootargs_end); bootm 0x40000 0x900000;run bootcmd2'

setenv bootcmd 'echo Booting Debian...; run bootcmd_debian; echo Booting Stock...; run bootcmd_stock; reset'

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
July 10, 2021 07:40PM
Thanks Bodhi, everything is working great.
Just want to confirm if I saved those envs as long as I serial cable connection then I could rescue it anytime if those envs messed up.

Codier
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
July 10, 2021 10:26PM
Codier,

The only way to be safe is:

- Try UART booting (Where you load the u-boot image over serial connection). You can dump the mtd0 on this box to a file, and then use kwboot to connect and load it, execute it. This will be a good excercise.

- If UART booting does not work, then be very careful when you change envs. The current envs settings like we did to boot Debian on USB are quite safe.

Any more changes in envs must be reviewed thoroughly before you commit the changes with saveenv. Because there are some u-boot commands (if use wrong value) could cause the box to stop before the countdown. And then UART booting is needed to recover.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
July 11, 2021 01:49AM
Example of UART booting with kwboot:

https://forum.doozan.com/read.php?3,51739,51919#msg-51919

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
July 21, 2021 08:01PM
Hi bodhi,

Thanks for the information. I have no knowledge for UART booting so I think I will just stick with the current env. I will wait for your next kernel, finalize the env and then save it after then.

Codier
Author:

Your Email:


Subject:


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