Welcome! Log In Create A New Profile

Advanced

HOWTO: Lenovo ix2-dl / Stock U-Boot, boot current kernel, access printenv from Debian, load kernel from GPT ide drive

Posted by jdwl101 
Re: Lenovo ix2-dl, boot new kernel and write and boot from flash
October 22, 2018 04:31AM
J,

I've added Eine's post to the Wiki

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

Quote

Booting Debian on Pogoplug

How to set up U-Boot for booting in multiple drives configuration
Backup and Restore NAND mtds
UART Booting HowTo for Selected Kirkwood Devices
Migrating from Arch to Debian?
How to boot new Debian rootfs using stock u-boot tftp - Pogo E02
How to boot new Debian rootfs on USB using stock u-boot - NSA325
Booting Debian rootfs on a GPT HDD with stock u-boot (with kernel files stored in HDD raw sector)

If you could clean up your post a bit to make clear what you did, I'd like to add that as a 2nd tutorial on the same topic. Thanks!

-bodhi
===========================
Forum Wiki
bodhi's corner
Below sets out how I was able to 1) configure an IX2-DL to boot from a USB Debian rootfs, with u-boot env access and then 2) from the internal GPT partitioned sata drives. Without needing to update the u-boot to something more modern and functional.

Note: you cannot go back to Stock after making these changes as the IX2’s stock partitions will be deleted. You could try making stock co-exist, I have no interest in booting stock again.

I used a serial console throughout, theoretically these steps could be completed using fw_setenv from ssh, but I'd recommend having a TTL cable available for if anything fails.

Start with USB booting to get Debian running (Bodhi’s 4.12 rootfs);
setenv load_initrd 'ext2load usb 0:1 0x2100000 /boot/uInitrd'
setenv load_uimage 'ext2load usb 0:1 0x800000 /boot/uImage'
setenv usb_boot 'usb start; run load_uimage; run load_initrd; bootm 0x800000 0x2100000'
setenv bootargs 'console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:0x80000@0(uboot),0x20000@0xa0000(env),0x20000@0xc0000(env2),0x300000@0x100000(uImage),0x400000@0x400000(initrd),0x3f800000@0x800000(boot),1024m@0x0(flash)  earlyprintk=serial'

Optional, use ar-lex’s DTS and DTB, specific to the IX2-DL (only)
IX2-DL custom DTB

This will give you a system booting Debian from USB, with USB rootfs;
** MARVELL BOARD: DB-88F6282A-BP LE

U-Boot 1.1.4 (Oct 28 2011 - 15:19:29) Marvell version: 3.6.1 - EMC

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

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
NAND:1024 MB
Found ADT7473, program PWM1 ... OK
Flash:  0 kB

Marvell Serial ATA Adapter
Integrated Sata device found
[0 0 0]: Enable DMA mode (6)
  Device 0 @ 0 0:
Model: ST2000DM001-1CH164                       Firm: CC26     Ser#:             Z2F0PEJZ
            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: ST1000DM003-9YN162                       Firm: CC9D     Ser#:             Z1D0F6TF
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512)


CPU : Marvell Feroceon (Rev 1)
Found kernel at 0x100000
Found initrd at 0x400000

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
Marvell>> setenv load_initrd 'ext2load usb 0:1 0x2100000 /boot/uInitrd.4.12'
Marvell>> setenv load_uimage 'ext2load usb 0:1 0x800000 /boot/uImage.4.12'
Marvell>> setenv usb_boot 'usb start; run load_uimage; run load_initrd; bootm 0x800000 0x2100000'
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
....
.................................................................................................................................................................................................................................................................................................................................................................................

3834683 bytes read
....
..............................................................................................................................................................
.
.......................................................................................................................................................................................................................................................
.........................................................................................................................................................................................................................................................................................................................................................................................................

8268888 bytes read
## Booting image at 00800000 ...
   Image Name:   Linux-4.12.1-kirkwood-tld-1
   Created:      2018-10-20   0:48:49 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3834619 Bytes =  3.7 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK
