Bug after editing 40_custom

Bug #1881872 reported by PERCE-NEIGE
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Grub Customizer
New
Undecided
Unassigned

Bug Description

Everything worked fine, until I created and edited the 40_custom file.

I wanted to add Android-x86 Lineage to Grub, which is not possible through os-prober.

After refreshing Grub-customizer to take into consideration the content of 40_custom, 40_custom disappeared (it can't be found in the "backup" file in grub.d, the only 40_custom in this backup folder is an untouched version, without what I've added.) and it produced a Grub-customizer error.

Content of 40_custom:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry "LINEAGEx" {
set root='(hd0,17)'
linux /android-4.4-RC2/kernel quiet root=/dev/ram0 androidboot.hardware=android_x86 acpi_sleep=s3_bios,s3_mode SRC=/android-4.4-RC2S SDCARD=/data/sdcard.img
initrd /android-4.4-RC2/initrd.img}

Output error from Grub-customizer:
Failed running "grub-mkconfig -o" /boot/grub/grub.cfg" output:
Sourcing file "/etc/default/grub"
Sourcing file "/etc/default/grub.d/50_peppermint.cfg"
Création du fichier de configuration GRUB...
Thème trouvé (...)
Image Linux trouvée:/boot/vmlinuz-4.15.0-101-generic
Image mémoire initiale trouvée: /boot/initrd.img-4.15.0-101-generic
(...)
erreur:syntax error.
erreur:Incorrect command.
erreur:syntax error.
Erreur de syntaxe à la ligne 124
Des erreurs de syntaxe sont détectées dans le fichier de configuration GRUB. (....)

Grub.new content =>

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="${saved_entry}"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}
function recordfail {
  set recordfail=1
  if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}
function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5' 871d1117-1dd7-4348-a4e6-9d4912737ce5
else
  search --no-floppy --fs-uuid --set=root 871d1117-1dd7-4348-a4e6-9d4912737ce5
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=fr_FR
  insmod gettext
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1' b0182798-5eb8-4218-a1e3-413e95a20a06
else
  search --no-floppy --fs-uuid --set=root b0182798-5eb8-4218-a1e3-413e95a20a06
fi
insmod gfxmenu
loadfont ($root)/grub/themes/starfield/dejavu_10.pf2
loadfont ($root)/grub/themes/starfield/dejavu_12.pf2
loadfont ($root)/grub/themes/starfield/dejavu_14.pf2
loadfont ($root)/grub/themes/starfield/dejavu_16.pf2
loadfont ($root)/grub/themes/starfield/dejavu_bold_14.pf2
insmod png
set theme=($root)/grub/themes/starfield/theme.txt
export theme
if [ "${recordfail}" = 1 ] ; then
  set timeout=30
else
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=menu
    set timeout=10
  # Fallback normal timeout code in case the timeout_style feature is
  # unavailable.
  else
    set timeout=10
  fi
fi
play 480 440 1
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=light-gray/black
set menu_color_highlight=white/red
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/40_custom_proxy ###
menuentry "LINEAGEx" { set root='(hd0,7)' linux /android-6.0-rc1/kernel quiet root=/dev/ram0 androidboot.hardware=android_x86 acpi_sleep=s3_bios,s3_mode SRC=/android-6.0-rc1 SDCARD=/data/sdcard.img initrd /android-6.0-rc1/initrd.img{
}
### END /etc/grub.d/40_custom_proxy ###

### BEGIN /etc/grub.d/41_linux_proxy ###

function gfxmode {
 set gfxpayload="${1}"
 if [ "${1}" = "keep" ]; then
  set vt_handoff=vt.handoff=1
 else
  set vt_handoff=
 fi
}
if [ "${recordfail}" != 1 ]; then
  if [ -e ${prefix}/gfxblacklist.txt ]; then
    if hwmatch ${prefix}/gfxblacklist.txt 3; then
      if [ ${match} = 0 ]; then
        set linux_gfx_mode=keep
      else
        set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
export linux_gfx_mode

menuentry "Peppermint GNU/Linux" --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-871d1117-1dd7-4348-a4e6-9d4912737ce5' {
 recordfail
 savedefault
 load_video
 gfxmode $linux_gfx_mode
 insmod gzio
 if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
 insmod part_msdos
 insmod ext2
 set root='hd0,msdos1'
 if [ x$feature_platform_search_hint = xy ]; then
   search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1' b0182798-5eb8-4218-a1e3-413e95a20a06
 else
   search --no-floppy --fs-uuid --set=root b0182798-5eb8-4218-a1e3-413e95a20a06
 fi
        linux /vmlinuz-4.15.0-101-generic root=UUID=871d1117-1dd7-4348-a4e6-9d4912737ce5 ro quiet splash $vt_handoff
 initrd /initrd.img-4.15.0-101-generic
}
submenu "Options avancées pour Peppermint GNU/Linux"{
menuentry "Peppermint GNU/Linux, avec Linux 4.15.0-101-generic" --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-101-generic-advanced-871d1117-1dd7-4348-a4e6-9d4912737ce5' {
  recordfail
 savedefault
  load_video
  gfxmode $linux_gfx_mode
  insmod gzio
  if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
  insmod part_msdos
  insmod ext2
  set root='hd0,msdos1'
  if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1' b0182798-5eb8-4218-a1e3-413e95a20a06
  else
    search --no-floppy --fs-uuid --set=root b0182798-5eb8-4218-a1e3-413e95a20a06
  fi
  echo 'Chargement de Linux 4.15.0-101-generic…'
         linux /vmlinuz-4.15.0-101-generic root=UUID=871d1117-1dd7-4348-a4e6-9d4912737ce5 ro quiet splash $vt_handoff
  echo 'Chargement du disque mémoire initial…'
  initrd /initrd.img-4.15.0-101-generic
}
menuentry "Peppermint GNU/Linux, with Linux 4.15.0-101-generic (recovery mode)" --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-101-generic-recovery-871d1117-1dd7-4348-a4e6-9d4912737ce5' {
  recordfail
  load_video
  insmod gzio
  if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
  insmod part_msdos
  insmod ext2
  set root='hd0,msdos1'
  if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1' b0182798-5eb8-4218-a1e3-413e95a20a06
  else
    search --no-floppy --fs-uuid --set=root b0182798-5eb8-4218-a1e3-413e95a20a06
  fi
  echo 'Chargement de Linux 4.15.0-101-generic…'
         linux /vmlinuz-4.15.0-101-generic root=UUID=871d1117-1dd7-4348-a4e6-9d4912737ce5 ro recovery nomodeset
  echo 'Chargement du disque mémoire initial…'
  initrd /initrd.img-4.15.0-101-generic
}
}
### END /etc/grub.d/41_linux_proxy ###

