]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - src/patches/grub-0.94-installcopyonly.patch
ovpnmain.cgi: Fix client package creation.
[people/teissler/ipfire-2.x.git] / src / patches / grub-0.94-installcopyonly.patch
CommitLineData
82705b6e
MT
1--- grub-0.94/util/grub-install.in.copyonly 2004-02-02 16:33:29.172127985 -0500
2+++ grub-0.94/util/grub-install.in 2004-02-02 16:34:26.027454320 -0500
3@@ -40,6 +40,7 @@
4 force_lba=
5 recheck=no
6 debug=no
7+justcopy=no
8
9 # look for secure tempfile creation wrappers on this platform
10 if test -x /bin/tempfile; then
11@@ -221,6 +222,17 @@
12 echo "$tmp_fname"
13 }
14
15+copy_images() {
16+ # Copy the GRUB images to the GRUB directory.
17+ for file in ${grubdir}/stage1 ${grubdir}/stage2 ${grubdir}/*stage1_5; do
18+ rm -f $file || exit 1
19+ done
20+ for file in \
21+ ${pkgdatadir}/stage1 ${pkgdatadir}/stage2 ${pkgdatadir}/*stage1_5; do
22+ cp -f $file ${grubdir} || exit 1
23+ done
24+}
25+
26 # Check the arguments.
27 for option in "$@"; do
28 case "$option" in
29@@ -240,6 +252,8 @@
30 force_lba="--force-lba" ;;
31 --recheck)
32 recheck=yes ;;
33+ --just-copy)
34+ justcopy=yes ;;
35 # This is an undocumented feature...
36 --debug)
37 debug=yes ;;
38@@ -258,12 +272,6 @@
39 esac
40 done
41
42-if test "x$install_device" = x; then
43- echo "install_device not specified." 1>&2
44- usage
45- exit 1
46-fi
47-
48 # If the debugging feature is enabled, print commands.
49 if test $debug = yes; then
50 set -x
51@@ -286,6 +294,18 @@
52 grubdir=${bootdir}/grub
53 device_map=${grubdir}/device.map
54
55+# if they just want the images copied, copy the images and then exit
56+if test $justcopy = yes; then
57+ copy_images
58+ exit 0
59+fi
60+
61+if test "x$install_device" = x; then
62+ echo "install_device not specified." 1>&2
63+ usage
64+ exit 1
65+fi
66+
67 # Check if GRUB is installed.
68 # This is necessary, because the user can specify "grub --read-only".
69 set $grub_shell dummy
70@@ -317,14 +337,7 @@
71 test -d "$bootdir" || mkdir "$bootdir" || exit 1
72 test -d "$grubdir" || mkdir "$grubdir" || exit 1
73
74-# Copy the GRUB images to the GRUB directory.
75-for file in ${grubdir}/stage1 ${grubdir}/stage2 ${grubdir}/*stage1_5; do
76- rm -f $file || exit 1
77-done
78-for file in \
79- ${pkgdatadir}/stage1 ${pkgdatadir}/stage2 ${pkgdatadir}/*stage1_5; do
80- cp -f $file ${grubdir} || exit 1
81-done
82+copy_images
83
84 # If --recheck is specified, remove the device map, if present.
85 if test $recheck = yes; then