From 5b034360bfd6d22060656b551c4cc7cda9495a9f Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Sat, 1 Mar 2014 09:45:41 +0100 Subject: [PATCH] refactoring --- build.sh | 56 +++++++++++++++++++------------------------------------- 1 file changed, 19 insertions(+), 37 deletions(-) diff --git a/build.sh b/build.sh index b326c34..3ad8875 100755 --- a/build.sh +++ b/build.sh @@ -340,32 +340,35 @@ EOT echo "remove the preconfigured boot and setup ours" rm -rf $DEST/image/sdcard/boot/* +TARGET=/image/sdcard if [ -x /sbin/makepkg ] && [ -x /sbin/installpkg ]; then mkdir -p $DEST/pkg-linux-sunxi/{boot,lib}/ + TARGET=/pkg-linux-sunxi +fi - cat < $DEST/pkg-linux-sunxi/boot/uEnv.txt +cat < $DEST$TARGET/boot/uEnv.txt root=/dev/mmcblk0p1 ro rootwait extraargs=console=tty0,115200 sunxi_no_mali_mem_reserve sunxi_g2d_mem_reserve=0 sunxi_ve_mem_reserve=0 hdmi.audio=EDID:0 disp.screen0_output_mode=EDID:1280x720p50 rootwait panic=10 rootfstype=ext4 rootflags=discard EOF - cp $BINARIES_DIR/cubie_configs/script-*.bin $DEST/pkg-linux-sunxi/boot/ - ( cd $DEST/pkg-linux-sunxi/boot/ - case $CUBIETRUCK_DISPLAY in - VGA) rm script.bin - ln script-vga.bin script.bin - break - ;; - HDMI) rm script.bin - ln script-hdmi.bin script.bin - break - ;; - esac ) +echo "setup video output" +cp $BINARIES_DIR/cubie_configs/script-*.bin $DEST$TARGET/boot/ +( cd $DEST$TARGET/boot/ + rm script.bin + case $CUBIETRUCK_DISPLAY in + VGA) ln script-vga.bin script.bin + ;; + HDMI) ln script-hdmi.bin script.bin + ;; + esac ) - cp $BINARIES_DIR/linux-sunxi/uImage $DEST/pkg-linux-sunxi/boot/ - cp -R $BINARIES_DIR/linux-sunxi/modules $DEST/pkg-linux-sunxi/lib/ - cp -R $BINARIES_DIR/linux-sunxi/firmware/ $DEST/pkg-linux-sunxi/lib/ +echo "Installing kernel" +cp $BINARIES_DIR/linux-sunxi/uImage $DEST$TARGET/boot/ +cp -R $BINARIES_DIR/linux-sunxi/modules $DEST$TARGET/lib/ +cp -R $BINARIES_DIR/linux-sunxi/firmware/ $DEST$TARGET/lib/ +if [ -x /sbin/makepkg ] && [ -x /sbin/installpkg ]; then mkdir -p $DEST/pkg-linux-sunxi/install/ PRGNAM=linux-sunxi cat < $DEST/pkg-linux-sunxi/install/slack-desc @@ -396,27 +399,6 @@ EOF ) installpkg --root $DEST/image/sdcard/ $DEST/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz -else - cat < $DEST/image/sdcard/boot/uEnv.txt -root=/dev/mmcblk0p1 ro rootwait -extraargs=console=tty0,115200 sunxi_no_mali_mem_reserve sunxi_g2d_mem_reserve=0 sunxi_ve_mem_reserve=0 hdmi.audio=EDID:0 disp.screen0_output_mode=EDID:1280x720p50 rootwait -panic=10 rootfstype=ext4 rootflags=discard -EOF - - echo "setup video output" - cp $BINARIES_DIR/cubie_configs/script-*.bin $DEST/image/sdcard/boot/ - ( cd $DEST/image/sdcard/boot/ - case $CUBIETRUCK_DISPLAY in - VGA) ln script-vga.bin script.bin - ;; - HDMI) ln script-hdmi.bin script.bin - ;; - esac ) - - echo "Installing kernel" - cp $BINARIES_DIR/linux-sunxi/uImage $DEST/image/sdcard/boot/ - cp -R $BINARIES_DIR/linux-sunxi/modules $DEST/image/sdcard/lib/ - cp -R $BINARIES_DIR/linux-sunxi/firmware/ $DEST/image/sdcard/lib/ fi sync