Lines 28-38
Link Here
|
28 |
|
28 |
|
29 |
CLASS="--class gnu-linux --class gnu --class os --class xen" |
29 |
CLASS="--class gnu-linux --class gnu --class os --class xen" |
30 |
|
30 |
|
31 |
if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then |
31 |
if [ -r /etc/altlinux-release ]; then |
32 |
OS=GNU/Linux |
32 |
OS=`cat /etc/altlinux-release | sed 's/ (.*$//g' | sed "s, $,,"` |
33 |
else |
33 |
else |
34 |
OS="${GRUB_DISTRIBUTOR} GNU/Linux" |
34 |
OS="ALTLinux" |
35 |
CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) ${CLASS}" |
|
|
36 |
fi |
35 |
fi |
37 |
|
36 |
|
38 |
# loop-AES arranges things so that /dev/loop/X can be our root device, but |
37 |
# loop-AES arranges things so that /dev/loop/X can be our root device, but |
Lines 44-50
Link Here
|
44 |
esac |
43 |
esac |
45 |
|
44 |
|
46 |
if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ |
45 |
if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ |
47 |
|| ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \ |
46 |
|| ! blkid -U "${GRUB_DEVICE_UUID}" > /dev/null \ |
48 |
|| uses_abstraction "${GRUB_DEVICE}" lvm; then |
47 |
|| uses_abstraction "${GRUB_DEVICE}" lvm; then |
49 |
LINUX_ROOT_DEVICE=${GRUB_DEVICE} |
48 |
LINUX_ROOT_DEVICE=${GRUB_DEVICE} |
50 |
else |
49 |
else |
Lines 138-144
Link Here
|
138 |
EOF |
137 |
EOF |
139 |
} |
138 |
} |
140 |
|
139 |
|
141 |
linux_list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* /boot/kernel-*; do |
140 |
[ ! -z $GRUB_VMLINUZ_SYMLINKS ] || GRUB_VMLINUZ_SYMLINKS="default" |
|
|
141 |
[ ! -z $GRUB_VMLINUZ_FAILSAFE ] || GRUB_VMLINUZ_FAILSAFE="default" |
142 |
|
143 |
linux_list=`ls -c1 /boot/vmlinu[z]-* | while read i; do |
142 |
if grub_file_is_not_garbage "$i"; then |
144 |
if grub_file_is_not_garbage "$i"; then |
143 |
basename=$(basename $i) |
145 |
basename=$(basename $i) |
144 |
version=$(echo $basename | sed -e "s,^[^0-9]*-,,g") |
146 |
version=$(echo $basename | sed -e "s,^[^0-9]*-,,g") |
Lines 150-156
Link Here
|
150 |
break |
152 |
break |
151 |
fi |
153 |
fi |
152 |
done |
154 |
done |
153 |
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 |
155 |
if [ $i = "/boot/vmlinuz-xen" ]; then |
|
|
156 |
echo -n "$i " |
157 |
elif (grep -qx "CONFIG_XEN_DOM0=y" "${config}" 2> /dev/null || grep -qx "CONFIG_XEN_PRIVILEGED_GUEST=y" "${config}" 2> /dev/null); then |
158 |
echo -n "$i " ; |
159 |
fi |
154 |
fi |
160 |
fi |
155 |
done` |
161 |
done` |
156 |
if [ "x${linux_list}" = "x" ] ; then |
162 |
if [ "x${linux_list}" = "x" ] ; then |
Lines 166-172
Link Here
|
166 |
esac |
172 |
esac |
167 |
} |
173 |
} |
168 |
|
174 |
|
169 |
xen_list=`for i in /boot/xen*; do |
175 |
xen_list=`for i in /boot/xen-*.*.*.gz; do |
170 |
if grub_file_is_not_garbage "$i" && file_is_not_sym "$i" ; then echo -n "$i " ; fi |
176 |
if grub_file_is_not_garbage "$i" && file_is_not_sym "$i" ; then echo -n "$i " ; fi |
171 |
done` |
177 |
done` |
172 |
prepare_boot_cache= |
178 |
prepare_boot_cache= |
Lines 198-208
Link Here
|
198 |
if [ -z "$boot_device_id" ]; then |
204 |
if [ -z "$boot_device_id" ]; then |
199 |
boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")" |
205 |
boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")" |
200 |
fi |
206 |
fi |
201 |
if [ "x$is_first_entry" != xtrue ]; then |
|
|
202 |
echo " submenu '$(gettext_printf "Xen hypervisor, version %s" "${xen_version}" | grub_quote)' \$menuentry_id_option 'xen-hypervisor-$xen_version-$boot_device_id' {" |
203 |
fi |
204 |
while [ "x$list" != "x" ] ; do |
207 |
while [ "x$list" != "x" ] ; do |
205 |
linux=`version_find_latest $list` |
208 |
linux=`echo $list | sed 's, .*,,g'` |
206 |
gettext_printf "Found linux image: %s\n" "$linux" >&2 |
209 |
gettext_printf "Found linux image: %s\n" "$linux" >&2 |
207 |
basename=`basename $linux` |
210 |
basename=`basename $linux` |
208 |
dirname=`dirname $linux` |
211 |
dirname=`dirname $linux` |
Lines 210-215
Link Here
|
210 |
version=`echo $basename | sed -e "s,^[^0-9]*-,,g"` |
213 |
version=`echo $basename | sed -e "s,^[^0-9]*-,,g"` |
211 |
alt_version=`echo $version | sed -e "s,\.old$,,g"` |
214 |
alt_version=`echo $version | sed -e "s,\.old$,,g"` |
212 |
linux_root_device_thisversion="${LINUX_ROOT_DEVICE}" |
215 |
linux_root_device_thisversion="${LINUX_ROOT_DEVICE}" |
|
|
216 |
if [ -L "$linux" ]; then |
217 |
if [ "x$GRUB_VMLINUZ_SYMLINKS" = "xno" ] || [ "x$GRUB_VMLINUZ_SYMLINKS" = "xfalse" ]; then |
218 |
echo "skipping symlink: $linux" >&2 |
219 |
list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '` |
220 |
continue |
221 |
fi |
222 |
if [ "$linux" != "/boot/vmlinuz-xen" ] && [ "x$GRUB_VMLINUZ_SYMLINKS" = "xdefault" ]; then |
223 |
echo "skipping symlink: $linux" >&2 |
224 |
list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '` |
225 |
continue |
226 |
fi |
227 |
fi |
213 |
|
228 |
|
214 |
initrd= |
229 |
initrd= |
215 |
for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \ |
230 |
for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \ |