0
A-P

Kernel hangs after network boot

Recommended Posts

hi all

i'm trying to boot my orange pi over the network.

i have written u-boot into SPI-Flash memory.

i modified boot.cmd script to download the kernel, init ram and script.bin from TFTP server.

after downloading them all the kernel tries to start but it dose not proceed.

I've attached the screenshot of the console. 

 

My boot.cmd

Spoiler

# DO NOT EDIT THIS FILE
#
# Please edit /boot/armbianEnv.txt to set supported parameters
#
setenv serverip 172.20.20.200
setenv load_addr "0x44000000"
setenv overlay_error "false"
# default values
setenv rootdev "/dev/nfs"
setenv verbosity "1"
setenv console "both"
setenv disp_mem_reserves "off"
setenv disp_mode "1920x1080p60"
setenv rootfstype "ext4"
setenv docker_optimizations "on"
setenv bootm_boot_mode sec
# Print boot source
itest.b *0x28 == 0x00 && echo "U-boot loaded from SD"
itest.b *0x28 == 0x02 && echo "U-boot loaded from eMMC or secondary SD"
itest.b *0x28 == 0x03 && echo "U-boot loaded from SPI"

echo "Boot script loaded from ${devtype}"

if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=tty1"; fi
if test "${console}" = "serial" || test "${console}" = "both"; then setenv consoleargs "${consoleargs} console=ttyS0,115200"; fi

setenv bootargs "root=${rootdev} rw nfsroot=172.20.20.90:/mnt/nfsroot ${consoleargs} hdmi.audio=EDID:0 disp.screen0_output_mode=${disp_mode} panic=10 consoleblank=0 loglevel=${verbosity} ubootpart=${partuuid} ubootsource=${devtype} ${extraargs} ${extraboardargs}"

if test "${disp_mem_reserves}" = "off"; then setenv bootargs "${bootargs} sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_fb_mem_reserve=16"; fi
if test "${docker_optimizations}" = "on"; then setenv bootargs "${bootargs} cgroup_enable=memory swapaccount=1"; fi

#load ${devtype} 0 ${ramdisk_addr_r} ${prefix}uInitrd
#load ${devtype} 0 ${kernel_addr_r} ${prefix}zImage
#setenv bootargs "root=${rootdev} rootwait nfsroot=172.20.20.90:/mnt/nfsroot console=ttyS0,115200 panic=10 consoleblank=0 loglevel=1"
tftpboot ${kernel_addr_r} zImage
tftpboot ${ramdisk_addr_r} uInitrd

echo "Found legacy kernel configuration"
#load ${devtype} 0 ${fdt_addr_r} ${prefix}script.bin
tftpboot ${fdt_addr_r} script.bin

bootz ${kernel_addr_r} ${ramdisk_addr_r}

# Recompile with:
# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr

 

Screenshot from 2017-04-26 19_46_35.png

Share this post


Link to post
Share on other sites

thanks zador

i am using DHCP Server in my network so i did not fill all IP related arguments.

when i use the same boot.cmd (boot.scr) on SD card every thing works fine and the NFS path will be mounted as root correctly.

Share this post


Link to post
Share on other sites

It seems that there is a problem with reading kernel from the network because when I try to read same kernel from SD card it works fine but with network no.

Can you please give me a step by step guide how to boot from network ? I've already flashed my SPI Flash with uboot.

Regards.

Share this post


Link to post
Share on other sites
19 hours ago, A-P said:

i am using DHCP Server in my network so i did not fill all IP related arguments.

 

Did you add "ip=dhcp" then?

 

19 hours ago, A-P said:

when i use the same boot.cmd (boot.scr) on SD card every thing works fine and the NFS path will be mounted as root correctly.

Exactly the same boot.cmd with exactly the same u-boot binary?

Share this post


Link to post
Share on other sites

i have added

setenv machid 1029

to boot.cmd and

ip=dhcp

to bootargs but nothing changed.

when i copy boot.scr into SD card every thing works fine.

Screenshot from 2017-05-02 17:44:22.png

Share this post


Link to post
Share on other sites

i tried with

setenv verbosity "7"
setenv console "both"

 

but there was no progress.

kernel hangs on

ion_reserve_comm......

Share this post


Link to post
Share on other sites

Any idea ?

@Igor can you please give me a step by step guide how you boot images from network when you test images before release ? Because I've heard images are developed on network because this way development is much faster.

best regards.

Share this post


Link to post
Share on other sites

thanks dear zador

after some hard work i fixed the problem and now kernel panic happens and the boor reboots.

i also tried with mainline kernel and every thing works fine.

for some driver problems i have to use kernel 3.4.113.

i think there is a problem with the network interface that prevents NFS root file system to be mounted.

Screenshot from 2017-06-25 21:37:23.png

Screenshot from 2017-06-25 21:37:13.png

Share this post


Link to post
Share on other sites

the script.bin file that i'm using is the same one i use on SD card after writing armbian image.
even i disabled wifi but there was no success.

i think more than one wifi module have error.

disp module -> fails!

UART module -> no regulator!

EHCI -> cant setup!

ALSA -> No sound card found!

IP-Config: Failed to open eth0!

so there is no network and there will be no NFS root!

Screenshot from 2017-07-01 16:35:59.png

Screenshot from 2017-07-01 16:42:38.png

Share this post


Link to post
Share on other sites

Problem Solved!!!

the problem was U-boot.

i was using the u-boot that was written by mainline kernel on SPI-Flash.

i rewrote u-boot from armbian with kernel 3.4.113 and everything was ok.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
0