### BEGIN /etc/grub.d/42_custom_proxy ###

# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.

menuentry "LINEAGEx" { set root='(hd0,7)' linux /android-6.0-rc1/kernel quiet root=/dev/ram0 androidboot.hardware=android_x86 acpi_sleep=s3_bios,s3_mode SRC=/android-6.0-rc1 SDCARD=/data/sdcard.img initrd /android-6.0-rc1/initrd.img{
}
### END /etc/grub.d/42_custom_proxy ###

### BEGIN /etc/grub.d/45_linux_xen ###

### END /etc/grub.d/45_linux_xen ###

### BEGIN /etc/grub.d/46_os-prober_proxy ###

set timeout_style=menu
if [ "${timeout}" = 0 ]; then
  set timeout=10
fi
menuentry "Windows Recovery Environment (sur /dev/sda6)" --class windows --class os $menuentry_id_option 'osprober-chain-3965-EAB6' {
 savedefault
 insmod part_msdos
 insmod fat
 set root='hd0,msdos6'
 if [ x$feature_platform_search_hint = xy ]; then
   search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 --hint='hd0,msdos6' 3965-EAB6
 else
   search --no-floppy --fs-uuid --set=root 3965-EAB6
 fi
 parttool ${root} hidden-
 drivemap -s (hd0) ${root}
 chainloader +1
}
### END /etc/grub.d/46_os-prober_proxy ###

### BEGIN /etc/grub.d/47_custom_proxy ###
menuentry "LINEAGEx" { set root='(hd0,7)' linux /android-6.0-rc1/kernel quiet root=/dev/ram0 androidboot.hardware=android_x86 acpi_sleep=s3_bios,s3_mode SRC=/android-6.0-rc1 SDCARD=/data/sdcard.img initrd /android-6.0-rc1/initrd.img{
}
### END /etc/grub.d/47_custom_proxy ###

### BEGIN /etc/grub.d/48_linux_proxy ###
### END /etc/grub.d/48_linux_proxy ###

### BEGIN /etc/grub.d/49_os-prober_proxy ###
menuentry "Windows Recovery Environment (sur /dev/sda6)" --class windows --class os $menuentry_id_option 'osprober-chain-3965-EAB6' {
 savedefault
 insmod part_msdos
 insmod fat
 set root='hd0,msdos6'
 if [ x$feature_platform_search_hint = xy ]; then
   search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 --hint='hd0,msdos6' 3965-EAB6
 else
   search --no-floppy --fs-uuid --set=root 3965-EAB6
 fi
 parttool ${root} hidden-
 drivemap -s (hd0) ${root}
 chainloader +1
}
### END /etc/grub.d/49_os-prober_proxy ###

### BEGIN /etc/grub.d/50_linux_proxy ###
### END /etc/grub.d/50_linux_proxy ###

### BEGIN /etc/grub.d/51_uefi-firmware ###
### END /etc/grub.d/51_uefi-firmware ###

### BEGIN /etc/grub.d/52_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/52_custom ###

Tags: boot grub
description: updated
description: updated
tags: added: grub
tags: added: boot
tags: removed: grub
tags: added: grub
no longer affects: grub
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.