summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorWaldemar Brodkorb <mail@waldemar-brodkorb.de>2012-07-31 09:49:16 +0200
committerWaldemar Brodkorb <mail@waldemar-brodkorb.de>2012-07-31 09:49:16 +0200
commitab7890233d09ad4e9a1991241b92f04954e61328 (patch)
tree22af45d014ca379ef83e00551704454838a0fa0e /scripts
parent0a5c10661f2e998467b3f54317f076f925241e0b (diff)
remove obsolete stuff
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/create-image-with-grub.sh45
1 files changed, 6 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 ))