[Arm-netbook] running allwinner-a10-video on mele causes kernel panic

Haakon Stende stende at gmail.com
Sun Jun 10 12:56:44 BST 2012


I only got the problem during boot.
I made me a script to generate the sdcard and when I get the boot its ok,
But network is not working. I had network working sometime but don't know
what changes I did when I had it working.
This is the script I made. It has to be runned in rootmode (sudo)

#!/bin/bash
#Set some variables
MMC_DEV=/dev/mmcblk0  #change if mmc-card mounts on different dev like
/dev/sdb
UBOOT_PART=$MMC_DEV"p1" #if dev is /dev/sdX then use 1 not p1
ROOTFS=$MMC_DEV"p2"    #if dev is /dev/sdX then use 2 not p2
HOSTNAME_MELE=mele
#Set the macadress you have on the box
MACADDRESS_="00:11:22:33:44:55"
MACADDRESS=`echo $MACADDRESS_|cut -c 1-2,4-5,7-8,10-11,13-14,16-17,19-20`
MELE_BUILDDIR=/mnt/allwinner/mele-bygg
GIT_UBOOT=sun4i
#Choose what linuxbranch you want to use
GIT_LINUX=allwinner-v3.0-android-v2
#GIT_LINUX=allwinner-v3.0-android
#GIT_LINUX=linux-3.3-sun4i
#GIT_LINUX=lichee-3.0.8-sun4i
#You can use your own image. Just unpack it to a catalog with the
$IMAGE_NAME in $MELE_BUILDDIR/images/$IMAGE_NAME
IMAGE_NAME=mele_debian_armhf_minimal
#IMAGE_NAME=mele_debian_armhf
ROOTIMG=$MELE_BUILDDIR/images/$IMAGE_NAME
umount $ROOTFS
umount $UBOOT_PART

#Get and unpack a downloadable image (Remove # to get it first time and
then add # after first run
#    mkdir -p $ROOTIMG
#    cd $MELE_BUILDDIR/images/
#    wget http://hands.com/~lkcl/mele_debian_armhf_minimal.cpio.gz
#    gunzip -d mele_debian_armhf_minimal.cpio.gz
cd $ROOTIMG
#    cpio -id < ../mele_debian_armhf_minimal.cpio

###    Set macadress and config dhcp on image
cat <<END > etc/network/interfaces
auto lo eth0
iface lo inet loopback
iface eth0 inet dhcp
hwaddress ether $MACADDRESS_
END

###    Set hostname in image
echo $HOSTNAME_MELE > etc/hostname

###    File system mounts.
cat <<END > etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/dev/root      /               ext4    noatime,errors=remount-ro 0 1
tmpfs          /tmp            tmpfs   defaults          0       0
END

##    Activate remote console and disable local consoles.
echo 'T0:2345:respawn:/sbin/getty -L ttyS0 115200 linux' >> etc/inittab
sed -i 's/^\([1-6]:.* tty[1-6]\)/#\1/' etc/inittab

###    Create the uboot
cd $MELE_BUILDDIR
#Some packages in ubuntu you need to install to build
#apt-get install emdebian-archive-keyring
#apt-get install gcc-4.5-arm-linux-gnueabi
#apt-get install build-essential git
#apt-get install u-boot-tools
#apt-get install gcc-4.5-arm-linux-gnueabi
#apt-get install gcc-4.5-arm-linux-gnueabihf
#ln -s /usr/bin/arm-linux-gnueabihf-gcc-4.5 /usr/bin/arm-linux-gnueabihf-gcc
#ln -s /usr/bin/arm-linux-gnueabi-gcc-4.5 /usr/bin/arm-linux-gnueabi-gcc

# Uncomment it on first run to get a clone of git
#git clone https://github.com/hno/uboot-allwinner.git

cd uboot-allwinner
# OK if you get "Already on sun4i".
git checkout $GIT_UBOOT

make clean
make sun4i CROSS_COMPILE=arm-linux-gnueabi-

### This will format and prepare your mmc card
dd if=/dev/zero of=$MMC_DEV bs=512 count=2047
sfdisk /dev/mmcblk0 <<EOF
64,1024
1088,;
EOF
#spl/sun4i-spl.bin doesnt work for me so I had to make temp a hack to get
uboot working
#dd if=spl/sun4i-spl.bin of=$MMC_DEV bs=1024 seek=8

#I had to make this hack to get uboot working. I think sth is wrong with
the uboot-build
#using the file from
http://rhombus-tech.net/allwinner_a10/hacking_the_mele_a1000/mele_ubuntu_image/
#using this article http://rhombus-tech.net/allwinner_a10/a10_image/
#unpack the image mele-ubuntu-lucid.img on $MELE_BUILDDIR/images
#    mkdir $MELE_BUILDDIR/binfiles
#    mkdir -p $MELE_BUILDDIR/images
#    cd $MELE_BUILDDIR/images
#    wget http://www.j1nx.nl/allwinner/images/mele-ubuntu-lucid.img.lzma
#    # or wget http://hands.com/~lkcl/mele-ubuntu-lucid.img.lzma
#    lzma -d mele-ubuntu-lucid.img.lzma
#    mount -o loop,offset=1048576
$MELE_BUILDDIR/images/mele-ubuntu-lucid.img ../mnt
#    umount ../mnt
#    cp ../mnt/evb.bin
#    dd if=mele-ubuntu-lucid.img
of=$MELE_BUILDDIR/binfiles/uboot_mele_mmc.bin bs=1024 skip=8 count=1008
#

#
dd if=../binfiles/uboot_mele_mmc.bin of=$MMC_DEV bs=1024 seek=8
dd if=u-boot.bin of=$MMC_DEV bs=1024 seek=32

cd $MELE_BUILDDIR
#git clone git://github.com/amery/linux-allwinner.git
cd linux-allwinner
git checkout $GIT_LINUX
make clean
make ARCH=arm CROSS_COMPILE=arm-linux-ghueabi- sun4i_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j16 uImage modules
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=output
modules_install
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=$ROOTIMG
modules_install

cd $MELE_BUILDDIR
#mkdir /media/UBOOT
echo $UBOOT_PART
mkfs.vfat -n 'UBOOT' $UBOOT_PART
mount $UBOOT_PART /media/UBOOT
cp linux-allwinner/arch/arm/boot/uImage /media/UBOOT
cp binfiles/evb.bin /media/UBOOT
cat <<END > boot.cmd
setenv console 'ttyS0,115200'
setenv root '/dev/mmcblk0p2'
setenv panicarg 'panic=10'
setenv extra 'rootfstype=ext4 rootwait'
setenv loglevel '8'
setenv setargs 'setenv bootargs console=${console} root=${root}
loglevel=${loglevel} ${panicarg} ${extra}'
setenv kernel 'uImage'
setenv boot_mmc 'fatload mmc 0 0x43000000 script.bin; fatload mmc 0
0x48000000 ${kernel}; bootm 0x48000000'
setenv bootcmd 'run setargs boot_mmc'
END

mkimage -A arm -O u-boot -T script -C none -n "boot" -d boot.cmd boot.scr
cp boot.scr /media/UBOOT
rm *.bin *.fex
wget
https://github.com/amery/sunxi-bin-archive/raw/master/mele-a1000/stock-nanda/script.bin
git clone https://github.com/amery/sunxi-tools
cd sunxi-tools
make
cd ..
sunxi-tools/bin2fex script.bin script.fex

sed s/000000000000/$MACADDRESS/ script.fex >scriptmac.fex

sunxi-tools/fex2bin scriptmac.fex scriptmac.bin

cp scriptmac.bin /media/UBOOT/script.bin

mkfs.ext4 -LROOTFS $ROOTFS
#mkdir /media/ROOTFS
umount $ROOTFS
mount $ROOTFS /media/ROOTFS
cd $ROOTIMG
cp -a * /media/ROOTFS

umount $UBOOT_PART
umount $ROOTFS

_____
Håkon

2012/6/10 lkcl luke <luke.leighton at gmail.com>

> On Sun, Jun 10, 2012 at 12:08 PM, Craig Whitcombe
> <craig.whitcombe at gmail.com> wrote:
> > ill update the wiki page for the ubuntu image to indicate that the
> > network card doesnt work.
>
>  super.  could you throw ian's comments in there as well at the same
> time, showing how to get it to work?
>
>  many thanks craig.
>
> > On 10 June 2012 13:05, Iain Bullard <iain.bullard at gmail.com> wrote:
>
> >> However, after building the 3.0 kernel from source and following the
> >> instructions
> >> here
> http://rhombus-tech.net/allwinner_a10/hacking_the_mele_a1000/Building_Debian_From_Source_Code_for_Mele/
> >> and *not* using the evb.bin from the original ubuntu image, the network
> >> interface works fine.
>
>  excellent. that's very valuable info.
>
>  l.
>
> _______________________________________________
> arm-netbook mailing list arm-netbook at lists.phcomp.co.uk
> http://lists.phcomp.co.uk/mailman/listinfo/arm-netbook
> Send large attachments to arm-netbook at files.phcomp.co.uk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.phcomp.co.uk/pipermail/arm-netbook/attachments/20120610/8fc3cf02/attachment-0001.html 


More information about the arm-netbook mailing list