@@ -207,7 +207,7 @@ find_rootdev() {
207
207
local ident_type=uuid
208
208
if ! [ -e " $GRUB_DEVICE " ] ; then
209
209
ident_type=error
210
- elif bool " $GRUB_DISABLE_LINUX_UUID " ; then
210
+ elif bool " $GRUB_DISABLE_LINUX_UUID " || [ " $1 " = " fallback " ] ; then
211
211
if bool " $GRUB_DISABLE_LINUX_PARTUUID " ; then
212
212
ident_type=path
213
213
else
@@ -317,6 +317,7 @@ process_kernels() {
317
317
latest_kernels=($( prioritize ${latest_kernels[@]} ) )
318
318
unset IFS
319
319
ROOT_PARAM=" root=$( find_rootdev) "
320
+ ROOT_PARAM_FALLBACK=" root=$( find_rootdev fallback) "
320
321
if [ -z " ${ROOT_PARAM## root=} " ] ; then
321
322
gettext_printf " Internal error - Failed to find the root device\n" >&2
322
323
exit 1
@@ -328,7 +329,11 @@ process_kernels() {
328
329
localpart=" ${uname_r// $latest / } "
329
330
comments=" $( get_comments " $uname_r " ) "
330
331
title=" ${OS}${comments} "
331
- linux_entry " $title " " ${GRUB_KERNEL_DIR}${kernel} " " $( get_initrd " $uname_r " ) " " $ARGS " " ${OS_ID} -${kernel} "
332
+ initrd=" $( get_initrd " $uname_r " ) "
333
+ if [ -z ${initrd/ ${INITRD_EARLY} / } ] ; then
334
+ ARGS=" ${ARGS/ $ROOT_PARAM / $ROOT_PARAM_FALLBACK } "
335
+ fi
336
+ linux_entry " $title " " ${GRUB_KERNEL_DIR}${kernel} " " $initrd " " $ARGS " " ${OS_ID} -${kernel} "
332
337
done
333
338
# Now we processed the latest versions of the kernel, time to put
334
339
# other kernel versions into the submenu.
@@ -350,7 +355,11 @@ process_kernels() {
350
355
comments=" $( gettext_printf " With kernel %s" " $uname_r " ) "
351
356
comments=" ($( echo " $comments " | grub_quote) )"
352
357
title=" ${OS}${comments} "
353
- linux_entry " $title " " ${GRUB_KERNEL_DIR} /${kernel} " " $( get_initrd " $uname_r " ) " " $ARGS " " ${OS_ID} -${kernel} "
358
+ initrd=" $( get_initrd " $uname_r " ) "
359
+ if [ -z ${initrd/ ${INITRD_EARLY} / } ] ; then
360
+ ARGS=" ${ARGS/ $ROOT_PARAM / $ROOT_PARAM_FALLBACK } "
361
+ fi
362
+ linux_entry " $title " " ${GRUB_KERNEL_DIR}${kernel} " " $initrd " " $ARGS " " ${OS_ID} -${kernel} "
354
363
done
355
364
done
356
365
printf " }\n"
0 commit comments