SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi everyone.
This is how the grub.cfg looks like after I have edited the 40_custom file. I also have removed the 10_linux, 20_linux_xen, 30_os_prober and the 41_custom entries. After that I edited the 40_custom file and added its entry I have run the grub.mkconfig command. Then, below is the version of the grub.cfg file that I have now.
the four distros and windows7 are booting perfectly.
I have copied these data from former grub.cfg file and edited the 40_custom adding the data I copied.
However,I think it is too full of information.
Which lines of each entry can be removed? Is there a more simple example of these entries I could apply to make it more simple?
how can I simplify the file?
Quote:
GNU nano 2.3.2 File: /mnt/sda2/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 ###
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="0"
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 vga
insmod video_bochs
insmod video_cirrus
fi
}
if [ x$feature_default_font_path = xy ] ; then
font=dejavusansmono
else
insmod part_msdos
insmod ext2
set root='hd0,msdos2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 a4818efe-2e15-4599-8797-c4f269329eaf
else
search --no-floppy --fs-uuid --set=root a4818efe-2e15-4599-8797-c4f269329eaf
fi
font="/usr/share/grub/dejavusansmono.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_output gfxterm
set timeout=10
### END /etc/grub.d/00_header ###
### 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 'Slackware64 current GNU/Linux, with Linux generic' --class slackware-14.1 --class gnu-linux --class gnu --class os {
load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 a4818efe-2e15-4599-8797-c4f269329eaf
else
search --no-floppy --fs-uuid --set=root a4818efe-2e15-4599-8797-c4f269329eaf
fi
echo 'Loading Linux generic ...'
linux /boot/vmlinuz-generic root=UUID=a4818efe-2e15-4599-8797-c4f269329eaf ro
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.gz
}
menuentry 'Windows 7 (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-9C7AC58F7AC5671C' {
insmod part_msdos
insmod ntfs
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 9C7AC58F7AC5671C
else
search --no-floppy --fs-uuid --set=root 9C7AC58F7AC5671C
fi
chainloader +1
}
menuentry 'Arch Linux, com o Linux linux (on /dev/sdb1)' --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1 6ea90d2a-f445-4dc2-88ae-cdedcd2be530
else
search --no-floppy --fs-uuid --set=root 6ea90d2a-f445-4dc2-88ae-cdedcd2be530
fi
linux /boot/vmlinuz-linux root=UUID=6ea90d2a-f445-4dc2-88ae-cdedcd2be530 rw quiet
initrd /boot/initramfs-linux.img
}
menuentry 'Slackware Linux (Slackware64 14.1) Microlinux (on /dev/sdc1)' --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='hd2,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1 9bb6f931-b14c-4a09-be04-77cf908351b1
else
search --no-floppy --fs-uuid --set=root 9bb6f931-b14c-4a09-be04-77cf908351b1
fi
linux /boot/vmlinuz-generic-3.10.17 root=/dev/sdc1
initrd /boot/initrd.gz
}
menuentry 'Slackware Linux (Slackware64 14.1) (on /dev/sdd1)' --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='hd3,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos1 --hint-efi=hd3,msdos1 --hint-baremetal=ahci3,msdos1 251245f5-041c-49ea-b427-fe18674d7735
else
search --no-floppy --fs-uuid --set=root 251245f5-041c-49ea-b427-fe18674d7735
fi
linux /boot/vmlinuz-generic-3.10.17 root=/dev/sdd1
initrd /boot/initrd.gz
}
### END /etc/grub.d/40_custom ###
Last edited by cezarrangel; 12-06-2014 at 04:25 AM.
thank you so much reaperX7. what I mean are the lines of the menuentries inside " begin /etc/grub.d/40_custom"part . Not above this part. I have seen other possibilities with less information.
Last edited by cezarrangel; 12-06-2014 at 04:16 AM.
Yeah, most are options, disk detection, etc. It's best to use /etc/defaults/grub rather than editing /boot/grub/grub.cfg directly if you aren't comfortable reading scripts. Best to leave it as is.
I thank you all. Colorpurple21859: this grub.cfg above is the result of the solution you gave me in another thread and now I will improve it even more with the suggestion below:
Quote:
menuentry 'Slackware on sdd1'{
set root=(hd4)
chainloader +1
}
maybe I should replace the chainloader +1 line (if I would not use its function) by the linux and inirt lines and that would be a very simple entry for 40_custom
besides, without the "--class gnu-linux --class gnu --class os" references
What you have is the very minimal needed to chainload to another boot loader. The chainloader +1 line is needed if your handing off the boot process to another bootloader. When booting a kernel, The linux line tells the bootloader the location of the kernel to be booted and options to pass to the kernel. The initrd line, like wise, tells the the bootloader the location of the initrd file, if one is required to boot the kernel. In both cases the set root line tells the bootloader what disk/partition to use.
Last edited by colorpurple21859; 12-06-2014 at 07:49 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.