From 4b7a075453479e183a02e34bf1177ef5538f026a Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Tue, 31 Jul 2012 09:13:26 +0200 Subject: add support for virtualbox emulator --- scripts/create-image-with-grub.sh | 17 ++++++++++++----- scripts/create-sys | 2 +- scripts/update-sys | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/create-image-with-grub.sh b/scripts/create-image-with-grub.sh index 43770f5ba..dbf073b07 100755 --- a/scripts/create-image-with-grub.sh +++ b/scripts/create-image-with-grub.sh @@ -67,14 +67,14 @@ type=qemu function usage { cat >&2 < 5 )); then print -u2 "$me: -c $OPTARG out of bounds" @@ -87,6 +87,8 @@ while getopts "c:hp:qs:ntf:" ch; do fi ;; (q) quiet=1 ;; (+q) quiet=0 ;; + (g) grub=1 ;; + (+g) grub=0 ;; (s) if [[ $OPTARG != @(96|192|384|576|1152)00 ]]; then print -u2 "$me: serial speed $OPTARG invalid" exit 1 @@ -310,13 +312,18 @@ done cp "${grubfiles[@]}" boot/grub/ cd "$TOPDIR" -dd if=qemu.img of=mbr bs=64k count=1 -bs=$((524288-64-1)) +dd if=$tgt of=mbr bs=64k count=1 2>/dev/null +bs=$((524288)) (( quiet )) || print Generating ext2 image with size $bs... -dd if=/dev/zero of=cfgfs bs=1024k count=$cfgfs +dd if=/dev/zero of=cfgfs bs=1024k count=$cfgfs 2>/dev/null genext2fs -q -b $bs -d $T ${tgt}.new (( quiet )) || print Finishing up... cat mbr ${tgt}.new cfgfs > $tgt +if [[ $type = vbox ]]; then + rm -f $tgt.vdi + VBoxManage convertdd $tgt $tgt.vdi +fi + rm -rf "$T" mbr ${tgt}.new cfgfs exit 0 diff --git a/scripts/create-sys b/scripts/create-sys index ffa0ed70f..c34a6ac3a 100755 --- a/scripts/create-sys +++ b/scripts/create-sys @@ -32,7 +32,7 @@ for i in $systems;do systemu=$(echo $system|tr '[:upper:]' '[:lower:]') system=$(echo $system|tr '[:upper:]_' '[:lower:]-') system=$(echo $system|sed 's#x86-64#x86_64#') - if [ "${system%-*}" = "toolchain" -o "${system%-*}" = "qemu" ];then + if [ "${system%-*}" = "toolchain" -o "${system%-*}" = "qemu" -o "${system%-*}" = "vbox" ];then printf "\tdefault \"${system%-*}\" if ADK_$systemu\n" >> $topdir/target/config/Config.in.system.default else printf "\tdefault \"${system}\" if ADK_$systemu\n" >> $topdir/target/config/Config.in.system.default diff --git a/scripts/update-sys b/scripts/update-sys index bcfbfa84e..64b56a7dd 100755 --- a/scripts/update-sys +++ b/scripts/update-sys @@ -49,7 +49,7 @@ config $archsym boolean EOF -if [ "${system}" = "toolchain" -o "${system}" = "qemu" ];then +if [ "${system}" = "toolchain" -o "${system}" = "qemu" -o "${system}" = "vbox" ];then sys=${system}-$cpuarch else sys=$system -- cgit v1.2.3