From 503fadd774c67431769f1db504cb990207c52aa8 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sun, 28 Dec 2014 13:44:40 +0100 Subject: [PATCH] rootfsinstall: fixes for cubox target --- src/rootfsinstall.sh | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/src/rootfsinstall.sh b/src/rootfsinstall.sh index aa4df22..38d0a29 100755 --- a/src/rootfsinstall.sh +++ b/src/rootfsinstall.sh @@ -10,12 +10,12 @@ SYSTEMFSTYPE=ext4 TARGET_ARCH=arm function usage() { - echo "Usage: $0 device rootfs-archive [-rpi|-cubox] [-a archive] [-c command] [-fs fstype] [-k kernel] [-p password] [-y]" + echo "Usage: $0 device rootfs-archive [-bpi|-cubox|-rpi] [-a archive] [-c command] [-fs fstype] [-k kernel] [-p password] [-y]" echo echo "Target platform (optional):" echo "-bpi : make a BananaPi SD with boot partition" - echo "-rpi : make a RaspberryPi SD with boot partition" echo "-cubox : make a Cubox SD with boot partition" + echo "-rpi : make a RaspberryPi SD with boot partition" echo echo "Options:" echo "-a archive : additional archive to unpack in rootfs root" @@ -159,8 +159,8 @@ case $TARGETDEVICE in BOOTFSSIZE=20M BOOTFSSTART=0 [ "$USEKERNEL" ] || USEKERNEL=uImage-3.6.9-cubox - KERNELDEST="@BOOT@/boot/uImage" - INSTALLPACKAGES="kernel-cubox kernel-cubox-modules $INSTALLPACKAGES" + KERNELDEST="@BOOT@/uImage" + INSTALLPACKAGES="kernel-cubox kernel-cubox-modules xf86-video-dove $INSTALLPACKAGES" ;; *) BOOTFSTYPE= if [ "$USEKERNEL" ]; then @@ -412,20 +412,26 @@ framebuffer_ignore_alpha=1" > $BOOTMP/config.txt [ "$SWHOME" -a "${SWHOME:0:4}" = "/tmp" ] && rm -rf $SWHOME elif [ "$TARGETDEVICE" = "cubox" ]; then - [ "$VIDEO_MODE" ] || VIDEO_MODE="1920x1080-32@60" - mkdir -p $BOOTMP/boot - echo "Creating u-boot boot.scr..." - cat > $BOOTMP/boot/boot.txt << _EOF + if [ -e $ROOTMP/boot/uImage-*-cubox ]; then + IMAGE=`ls $ROOTMP/boot/uImage-*-cubox | head -n 1` + cp $IMAGE* $BOOTMP/ + ln -s ${IMAGE/*\/}-boot.scr $BOOTMP/boot.scr + else + [ "$VIDEO_MODE" ] || VIDEO_MODE="1920x1080-32@60" + mkdir -p $BOOTMP + echo "Creating u-boot boot.scr..." + cat > $BOOTMP/boot.txt << _EOF setenv bootargs 'console=ttyS0,115200n8 vmalloc=384M root=/dev/mmcblk0p2 video=dovefb:lcd0:$VIDEO_MODE-edid clcd.lcd0_enable=1 clcd.lcd1_enable=0 rootwait' echo ======== Loading kernel ======== -ext2load mmc 0:1 0x00200000 /boot/uImage +ext2load mmc 0:1 0x00200000 /uImage echo ======== Booting kernel ======== bootm _EOF - mkimage -A arm -O linux -T script -C none -n "u-boot commands" -d $BOOTMP/boot/boot.txt $BOOTMP/boot/boot.scr || { - echo "ERROR: mkimage: error creating boot.scr; aborting." - exit 1 - } + mkimage -A arm -O linux -T script -C none -n "u-boot commands" -d $BOOTMP/boot.txt $BOOTMP/boot.scr || { + echo "ERROR: mkimage: error creating boot.scr; aborting." + exit 1 + } + fi fi KERNELDEST=`echo $KERNELDEST | sed "s|@BOOT@|$BOOTMP|g"`