summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/create-image-with-grub.sh45
-rw-r--r--target/x86/sys-available/vbox-i68614
2 files changed, 20 insertions, 39 deletions
diff --git a/scripts/create-image-with-grub.sh b/scripts/create-image-with-grub.sh
index dbf073b07..47f37e6da 100755
--- a/scripts/create-image-with-grub.sh
+++ b/scripts/create-image-with-grub.sh
@@ -67,7 +67,7 @@ type=qemu
function usage {
cat >&2 <<EOF
-Syntax: $me [Âg] [-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
@@ -139,35 +139,6 @@ if [[ ! -f $src ]]; then
fi
(( quiet )) || print "Installing $src on $tgt."
-case $ostype {
-(DragonFly|*BSD*)
- basedev=${tgt%c}
- tgt=${basedev}c
- part=${basedev}i
- match=\'${basedev}\''[a-p]'
- function mount_ext2fs {
- mount -t ext2fs "$1" "$2"
- }
- ;;
-(Darwin)
- basedev=$tgt
- part=${basedev}s1
- match=\'${basedev}\''?(s+([0-9]))'
- function mount_ext2fs {
- fuse-ext2 "$1" "$2" -o rw+
- sleep 3
- }
- ;;
-(Linux)
- basedev=$tgt
- part=${basedev}1
- match=\'${basedev}\''+([0-9])'
- function mount_ext2fs {
- mount -t ext2 "$1" "$2"
- }
- ;;
-}
-
qemu-img create -f raw $tgt 524288k
if stat -qs .>/dev/null 2>&1; then
@@ -189,6 +160,7 @@ if ! T=$(mktemp -d /tmp/openadk.XXXXXXXXXX); then
print -u2 Error creating temporary directory.
exit 1
fi
+
tar -xOzf "$src" usr/share/grub-bin/core.img >"$T/core.img"
integer coreimgsz=$($statcmd "$T/core.img")
if (( coreimgsz < 1024 )); then
@@ -201,16 +173,11 @@ if (( coreimgsz > 65024 )); then
rm -rf "$T"
exit 1
fi
+
(( coreendsec = (coreimgsz + 511) / 512 ))
-if [[ $basedev = /dev/svnd+([0-9]) ]]; then
- # BSD svnd0 mode: protect sector #1
- corestartsec=2
- (( ++coreendsec ))
- corepatchofs=$((0x614))
-else
- corestartsec=1
- corepatchofs=$((0x414))
-fi
+corestartsec=1
+corepatchofs=$((0x414))
+
# partition offset: at least coreendsec+1 but aligned on a multiple of secs
(( partofs = ((coreendsec / secs) + 1) * secs ))
diff --git a/target/x86/sys-available/vbox-i686 b/target/x86/sys-available/vbox-i686
new file mode 100644
index 000000000..88b5ec63c
--- /dev/null
+++ b/target/x86/sys-available/vbox-i686
@@ -0,0 +1,14 @@
+config ADK_TARGET_SYSTEM_VBOX_I686
+ bool "VirtualBox Emulator"
+ select ADK_x86
+ select ADK_vbox_i686
+ select ADK_CPU_I686
+ select ADK_HARDWARE_VBOX
+ select ADK_TARGET_WITH_VGA
+ select ADK_TARGET_WITH_INPUT
+ select ADK_TARGET_WITH_PCI
+ select ADK_TARGET_WITH_HDD
+ select ADK_TARGET_WITH_SATA
+ help
+ Support for VirtualBox Emulator (i686).
+