From: Kees Jongenburger Date: Fri, 8 Mar 2013 08:42:32 +0000 (+0100) Subject: build:small fixes to arm_sdimage. X-Git-Tag: v3.3.0~1098 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=149ed6cff5b920190c94eb6505dd9890cf918b96;p=minix.git build:small fixes to arm_sdimage. * Use the same output directory as was previously the standard. * Add copying of uEnv and cmdline to the obj directory to allow booting from tftp. * No longer start qemu at the end of the process. * Use sudo if the script was called as non root user. Change-Id: I53143b1ce6633e764d173c3eb883c2efa3e6a5b7 --- diff --git a/releasetools/arm_sdimage.sh b/releasetools/arm_sdimage.sh index 720296d28..9f4acd6ad 100755 --- a/releasetools/arm_sdimage.sh +++ b/releasetools/arm_sdimage.sh @@ -1,11 +1,18 @@ #!/bin/bash set -e +if [ `id -u` -ne 0 ] +then + echo "This script should be running as root calling sudo" + sudo $0 + exit 1 +fi + MP_MINIX=/tmp/minix MP_BOOT=/tmp/minixboot : ${ARCH=evbearm-el} -: ${OBJ=../obj.arm} +: ${OBJ=../obj.${ARCH}} : ${CROSS_TOOLS=${OBJ}/"tooldir.`uname -s`-`uname -r`-`uname -m`"/bin} : ${CROSS_PREFIX=${CROSS_TOOLS}/arm-elf32-minix-} : ${DESTDIR=${OBJ}/destdir.$ARCH} @@ -13,7 +20,6 @@ MP_BOOT=/tmp/minixboot : ${LOOP=/dev/loop0} : ${EMPTYIMG=minix_arm_sd_empty.img} : ${IMG=minix_arm_sd.img} -: ${QEMU=/opt/bin/qemu-system-arm} BUILDSH=build.sh @@ -74,6 +80,10 @@ mount ${LOOP}p6 ${MP_MINIX}/home mount ${LOOP}p7 ${MP_MINIX}/usr cp releasetools/uEnv.txt releasetools/cmdline.txt $MP_BOOT +# +# also copy to the obj directory to allow tftp booting +# using obj dir as root +cp releasetools/uEnv.txt releasetools/cmdline.txt ${OBJ} ${CROSS_PREFIX}objcopy ${OBJ}/kernel/kernel -O binary ${OBJ}/kernel.bin cp ${OBJ}/kernel.bin $MP_BOOT @@ -104,5 +114,3 @@ umount $MP_MINIX/usr umount $MP_MINIX umount $MP_BOOT losetup -d $LOOP - -$QEMU -M beaglexm -drive if=sd,cache=writeback,file=$IMG -clock unix -serial pty -vnc :1 $*