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
August 23, 2021 11:36PM
Hi bodhi,

I've changed it but I don't know if this is what supposed to see but it seems different than what we modified on console end.

root@omv:~# cat /etc/fw_env.config
# MTD device name       Device offset   Env. size       Flash sector size       Number of sectors
/dev/mtd1 0x0 0x1000 0x1000
/dev/mtd2 0x0 0x1000 0x1000
root@omv:~# 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

Thanks
codier
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
August 23, 2021 11:45PM
codier,

Cool! it is working.

What you did in serial console with several setenvs were temporary.

This listing should be the same as what you have before doing setenvs in serial console. You should compare the 2 lists to verify.

So at this point, what you want to do is to backup all mtds to files before doing anything further.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
August 24, 2021 10:39AM
Hi bodhi,

Great. Thanks for all your help. by the way, could you show me how to backup mtds? And should I saveenv before or after the backup?

codier
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
August 24, 2021 04:57PM
codier,

Your mtds are:

root@omv:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 0007e000 00001000 "u-boot"
mtd1: 00001000 00001000 "env"
mtd2: 00001000 00001000 "env2"

Back up with dd (SPI flash must use dd).

Save the current envs, just in case (use whatever file name you chose for omv-ix2-ng-stock-envs.text):
cd /boot
fw_printenv > omv-ix2-ng-stock-envs.text

Back up all mtds:

dd if=/dev/mtd0 of=mtd0.ix-2-ng  bs=504k conv=sync
dd if=/dev/mtd1 of=mtd1.ix-2-ng  bs=4k conv=sync
dd if=/dev/mtd2 of=mtd2.ix-2-ng  bs=4k conv=sync

And then you should boot back to serial console, save the stock bootcmd

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'

Change the mtdparts to different name this time to keep the old one for stock.

setenv bootargs_mtd_debian '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_debian) earlyprintk=serial init=/bin/systemd'

The rest are the same as before:

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'
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 'echo Booting Debian...; run bootcmd_debian; echo Booting Stock...; run bootcmd_stock; reset'

Now try booting again to make sure you did not have any typos in envs.

boot

After logged in to Debian, do a reboot and come back to serial console.

Enter all envs as before, save them and then boot

saveenv
boot

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
August 24, 2021 09:34PM
Hi bodhi,

I tried the new envs and it worked great for USB debian but didn't work for stock.

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 bootargs_mtd_debian 'mtdparts=spi0.0:0x7e000@0(u-boot),0x1000@0x7f000(env),0x1000@0x7e000(env2)'
Marvell>> setenv usb_set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $(bootargs_mtd_debian) 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'
Marvell>> setenv bootcmd 'echo Booting Debian...; run bootcmd_debian; echo Booting Stock...; run bootcmd_stock; reset'
Marvell>> boot
Booting Debian...
(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..
Booting Stock...

Reset IDE:
Marvell Serial ATA Adapter
Integrated Sata device found
[0 0 0]: Enable DMA mode (6)
  Device 0 @ 0 0:
Model: WDC WD20EZRX-00D8PB0                    
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 1907729.0 MB = 1863.0 GB (-387938128 x 512)
[0 1 0]: Enable DMA mode (6)
  Device 1 @ 0 1:
Model: WDC WD20EZRX-00D8PB0                   
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 1907729.0 MB = 1863.0 GB (-387938128 x 512)


IDE read: device 0 block # 2048, count 6144 ... 6144 blocks read: OK

IDE read: device 0 block # 8192, count 6144 ... 6144 blocks read: OK
## Booting image at 00040000 ...
Bad Magic Number

IDE device 1: Model: WDC WD20EZRX-00D8PB0                    
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 1907729.0 MB = 1863.0 GB (-387938128 x 512)
... is now current device

IDE read: device 1 block # 2048, count 6144 ... 6144 blocks read: OK

IDE read: device 1 block # 8192, count 6144 ... 6144 blocks read: OK
## Booting image at 00040000 ...
Bad Magic Number

Thanks
codier
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
August 24, 2021 09:42PM
Hi bodhi,

Ah.. nvm. I think it's because I formatted both hard drives in OMV. Since stock U-boot was saved from the hard disk so it won't boot from stock anymore.
Do you have any idea that if I can use the 1MB flash as the stock u-boot?

Thanks
codier



Edited 1 time(s). Last edit at 08/24/2021 09:44PM by codier.
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
August 24, 2021 10:44PM
codier,

> Ah.. nvm. I think it's because I formatted both
> hard drives in OMV. Since stock U-boot was saved
> from the hard disk so it won't boot from stock
> anymore.

Not that reason, u-boot is not stored on HDD, it is stored in SPI flash.

Did you try: Power up, interrupt serial console and

run bootcmd_stock

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
August 25, 2021 07:39AM
Hi bodhi,

It didn't work. Just want to clearify something first.

From your post

"And then you should boot back to serial console, save the stock bootcmd"

do you mean?
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'
saveenv

Thanks
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
August 25, 2021 04:30PM
codier,

> From your post
>
> "And then you should boot back to serial console,
> save the stock bootcmd"
>
> do you mean?
>
> 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'
> saveenv
>
>

I meant setting the boocmd_stock permanently as same as other new envs. So later you can set it up to boot sock OS as a fall back if there is a problem with the USB drive.

After you save the envs, get a listing in serial console, and compare with the list of envs in Debian. And if they look OK, try setting some envs in Debian to test.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
August 25, 2021 07:47PM
Hi bodhi,

Got it.

Since there is an issue to boot into stock so I will not saveenv to save it permanently for now.

I tried to power off and start it by follow your instruction and it still didn't work
I tested without setting any new envs so I run bootcmd instead of bootcmd_stock since they are the same.
We test it before and it was able to boot into stock.

         __  __                      _ _
        |  \/  | __ _ _ ____   _____| | |
        | |\/| |/ _` | '__\ \ / / _ \ | |
        | |  | | (_| | |   \ 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

Marvell Serial ATA Adapter
Integrated Sata device found
[0 0 0]: Enable DMA mode (6)
  Device 0 @ 0 0:
Model: WDC WD20EZRX-00D8PB0                    
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 1907729.0 MB = 1863.0 GB (-387938128 x 512)
[0 1 0]: Enable DMA mode (6)
  Device 1 @ 0 1:
Model: WDC WD20EZRX-00D8PB0                     
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 1907729.0 MB = 1863.0 GB (-387938128 x 512)


CPU : Marvell Feroceon (Rev 1)

Streaming disabled
Write allocate disabled


USB 0: host mode
PEX 0: interface detected no Link.
PEX 1: interface detected no Link.
Net:   egiga0 [PRIME]
Hit any key to stop autoboot:  0

Reset IDE:
Marvell Serial ATA Adapter
Integrated Sata device found
[0 0 0]: Enable DMA mode (6)
  Device 0 @ 0 0:
Model: WDC WD20EZRX-00D8PB0                     
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 1907729.0 MB = 1863.0 GB (-387938128 x 512)
[0 1 0]: Enable DMA mode (6)
  Device 1 @ 0 1:
Model: WDC WD20EZRX-00D8PB0                     
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 1907729.0 MB = 1863.0 GB (-387938128 x 512)


IDE read: device 0 block # 2048, count 6144 ... 6144 blocks read: OK

IDE read: device 0 block # 8192, count 6144 ... 6144 blocks read: OK
## Booting image at 00040000 ...
Bad Magic Number

IDE device 1: Model: WDC WD20EZRX-00D8PB0                    
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 1907729.0 MB = 1863.0 GB (-387938128 x 512)
... is now current device

IDE read: device 1 block # 2048, count 6144 ... 6144 blocks read: OK

IDE read: device 1 block # 8192, count 6144 ... 6144 blocks read: OK
## Booting image at 00040000 ...
Bad Magic Number
Marvell>> 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;
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
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
bootargs=console=ttyS0,115200 root=/dev/ram0 mtdparts=spi_flash:0x7e000@0(u-boot),0x1000@0x7f000(env),0x1000@0x7e000(env2) :::DB88FXX81:eth0:none

Environment size: 2147/4091 bytes
Marvell>> run bootcmd

Reset IDE:
Marvell Serial ATA Adapter
Integrated Sata device found
[0 0 0]: Enable DMA mode (6)
  Device 0 @ 0 0:
Model: WDC WD20EZRX-00D8PB0                    
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 1907729.0 MB = 1863.0 GB (-387938128 x 512)
[0 1 0]: Enable DMA mode (6)
  Device 1 @ 0 1:
Model: WDC WD20EZRX-00D8PB0                     
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 1907729.0 MB = 1863.0 GB (-387938128 x 512)


IDE read: device 0 block # 2048, count 6144 ... 6144 blocks read: OK

IDE read: device 0 block # 8192, count 6144 ... 6144 blocks read: OK
## Booting image at 00040000 ...
Bad Magic Number

IDE device 1: Model: WDC WD20EZRX-00D8PB0                    
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 1907729.0 MB = 1863.0 GB (-387938128 x 512)
... is now current device

IDE read: device 1 block # 2048, count 6144 ... 6144 blocks read: OK

IDE read: device 1 block # 8192, count 6144 ... 6144 blocks read: OK
## Booting image at 00040000 ...
Bad Magic Number
Marvell>>

Thanks
codier
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
August 26, 2021 04:32PM
codier,

> Since there is an issue to boot into stock so I
> will not saveenv to save it permanently for now.

You have serial console, so it is OK to save the envs to boot to Debian permanently. Worry about booting to stock later.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Lenovo ix2-ng to put Debian Stretch and OMV4
September 01, 2021 10:21PM
Hi bodhi,

I saved envs. It's been running few days and it's stable. Thanks again for all your help.

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: