diff options
author | Waldemar Brodkorb <mail@waldemar-brodkorb.de> | 2012-07-31 09:13:26 +0200 |
---|---|---|
committer | Waldemar Brodkorb <mail@waldemar-brodkorb.de> | 2012-07-31 09:13:26 +0200 |
commit | 4b7a075453479e183a02e34bf1177ef5538f026a (patch) | |
tree | 4b9684a91f0f6c9f34ef950aa5224d37c6471dc6 /scripts | |
parent | 1815107e44f048cc810cb2fd4ccd15510c57b420 (diff) |
add support for virtualbox emulator
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/create-image-with-grub.sh | 17 | ||||
-rwxr-xr-x | scripts/create-sys | 2 | ||||
-rwxr-xr-x | scripts/update-sys | 2 |
3 files changed, 14 insertions, 7 deletions
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 <<EOF -Syntax: $me [± ][-c cfgfssize] [-p panictime] [±q] [-s serialspeed] +Syntax: $me [Âg] [-c cfgfssize] [-p panictime] [±q] [-s serialspeed] [±t][ -f diskformat ] -n disk.img archive Defaults: -c 1 -p 10 -s 115200 -f qemu; -t = enable serial console EOF exit $1 } -while getopts "c:hp:qs:ntf:" ch; do +while getopts "c:ghp:qs:ntf:" ch; do case $ch { (c) if (( (cfgfs = OPTARG) < 0 || cfgfs > 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 |