Magellan Linux

Contents of /trunk/grub/patches/grub-2.00-busybox.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1847 - (show annotations) (download)
Tue Jul 17 12:59:53 2012 UTC (11 years, 9 months ago) by niro
File size: 4898 byte(s)
-reworked patches for 2.00
1 diff -Naur grub-2.00/util/grub.d/10_kfreebsd.in grub-2.00-magellan/util/grub.d/10_kfreebsd.in
2 --- grub-2.00/util/grub.d/10_kfreebsd.in 2012-03-04 22:02:30.000000000 +0100
3 +++ grub-2.00-magellan/util/grub.d/10_kfreebsd.in 2012-07-17 16:49:58.248982642 +0200
4 @@ -227,7 +227,7 @@
5 kfreebsd_entry "${OS}" "${version}" recovery "-s"
6 fi
7
8 - list=`echo $list | tr ' ' '\n' | grep -vx $kfreebsd | tr '\n' ' '`
9 + list=`echo $list | tr ' ' '\n' | grepvx $kfreebsd | tr '\n' ' '`
10 is_first_entry=false
11 done
12
13 diff -Naur grub-2.00/util/grub.d/10_linux.in grub-2.00-magellan/util/grub.d/10_linux.in
14 --- grub-2.00/util/grub.d/10_linux.in 2012-07-17 16:48:47.471980599 +0200
15 +++ grub-2.00-magellan/util/grub.d/10_linux.in 2012-07-17 16:51:02.465983665 +0200
16 @@ -108,8 +108,8 @@
17 # FIXME: We need an interface to select vesafb in case efifb can't be used.
18 if [ "x$GRUB_GFXPAYLOAD_LINUX" = x ]; then
19 echo " load_video" | sed "s/^/$submenu_indentation/"
20 - if grep -qx "CONFIG_FB_EFI=y" "${config}" 2> /dev/null \
21 - && grep -qx "CONFIG_VT_HW_CONSOLE_BINDING=y" "${config}" 2> /dev/null; then
22 + if grepqx "CONFIG_FB_EFI=y" "${config}" 2> /dev/null \
23 + && grepqx "CONFIG_VT_HW_CONSOLE_BINDING=y" "${config}" 2> /dev/null; then
24 echo " set gfxpayload=keep" | sed "s/^/$submenu_indentation/"
25 fi
26 else
27 @@ -246,7 +246,7 @@
28 "single ${GRUB_CMDLINE_LINUX}"
29 fi
30
31 - list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
32 + list=`echo $list | tr ' ' '\n' | grepvx $linux | tr '\n' ' '`
33 is_first_entry=false
34 done
35
36 diff -Naur grub-2.00/util/grub.d/20_linux_xen.in grub-2.00-magellan/util/grub.d/20_linux_xen.in
37 --- grub-2.00/util/grub.d/20_linux_xen.in 2012-07-17 16:48:47.472980664 +0200
38 +++ grub-2.00-magellan/util/grub.d/20_linux_xen.in 2012-07-17 16:51:51.722982822 +0200
39 @@ -150,7 +150,7 @@
40 break
41 fi
42 done
43 - if (grep -qx "CONFIG_XEN_DOM0=y" "${config}" 2> /dev/null || grep -qx "CONFIG_XEN_PRIVILEGED_GUEST=y" "${config}" 2> /dev/null); then echo -n "$i " ; fi
44 + if (grepqx "CONFIG_XEN_DOM0=y" "${config}" 2> /dev/null || grepqx "CONFIG_XEN_PRIVILEGED_GUEST=y" "${config}" 2> /dev/null); then echo -n "$i " ; fi
45 fi
46 done`
47 if [ "x${linux_list}" = "x" ] ; then
48 @@ -254,12 +254,12 @@
49 "single ${GRUB_CMDLINE_LINUX}" "${GRUB_CMDLINE_XEN}"
50 fi
51
52 - list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
53 + list=`echo $list | tr ' ' '\n' | grepvx $linux | tr '\n' ' '`
54 done
55 if [ x"$is_first_entry" != xtrue ]; then
56 echo ' }'
57 fi
58 - xen_list=`echo $xen_list | tr ' ' '\n' | grep -vx $current_xen | tr '\n' ' '`
59 + xen_list=`echo $xen_list | tr ' ' '\n' | grepvx $current_xen | tr '\n' ' '`
60 done
61
62 # If at least one kernel was found, then we need to
63 diff -Naur grub-2.00/util/grub-install.in grub-2.00-magellan/util/grub-install.in
64 --- grub-2.00/util/grub-install.in 2012-07-17 16:43:22.095982796 +0200
65 +++ grub-2.00-magellan/util/grub-install.in 2012-07-17 16:53:32.643985646 +0200
66 @@ -64,6 +64,21 @@
67 removable=no
68 efi_quiet=
69
70 +grepqx()
71 +{
72 + local line="$1"
73 + local file="$2"
74 + local ret
75 +
76 + ret=$(sed -n "/^${line}$/p" ${file})
77 + if [[ -z ${ret} ]]
78 + then
79 + return 1
80 + else
81 + return 0
82 + fi
83 +}
84 +
85 # Get GRUB_DISTRIBUTOR.
86 if test -f "${sysconfdir}/conf.d/grub" ; then
87 . "${sysconfdir}/conf.d/grub"
88 @@ -629,7 +644,7 @@
89
90 if [ "x${devabstraction_module}" = "x" ] ; then
91 if [ x"${install_device}" != x ]; then
92 - if echo "${install_device}" | grep -qx "(.*)" ; then
93 + if echo "${install_device}" | grepqx "(.*)" ; then
94 install_drive="${install_device}"
95 else
96 install_drive="`"$grub_probe" --device-map="${device_map}" --target=drive --device "${install_device}"`" || exit 1
97 diff -Naur grub-2.00/util/grub-mkconfig_lib.in grub-2.00-magellan/util/grub-mkconfig_lib.in
98 --- grub-2.00/util/grub-mkconfig_lib.in 2012-06-27 17:27:53.000000000 +0200
99 +++ grub-2.00-magellan/util/grub-mkconfig_lib.in 2012-07-17 16:54:47.022978540 +0200
100 @@ -220,7 +220,7 @@
101 version_test_numeric_a="$version_test_numeric_b"
102 version_test_numeric_b="$version_test_numeric_c"
103 fi
104 - if (echo "$version_test_numeric_a" ; echo "$version_test_numeric_b") | version_sort | head -n 1 | grep -qx "$version_test_numeric_b" ; then
105 + if (echo "$version_test_numeric_a" ; echo "$version_test_numeric_b") | version_sort | head -n 1 | grepqx "$version_test_numeric_b" ; then
106 return 0
107 else
108 return 1
109 @@ -349,3 +349,38 @@
110 cat
111 fi
112 }
113 +
114 +grepqx()
115 +{
116 + local line="$1"
117 + local file="$2"
118 + local ret
119 +
120 + ret=$(sed -n "/^${line}$/p" ${file})
121 + if [[ -z ${ret} ]]
122 + then
123 + return 1
124 + else
125 + return 0
126 + fi
127 +}
128 +
129 +grepvx()
130 +{
131 + local line="$1"
132 + local file="$2"
133 + local ret
134 +
135 + # fix /
136 + line="$(echo ${line} | sed 's:/:\\/:g')"
137 +
138 + ret=$(sed "/^${line}$/d" ${file})
139 + if [[ -z ${ret} ]]
140 + then
141 + return 1
142 + else
143 + echo "${ret}"
144 + return 0
145 + fi
146 +}
147 +