Welcome! Log In Create A New Profile

Advanced

Debian don't boot after change from ARCH

Posted by droidbox 
Debian don't boot after change from ARCH
June 01, 2017 04:48AM
After broken my USB Stick, i install Debian on a new USB Stick. But it does not start.
Can someone help me?

The error message:
[    3.222532] hctosys: unable to open rtc device (rtc0)
[    3.229064] Waiting 10 sec before mounting root device...
[   13.240761] VFS: Cannot open root device "sda1" or unknown-block(0,0): error -6
[   13.248109] Please append a correct "root=" boot option; here are the available partitions:
[   13.256558] 1f00          262144 mtdblock0  (driver?)
[   13.261690] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[   13.269991] CPU: 0 PID: 1 Comm: swapper Not tainted 4.4.0-kirkwood-tld-1 #1
[   13.276980] Hardware name: Marvell Kirkwood (Flattened Device Tree)
[   13.283298] [<c0016784>] (unwind_backtrace) from [<c00129f8>] (show_stack+0x10/0x14)
[   13.291082] [<c00129f8>] (show_stack) from [<c00c2200>] (panic+0x80/0x214)
[   13.297998] [<c00c2200>] (panic) from [<c07d9280>] (mount_block_root+0x204/0x24c)
[   13.305520] [<c07d9280>] (mount_block_root) from [<c07d93b4>] (mount_root+0xec/0x118)
[   13.313384] [<c07d93b4>] (mount_root) from [<c07d9504>] (prepare_namespace+0x124/0x184)
[   13.321424] [<c07d9504>] (prepare_namespace) from [<c07d8e9c>] (kernel_init_freeable+0x208/0x258)
[   13.330342] [<c07d8e9c>] (kernel_init_freeable) from [<c05b16b4>] (kernel_init+0x8/0xe4)
[   13.338474] [<c05b16b4>] (kernel_init) from [<c000f090>] (ret_from_fork+0x14/0x24)
[   13.346086] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

And the envirement
U-Boot 2014.04.R2-1 (May 15 2014 - 14:35:47) Arch Linux ARM
Seagate FreeAgent DockStar

SoC:   Kirkwood 88F6281_A0
DRAM:  128 MiB
WARNING: Caches not enabled
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
88E1116 Initialized on egiga0
Hit any key to stop autoboot:  0 
DockStar> printenv 
baudrate=115200
bootargs=console=$console root=LABEL=rootfs rootdelay=10 $mtdparts
bootcmd=usb start; setenv letter 9;for type in usb; do for disk in 0 1 2 3; do if ${type} part ${disk};then setexpr letter $letter + 1;run load;fi;done;done;
bootdelay=5
bootm=echo Booting from ${disk} ...; run setargs; bootm ${loadaddr};
bootz=echo Booting from ${disk} ...; run setargs; bootz ${loadaddr} - ${fdt_addr};
console=ttyS0
ethact=egiga0
ethaddr=00:10:75:1A:B7:CF
fdt_addr=0x800000
fdt_file==
importbootenv=echo Importing environment (uEnv.txt)...; env import -t $loadaddr $filesize
letter=a
load=echo Attempting to boot from ${type} ${disk}:1...;if run loadbootenv; then run importbootenv;fi;echo Checking if uenvcmd is set ...;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;echo Running default loadzimage ...;if run loadzimage; then run loadfdt;run bootz;fi;echo Running default loaduimage ...;if run loaduimage; then run bootm;fi;
loadaddr=0x810000
loadbootenv=load ${type} ${disk}:1 ${loadaddr} /boot/uEnv.txt
loadfdt=load ${type} ${disk}:1 ${fdt_addr} ${fdt_file}
loaduimage=load ${type} ${disk}:1 ${loadaddr} ${uimage}
loadzimage=load ${type} ${disk}:1 ${loadaddr} ${zimage}
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:1M(u-boot),-(rootfs)
setargs=setenv bootargs console=${console},${baudrate} ${optargs} root=/dev/sd${letter}1 rw rootwait ${mtdparts}
uimage=/boot/uImage
usb_set_bootargs=setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts
zimage=/boot/zImage

Environment size: 1601/131068 bytes

Regards droidbox
Re: Debian don't boot after change from ARCH
June 01, 2017 05:08AM
droidbox,

Basically, you need uInitrd in your bootm command.

See here for how:
http://forum.doozan.com/read.php?3,23727

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian don't boot after change from ARCH
June 01, 2017 05:35AM
Sorry bodhi,

i don't understand it. This are the uEnv
console=ttyS0,115200
uimage=/boot/uImage
initrd=/boot/uInitrd
fdt_file=/boot/dts/kirkwood-dockstar.dtb
fdt_addr=0x1c00000
uimage_addr=0x800000
initrd_addr=0x1100000
loadfdt=ext2load ${type} ${disk}:1 ${fdt_addr} ${fdt_file}
loaduimage=ext2load ${type} ${disk}:1 ${uimage_addr} ${uimage}
loaduinitrd=ext2load ${type} ${disk}:1 ${initrd_addr} ${initrd}
set_bootargs=setenv bootargs console=$console root=LABEL=rootfs rootdelay=10 $mtdparts
load_debian=setenv type usb; setenv disk 0; run set_bootargs; echo Running loadfdt ...;run loadfdt; echo Running loaduinitrd ...;run loaduinitrd; echo Running loaduimage ...; run loaduimage
bootm=run load_debian; echo Booting from ${type} ${disk}:1 ...; bootm ${uimage_addr} ${initrd_addr} ${fdt_addr}
load=echo Attempting to boot from ${type} ${disk}:1...;if run loadbootenv; then run importbootenv;fi;echo Checking if uenvcmd is set ...;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;echo Running default loadzimage ...;if run loadzimage; then run loadfdt;run bootz;fi;echo Running default loaduimage ...;if run loaduimage; then run bootm;fi;
loadfdt=load ${type} ${disk}:1 ${fdt_addr} ${fdt_file}
loaduimage=load ${type} ${disk}:1 ${loadaddr} ${uimage}
loaduinitrd=load ${type} ${disk}:1 0x1100000 /boot/uInitrd
droidbox
Re: Debian don't boot after change from ARCH
June 01, 2017 12:05PM
droidbox,

To boot Debian using Arch u-boot, you need this content:

console=ttyS0,115200
uimage=/boot/uImage
initrd=/boot/uInitrd
fdt_file=/boot/dts/kirkwood-dockstar.dtb 
fdt_addr=0x1c00000
uimage_addr=0x800000
initrd_addr=0x1100000
loadfdt=ext2load ${type} ${disk}:1 ${fdt_addr} ${fdt_file}
loaduimage=ext2load ${type} ${disk}:1 ${uimage_addr} ${uimage}
loaduinitrd=ext2load ${type} ${disk}:1 ${initrd_addr} ${initrd} 
set_bootargs=setenv bootargs console=$console root=LABEL=rootfs rootdelay=10 $mtdparts
load_debian=setenv type usb; setenv disk 0; run set_bootargs; echo Running loadfdt ...;run loadfdt; echo Running loaduinitrd ...;run loaduinitrd; echo Running loaduimage ...; run loaduimage 
bootm=run load_debian; echo Booting from ${type} ${disk}:1 ...; bootm ${uimage_addr} ${initrd_addr} ${fdt_addr}

That's the file I attached in the post above.

So follow the instruction in that post.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian don't boot after change from ARCH
June 02, 2017 02:00AM
Okay. I write in /boot/uEnv.txt
console=ttyS0,115200
uimage=/boot/uImage
initrd=/boot/uInitrd
fdt_file=/boot/dts/kirkwood-dockstar.dtb 
fdt_addr=0x1c00000
uimage_addr=0x800000
initrd_addr=0x1100000
loadfdt=ext2load ${type} ${disk}:1 ${fdt_addr} ${fdt_file}
loaduimage=ext2load ${type} ${disk}:1 ${uimage_addr} ${uimage}
loaduinitrd=ext2load ${type} ${disk}:1 ${initrd_addr} ${initrd} 
set_bootargs=setenv bootargs console=$console root=LABEL=rootfs rootdelay=10 $mtdparts
load_debian=setenv type usb; setenv disk 0; run set_bootargs; echo Running loadfdt ...;run loadfdt; echo Running loaduinitrd ...;run loaduinitrd; echo Running loaduimage ...; run loaduimage 
bootm=run load_debian; echo Booting from ${type} ${disk}:1 ...; bootm ${uimage_addr} ${initrd_addr} ${fdt_addr}
but the error remains
[    3.181001] hidraw: raw HID events driver (C) Jiri Kosina
[    3.186836] drop_monitor: Initializing network drop monitor service
[    3.193430] NET: Registered protocol family 17
[    3.198164] Key type dns_resolver registered
[    3.203361] registered taskstats version 1
[    3.207527] Loading compiled-in X.509 certificates
[    3.212434] zswap: loaded using pool lzo/zbud
[    3.217924] Key type encrypted registered
[    3.222516] hctosys: unable to open rtc device (rtc0)
[    3.229050] Waiting 10 sec before mounting root device...
[   13.240748] VFS: Cannot open root device "sda1" or unknown-block(0,0): error -6
[   13.248091] Please append a correct "root=" boot option; here are the available partitions:
[   13.256540] 1f00          262144 mtdblock0  (driver?)
[   13.261673] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[   13.269974] CPU: 0 PID: 1 Comm: swapper Not tainted 4.4.0-kirkwood-tld-1 #1
[   13.276962] Hardware name: Marvell Kirkwood (Flattened Device Tree)
[   13.283288] [<c0016784>] (unwind_backtrace) from [<c00129f8>] (show_stack+0x10/0x14)
[   13.291072] [<c00129f8>] (show_stack) from [<c00c2200>] (panic+0x80/0x214)
[   13.297989] [<c00c2200>] (panic) from [<c07d9280>] (mount_block_root+0x204/0x24c)
[   13.305511] [<c07d9280>] (mount_block_root) from [<c07d93b4>] (mount_root+0xec/0x118)
[   13.313384] [<c07d93b4>] (mount_root) from [<c07d9504>] (prepare_namespace+0x124/0x184)
[   13.321424] [<c07d9504>] (prepare_namespace) from [<c07d8e9c>] (kernel_init_freeable+0x208/0x258)
[   13.330342] [<c07d8e9c>] (kernel_init_freeable) from [<c05b16b4>] (kernel_init+0x8/0xe4)
[   13.338474] [<c05b16b4>] (kernel_init) from [<c000f090>] (ret_from_fork+0x14/0x24)
[   13.346085] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,
tune2fs -L rootfs /dev/sdb1
I made.

droidbox
Re: Debian don't boot after change from ARCH
June 02, 2017 02:12AM
When i install on another USB stick Archlinux and i update uboot with this thread can i then boot with my debian stick?

droidbox
Re: Debian don't boot after change from ARCH
June 02, 2017 02:54AM
Hmm. Aerch Linux doesnt start
U-Boot 2014.04.R2-1 (May 15 2014 - 14:35:47) Arch Linux ARM
Seagate FreeAgent DockStar

SoC:   Kirkwood 88F6281_A0
DRAM:  128 MiB
WARNING: Caches not enabled
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
88E1116 Initialized on egiga0
Hit any key to stop autoboot:  0 
(Re)start USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 3 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found

Partition Map for USB device 0  --   Partition Type: DOS

Part    Start Sector    Num Sectors     UUID            Type
  1     2048            4020224         350d9fdf-01     83 Boot
Attempting to boot from usb 0:1...
** File not found /boot/uEnv.txt **
Checking if uenvcmd is set ...
Running default loadzimage ...
** File not found /boot/zImage **
Running default loaduimage ...
4608768 bytes read in 456 ms (9.6 MiB/s)
Booting from 0 ...
Unknown command 'bootargs' - try 'help'
## Booting kernel from Legacy Image at 00810000 ...
   Image Name:   Linux-4.4.63-1-ARCH
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4608704 Bytes = 4.4 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...

Re: Debian don't boot after change from ARCH
June 02, 2017 03:25AM
Okay, Arch Linux run now.

Can i now update uboot with this thread to boot with the debian stick?

droidbox



Edited 1 time(s). Last edit at 06/02/2017 04:16AM by droidbox.
Re: Debian don't boot after change from ARCH
June 02, 2017 04:59AM
[root@alarm bauen]# dmesg | grep -i 'bad'
[   12.300441] Scanning device for bad blocks
[   12.330231] Bad eraseblock 336 at 0x000002a00000
[   12.440423] Bad eraseblock 1721 at 0x00000d720000
[   12.450073] Bad eraseblock 1786 at 0x00000df40000
Re: Debian don't boot after change from ARCH
June 02, 2017 12:40PM
droidbox,

> Okay, Arch Linux run now.
>
> Can i now update uboot

Sure. In Arch, you can install u-boot-2016.05-tld-1to boot with Debian. And your bad blocks are OK (they are not in the first 8 blocks).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian don't boot after change from ARCH
June 06, 2017 06:06AM
Hi Bodhi,

after the U-Boot upgrade, the error is the same. Please take a look to the attachment.

Can you help?

droidbox



Edited 1 time(s). Last edit at 06/06/2017 06:06AM by droidbox.
Attachments:
open | download - dockstar_uboot_error.txt (230.1 KB)
Re: Debian don't boot after change from ARCH
June 06, 2017 09:12AM
droidbox,

Look like you flashed u-boot image successfully, but did not flash the default envs image in step 8:

Quote

8. Flashing default u-boot envs image:

As described in step 1, u-boot envs must be defined in etc/fw_env.config as

# MTD device name Device offset Env. size Flash sector size Number of sectors
/dev/mtd0 0xc0000 0x20000 0x20000