## Loading Ramdisk Image at 02100000 ...
   Image Name:   initramfs-4.12.1-kirkwood-tld-1
   Created:      2018-10-20   0:49:12 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    8268824 Bytes =  7.9 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK

Starting kernel ...
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.18.4-kirkwood-tld-1 (root@tldDebian) (gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)) #1 PREEMPT Fri Aug 24 22:13:40 PDT 2018
[    0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] OF: fdt: Machine model: Lenovo IX2-ng

With populated MTD devices;
[    6.572050] Creating 6 MTD partitions on "orion_nand":
[    6.577335] 0x000000000000-0x000000080000 : "uboot"
[    6.583012] 0x0000000a0000-0x0000000c0000 : "env"
[    6.588430] 0x0000000c0000-0x0000000e0000 : "env2"
[    6.593955] 0x000000100000-0x000000400000 : "uImage"
[    6.599739] 0x000000400000-0x000000800000 : "initrd"
[    6.605568] 0x000000800000-0x000040000000 : "boot"
>  cat /proc/mtd
> dev:    size   erasesize  name
> mtd0: 00080000 00020000 "uboot"
> mtd1: 00020000 00020000 "env"
> mtd2: 00020000 00020000 "env2"
> mtd3: 00300000 00020000 "uImage"
> mtd4: 00400000 00020000 "initrd"
> mtd5: 3f800000 00020000 "boot"

To access u-boot variables from Debian (usually problematic with this box) add this to /etc/fw_env.config
# MTD device name       Device offset   Env. size       Flash sector size      $
/dev/mtd1 0x0000 0x20000 0x20000
/dev/mtd2 0x0000 0x20000 0x20000
Only 1 entry should be required (MTD1), on my IX2 it oddly needs both to read and write the variables, but works and doesn’t throw errors.
This means we have a 100% functional kernel and Debian install on USB, without upgrading u-boot.

Part II – booting from sata/IDE w/ GPT partition table
The IX2-DL is a dual drive NAS, so we can host rootfs and images on the sata drives. I originally planned to write the uImage and uInitrd to flash, turns out the stock partitions are too small and the mtd sizes would have to change and Bodhi doesn’t recommend flash booting anyway. So I used the sata drives to host the images instead.

This is easiest to set up if the drives are blank, if you can back up your data and start fresh that will be easiest. For drives under 2TB you could then partition using MBR and u-boot will be able to load the images off an ext2 /boot partition.
I didn’t have sufficient storage to back up the 3TB of data I have on the IX2, so took the risk.

The main issue with loading images from large sata drives, or drives partitioned by the stock install, is the old u-boot doesn’t support GPT. This means u-boot doesn’t recognise any partitions on the drives. There is a way around this though, documented by Eine here;
Booting from GPT drive on stock u-boot

This solution uses ‘ide read’ in u-boot to load the uImage and uInitrd directly from drive sectors, ignoring the partition table. To make it work you need a drive partitioned with free space at the beginning, 128MiB is sufficient.

To avoid losing any of my stored data on the drives I kept the mdadm setup for the DATA volume group, but deleted MD0, the stock raid 1 root file system. That give 20GB of free space on each drive. This has risks, be careful, if you can backup first do so.
Example Partition table:
Model: ATA ST1000DM003-9YN1 (scsi)
Disk /dev/sdc: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name     Flags
 1      128MB   21.5GB  21.4GB   ext4        rootfs
 2      21.5GB  1000GB  979GB                primary  msftdata

Partition 1 is where you extract Bodhi’s rootfs and configure using his instructions (or copy your existing USB rootfs). Partition 2 is the existing mdadm raid / LVM volume.

Next write a working uImage and uInitrd to the unpartitioned space before partition 1, avoiding the GPT table. Make sure the dd is to the drive partitioned above!

/kernels# dd if=uImage of=/dev/sdc bs=1MiB seek=10
3+1 records in
3+1 records out
4171272 bytes (4.2 MB, 4.0 MiB) copied, 3.1455 s, 1.3 MB/s

/kernels# dd if=uInitrd of=/dev/sdc bs=1MiB seek=20
9+1 records in
9+1 records out
9762728 bytes (9.8 MB, 9.3 MiB) copied, 0.196305 s, 49.7 MB/s

Reboot into u-boot to load the images from the sata drive. Key here is in Eine’s guide the uInitrd was smaller, we need to change the ide read command to load the entire image into memory by setting the size to 0x4F00 (up from 0x4000).

The ide device command sets which drive is being read from, needed as this is a 2 drive NAS.

The imi command then confirms that the loaded image is complete.
U-Boot 1.1.4 (Oct 28 2011 - 15:19:29) Marvell version: 3.6.1 - EMC

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

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
NAND:1024 MB
Found ADT7473, program PWM1 ... OK
Flash:  0 kB

Marvell Serial ATA Adapter
Integrated Sata device found
[0 0 0]: Enable DMA mode (6)
  Device 0 @ 0 0:
Model: ST2000DM001-1CH164                       Firm: CC26     Ser#:             Z2F0PEJZ
            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: ST1000DM003-9YN162                       Firm: CC9D     Ser#:             Z1D0F6TF
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512)


CPU : Marvell Feroceon (Rev 1)
Found kernel at 0x100000
Found initrd at 0x400000

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
Marvell>> ide device 1;ide read 0x2100000 0xA000 0x4F00

IDE device 1: Model: ST1000DM003-9YN162                       Firm: CC9D     Ser#:             Z1D0F6TF
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512)
... is now current device

IDE read: device 1 block # 40960, count 20224 ... 20224 blocks read: OK
Marvell>> imi 0x2100000

## Checking Image at 02100000 ...
   Image Name:   initramfs-4.18.4-kirkwood-tld-1
   Created:      2018-10-20  19:08:21 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    9762664 Bytes =  9.3 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK

If the images check out set bootcmd to load both the uImage and uInitrd and boot.
Marvell>> setenv bootcmd 'ide device 1; ide read 0x40000 0x5000 0x2000; ide read 0x2100000 0xA000 0x4F00; bootm 0x40000 0x2100000'
Marvell>> boot

IDE device 1: Model: ST1000DM003-9YN162                       Firm: CC9D     Ser#:             Z1D0F6TF
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512)
... is now current device

IDE read: device 1 block # 20480, count 8192 ... 8192 blocks read: OK

IDE read: device 1 block # 40960, count 20224 ... 20224 blocks read: OK
## Booting image at 00040000 ...
   Image Name:   Linux-4.18.4-kirkwood-tld-1
   Created:      2018-10-21   2:09:48 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4171208 Bytes =  4 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK
## Loading Ramdisk Image at 02100000 ...
   Image Name:   initramfs-4.18.4-kirkwood-tld-1
   Created:      2018-10-20  19:08:21 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    9762664 Bytes =  9.3 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK

Starting kernel ...

If all went to plan save the new bootcmd using fw_setenv in Debian, or write the new bootcmd from u-boot.

Enjoy your upgraded IX2-DL, all without needing any u-boot change.

Any questions let me know.
Thanks! added to the Wiki thread.

-bodhi
===========================
Forum Wiki
bodhi's corner
Some additional info;

Server Performance for the Ix2-DL on Debian Squeeze / Kernel 4.18;
- NFS ~65MB per second
- Samba ~63MB per second

That is around double the stock performance, see SNB Review

