--- grub-0.90/util/grub-install.in~	Thu Jul 19 18:42:58 2001
+++ grub-0.90/util/grub-install.in	Thu Jul 19 18:43:12 2001
@@ -38,6 +38,7 @@
 force_lba=
 recheck=no
 debug=no
+justcopy=no
 
 # Usage: usage
 # Print the usage.
@@ -149,6 +150,17 @@
     fi
 }
 
+copy_images() {
+    # Copy the GRUB images to the GRUB directory.
+    for file in ${grubdir}/stage1 ${grubdir}/stage2 ${grubdir}/*stage1_5; do
+	rm -f $file || exit 1
+    done
+    for file in \
+	${pkgdatadir}/stage1 ${pkgdatadir}/stage2 ${pkgdatadir}/*stage1_5; do
+	cp -f $file ${grubdir} || exit 1
+    done
+}
+
 # Check the arguments.
 for option in "$@"; do
     case "$option" in
@@ -166,6 +178,8 @@
 	force_lba="--force-lba" ;;
     --recheck)
 	recheck=yes ;;
+    --just-copy)
+        justcopy=yes ;;
     # This is an undocumented feature...
     --debug)
 	debug=yes ;;
@@ -179,12 +193,6 @@
     esac
 done
 
-if test "x$install_device" = x; then
-    echo "install_device not specified." 1>&2
-    usage
-    exit 1
-fi
-
 # If the debugging feature is enabled, print commands.
 if test $debug = yes; then
     set -x
@@ -195,6 +203,18 @@
 grubdir=${bootdir}/grub
 device_map=${grubdir}/device.map
 
+# if they just want the images copied, copy the images and then exit
+if test $justcopy = yes; then
+    copy_images
+    exit 0
+fi
+
+if test "x$install_device" = x; then
+    echo "install_device not specified." 1>&2
+    usage
+    exit 1
+fi
+
 # Check if GRUB is installed
 if test -f "$grub_shell"; then
     :
@@ -224,14 +244,7 @@
 test -d "$bootdir" || mkdir "$bootdir" || exit 1
 test -d "$grubdir" || mkdir "$grubdir" || exit 1
 
-# Copy the GRUB images to the GRUB directory.
-for file in ${grubdir}/stage1 ${grubdir}/stage2 ${grubdir}/*stage1_5; do
-    rm -f $file || exit 1
-done
-for file in \
-    ${pkgdatadir}/stage1 ${pkgdatadir}/stage2 ${pkgdatadir}/*stage1_5; do
-    cp -f $file ${grubdir} || exit 1
-done
+copy_images
 
 # If --recheck is specified, remove the device map, if present.
 if test $recheck = yes; then