A special section (B. Flashing default u-boot envs image) about flashing default u-boot envs is included at the end of this installation procedure. Please follow the instruction in this section B to perform this step before continuing with step 9.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 06/06/2017 09:15AM by bodhi.
Re: Debian don't boot after change from ARCH
June 06, 2017 09:18AM
droidbox,

Here is how to boot with the default envs using uEnv.txt loading capability using uboot.2016.05-tld-1.environment (the content of the default envs in text format).

1. Copy the default envs in text format to the rootfs on USB. Assuming the USB rootfs is mounted on another Linux box as /media/sdb1.

Become root and copy the default envs to uEnv.txt:
su
cp -a uboot.2016.05-tld-1.environment /media/sdb1/boot/uEnv.txt

2. Modify the uEnv.txt to replace the 2 envs devices and dtb_file as following:

devices=usb
dtb_file=/boot/dts/kirkwood-dockstar.dtb

3. and then sync and unmount the USB

sync
umount /media/sdb1

4. Plug in this USB rootfs to the Dockstar, and power up.

5. Capture the entire serial console boot tlog. Please post here.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian don't boot after change from ARCH
June 07, 2017 07:27AM
Hi bodhi, thanks for your help, but it doesn't run.
Seagate FreeAgent DockStar

SoC:   Kirkwood 88F6281_A0
DRAM:  128 MiB
WARNING: Caches not enabled
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
88E1116 Initialized on egiga0
Hit any key to stop autoboot:  0
DockStar> printenv 
arcNumber=2998
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec
bootcmd_exec=run load_uimage; if run load_initrd; then if run load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else bootm $load_uimage_addr; fi; fi
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootdelay=10
bootdev=usb
device=0:1
devices=usb ide mmc
disks=0 1 2 3
dtb_file=/boot/dts/kirkwood-dockstar.dtb
ethact=egiga0
ethaddr=00:10:75:1A:B7:CF
if_netconsole=ping $serverip
ipaddr=192.168.0.231
led_error=orange blinking
led_exit=green off
led_init=green blinking
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_dtb_addr=0x1c00000
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd
load_initrd_addr=0x1100000
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
load_uimage_addr=0x800000
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:1M(u-boot),-(rootfs)
partition=nand0,2
preboot_nc=run if_netconsole start_netconsole
scan_disk=echo running scan_disk ...; scan_done=0; setenv scan_usb "usb start";  setenv scan_ide "ide reset";  setenv scan_mmc "mmc rescan"; for dev in $devices; do if test $scan_done -eq 0; then echo Scan device $dev; run scan_$dev; for disknum in $disks; do if test $scan_done -eq 0; then echo device $dev $disknum:1; if load $dev $disknum:1 $load_uimage_addr /boot/uImage 1; then scan_done=1; echo Found bootable drive on $dev $disknum; setenv device $disknum:1; setenv bootdev $dev; fi; fi; done; fi; done
serverip=192.168.0.220
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=serial
stdin=serial
stdout=serial
uenv_addr=0x810000
uenv_import=echo importing envs ...; env import -t $uenv_addr $filesize
uenv_init_devices=setenv init_usb "usb start";  setenv init_ide "ide reset";  setenv init_mmc "mmc rescan"; for devtype in $devices; do run init_$devtype; done;
uenv_load=run uenv_init_devices; setenv uenv_loaded 0; for devtype in $devices;  do for disknum in 0; do run uenv_read_disk; done; done;
uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi
uenv_read_disk=if test $devtype -eq mmc; then if $devtype part; then run uenv_read;  fi; else if $devtype part $disknum; then run uenv_read; fi;  fi
usb_ready_retry=15

Environment size: 2824/131068 bytes
I attached the log.

droidbox
Attachments:
open | download - dockstar_problem_new.txt (239.7 KB)
Re: Debian don't boot after change from ARCH
June 07, 2017 02:10PM
droidbox,

You're almost there! the rootfs you are using is not set correctly.

When we boot with the new u-boot, and its default envs. The DTB should not be appended in step 4.

Quote

4. Create uImage with embedded DTB for booting with older u-boots (2012 or earlier). Skip 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).

Generate the uImage with DTB embedded inside:
cd /media/sdb1/boot
cp -a zImage-4.4.0-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-4.4.0-kirkwood-tld-1 -d zImage.fdt uImage
sync


So reverse this step:

Mount the USB rootfs drive on another Linux box. Assuming it is mounted as /media/sdb1

cd /media/sdb1/boot
cp -a uImage uImage.dockstar
cp -a uImage.orig uImage
sync

Then unmount the USB drive. Bring it back to the Dockstar and power up the Dockstar.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian don't boot after change from ARCH
June 08, 2017 01:50AM
That was hard work. Now everything works as it should. Tank you very much for your help.

droidbox
Author:

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: