LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-25-2018, 04:39 PM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Rep: Reputation: 76
Syntax error in grub.cfg.


Hi:
Code:
root@revenge grub.d]# cat /etc/grub.d/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.

echo "Adding Slackware-current." >&2
cat << EOF
menuentry "Slackware-current" {
set root=(hd0,3)
linux /mnt/boot/vmlinuz-generic root=/dev/mmcblk0p3 ro quiet splash
initrd  /mnt/boot/initrd.gz
}
EOF
[root@revenge grub.d]#
Where is the syntax error. grub-mkconfig -o /boot/grub/grub.cfg reports it. The command was
Code:
[root@revenge grub]# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux-zen
Found initrd image: /boot/intel-ucode.img /boot/initramfs-linux-zen.img
Found fallback initrd image(s) in /boot: initramfs-linux-zen-fallback.img
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/intel-ucode.img /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot: initramfs-linux-fallback.img
Found Slackware 14.2 (pre-15.0 -current) on /dev/mmcblk0p3
error: syntax error.
error: Incorrect command.
error: syntax error.
Syntax error at line 223
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/grub.cfg.new file attached.
[root@revenge grub]#

Last edited by stf92; 05-25-2018 at 04:43 PM.
 
Old 05-25-2018, 05:02 PM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
why are you using a custom file for slackwhere, grub doe not pick it up on its own?
do you have one of them laptops that has their "hdd" as a sd card setup, or are you using a SD Card plugged into your laptop SD Card Slot?

for current as it is right now grub shows it as slackwear 14.2+ for current.

cat << EOF and EOF does not belong in there
 
Old 05-25-2018, 05:19 PM   #3
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Rep: Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161
Quote:
Where is the syntax error.
Change the file to just this:

Code:
menuentry "Slackware-current" {
set root=(hd0,3)
linux /mnt/boot/vmlinuz-generic root=/dev/mmcblk0p3 ro quiet splash
initrd  /mnt/boot/initrd.gz
}
Also, is /mnt/boot correct?
 
Old 05-25-2018, 06:11 PM   #4
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Quote:
Originally Posted by BW-userx View Post
why are you using a custom file for slackwhere, grub doe not pick it up on its own?
It seems to have a problem with initrd.
Quote:
do you have one of them laptops that has their "hdd" as a sd card setup, or are you using a SD Card plugged into your laptop SD Card Slot?
Yes, it has an eMMC device instead of a hard disk.
 
Old 05-25-2018, 06:25 PM   #5
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Code:
[root@revenge grub]# cat grub.cfg
#
# 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 ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  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="0"
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 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
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root  4b48227b-6b20-4cdd-b9a4-fee01fab42d4
else
  search --no-floppy --fs-uuid --set=root 4b48227b-6b20-4cdd-b9a4-fee01fab42d4
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=en_US
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-4b48227b-6b20-4cdd-b9a4-fee01fab42d4' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_msdos
	insmod ext2
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root  4b48227b-6b20-4cdd-b9a4-fee01fab42d4
	else
	  search --no-floppy --fs-uuid --set=root 4b48227b-6b20-4cdd-b9a4-fee01fab42d4
	fi
	echo	'Loading Linux linux-zen ...'
	linux	/boot/vmlinuz-linux-zen root=UUID=4b48227b-6b20-4cdd-b9a4-fee01fab42d4 rw  quiet noapic
	echo	'Loading initial ramdisk ...'
	initrd	/boot/intel-ucode.img /boot/initramfs-linux-zen.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-4b48227b-6b20-4cdd-b9a4-fee01fab42d4' {
	menuentry 'Arch Linux, with Linux linux-zen' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-zen-advanced-4b48227b-6b20-4cdd-b9a4-fee01fab42d4' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_msdos
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  4b48227b-6b20-4cdd-b9a4-fee01fab42d4
		else
		  search --no-floppy --fs-uuid --set=root 4b48227b-6b20-4cdd-b9a4-fee01fab42d4
		fi
		echo	'Loading Linux linux-zen ...'
		linux	/boot/vmlinuz-linux-zen root=UUID=4b48227b-6b20-4cdd-b9a4-fee01fab42d4 rw  quiet noapic
		echo	'Loading initial ramdisk ...'
		initrd	/boot/intel-ucode.img /boot/initramfs-linux-zen.img
	}
	menuentry 'Arch Linux, with Linux linux-zen (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-zen-fallback-4b48227b-6b20-4cdd-b9a4-fee01fab42d4' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_msdos
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  4b48227b-6b20-4cdd-b9a4-fee01fab42d4
		else
		  search --no-floppy --fs-uuid --set=root 4b48227b-6b20-4cdd-b9a4-fee01fab42d4
		fi
		echo	'Loading Linux linux-zen ...'
		linux	/boot/vmlinuz-linux-zen root=UUID=4b48227b-6b20-4cdd-b9a4-fee01fab42d4 rw  quiet noapic
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initramfs-linux-zen-fallback.img
	}
	menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-4b48227b-6b20-4cdd-b9a4-fee01fab42d4' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_msdos
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  4b48227b-6b20-4cdd-b9a4-fee01fab42d4
		else
		  search --no-floppy --fs-uuid --set=root 4b48227b-6b20-4cdd-b9a4-fee01fab42d4
		fi
		echo	'Loading Linux linux ...'
		linux	/boot/vmlinuz-linux root=UUID=4b48227b-6b20-4cdd-b9a4-fee01fab42d4 rw  quiet noapic
		echo	'Loading initial ramdisk ...'
		initrd	/boot/intel-ucode.img /boot/initramfs-linux.img
	}
	menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-4b48227b-6b20-4cdd-b9a4-fee01fab42d4' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_msdos
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  4b48227b-6b20-4cdd-b9a4-fee01fab42d4
		else
		  search --no-floppy --fs-uuid --set=root 4b48227b-6b20-4cdd-b9a4-fee01fab42d4
		fi
		echo	'Loading Linux linux ...'
		linux	/boot/vmlinuz-linux root=UUID=4b48227b-6b20-4cdd-b9a4-fee01fab42d4 rw  quiet noapic
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initramfs-linux-fallback.img
	}
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Slackware 14.2 (pre-15.0 -current) (on /dev/mmcblk0p3)' --class slackware --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-ca12f07c-07c7-4c0a-a9c1-597b0d7020f0' {
	insmod part_msdos
	insmod ext2
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root  ca12f07c-07c7-4c0a-a9c1-597b0d7020f0
	else
	  search --no-floppy --fs-uuid --set=root ca12f07c-07c7-4c0a-a9c1-597b0d7020f0
	fi
	linux /boot/vmlinuz-generic-4.14.34 root=/dev/mmcblk0p3
}
submenu 'Advanced options for Slackware 14.2 (pre-15.0 -current) (on /dev/mmcblk0p3)' $menuentry_id_option 'osprober-gnulinux-advanced-ca12f07c-07c7-4c0a-a9c1-597b0d7020f0' {
	menuentry 'Slackware 14.2 (pre-15.0 -current) (on /dev/mmcblk0p3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-generic-4.14.34--ca12f07c-07c7-4c0a-a9c1-597b0d7020f0' {
		insmod part_msdos
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  ca12f07c-07c7-4c0a-a9c1-597b0d7020f0
		else
		  search --no-floppy --fs-uuid --set=root ca12f07c-07c7-4c0a-a9c1-597b0d7020f0
		fi
		linux /boot/vmlinuz-generic-4.14.34 root=/dev/mmcblk0p3
	}
	menuentry 'Slackware 14.2 (pre-15.0 -current) (on /dev/mmcblk0p3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-huge-4.14.34--ca12f07c-07c7-4c0a-a9c1-597b0d7020f0' {
		insmod part_msdos
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  ca12f07c-07c7-4c0a-a9c1-597b0d7020f0
		else
		  search --no-floppy --fs-uuid --set=root ca12f07c-07c7-4c0a-a9c1-597b0d7020f0
		fi
		linux /boot/vmlinuz-huge-4.14.34 root=/dev/mmcblk0p3
	}
}

### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# 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 "Slackware-current" {
set root=(hd0,3)
linux /mnt/boot/vmlinuz-generic root=/dev/mmcblk0p3 ro quiet splash
initrd  /mnt/boot/initrd.gz
}
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_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/41_custom ###
[root@revenge grub]#
You see?, the os-prober puts the huge kernel, but I want the generic one to be booted!
 
Old 05-25-2018, 06:25 PM   #6
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Quote:
Originally Posted by upnort View Post
Change the file to just this:

Code:
menuentry "Slackware-current" {
set root=(hd0,3)
linux /mnt/boot/vmlinuz-generic root=/dev/mmcblk0p3 ro quiet splash
initrd  /mnt/boot/initrd.gz
}
Also, is /mnt/boot correct?
No, I think it is not. Thanks for the warning.
 
Old 05-25-2018, 06:58 PM   #7
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
you need to preform these steps to get your kernel changed over first. Then just updating grub should do the trick.

https://docs.slackware.com/slackware:beginners_guide

your sub menu
Code:
submenu 'Advanced options for Slackware 14.2 (pre-15.0 -current) (on /dev/mmcblk0p3)' $menuentry_id_option 'osprober-gnulinux-advanced-ca12f07c-07c7-4c0a-a9c1-597b0d7020f0' {
	menuentry 'Slackware 14.2 (pre-15.0 -current) (on /dev/mmcblk0p3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-generic-4.14.34--ca12f07c-07c7-4c0a-a9c1-597b0d7020f0' {
		insmod part_msdos
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  ca12f07c-07c7-4c0a-a9c1-597b0d7020f0
		else
		  search --no-floppy --fs-uuid --set=root ca12f07c-07c7-4c0a-a9c1-597b0d7020f0
		fi
		linux /boot/vmlinuz-generic-4.14.34 root=/dev/mmcblk0p3
But I'd still follow the steps in slack.docs

Last edited by BW-userx; 05-25-2018 at 07:01 PM.
 
Old 05-25-2018, 07:07 PM   #8
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
You say that's the submenu I should use? But where is the initrd line? Anyway, I erased the /mnt element from the path and ran grub-mkconfig, booted and the following happened:
Code:
/boot/initrd.gz: Loading kernel modules from initrd image:
insmod  /lib/modules/blah/blah
insmod /lib/modules/blah/blah
mount: can't find /mnt in /etc/fstab
ERROR: No /sbin/init found on rootdev (or not mounted). Trouble ahead.
I mount could not mount whatever it was then the error following makes sense (not mounted). The question is where does /mnt come from. Any file containing that word? I search the string 'mnt' in /boot/grub/grub.cfg and did not find it.

I will run the mkinitrd-command-generator and see what happens.

Last edited by stf92; 05-25-2018 at 07:26 PM.
 
Old 05-25-2018, 07:46 PM   #9
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by stf92 View Post
You say that's the submenu I should use? But where is the initrd line? Anyway, I erased the /mnt element from the path and ran grub-mkconfig, booted and the following happened:
Code:
/boot/initrd.gz: Loading kernel modules from initrd image:
insmod  /lib/modules/blah/blah
insmod /lib/modules/blah/blah
mount: can't find /mnt in /etc/fstab
ERROR: No /sbin/init found on rootdev (or not mounted). Trouble ahead.
I mount could not mount whatever it was then the error following makes sense (not mounted). The question is where does /mnt come from. Any file containing that word? I search the string 'mnt' in /boot/grub/grub.cfg and did not find it.

I will run the mkinitrd-command-generator and see what happens.
the custom file is made by the user, so you tell me where did you get the /mnt/
linux /boot/vmlinuz-generic-4.14.34 root=/dev/mmcblk0p3

I do not know the file structure for this type, but go to that link and read the instructions to change your kernel, but you have to boot in using your hudge then do the work when when you're finished then do not do the LiLo step, update grub instead.
 
Old 05-25-2018, 08:06 PM   #10
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by stf92 View Post
Code:
[root@revenge grub]# cat grub.cfg
#
# 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 ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  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="0"
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 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
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root  4b48227b-6b20-4cdd-b9a4-fee01fab42d4
else
  search --no-floppy --fs-uuid --set=root 4b48227b-6b20-4cdd-b9a4-fee01fab42d4
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=en_US
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-4b48227b-6b20-4cdd-b9a4-fee01fab42d4' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_msdos
	insmod ext2
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root  4b48227b-6b20-4cdd-b9a4-fee01fab42d4
	else
	  search --no-floppy --fs-uuid --set=root 4b48227b-6b20-4cdd-b9a4-fee01fab42d4
	fi
	echo	'Loading Linux linux-zen ...'
	linux	/boot/vmlinuz-linux-zen root=UUID=4b48227b-6b20-4cdd-b9a4-fee01fab42d4 rw  quiet noapic
	echo	'Loading initial ramdisk ...'
	initrd	/boot/intel-ucode.img /boot/initramfs-linux-zen.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-4b48227b-6b20-4cdd-b9a4-fee01fab42d4' {
	menuentry 'Arch Linux, with Linux linux-zen' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-zen-advanced-4b48227b-6b20-4cdd-b9a4-fee01fab42d4' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_msdos
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  4b48227b-6b20-4cdd-b9a4-fee01fab42d4
		else
		  search --no-floppy --fs-uuid --set=root 4b48227b-6b20-4cdd-b9a4-fee01fab42d4
		fi
		echo	'Loading Linux linux-zen ...'
		linux	/boot/vmlinuz-linux-zen root=UUID=4b48227b-6b20-4cdd-b9a4-fee01fab42d4 rw  quiet noapic
		echo	'Loading initial ramdisk ...'
		initrd	/boot/intel-ucode.img /boot/initramfs-linux-zen.img
	}
	menuentry 'Arch Linux, with Linux linux-zen (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-zen-fallback-4b48227b-6b20-4cdd-b9a4-fee01fab42d4' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_msdos
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  4b48227b-6b20-4cdd-b9a4-fee01fab42d4
		else
		  search --no-floppy --fs-uuid --set=root 4b48227b-6b20-4cdd-b9a4-fee01fab42d4
		fi
		echo	'Loading Linux linux-zen ...'
		linux	/boot/vmlinuz-linux-zen root=UUID=4b48227b-6b20-4cdd-b9a4-fee01fab42d4 rw  quiet noapic
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initramfs-linux-zen-fallback.img
	}
	menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-4b48227b-6b20-4cdd-b9a4-fee01fab42d4' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_msdos
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  4b48227b-6b20-4cdd-b9a4-fee01fab42d4
		else
		  search --no-floppy --fs-uuid --set=root 4b48227b-6b20-4cdd-b9a4-fee01fab42d4
		fi
		echo	'Loading Linux linux ...'
		linux	/boot/vmlinuz-linux root=UUID=4b48227b-6b20-4cdd-b9a4-fee01fab42d4 rw  quiet noapic
		echo	'Loading initial ramdisk ...'
		initrd	/boot/intel-ucode.img /boot/initramfs-linux.img
	}
	menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-4b48227b-6b20-4cdd-b9a4-fee01fab42d4' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_msdos
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  4b48227b-6b20-4cdd-b9a4-fee01fab42d4
		else
		  search --no-floppy --fs-uuid --set=root 4b48227b-6b20-4cdd-b9a4-fee01fab42d4
		fi
		echo	'Loading Linux linux ...'
		linux	/boot/vmlinuz-linux root=UUID=4b48227b-6b20-4cdd-b9a4-fee01fab42d4 rw  quiet noapic
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initramfs-linux-fallback.img
	}
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Slackware 14.2 (pre-15.0 -current) (on /dev/mmcblk0p3)' --class slackware --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-ca12f07c-07c7-4c0a-a9c1-597b0d7020f0' {
	insmod part_msdos
	insmod ext2
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root  ca12f07c-07c7-4c0a-a9c1-597b0d7020f0
	else
	  search --no-floppy --fs-uuid --set=root ca12f07c-07c7-4c0a-a9c1-597b0d7020f0
	fi
	linux /boot/vmlinuz-generic-4.14.34 root=/dev/mmcblk0p3
}
submenu 'Advanced options for Slackware 14.2 (pre-15.0 -current) (on /dev/mmcblk0p3)' $menuentry_id_option 'osprober-gnulinux-advanced-ca12f07c-07c7-4c0a-a9c1-597b0d7020f0' {
	menuentry 'Slackware 14.2 (pre-15.0 -current) (on /dev/mmcblk0p3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-generic-4.14.34--ca12f07c-07c7-4c0a-a9c1-597b0d7020f0' {
		insmod part_msdos
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  ca12f07c-07c7-4c0a-a9c1-597b0d7020f0
		else
		  search --no-floppy --fs-uuid --set=root ca12f07c-07c7-4c0a-a9c1-597b0d7020f0
		fi
		linux /boot/vmlinuz-generic-4.14.34 root=/dev/mmcblk0p3
	}
	menuentry 'Slackware 14.2 (pre-15.0 -current) (on /dev/mmcblk0p3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-huge-4.14.34--ca12f07c-07c7-4c0a-a9c1-597b0d7020f0' {
		insmod part_msdos
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  ca12f07c-07c7-4c0a-a9c1-597b0d7020f0
		else
		  search --no-floppy --fs-uuid --set=root ca12f07c-07c7-4c0a-a9c1-597b0d7020f0
		fi
		linux /boot/vmlinuz-huge-4.14.34 root=/dev/mmcblk0p3
	}
}

### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# 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 "Slackware-current" {
set root=(hd0,3)
linux /mnt/boot/vmlinuz-generic root=/dev/mmcblk0p3 ro quiet splash
initrd  /mnt/boot/initrd.gz
}
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_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/41_custom ###
[root@revenge grub]#
You see?, the os-prober puts the huge kernel, but I want the generic one to be booted!
Give https://github.com/Richard-Cranium/SlackwareGrub2 a try. Post if it works or not. (For example, it will attempt to match up files vmlinuz-generic-4.4.132 and initrd-4.4.132.gz first.)
 
Old 05-25-2018, 08:07 PM   #11
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,346

Rep: Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589
It should be this.

Code:
menuentry "Slackware-current" {
set root=(hd0,3)
linux /boot/vmlinuz-generic root=/dev/mmcblk0p3 ro quiet splash
initrd  /boot/initrd.gz
}
 
Old 05-25-2018, 09:22 PM   #12
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Either with my 40_custom or with Richard Cranium's file I get the same errors:
Code:
mbcache: export duplicate syjbol _mb_cache_entry_free (owned by kernel)
modprobe: ERROR: could not insert 'mb_cache': Exec format error
[Idem]
modprobe: ERROR: could not insert 'ext2': Exec format error
mmc0: new HS200 MMC card at address 0001
mount: mounting /dev/mmcblk0p3 on /mnt failed: No such file or directory
ERROR: No  /sbin/init found on rootdev (or not mounted). Trouble ahead.
Notice the slackware installer reads/writes the eMMC memory perfectly well. So in principle the drivers to access that device are there. By doing mkinitrd_command_generator.sh the driver for mmc (I forgot the name) appeared. So this was a great step forward in the road to boot Slackware on this machine. Now perhaps /dev/mmcblk0p3 should be named by the long name given by blkid.
 
Old 05-26-2018, 05:28 AM   #13
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Quote:
Originally Posted by stf92 View Post
Code:
mbcache: export duplicate syjbol _mb_cache_entry_free (owned by kernel)
modprobe: ERROR: could not insert 'mb_cache': Exec format error
[Idem]
modprobe: ERROR: could not insert 'ext2': Exec format error
Those errors indicate that you are still using the HUGE kernel instead of the generic kernel. The error is harmless by the way. It's what happens if you 'modprobe' a module which is already built into the kernel.
Since you are using "/boot/vmlinuz-generic" in your grub configuration, which is a symlink, it is probably pointing to the huge kernel.

You should always use the full name of the generic kernel and not rely on a symlink which is only there for newbies and to make unattended (huge) kernel installs and upgrades possible.

Last edited by Alien Bob; 05-26-2018 at 11:00 AM.
 
Old 05-26-2018, 06:46 AM   #14
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Well, there are two things I don't understand here. This is the latest grub.cfg I have used, which produced the errors shown above (post #):
Code:
[root@revenge grub]# cat /boot/grub/grub.cfg
#
# 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 ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  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="0"
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 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
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root  4b48227b-6b20-4cdd-b9a4-fee01fab42d4
else
  search --no-floppy --fs-uuid --set=root 4b48227b-6b20-4cdd-b9a4-fee01fab42d4
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=en_US
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/09_slackware_linux ###
### END /etc/grub.d/09_slackware_linux ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-4b48227b-6b20-4cdd-b9a4-fee01fab42d4' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_msdos
	insmod ext2
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root  4b48227b-6b20-4cdd-b9a4-fee01fab42d4
	else
	  search --no-floppy --fs-uuid --set=root 4b48227b-6b20-4cdd-b9a4-fee01fab42d4
	fi
	echo	'Loading Linux linux-zen ...'
	linux	/boot/vmlinuz-linux-zen root=UUID=4b48227b-6b20-4cdd-b9a4-fee01fab42d4 rw  quiet noapic
	echo	'Loading initial ramdisk ...'
	initrd	/boot/intel-ucode.img /boot/initramfs-linux-zen.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-4b48227b-6b20-4cdd-b9a4-fee01fab42d4' {
	menuentry 'Arch Linux, with Linux linux-zen' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-zen-advanced-4b48227b-6b20-4cdd-b9a4-fee01fab42d4' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_msdos
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  4b48227b-6b20-4cdd-b9a4-fee01fab42d4
		else
		  search --no-floppy --fs-uuid --set=root 4b48227b-6b20-4cdd-b9a4-fee01fab42d4
		fi
		echo	'Loading Linux linux-zen ...'
		linux	/boot/vmlinuz-linux-zen root=UUID=4b48227b-6b20-4cdd-b9a4-fee01fab42d4 rw  quiet noapic
		echo	'Loading initial ramdisk ...'
		initrd	/boot/intel-ucode.img /boot/initramfs-linux-zen.img
	}
	menuentry 'Arch Linux, with Linux linux-zen (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-zen-fallback-4b48227b-6b20-4cdd-b9a4-fee01fab42d4' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_msdos
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  4b48227b-6b20-4cdd-b9a4-fee01fab42d4
		else
		  search --no-floppy --fs-uuid --set=root 4b48227b-6b20-4cdd-b9a4-fee01fab42d4
		fi
		echo	'Loading Linux linux-zen ...'
		linux	/boot/vmlinuz-linux-zen root=UUID=4b48227b-6b20-4cdd-b9a4-fee01fab42d4 rw  quiet noapic
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initramfs-linux-zen-fallback.img
	}
	menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-4b48227b-6b20-4cdd-b9a4-fee01fab42d4' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_msdos
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  4b48227b-6b20-4cdd-b9a4-fee01fab42d4
		else
		  search --no-floppy --fs-uuid --set=root 4b48227b-6b20-4cdd-b9a4-fee01fab42d4
		fi
		echo	'Loading Linux linux ...'
		linux	/boot/vmlinuz-linux root=UUID=4b48227b-6b20-4cdd-b9a4-fee01fab42d4 rw  quiet noapic
		echo	'Loading initial ramdisk ...'
		initrd	/boot/intel-ucode.img /boot/initramfs-linux.img
	}
	menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-4b48227b-6b20-4cdd-b9a4-fee01fab42d4' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_msdos
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  4b48227b-6b20-4cdd-b9a4-fee01fab42d4
		else
		  search --no-floppy --fs-uuid --set=root 4b48227b-6b20-4cdd-b9a4-fee01fab42d4
		fi
		echo	'Loading Linux linux ...'
		linux	/boot/vmlinuz-linux root=UUID=4b48227b-6b20-4cdd-b9a4-fee01fab42d4 rw  quiet noapic
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initramfs-linux-fallback.img
	}
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Slackware 14.2 (pre-15.0 -current) (on /dev/mmcblk0p3)' --class slackware --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-ca12f07c-07c7-4c0a-a9c1-597b0d7020f0' {
	insmod part_msdos
	insmod ext2
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root  ca12f07c-07c7-4c0a-a9c1-597b0d7020f0
	else
	  search --no-floppy --fs-uuid --set=root ca12f07c-07c7-4c0a-a9c1-597b0d7020f0
	fi
	linux /boot/vmlinuz root=/dev/mmcblk0p3
	initrd /boot/initrd.gz
}
submenu 'Advanced options for Slackware 14.2 (pre-15.0 -current) (on /dev/mmcblk0p3)' $menuentry_id_option 'osprober-gnulinux-advanced-ca12f07c-07c7-4c0a-a9c1-597b0d7020f0' {
	menuentry 'Slackware 14.2 (pre-15.0 -current) (on /dev/mmcblk0p3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz--ca12f07c-07c7-4c0a-a9c1-597b0d7020f0' {
		insmod part_msdos
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  ca12f07c-07c7-4c0a-a9c1-597b0d7020f0
		else
		  search --no-floppy --fs-uuid --set=root ca12f07c-07c7-4c0a-a9c1-597b0d7020f0
		fi
		linux /boot/vmlinuz root=/dev/mmcblk0p3
		initrd /boot/initrd.gz
	}
	menuentry 'Slackware 14.2 (pre-15.0 -current) (on /dev/mmcblk0p3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz--ca12f07c-07c7-4c0a-a9c1-597b0d7020f0' {
		insmod part_msdos
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  ca12f07c-07c7-4c0a-a9c1-597b0d7020f0
		else
		  search --no-floppy --fs-uuid --set=root ca12f07c-07c7-4c0a-a9c1-597b0d7020f0
		fi
		linux /boot/vmlinuz root=/dev/mmcblk0p3
		initrd /boot/initrd.gz
	}
	menuentry 'Slackware 14.2 (pre-15.0 -current) (on /dev/mmcblk0p3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-generic--ca12f07c-07c7-4c0a-a9c1-597b0d7020f0' {
		insmod part_msdos
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  ca12f07c-07c7-4c0a-a9c1-597b0d7020f0
		else
		  search --no-floppy --fs-uuid --set=root ca12f07c-07c7-4c0a-a9c1-597b0d7020f0
		fi
		linux /boot/vmlinuz-generic root=/dev/mmcblk0p3
	}
	menuentry 'Slackware 14.2 (pre-15.0 -current) (on /dev/mmcblk0p3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-generic-4.14.34--ca12f07c-07c7-4c0a-a9c1-597b0d7020f0' {
		insmod part_msdos
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  ca12f07c-07c7-4c0a-a9c1-597b0d7020f0
		else
		  search --no-floppy --fs-uuid --set=root ca12f07c-07c7-4c0a-a9c1-597b0d7020f0
		fi
		linux /boot/vmlinuz-generic-4.14.34 root=/dev/mmcblk0p3
	}
	menuentry 'Slackware 14.2 (pre-15.0 -current) (on /dev/mmcblk0p3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-huge--ca12f07c-07c7-4c0a-a9c1-597b0d7020f0' {
		insmod part_msdos
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  ca12f07c-07c7-4c0a-a9c1-597b0d7020f0
		else
		  search --no-floppy --fs-uuid --set=root ca12f07c-07c7-4c0a-a9c1-597b0d7020f0
		fi
		linux /boot/vmlinuz-huge root=/dev/mmcblk0p3
	}
	menuentry 'Slackware 14.2 (pre-15.0 -current) (on /dev/mmcblk0p3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-huge-4.14.34--ca12f07c-07c7-4c0a-a9c1-597b0d7020f0' {
		insmod part_msdos
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  ca12f07c-07c7-4c0a-a9c1-597b0d7020f0
		else
		  search --no-floppy --fs-uuid --set=root ca12f07c-07c7-4c0a-a9c1-597b0d7020f0
		fi
		linux /boot/vmlinuz-huge-4.14.34 root=/dev/mmcblk0p3
	}
}

### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# 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 "Slackware-current" {
# set root=(hd0,3)
# linux /boot/vmlinuz-generic root=/dev/mmcblk0p3 ro quiet splash
# initrd /boot/initrd.gz
# }
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_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/41_custom ###
[root@revenge grub]#
If you see the entry of 09_slackware_linux, which is the stanza provided by Richard Cranium, you'll see the section is empty. This stanza is:
Code:
[root@revenge grub.d]# cat /etc/grub.d/09_slackware_linux 
#! /bin/sh
set -e
# grub-mkconfig helper script.
# Copyright (C) 2006,2007,2008,2009,2010  Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB.  If not, see <http://www.gnu.org/licenses/>.

prefix="/usr"
exec_prefix="${prefix}"
datarootdir="${prefix}/share"

. "${datarootdir}/grub/grub-mkconfig_lib"

export TEXTDOMAIN=grub
export TEXTDOMAINDIR="${datarootdir}/locale"

CLASS="--class gnu-linux --class gnu --class os"

if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
  OS=GNU/Linux
else
  OS="${GRUB_DISTRIBUTOR} GNU/Linux"
  CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]') ${CLASS}"
fi

# loop-AES arranges things so that /dev/loop/X can be our root device, but
# the initrds that Linux uses don't like that.
case ${GRUB_DEVICE} in
  /dev/loop/*|/dev/loop[0-9])
    GRUB_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"`
  ;;
esac

if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
    || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" ; then
  LINUX_ROOT_DEVICE=${GRUB_DEVICE}
else
  LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
fi

linux_entry ()
{
  os="$1"
  tag="$2"
  version="$3"
  recovery="$4"
  args="$5"
  if ${recovery} ; then
    title="$(gettext "%s, with Linux %s [%s] (recovery mode)")"
  else
    title="$(gettext "%s, with Linux %s [%s]")"
  fi
  printf "menuentry \"${title}\" ${CLASS} {\n" "${os}" "${version}" "${tag}"
  save_default_entry | sed -e "s/^/\t/"

  # Use ELILO's generic "efifb" when it's known to be available.
  # FIXME: We need an interface to select vesafb in case efifb can't be used.
  if [ "x$GRUB_GFXPAYLOAD_LINUX" = x ]; then
      if grep -qx "CONFIG_FB_EFI=y" /boot/config-${version} 2> /dev/null \
	  && grep -qx "CONFIG_VT_HW_CONSOLE_BINDING=y" /boot/config-${version} 2> /dev/null; then
	  cat << EOF
	set gfxpayload=keep
EOF
      fi
  else
	  cat << EOF
	set gfxpayload=$GRUB_GFXPAYLOAD_LINUX
EOF
  fi

  if [ -z "${prepare_boot_cache}" ]; then
    prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
  fi
  printf '%s\n' "${prepare_boot_cache}"
  cat << EOF
	echo	$(printf "$(gettext "Loading Linux %s ...")" ${version})
	linux	${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
EOF
  if test -n "${initrd}" ; then
    cat << EOF
	echo	$(gettext "Loading initial ramdisk ...")
	initrd	${rel_dirname}/${initrd}
EOF
  fi
  cat << EOF
}
EOF
}


process_list ()
{
    mylist="$1"
    tag="$2"
    initrd_allowed="$3"
    while [ "x$mylist" != "x" ] ; do
	linux=`version_find_latest $mylist`
	echo "Found linux image: $linux" >&2
	basename=`basename $linux`
	dirname=`dirname $linux`
	rel_dirname=`make_system_path_relative_to_its_root $dirname`
	version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
	alt_version=`echo $version | sed -e "s,\.old$,,g"`
	linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
        initrd=
	if [ "x${initrd_allowed}" = "xtrue" ]; then
	    for i in "initrd-${version}.gz" "initrd.gz" \
		"initrd.img-${version}" "initrd-${version}.img" \
		"initrd-${version}" "initrd.img-${alt_version}" \
		"initrd-${alt_version}.img" "initrd-${alt_version}"; do
		if test -e "${dirname}/${i}" ; then
		    initrd="$i"
		    break
		fi
	    done
	    if test -n "${initrd}" ; then
		echo "Found initrd image: ${dirname}/${initrd}" >&2
	    else
                # "UUID=" magic is parsed by initrds.  Since there's no initrd, it can't work here.
		linux_root_device_thisversion=${GRUB_DEVICE}
	    fi
	else
            # "UUID=" magic is parsed by initrds.  Since there's no initrd, it can't work here.
	    linux_root_device_thisversion=${GRUB_DEVICE}
	fi

	linux_entry "${OS}" "${tag}" "${version}" false \
	    "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
	if [ "x${GRUB_DISABLE_LINUX_RECOVERY}" != "xtrue" ]; then
	    linux_entry "${OS}" "${tag}" "${version}" true \
		"single ${GRUB_CMDLINE_LINUX}"
	fi

	mylist=`echo $mylist | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
    done
}

prepare_boot_cache=

list=`for i in /boot/vmlinu[xz]-generic-* /vmlinu[xz]-generic-* ; do
        if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
      done`

process_list "${list}" "generic" "true"

list=`for i in /boot/vmlinu[xz]-huge-* /vmlinu[xz]-huge-* ; do
        if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
      done`

process_list "${list}" "huge" "false"
[root@revenge grub.d]#
Why did grub-mkconfig not include this stanza? Second question. In the grub.cfg file there are a lot of menues and submenues for slackware in the os_prober section. Two of them have the words vmlinuz which is a symlink pointing to the huge kernel. And the submenu where it puts 'vmlinuz-generic' it does not include the initrd file!!!

In short: I need to know what the 09_slackware_linux file has that makes grub-mkinstall not to include it in grub.cfg. On the other hand, the vmlinuz-generic link is pointing to the generic kernel, as I have just checked.

EDIT: I have just edited by hand the grub.cfg file, replacing 'vmlinuz' by 'vmlinuz-generic' in the first submenu. The second submenu I don't care right now as it is the Advanced Options option when one boots. Result: no more errors due to modprobe but still it does not find /dev/mmcblk0p3. I'll replace this by the uuid number provided by blkid and see what happens.

Last edited by stf92; 05-26-2018 at 07:04 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] generating grub.cfg - error: mdadm: Unknown keyword ; masuch Linux - Newbie 2 06-23-2012 03:27 AM
Incorrect syntax in grub.cfg, or damaged boot sector? sonichedgehog Linux - Software 3 03-31-2011 11:44 AM
[SOLVED] Grub can't find grub.cfg when booting - error: no such device Breagha Linux - Software 8 03-14-2010 12:40 PM
Grub2 questions: need to know grub.cfg syntax for bootable grub_eltorito iso's?? linus72 Linux - General 11 02-11-2010 06:20 PM
timidity.cfg syntax error in first line... Simon Bridge Linux - Software 0 04-25-2004 09:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration