From fc71c5f09bc8bd60e2e8e09bdb57b3143bc9d22f Mon Sep 17 00:00:00 2001 From: Jonathan Herman Date: Thu, 17 Jan 2013 13:15:24 -0800 Subject: Added Tegra kernel install scripts. --- arm-installer-common.sh | 13 +++++-------- odroid-install-kernel.sh | 6 +++++- panda-install-kernel.sh | 6 +++++- tegra-install-kernel.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+), 10 deletions(-) create mode 100755 tegra-install-kernel.sh diff --git a/arm-installer-common.sh b/arm-installer-common.sh index ecbcc89..18857ce 100644 --- a/arm-installer-common.sh +++ b/arm-installer-common.sh @@ -5,8 +5,6 @@ set -u # Build host for ARM. HOST="pound.cs.unc.edu" -# User doing the builds. -USER="cjk" # Not installed on the U-Boot partition. ZIMAGE_FILE="zImage" @@ -37,14 +35,10 @@ error() { exit 1 } -if [ $# -ne 2 ] ; then - error "Usage: `basename $0` " -fi - KERN_DIR=$1 -BOOT_TXT=$2 +BOOT_TXT=${2-""} -if [ ! -f "$BOOT_TXT" ] ; then +if [ ! -z "$BOOT_TXT" -o -f "$BOOT_TXT" ] ; then error "Boot script TXT not a file: $BOOT_TXT" fi @@ -91,6 +85,7 @@ mkuboot() { mkimage -A arm -O linux -T kernel -C none \ -a $LOAD_ADDR -e $ENTRY_POINT \ -d $TMP_DIR/$ZIMAGE_FILE $TMP_DIR/$UIMAGE_FILE >&2 + out_image=$TMP_DIR/$UIMAGE_FILE echo "done." >&2 } @@ -133,9 +128,11 @@ mkuinitrd() { copy_to_uboot() { echo "Copying files to u-boot partition ..." >&2 + sudo cp $TMP_DIR/$UIMAGE_FILE $UBOOT_PATH/ sudo cp $TMP_DIR/$SCRIPT_FILE $UBOOT_PATH/ sudo cp $TMP_DIR/$INITRD_FILE $UBOOT_PATH/ + echo "done." >&2 } diff --git a/odroid-install-kernel.sh b/odroid-install-kernel.sh index 060152f..89911ce 100755 --- a/odroid-install-kernel.sh +++ b/odroid-install-kernel.sh @@ -1,5 +1,9 @@ #!/bin/sh +if [ $# -ne 2 ] ; then + error "Usage: `basename $0` " +fi + . $(dirname $0)/arm-installer-common.sh # This is machine specific, AFAIK. @@ -20,7 +24,7 @@ CONFIG_FILE="config-$KVERSION" fetchfiles -mkuboot +mkuboot > /dev/null mkscript diff --git a/panda-install-kernel.sh b/panda-install-kernel.sh index 2a7f66a..70fc900 100755 --- a/panda-install-kernel.sh +++ b/panda-install-kernel.sh @@ -1,5 +1,9 @@ #!/bin/sh +if [ $# -ne 2 ] ; then + error "Usage: `basename $0` " +fi + . $(dirname $0)/arm-installer-common.sh # This is machine specific, AFAIK. @@ -16,7 +20,7 @@ CONFIG_FILE="config-$KVERSION" fetchfiles -mkuboot +mkuboot > /dev/null mkscript diff --git a/tegra-install-kernel.sh b/tegra-install-kernel.sh new file mode 100755 index 0000000..c48f8b0 --- /dev/null +++ b/tegra-install-kernel.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +if [ $# -ne 1 ] ; then + error "Usage: `basename $0` " +fi + +. $(dirname $0)/arm-installer-common.sh + +LOAD_ADDR=0x81008000 +ENTRY_POINT=0x81008000 + +USB_PART=/dev/sdb1 +TMP_MOUNT=$(mktemp -d) +# Use default boot image name on Tegra instead of creating a new boot script +# The tegra cannot install a new boot script without manual labor +BOOT_IMAGE=vmlinux.uimg + +KVERSION=$(getversion) +CONFIG_FILE="config-$KVERSION" + +fetchfiles + +mkuboot + +moveconfig + +echo "Mounting USB partition ..." >&2 +sudo mount $USB_PART $TMP_MOUNT +echo "done." >&2 + +if [ ! -d "$TMP_MOUNT/boot" ]; then + sudo rm -f "$TMP_MOUNT/boot" + sudo mkdir "$TMP_MOUNT/boot" +fi +sudo cp $out_image "$TMP_MOUNT/boot/$BOOT_IMAGE" + +echo "Unmounting USB partition ..." >&2 +sudo umount $TMP_MOUNT +echo "done." >&2 + +rm_tmp_files +rm -rf $TMP_MOUNT + +echo "All done!" >&2 -- cgit v1.2.2