summaryrefslogtreecommitdiff
path: root/release/INSTALL-GRUB-MBR
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-07-15 18:04:29 +0000
committerMiles Bader <miles@gnu.org>1996-07-15 18:04:29 +0000
commit650b37cbc25d357e47efdff2a8ffe5abb6e72cfb (patch)
treeb61c22fd575ebf404144c68e4895ad7fe7b1b593 /release/INSTALL-GRUB-MBR
parent6c58b2f101948d0e547eb0aec03df7e0490a469c (diff)
Initial revision
Diffstat (limited to 'release/INSTALL-GRUB-MBR')
-rw-r--r--release/INSTALL-GRUB-MBR34
1 files changed, 34 insertions, 0 deletions
diff --git a/release/INSTALL-GRUB-MBR b/release/INSTALL-GRUB-MBR
new file mode 100644
index 00000000..1a5f694c
--- /dev/null
+++ b/release/INSTALL-GRUB-MBR
@@ -0,0 +1,34 @@
+#!/bin/bash
+# Install grub stage1 as the MBR, copying the dos partition table from the
+# existing MBR.
+
+DEV="$1"
+
+if [ ! "$DEV" -o ! -w "$DEV" ]; then
+ echo 2>&1 "Usage: $0 DEVICE"
+ exit 1
+fi
+
+case "$DEV" in)
+ *r?d[0-9])
+ ;;
+ *)
+ echo "The device $DEV doesn't seem to be a whole-disk raw device; continue? [n] "
+ read C
+ case "$C" in)
+ [Yy]*)
+ ;;
+ *)
+ echo 2>&1 "$0: Aborting";
+ exit 2
+ ;;
+ esac
+ ;;
+esac
+
+cd /tmp
+
+dd if="$DEV" of=mbr \
+&& cp /boot/grub/stage1_ffs stage1 \
+&& dd if=mbr of=stage1 conv=notrunc bs=1 seek=446 skip=446 count=64 \
+&& dd if=stage1 of="$DEV" bs=512 count=1