Format of the Flash boot partition is UBIFS, easily mounted using UBI Attach;
Dmesg of mounting
[ 2915.192097] ubi0: attaching mtd5
[ 2915.902529] ubi0: scanning is finished
[ 2915.918166] ubi0 warning: ubi_eba_init: cannot reserve enough PEBs for bad PEB handling, reserved 81, need 157
[ 2915.930989] ubi0: attached mtd5 (name "boot", size 1016 MiB)
[ 2915.937018] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
[ 2915.943928] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512
[ 2915.951180] ubi0: VID header offset: 512 (aligned 512), data offset: 2048
[ 2915.958955] ubi0: good PEBs: 8125, bad PEBs: 3, corrupted PEBs: 0
[ 2915.965269] ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
[ 2915.973484] ubi0: max/mean erase counter: 13/7, WL threshold: 4096, image sequence number: 0
[ 2915.982434] ubi0: available PEBs: 0, total reserved PEBs: 8125, PEBs reserved for bad PEB handling: 81
[ 2915.992009] ubi0: background thread "ubi_bgt0d" started, PID 3672
[ 3035.353687] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 3681
[ 3035.371253] UBIFS (ubi0:0): recovery needed
[ 3035.448165] UBIFS (ubi0:0): recovery completed
[ 3035.452716] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "boot"
[ 3035.460296] UBIFS (ubi0:0): LEB size: 129024 bytes (126 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[ 3035.470439] UBIFS (ubi0:0): FS size: 1035159552 bytes (987 MiB, 8023 LEBs), journal size 33546240 bytes (31 MiB, 260 LEBs)
[ 3035.481705] UBIFS (ubi0:0): reserved for root: 4952683 bytes (4836 KiB)
[ 3035.488519] UBIFS (ubi0:0): media format: w4/r0 (latest is w5/r0), UUID ED69950E-9378-442B-BA6C-7D1BA8FE474E, small LPT model



Edited 1 time(s). Last edit at 10/23/2018 04:13PM by jdwl101.
Further details on the ix2-dl should anyone need them, I've added some useful items to my Google Drive share;

- the recovery usb creator
- uboot GPL sources
- 'Lifeline' GPL sources
- ix2-dl specific DTB

Available here; IX2-DL software

I also have a copy of the images on the UBIFS flash, nothing particular of note that isn't explained in the posts above.
Lenovo ix2-NG/ not booting
March 31, 2020 03:33PM
hard drive defective and changed by new one .ix2-NG not booting.
_  __                      _ _
        |  \/  | __ _ _ ____   _____| | |
        | |\/| |/ _` | '__\ \ / / _ \ | |
        | |  | | (_| | |   \ 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 1 0]: Enable DMA mode (6)
  Device 1 @ 0 1:
Model: ST4000DM000-1F2168                       Firm: CC54     Ser#:             Z307NL8Q
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 1718295.8 MB = 1678.0 GB (-775897424 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

IDE device 1: Model: ST4000DM000-1F2168                       Firm: CC54     Ser#:             Z307NL8Q
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 1718295.8 MB = 1678.0 GB (-775897424 x 512)
... is now current device

IDE read: device 1 block # 20480, count 8192 ... 8192 blocks read: OK

IDE read: device 1 block # 40960, count 20224 ... 20224 blocks read: OK
## Booting image at 00040000 ...
Bad Magic Number
Marvell>> printenv
baudrate=115200
loads_echo=0
rootpath=/srv/ubuntu
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
mfgmodel=ix2
preroot_ver=0.0.2
uboot_ver=0.0.8
serial_number=5563Y01001G334002ABJ0D1
ethaddr=00:D0:B8:15:20:F3
serialNo=EUAD39006D
modelname=32041700
fw_ver=4.0.4.14600d
serialno=0,01T73RXmePA2CzsdqLnYn8jFkQf69Z9NHFKgVU7E4SgVrWmAkO1KSRjc+I52tewqHa,EUAD39006D,
runintime=10800
ftpserver=192.168.43.4
testfile=100M
mfgtest_state=system_tested_ok
pre_path=IX2/1.0.8/download_runin.sh
pre_path_conf=IX2/1.0.8/download_runin.conf
pre_serverip=192.168.32.4
pre_user=ixxrunin
pre_passwd=123
pre_dirzi=IX2/1.0.8
bootcmd2=ide dev 1;ide read 0x40000 0x800 0x1800; ide read 0x900000 0x2000 0x2000; bootm 0x40000 0x900000;
dnsip=192.168.1.1
arcNumber=1682
bootargs=console=ttyS0,115200 root=/dev/ram0 mtdparts=spi_flash:0x7e000@0(u-boot),0x1000@0x7f000(env),0x1000@0x7e000(env2) :::DB88FXX81:eth0:none
filesize=2d4a40
fileaddr=5400000
gatewayip=192.168.1.1
netmask=255.255.255.0
ipaddr=192.168.1.12
serverip=192.168.1.10
bootargs_console=console=ttyS0,115200
mtdparts=orion_nand:0x300000@0x100000(zImage),0x1000000@0x540000(initrd)=root=/dev/mapper/debian--vg-root rootdelay=10
bootcmd=ide device 1; ide read 0x40000 0x5000 0x2000; ide read 0x2100000 0xA000 0x4F00; bootm 0x40000 0x2100000
stdin=serial
stdout=serial
stderr=serial
mainlineLinux=yes
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

Environment size: 2293/4091 bytes

Kindly advise

======
Moderatore edit: please use code tags (Formatted Code button) to post log.



Edited 1 time(s). Last edit at 03/31/2020 05:37PM by bodhi.
Re: Lenovo ix2-NG/ not booting
March 31, 2020 05:43PM
bootcmd=ide device 1; ide read 0x40000 0x5000 0x2000; ide read 0x2100000 0xA000 0x4F00; bootm 0x40000 0x2100000


IDE device 1: Model: ST4000DM000-1F2168                       Firm: CC54     Ser#:             Z307NL8Q
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 1718295.8 MB = 1678.0 GB (-775897424 x 512)
... is now current device

IDE read: device 1 block # 20480, count 8192 ... 8192 blocks read: OK

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

It looks OK to me, as far as the envs. So try writing uImage and uInitrd to the HDD sectors again.

-bodhi
===========================
Forum Wiki
bodhi's corner
Hi edd;

I agree with Bodhi, try re-writing the kernel and image to the sectors.

Once they're written use imi command in uboot to test to make certain they're loading correctly.

If you're using different / more recent images they may be larger than mine and require revised load commands to load the whole image (most likely the initrd has grown).

Regards,
J
Hi guys, thanks for yoru contributins to this forum especially jdwl101 + bodi. Hoping you can help me. I'm trying to revive an old ix2dl without drives. Don't really have a use for it, but figured learning a bit would be neat prjoect and maybe repurpose this instead of it going to the recycler.
I tried following the guide and can't seem to get to boot from USB i'm using the 4.12 rootfs file.

I do this:
setenv load_initrd 'ext2load usb 0:1 0x2100000 /boot/uInitrd'
setenv load_uimage 'ext2load usb 0:1 0x800000 /boot/uImage'
setenv usb_boot 'usb start; run load_uimage; run load_initrd; bootm 0x800000 0x2100000'
setenv bootargs 'console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:0x80000@0(uboot),0x20000@0xa0000(env),0x20000@0xc0000(env2),0x300000@0x100000(uImage),0x400000@0x400000(initrd),0x3f800000@0x800000(boot),1024m@0x0(flash) earlyprintk=serial'


Get teh following error:
## Booting image at 00040000 ...
Bad Magic Number


Full disclosure I really have no idea what I'm doing but willing to learn.
Hope you can help.


Below is the output of printenv. Any ideas?

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
fw_ver=4.1.102.29716
uboot_ver=0.0.9
serial_number=5563Y01001G4440019DJ0E1
ethaddr=00:D0:B8:28:97:BF
serialNo=SM10G7863544900263
modelname=SM10G78635
serialno=0,01dXe59DvQHBvi1Ltw7XXd7EPAKFMaRQ9o1Zlb02InJQi3EvAUjktvxArc3IVNjXN+,SM10G7863544900263,
runintime=10800
ftpserver=192.168.43.4
testfile=100M
mfgtest_state=system_tested_ok
pre_path=IX2/1.1.1/download_runin.sh
pre_path_conf=IX2/1.1.1/download_runin.conf
pre_serverip=192.168.32.4
pre_user=ixxrunin
pre_passwd=123
pre_dirzi=IX2/1.1.1
serverip=192.168.32.4
bootcmd=ide reset; ide read 0x40000 0x800 0x1800; ide read 0x900000 0x2000 0x2000; setenv bootargs $(console) $(bootargs_root) $(bootargs_mtd) $(bootargs_end); bootm 0x40000 0x900000;run bo2
bootcmd2=ide dev 1;ide read 0x40000 0x800 0x1800; ide read 0x900000 0x2000 0x2000; bootm 0x40000 0x900000;
load_initrd=ext2load usb 0:1 0x2100000 /boot/uInitrd
load_uimage=ext2load usb 0:1 0x800000 /boot/uImage
usb_boot=usb start; run load_uimage; run load_initrd; bootm 0x800000 0x2100000
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
ix2fbz,


Your bootcmd is currently:

bootcmd=ide reset; ide read 0x40000 0x800 0x1800; ide read 0x900000 0x2000 0x2000; setenv bootargs $(console) $(bootargs_root) $(bootargs_mtd) $(bootargs_end); bootm 0x40000 0x900000;run bo2

And you did
setenv load_initrd 'ext2load usb 0:1 0x2100000 /boot/uInitrd' 
setenv load_uimage 'ext2load usb 0:1 0x800000 /boot/uImage' 
setenv usb_boot 'usb start; run load_uimage; run load_initrd; bootm 0x800000 0x2100000' 
setenv bootargs 'console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:0x80000@0(uboot),0x20000@0xa0000(env),0x20000@0xc0000(env2),0x300000@0x100000(uImage),0x400000@0x400000(initrd),0x3f800000@0x800000(boot),1024m@0x0(flash) earlyprintk=serial'

That was not enough. So try again

With the USB rootfs attached, interrupt serial console and run the same envs, but also need to modify bootcmd env:

setenv load_initrd 'ext2load usb 0:1 0x2100000 /boot/uInitrd' 
setenv load_uimage 'ext2load usb 0:1 0x800000 /boot/uImage' 
setenv usb_boot 'usb start; run load_uimage; run load_initrd; bootm 0x800000 0x2100000' 
setenv bootargs 'console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:0x80000@0(uboot),0x20000@0xa0000(env),0x20000@0xc0000(env2),0x300000@0x100000(uImage),0x400000@0x400000(initrd),0x3f800000@0x800000(boot),1024m@0x0(flash) earlyprintk=serial'
setenv bootcmd 'run usb_boot; ide reset; ide read 0x40000 0x800 0x1800; ide read 0x900000 0x2000 0x2000; setenv bootargs $(console) $(bootargs_root) $(bootargs_mtd) $(bootargs_end); bootm 0x40000 0x900000'

And then
boot

-bodhi
===========================
Forum Wiki
bodhi's corner
You're a legend bodhi! Thanks for your help. It boots off USB now.

I'm getting the following error:
Gave up waiting for root file system device. Common problems:
- Boot args (cat /proc/cmdline)
- Check rootdelay= (did the system wait long enough?)
- Missing modules (cat /proc/modules; ls /dev)
ALERT! LABEL=rootfs does not exist. Dropping to a shell!


I feel like the first time it booted it went further than this. I tried extending the rootdelay (20s) but this ddin't help. I must be doing something incorrectly creating the rootfs usb stick?
ix2fbz,

That error usually inidicates that the rootfs partition was not labeled as rootfs.

So mount the USB rootfs on another Linux box. Assuming it is assigned as /dev/sdb1,

Check if the label was actually rootfs
e2label /dev/sdb1
If not, set it

e2label /dev/sdb1 rootfs
sync
And then try booting again.

-bodhi
===========================
Forum Wiki
bodhi's corner
thanks bodhi! USB booting working like a charm!

Trying to figure out IDE booting now.

In my limited understanding dd'd the usb drive I created to spare HD i had a round. I created an ext2 20gb partition and named it rootfs.

Then I tried via tty to boot from this:


setenv load_initrd 'ext2load ide 0:1 0x2100000 /boot/uInitrd' 
setenv load_uimage 'ext2load ide 0:1 0x800000 /boot/uImage' 
setenv ide_boot 'run load_uimage; run load_initrd; bootm 0x800000 0x2100000' 
setenv bootargs 'console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:0x80000@0(uboot),0x20000@0xa0000(env),0x20000@0xc0000(env2),0x300000@0x100000(uImage),0x400000@0x400000(initrd),0x3f800000@0x800000(boot),1024m@0x0(flash) earlyprintk=serial'
setenv bootcmd 'run ide_boot; ide reset; ide read 0x40000 0x800 0x1800; ide read 0x900000 0x2000 0x2000; setenv bootargs $(console) $(bootargs_root) $(bootargs_mtd) $(bootargs_end); bootm 0x40000 0x900000'

then run boot

Problem is I get a bad partiion then badmagic number error.
In debian I can mount the drive and view the files. Could the dd method of duplicating the usb drive be the problem?

Reset IDE: 
Marvell Serial ATA Adapter
Integrated Sata device found
[0 1 0]: Enable DMA mode (5)
  Device 1 @ 0 1:
Model: Hitachi HTS541612J9SA00                  Firm: SBDOC7HP Ser#:       SB2581L6G6S15E
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 114473.4 MB = 111.7 GB (234441648 x 512)

** Bad partition 1 **
** Bad partition 1 **
## Booting image at 00800000 ...
Bad Magic Number

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

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

ix2fbz,

In the Wiki


Quote

Booting Debian on Pogoplug

How to set up U-Boot for booting in multiple drives configuration
Backup and Restore NAND mtds
UART Booting HowTo for Selected Kirkwood Devices
Migrating from Arch to Debian?
How to boot new Debian rootfs using stock u-boot tftp - Pogo E02
How to boot new Debian rootfs on USB using stock u-boot - NSA325
How to boot Debian rootfs on a GPT HDD with stock u-boot (kernel files stored in HDD raw sector), 2nd HowTo post
How to boot Pogo V3 from SATA (to unbrick), 2nd How to Post
How to install U-Boot for Pogoplug V3 (OXNAS OX820) from OpenWRT
Boot Kirkwood rootfs with stock u-boot


Point back to this thread. This post was written by jdwl101:

https://forum.doozan.com/read.php?2,70294,70794#msg-70794

If you still have problem booting wiht HDD, then post the log of the HDD rootfs creation session, how the sectors were prepared..... and boot log. Basically, post everything here.

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



Edited 2 time(s). Last edit at 01/09/2021 03:55PM by bodhi.
Hi ix2fbz,

Using dd to copy your usb to the hard disk is unlikely to work, create a new partition and create a new rootfs on it, using the original archive.

You can copy a rootfs - there are some instructions in the wiki post - but I'd suggest starting fresh.

Also, to start the hard disk booting first try loading the kernel and initrd from your usb drive before going full hard disk booting. This will eliminate issues 1 at a time.

Cheers,
J
good day,

i hope this is the right place to ask a maybe stupid question, which I cannot find easily an answer for by scrolling through all these threads.
I have a working iomega ix2-ng and a spare iomega ix2-ng, which i would like to use with full Debian.
Is a serial connection/jtag needed to set this up ? Can it be done without, by preparing on another linux pc the disk and inserting it into the ix2-ng ? if the latter is true, how to prepare the image ( i guess the partition labelled rootfs) so that it will allow ssh / telnet connectivity to take over control ?

thank you
sverfaillie,

> I have a working iomega ix2-ng and a spare iomega
> ix2-ng, which i would like to use with full
> Debian.
> Is a serial connection/jtag needed to set this up
> ?

Yes. Since jdwl101 started with serial console, the instruction is based on that.

To write an installation procedure starting from inside stock OS, jdwl101 or somebody needs to go back to stock and test that. So it is not available.

After you got it booted with Debian rootfs, then SSH in as usual.

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

As Bodhi said a serial console is really needed for the ix2. You need to be able to see what happens as it runs through uboot. That said, the serial pins are present on the board so it is very easy to connect to.

While it could be possible to make the required uboot changes from the default OS, I wasn't able to get that to work due to limitations in the default set up and you may be left with a box that won't boot anything.

If you use my instructions it should be straightforward to get it running. Start with usb first. These boxes are pretty quick and useful once the factory software is replaced.

Also, you will need to prepare a debian usb stick on another linux box. Bodhi's instructions are pretty straightforward.

Happy to answer any questions you have.
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: