LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM
User Name
Password
Slackware - ARM This forum is for the discussion of Slackware ARM.

Notices


Reply
  Search this Thread
Old 11-01-2015, 04:56 AM   #1
justwantin
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Slackwarearm
Posts: 879

Rep: Reputation: 120Reputation: 120
u-boot / boot.cmd question


Perhaps someone can give me a pointer or two.......

I'm using a fresh compile of u-boot-2015-10 with the most recent slackwarearm-current and have spent the afternoon trying to get the zImage-armv7 to boot off an sdcard on a bananapro.

u-boot sees the sdcard
Code:
=> ls mmc 0:1
<DIR>       4096 .
<DIR>       4096 ..
<DIR>      20480 dtb
            1060 boot.cmd
         7864666 initrd-armv7
        40981241 initrd-armv7.img
         3842496 zImage-armv7
            1132 boot.scr
however, I am unable to load the kernel
Quote:
Found U-Boot script /boot.scr
1132 bytes read in 121 ms (8.8 KiB/s)
## Executing script at 43100000
27637 bytes read in 713 ms (37.1 KiB/s)
** File not found zImage-arm7 **
** File not found initrd-arm7.img **
Bad Linux ARM zImage magic!
I've tried adapting a armbian boot.cmd from an image that I have booted successfully and have made attempts using a few other scripts and info found on the net, again unsuccessfully.

Originally I had everything in a directory named boot but to simplify things I've removed boot as shown above. Here is my boot.cmd
Code:
setenv bootcmd_generic 'debug earlyprintk sunxi_g2d_mem_reserve=0 sunxi_ve_mem_reserve=0 disp.screen0_output_mode=EDID:1280x720p50 hdmi.audio=EDID:0'
setenv bootargs console=ttyS0,115200n8 root=/dev/mmcblk0p1 rootwait=10
#
ext4load mmc 0:1 0x43000000 dtb/sun7i-a20-bananapro.dtb
ext4load mmc 0:1 0x47000000 zImage-arm7
ext4load mmc 0:1 0x48000000 initrd-arm7.img
bootz 0x47000000 - 0x48000000 - 0x43000000
It seems to me that the addressing of dtb, kernel and initrd are correct, the script is found by u-boot but I never am able to load the kernel

Last edited by justwantin; 11-01-2015 at 11:13 AM. Reason: tyop
 
Old 11-01-2015, 02:39 PM   #2
drmozes
Slackware Contributor
 
Registered: Apr 2008
Distribution: Slackware
Posts: 1,553

Rep: Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314Reputation: 1314
[QUOTE=justwantin;5443146]Perhaps someone can give me a pointer or two.......


Code:
         7864666 initrd-armv7
        40981241 initrd-armv7.img
         3842496 zImage-armv7
  
ext4load mmc 0:1 0x47000000 zImage-arm7
ext4load mmc 0:1 0x48000000 initrd-arm7.img
One has "v" and the other does not.
The Slackware ARM kernels have the "v". The ".img" file is the installer, by the way - not the OS initrd.
 
Old 11-02-2015, 05:14 AM   #3
justwantin
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Slackwarearm
Posts: 879

Original Poster
Rep: Reputation: 120Reputation: 120
Thanks Stuart! exactly two pointers.
Quote:
One has "v" and the other does not.
The first is a very good example of why one should just go to bed and look at the problem again with a fresh head in the morning.
Quote:
The ".img" file is the installer, by the way - not the OS initrd.
Yes I knew that. I was actually trying to set up for booting the installation from the SD card. My boot.cmd (above) was very basic and more was required. I used what I needed from your INSTALL_BANANAPI.TXT, created a boot.scr, it worked and I am installing Slackwarearm on a 2.5" drive attached to a Banana Pi Pro as I write....... install completed...... no problem except that this SD card can only be an installation SD card with that boot.scr in there. I suppose I can delete it and manually configure u-boot on the card tomorrow.... or maybe write another boot.cmd for booting Slackwarearm. Great Fun! Here's the complete boot.cmd and thanks for the help
Code:
########################################################
# boot.cmd 
# RM2015112
# Configured to install Slackwarearm on a Banana Pi Pro 
# by booting installer from a MicroSD via u-boot.
#
# Adapted from INSTALL_BANANAPI.TXT by Stuart Winter
#
# It might be a good idea to make sure u-boot is set 
# to factory defaults before allowing u-boot to boot
# into an installation with the follwing command:
#	sun7i#  env default -a ; reset 
#######################################################
# Create persistent variables used for both install 
# and booting installed system
setenv fdt_addr 0x43000000
setenv kernel_addr_r 0x47000000
setenv ramdisk_addr_r 0x48000000
setenv bootcmd_generic 'debug earlyprintk sunxi_g2d_mem_reserve=0 sunxi_ve_mem_reserve=0 disp.screen0_output_mode=EDID:1280x720p50 hdmi.audio=EDID:0'
#
# Set (uncomment) for either serial or hdmi console 
# after installation. 
setenv slkconsole "console=ttyS0,115200n8"
# setenv slkconsole "console=tty1"
#
# Save persistent variables
saveenv
#
# Create variables for booting into install Note that
# root is set for partition 1 on the SD card.
setenv bootargs console=ttyS0,115200n8 root=/dev/mmcblk0p1 rootwait panic=10
#
# Change the following line accordingly for Banana Pi
# install
ext4load mmc 0:1 ${fdt_addr} sun7i-a20-bananapro.dtb
fdt addr ${fdt_addr} 0x40000
ext4load mmc 0:1 ${kernel_addr_r} zImage-armv7
ext4load mmc 0:1 ${ramdisk_addr_r} initrd-armv7.img
#
# Set install boot environment
setenv bootargs "console=ttyS0,115200n8 ${bootcmd_generic} TERM=screen-256color nodhcp root=/dev/ram rw"
#
# Boot
bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr}
#
# Use the following command to create a boot.scr:
# 	mkimage -C none -A arm -T script -d boot.cmd boot.scr 
# Adjust paths accordingly.
 
Old 11-03-2015, 05:19 AM   #4
justwantin
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Slackwarearm
Posts: 879

Original Poster
Rep: Reputation: 120Reputation: 120
I have a boot.scr for booting Slackwarearm on a 2.5hdd now and I understand u-boot a little better. The boot.cmd file (above) for booting an install can be improved. The INSTALL_BANANAPI.TXT works fine if there is a network to connect to but if there is no network an sd card can be set up for booting with the Slackware ARM tree on a usb stick or partition on the sd card or the 2.5hdd without having to do allot of copy/pasting. Also, a usb/uart cable would not be necesary if a monitor and usb keyboard can be plugged into the board. After install the sd card can be mounted to change boot.scr files before exit/reboot Here's what I am using to boot the hdd install. I'll have to clean up the other one in case someone comes along and wants to use it but not tonight.
Code:
# boot.cmd
# 
# Run manually if before u-boot boot if there are persistent variables to clear
# sun7i# env default -a ; reset
#
setenv fdt_addr 0x43000000
#
setenv kernel_addr_r 0x47000000
#
setenv ramdisk_addr_r 0x48000000
#
setenv bootcmd_generic 'debug earlyprintk sunxi_g2d_mem_reserve=0 sunxi_ve_mem_reserve=0 disp.screen0_output_mode=EDID:1280x720p50 hdmi.audio=EDID:0' 
#
scsi reset
#
scsi scan
#
# Uncomment for console to use the _serial_ port
setenv bootargs console=ttyS0,115200n8 root=/dev/sda2 waitforroot=3 rootfstype=ext4
# Uncomment for console to use the _HDMI_ port
# setenv bootargs console=tty1 root=/dev/sda2 waitforroot=3 rootfstype=ext4
#
ext4load scsi 0:2 ${fdt_addr} /boot/dtb/sun7i-a20-bananapro.dtb ; fdt addr ${fdt_addr} 0x40000
#
ext4load scsi 0:2 ${kernel_addr_r} /boot/zImage-armv7
#
ext4load scsi 0:2 ${ramdisk_addr_r} /boot/initrd-armv7
#
bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr}
#
# Create boot.scr with:
# => mkimage -C none -A arm -T script -d boot.cmd boot.scr
 
Old 11-20-2015, 04:18 PM   #5
justwantin
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Slackwarearm
Posts: 879

Original Poster
Rep: Reputation: 120Reputation: 120
After working on this when I have some free time I have only been able to twice install on the bananapi pro twice as discussed above. After long delays loading initrd to ram it always hangs on "Starting Kernel ....." Following on from some things I found on the net I began to think it might be noise in my serial connection or perhaps my USB/Uart cable as I sometimes have had garbled stdout as below.
Code:
ed library links:  /sbin/ldconfig &
setterm: cannot (un)set powersave mode: Inappro
Stysklogd daemdatidexes:  /usdm trigger --ge
taH daemon:  /Upting MIME datarting SKit daemon:  /usr/sbin-pixbuf.load/bin/update-Upd /usr/bin/upmpiliib-compile-schemas /usr/pm -m /dev/mouse -t imp2.3-armv7 (ttyS0)

Welcome to Linux
x 4.2.3-armv7 (ttyS0)

pioot
ssword: Lit Nov 21 08:v/ttyS0.
Yo.

not and knows that he knows not is ignorant.  Teach him.
Ht he knows not is a fool.  Shun him.ot@p
I tried using a different computer and also installing with keyboard and screen connected directly to the pi pro. but had no joy, very long initrd load the hang on starting kernel.

However, If I partition a my 2.5" drive, format an ext4 partition and copy in dtb, zImage-armv7 and initrd-armv7.img into a boot directory I can install with the following script and install via a serial connection. Source for install can either be via network or off a mounted partion on a usb stick. This script can be used to both install and run slackwarearm on the pi pro. It boots with initrd-armv7.img if there is not a initrd-armv7 in boot on the root file system of sda2. If initrd-armv7 is not present it will boot with initrd-armv7.img provided it is found in the boot directory.
Code:
# boot.cmd
#
# Use the commands below to delete persistent variables in u-boot
# env default -a ; reset
#
setenv fdt_addr 0x43000000
setenv kernel_addr_r 0x47000000
setenv ramdisk_addr_r 0x48000000
setenv bootcmd_generic 'debug earlyprintk sunxi_g2d_mem_reserve=0 sunxi_ve_mem_reserve=0 disp.screen0_output_mode=EDID:1280x720p50 hdmi.audio=EDID:0' 
#
scsi reset
scsi scan
#
setenv bootargs console=ttyS0,115200n8 root=/dev/sda2 waitforroot=3 rootfstype=ext4
#
if test -e scsi 0:2 /boot/initrd-armv7; then
ext4load scsi 0:2 ${fdt_addr} /boot/dtb/sun7i-a20-bananapro.dtb ; fdt addr ${fdt_addr} 0x40000
ext4load scsi 0:2 ${kernel_addr_r} /boot/zImage-armv7
ext4load scsi 0:2 ${ramdisk_addr_r} /boot/initrd-armv7
bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr}
else
ext4load scsi 0:2 ${fdt_addr} /boot/dtb/sun7i-a20-bananapro.dtb ; fdt addr ${fdt_addr} 0x40000
ext4load scsi 0:2 ${kernel_addr_r} /boot/zImage-armv7
ext4load scsi 0:2 ${ramdisk_addr_r} /boot/initrd-armv7.img
bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr}
fi
#
# Create boot.scr with:
# => mkimage -C none -A arm -T script -d boot.cmd boot.scr
I think I'll just move on. This works first time / every time. I'll ponder why I can't install the other way some other day.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] What does ${extra} mean in boot file boot.cmd? linux_walt Linux - Embedded & Single-board computer 7 02-08-2015 12:48 AM
[resolved] suse linux boot option for cmd line jzoudavy Linux - Newbie 3 11-12-2013 11:42 AM
grub question changing boot order making windows boot first nfsutim Linux - Newbie 29 10-27-2012 12:53 PM
Fedora 16: Trying to execute an xinput command at boot up before login. Cmd works in terminal as su Ron Pierce Linux - Newbie 1 04-24-2012 09:41 PM
grub help needed cmd/menu mode boot prob/setup vlinux Linux - Software 3 11-13-2004 12:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM

All times are GMT -5. The time now is 07:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration