Compile a Kernel and install it = impossible?

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Lexdale
Level 1
Level 1
Posts: 18
Joined: Sun Mar 06, 2016 8:08 am

Compile a Kernel and install it = impossible?

Postby Lexdale » Sun Jun 18, 2017 5:17 pm

Hi guys.

I've tried to compile a kernel and installing it on Linux Mint 18.1. I've tried to compile and install three different Kernel versions now, but with the same result:

ERROR MESSAGE
when I open up GRUB menu on boot, and choose the newly installed kernel, it hangs just after I see the text: "Loading initial ramdisk ..."
and then nothing.

I tried to change kernel boot mode to nomodeset, but it still hangs the same way.
If I choose to boot on the original kernel that ships with the Mint installation (with nomodeset) I see the terminal and all text that goes with it on boot.

This is how i compiled and installed my kernel:
Downloaded the kernel 4.0.1 and uncompressed it.

Then I copied the current configfile:
/boot/grub/config-[file] to directory /linux-4.0.1/.config

And after that I did this:
/linux-4.0.1/ make menuconfig
/linux-4.0.1/ make clean
/linux-4.0.1/ make deb-pkg

And after that reboot, and boot with new kernel and it hangs after "Loading initial ramdisk..."

I also tried installing the kernel this way:
sudo make modules_install install

I also tried to make .config file by typing: localmodconfig

I also tried to update grub by: sudo update-grub
But nothing I do helps.

So, two years ago I compiled a kernel and installed it on Ubuntu 14.04 this way, and it worked immediately, so for the fun of it I downloaded Ubuntu 14.04 yesterday and compiled and installed a kernel the same way, and of course it worked.

So, the question is: is there some special way in order to compile and install a kernel on Linux Mint?
(I'm not interested in installing a kernel in update-manager. I*m only interested in compiling and installing the kernel the old fashion way)

Here's my grub.cfg if you want to study it, I've highlighed the new kernel 4.0.1 below so it's easy to find:

Code: Select all

#
# 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="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 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,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 fb349731-8aa1-4c7b-a964-abb3739460f7
else
search --no-floppy --fs-uuid --set=root fb349731-8aa1-4c7b-a964-abb3739460f7
fi
font="/grub/unicode.pf2"
fi

if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=sv_SE
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
set timeout=30
else
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=hidden
set timeout=0
# Fallback hidden-timeout code in case the timeout_style feature is
# unavailable.
elif sleep --interruptible 0 ; then
set timeout=0
fi
fi
### END /etc/grub.d/00_header ###

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

### BEGIN /etc/grub.d/06_mint_theme ###
set menu_color_normal=white/black
set menu_color_highlight=white/light-gray
### END /etc/grub.d/06_mint_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="${1}"
if [ "${1}" = "keep" ]; then
set vt_handoff=vt.handoff=7
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 'Linux Mint 18.1 MATE 64-bit' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-f81fe850-7167-4d49-9838-f66d3b744511' {
recordfail
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 fb349731-8aa1-4c7b-a964-abb3739460f7
else
search --no-floppy --fs-uuid --set=root fb349731-8aa1-4c7b-a964-abb3739460f7
fi
linux   /vmlinuz-4.4.0-53-generic root=/dev/mapper/mint--vg-root ro quiet splash $vt_handoff
initrd   /initrd.img-4.4.0-53-generic
}
submenu 'Advanced flags for Linux Mint 18.1 MATE 64-bit' $menuentry_id_option 'gnulinux-advanced-f81fe850-7167-4d49-9838-f66d3b744511' {
menuentry 'Linux Mint 18.1 MATE 64-bit, with Linux 4.4.0-53-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-53-generic-advanced-f81fe850-7167-4d49-9838-f66d3b744511' {
recordfail
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 fb349731-8aa1-4c7b-a964-abb3739460f7
else
search --no-floppy --fs-uuid --set=root fb349731-8aa1-4c7b-a964-abb3739460f7
fi
echo   'Loading Linux 4.4.0-53-generic …'
linux   /vmlinuz-4.4.0-53-generic root=/dev/mapper/mint--vg-root ro quiet splash $vt_handoff
echo   'Loading initial ramdisk …'
initrd   /initrd.img-4.4.0-53-generic
}
menuentry 'Linux Mint 18.1 MATE 64-bit, with Linux 4.4.0-53-generic (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-53-generic-init-upstart-f81fe850-7167-4d49-9838-f66d3b744511' {
recordfail
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 fb349731-8aa1-4c7b-a964-abb3739460f7
else
search --no-floppy --fs-uuid --set=root fb349731-8aa1-4c7b-a964-abb3739460f7
fi
echo   'Loading Linux 4.4.0-53-generic …'
linux   /vmlinuz-4.4.0-53-generic root=/dev/mapper/mint--vg-root ro quiet splash $vt_handoff init=/sbin/upstart
echo   'Loading initial ramdisk …'
initrd   /initrd.img-4.4.0-53-generic
}
menuentry 'Linux Mint 18.1 MATE 64-bit, with Linux 4.4.0-53-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-53-generic-recovery-f81fe850-7167-4d49-9838-f66d3b744511' {
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 fb349731-8aa1-4c7b-a964-abb3739460f7
else
search --no-floppy --fs-uuid --set=root fb349731-8aa1-4c7b-a964-abb3739460f7
fi
echo   'Loading Linux 4.4.0-53-generic …'
linux   /vmlinuz-4.4.0-53-generic root=/dev/mapper/mint--vg-root ro recovery nomodeset
echo   'Loading initial ramdisk …'
initrd   /initrd.img-4.4.0-53-generic
}
[b]menuentry 'Linux Mint 18.1 MATE 64-bit, with Linux 4.0.1' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.0.1-advanced-f81fe850-7167-4d49-9838-f66d3b744511' {
recordfail
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 fb349731-8aa1-4c7b-a964-abb3739460f7
else
search --no-floppy --fs-uuid --set=root fb349731-8aa1-4c7b-a964-abb3739460f7
fi
echo   'Loading Linux 4.0.1 …'
linux   /vmlinuz-4.0.1 root=/dev/mapper/mint--vg-root ro quiet splash $vt_handoff
echo   'Loading initial ramdisk …'
initrd   /initrd.img-4.0.1
}
[/b]menuentry 'Linux Mint 18.1 MATE 64-bit, with Linux 4.0.1 (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.0.1-init-upstart-f81fe850-7167-4d49-9838-f66d3b744511' {
recordfail
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 fb349731-8aa1-4c7b-a964-abb3739460f7
else
search --no-floppy --fs-uuid --set=root fb349731-8aa1-4c7b-a964-abb3739460f7
fi
echo   'Loading Linux 4.0.1 …'
linux   /vmlinuz-4.0.1 root=/dev/mapper/mint--vg-root ro quiet splash $vt_handoff init=/sbin/upstart
echo   'Loading initial ramdisk …'
initrd   /initrd.img-4.0.1
}
menuentry 'Linux Mint 18.1 MATE 64-bit, with Linux 4.0.1 (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.0.1-recovery-f81fe850-7167-4d49-9838-f66d3b744511' {
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 fb349731-8aa1-4c7b-a964-abb3739460f7
else
search --no-floppy --fs-uuid --set=root fb349731-8aa1-4c7b-a964-abb3739460f7
fi
echo   'Loading Linux 4.0.1 …'
linux   /vmlinuz-4.0.1 root=/dev/mapper/mint--vg-root ro recovery nomodeset
echo   'Loading initial ramdisk …'
initrd   /initrd.img-4.0.1
}
}

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

### BEGIN /etc/grub.d/10_lupin ###
### END /etc/grub.d/10_lupin ###

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

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

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry 'Memory test (memtest86+)' {
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 fb349731-8aa1-4c7b-a964-abb3739460f7
else
search --no-floppy --fs-uuid --set=root fb349731-8aa1-4c7b-a964-abb3739460f7
fi
knetbsd   /memtest86+.elf
}
menuentry 'Memory test (memtest86+, serial console 115200)' {
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 fb349731-8aa1-4c7b-a964-abb3739460f7
else
search --no-floppy --fs-uuid --set=root fb349731-8aa1-4c7b-a964-abb3739460f7
fi
linux16   /memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

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

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

### 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.
### 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 ###


Here is /boot/
drwxr-xr-x 4 root root 1,0K jun 16 07:34 .
drwxr-xr-x 23 root root 4,0K jun 16 05:05 ..
-rw-r--r-- 1 root root 1,2M dec 2 2016 abi-4.4.0-53-generic
-rw-r--r-- 1 root root 175K jun 16 07:32 config-4.0.1
-rw-r--r-- 1 root root 186K dec 2 2016 config-4.4.0-53-generic
drwxr-xr-x 5 root root 1,0K jun 16 07:34 grub
-rw-r--r-- 1 root root 254M jun 16 07:34 initrd.img-4.0.1
-rw-r--r-- 1 root root 40M jun 16 05:05 initrd.img-4.4.0-53-generic
drwx------ 2 root root 12K jun 16 05:02 lost+found
-rw-r--r-- 1 root root 179K jan 28 2016 memtest86+.bin
-rw-r--r-- 1 root root 181K jan 28 2016 memtest86+.elf
-rw-r--r-- 1 root root 181K jan 28 2016 memtest86+_multiboot.bin
-rw-r--r-- 1 root root 3,5M jun 16 07:32 System.map-4.0.1
-rw------- 1 root root 3,7M dec 2 2016 System.map-4.4.0-53-generic
-rw-r--r-- 1 root root 6,5M jun 16 07:32 vmlinuz-4.0.1
-rw-r--r-- 1 root root 6,8M dec 13 2016 vmlinuz-4.4.0-53-generic


Here is /
drwxr-xr-x 23 root root 4,0K jun 16 05:05 .
drwxr-xr-x 23 root root 4,0K jun 16 05:05 ..
drwxr-xr-x 2 root root 4,0K jun 16 05:06 bin
drwxr-xr-x 4 root root 1,0K jun 16 07:34 boot
drwxr-xr-x 2 root root 4,0K jun 16 05:04 cdrom
drwxr-xr-x 20 root root 4,3K jun 17 10:08 dev
drwxr-xr-x 155 root root 12K jun 16 05:47 etc
drwxr-xr-x 3 root root 4,0K jun 16 05:05 home
rwxrwxrwx 1 root root 32 jun 16 05:05 initrd.img -> boot/initrd.img-4.4.0-53-generic[/b]
drwxr-xr-x 25 root root 4,0K jun 16 05:06 lib
drwxr-xr-x 2 root root 4,0K dec 13 2016 lib64
drwx------ 2 root root 16K jun 16 05:02 lost+found
drwxr-xr-x 2 root root 4,0K dec 13 2016 media
drwxr-xr-x 2 root root 4,0K dec 13 2016 mnt
drwxr-xr-x 2 root root 4,0K dec 13 2016 opt
dr-xr-xr-x 181 root root 0 jun 17 10:03 proc
drwx------ 7 root root 4,0K jun 16 05:51 root
drwxr-xr-x 31 root root 980 jun 17 10:23 run
drwxr-xr-x 2 root root 12K jun 16 05:06 sbin
drwxr-xr-x 2 root root 4,0K dec 13 2016 srv
dr-xr-xr-x 13 root root 0 jun 17 10:03 sys
drwxrwxrwt 13 root root 4,0K jun 17 10:23 tmp
drwxr-xr-x 10 root root 4,0K dec 13 2016 usr
drwxr-xr-x 11 root root 4,0K dec 13 2016 var
lrwxrwxrwx 1 root root 29 jun 16 05:05 vmlinuz -> boot/vmlinuz-4.4.0-53-generic


Here you can see the end of compiling+installation of the new kernel:
......
........
..........
INSTALL /lib/firmware/cpia2/stv0672_vp4.bin
INSTALL /lib/firmware/yam/1200.bin
INSTALL /lib/firmware/yam/9600.bin
DEPMOD 4.0.1
sh ./arch/x86/boot/install.sh 4.0.1 arch/x86/boot/bzImage \
System.map "/boot"
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.0.1 /boot/vmlinuz-4.0.1
run-parts: executing /etc/kernel/postinst.d/dkms 4.0.1 /boot/vmlinuz-4.0.1
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.0.1 /boot/vmlinuz-4.0.1
update-initramfs: Generating /boot/initrd.img-4.0.1
Warning: No support for locale: sv_SE.utf8
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.0.1 /boot/vmlinuz-4.0.1
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.0.1 /boot/vmlinuz-4.0.1
Generating configfile for grub …
Found linux-image: /boot/vmlinuz-4.4.0-53-generic
Found initrd-image: /boot/initrd.img-4.4.0-53-generic
Found linux-image: /boot/vmlinuz-4.0.1
Found initrd-image: /boot/initrd.img-4.0.1
Found memtest86+ image: /memtest86+.elf
Found memtest86+ image: /memtest86+.bin
Done


Can someone please help me before I loose my mind over this
Thanks
Last edited by Lexdale on Mon Jun 19, 2017 12:22 pm, edited 1 time in total.

User avatar
jimallyn
Level 15
Level 15
Posts: 5804
Joined: Thu Jun 05, 2014 7:34 pm
Location: Wenatchee, WA USA

Re: Compile a Kernel and install it = impossible?

Postby jimallyn » Sun Jun 18, 2017 5:32 pm

Is there some particular reason that you want to go to the trouble of compiling and installing a 4.0.1 kernel when Mint comes with a 4.4 kernel and also has 4.8 and 4.10 kernels available for installation?
Image

“If the government were coming for your TVs and cars, then you'd be upset. But, as it is, they're only coming for your sons.” - Daniel Berrigan

Lexdale
Level 1
Level 1
Posts: 18
Joined: Sun Mar 06, 2016 8:08 am

Re: Compile a Kernel and install it = impossible?

Postby Lexdale » Sun Jun 18, 2017 5:40 pm

jimallyn wrote:Is there some particular reason that you want to go to the trouble of compiling and installing a 4.0.1 kernel when Mint comes with a 4.4 kernel and also has 4.8 and 4.10 kernels available for installation?


No, there's no particular reason, I just grabbed some kernel. And I've tried with tree different kernel versions now, but with the same result.
What am I doing wrong? this always worked fine on Ubuntu 14.04. I just have to compile some kernel and install it, and that's that.

I'm not interested in installing a kernel with help of update-manager, I have to do it the old fashion way.

User avatar
Laurent85
Level 12
Level 12
Posts: 4392
Joined: Tue May 26, 2015 10:11 am
Location: Vendée, France

Re: Compile a Kernel and install it = impossible?

Postby Laurent85 » Mon Jun 19, 2017 10:20 am

Linux Mint uses kernel packages from Ubuntu repositories. And Ubuntu does not use vanilla kernels, their own patches are applied on the linux kernel tree. Building your own kernel from the vanilla tree will lead to inconsistencies with the system framework. Unless you know what you are doing stick to official kernels available from Update Manager.

You may get help building your own kernel in the Other topics forum section, Linux Mint does not support unofficial kernels.
Image
H: Pedro, est-ce le chant du fufu ou l'odeur du poivrier,
H: Je me sens une autre femme ?
P: Honorine, viens sous les palétuviers.
H: Sous les palétuviers ? Oh ! Vous en avez de ces mots.

User avatar
JerryF
Level 5
Level 5
Posts: 844
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: Compile a Kernel and install it = impossible?

Postby JerryF » Mon Jun 19, 2017 11:25 am

Lexdale,

If you could, please, next time when you post something long like that, put it in between the Code tags? I makes it so much easier to go through the postings. Thanks. :wink:
As an example:

Code: Select all

#
# 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="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 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,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 fb349731-8aa1-4c7b-a964-abb3739460f7
else
search --no-floppy --fs-uuid --set=root fb349731-8aa1-4c7b-a964-abb3739460f7
fi
font="/grub/unicode.pf2"
fi

if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=sv_SE
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
set timeout=30
else
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=hidden
set timeout=0
# Fallback hidden-timeout code in case the timeout_style feature is
# unavailable.
elif sleep --interruptible 0 ; then
set timeout=0
fi
fi
### END /etc/grub.d/00_header ###

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

### BEGIN /etc/grub.d/06_mint_theme ###
set menu_color_normal=white/black
set menu_color_highlight=white/light-gray
### END /etc/grub.d/06_mint_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="${1}"
if [ "${1}" = "keep" ]; then
set vt_handoff=vt.handoff=7
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 'Linux Mint 18.1 MATE 64-bit' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-f81fe850-7167-4d49-9838-f66d3b744511' {
recordfail
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 fb349731-8aa1-4c7b-a964-abb3739460f7
else
search --no-floppy --fs-uuid --set=root fb349731-8aa1-4c7b-a964-abb3739460f7
fi
linux   /vmlinuz-4.4.0-53-generic root=/dev/mapper/mint--vg-root ro quiet splash $vt_handoff
initrd   /initrd.img-4.4.0-53-generic
}
submenu 'Advanced flags for Linux Mint 18.1 MATE 64-bit' $menuentry_id_option 'gnulinux-advanced-f81fe850-7167-4d49-9838-f66d3b744511' {
menuentry 'Linux Mint 18.1 MATE 64-bit, with Linux 4.4.0-53-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-53-generic-advanced-f81fe850-7167-4d49-9838-f66d3b744511' {
recordfail
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 fb349731-8aa1-4c7b-a964-abb3739460f7
else
search --no-floppy --fs-uuid --set=root fb349731-8aa1-4c7b-a964-abb3739460f7
fi
echo   'Loading Linux 4.4.0-53-generic …'
linux   /vmlinuz-4.4.0-53-generic root=/dev/mapper/mint--vg-root ro quiet splash $vt_handoff
echo   'Loading initial ramdisk …'
initrd   /initrd.img-4.4.0-53-generic
}
menuentry 'Linux Mint 18.1 MATE 64-bit, with Linux 4.4.0-53-generic (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-53-generic-init-upstart-f81fe850-7167-4d49-9838-f66d3b744511' {
recordfail
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 fb349731-8aa1-4c7b-a964-abb3739460f7
else
search --no-floppy --fs-uuid --set=root fb349731-8aa1-4c7b-a964-abb3739460f7
fi
echo   'Loading Linux 4.4.0-53-generic …'
linux   /vmlinuz-4.4.0-53-generic root=/dev/mapper/mint--vg-root ro quiet splash $vt_handoff init=/sbin/upstart
echo   'Loading initial ramdisk …'
initrd   /initrd.img-4.4.0-53-generic
}
menuentry 'Linux Mint 18.1 MATE 64-bit, with Linux 4.4.0-53-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-53-generic-recovery-f81fe850-7167-4d49-9838-f66d3b744511' {
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 fb349731-8aa1-4c7b-a964-abb3739460f7
else
search --no-floppy --fs-uuid --set=root fb349731-8aa1-4c7b-a964-abb3739460f7
fi
echo   'Loading Linux 4.4.0-53-generic …'
linux   /vmlinuz-4.4.0-53-generic root=/dev/mapper/mint--vg-root ro recovery nomodeset
echo   'Loading initial ramdisk …'
initrd   /initrd.img-4.4.0-53-generic
}
menuentry 'Linux Mint 18.1 MATE 64-bit, with Linux 4.0.1' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.0.1-advanced-f81fe850-7167-4d49-9838-f66d3b744511' {
recordfail
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 fb349731-8aa1-4c7b-a964-abb3739460f7
else
search --no-floppy --fs-uuid --set=root fb349731-8aa1-4c7b-a964-abb3739460f7
fi
echo   'Loading Linux 4.0.1 …'
linux   /vmlinuz-4.0.1 root=/dev/mapper/mint--vg-root ro quiet splash $vt_handoff
echo   'Loading initial ramdisk …'
initrd   /initrd.img-4.0.1
}
menuentry 'Linux Mint 18.1 MATE 64-bit, with Linux 4.0.1 (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.0.1-init-upstart-f81fe850-7167-4d49-9838-f66d3b744511' {
recordfail
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 fb349731-8aa1-4c7b-a964-abb3739460f7
else
search --no-floppy --fs-uuid --set=root fb349731-8aa1-4c7b-a964-abb3739460f7
fi
echo   'Loading Linux 4.0.1 …'
linux   /vmlinuz-4.0.1 root=/dev/mapper/mint--vg-root ro quiet splash $vt_handoff init=/sbin/upstart
echo   'Loading initial ramdisk …'
initrd   /initrd.img-4.0.1
}
menuentry 'Linux Mint 18.1 MATE 64-bit, with Linux 4.0.1 (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.0.1-recovery-f81fe850-7167-4d49-9838-f66d3b744511' {
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 fb349731-8aa1-4c7b-a964-abb3739460f7
else
search --no-floppy --fs-uuid --set=root fb349731-8aa1-4c7b-a964-abb3739460f7
fi
echo   'Loading Linux 4.0.1 …'
linux   /vmlinuz-4.0.1 root=/dev/mapper/mint--vg-root ro recovery nomodeset
echo   'Loading initial ramdisk …'
initrd   /initrd.img-4.0.1
}
}

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

### BEGIN /etc/grub.d/10_lupin ###
### END /etc/grub.d/10_lupin ###

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

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

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry 'Memory test (memtest86+)' {
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 fb349731-8aa1-4c7b-a964-abb3739460f7
else
search --no-floppy --fs-uuid --set=root fb349731-8aa1-4c7b-a964-abb3739460f7
fi
knetbsd   /memtest86+.elf
}
menuentry 'Memory test (memtest86+, serial console 115200)' {
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 fb349731-8aa1-4c7b-a964-abb3739460f7
else
search --no-floppy --fs-uuid --set=root fb349731-8aa1-4c7b-a964-abb3739460f7
fi
linux16   /memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

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

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

### 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.
### 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 ###
Don't forget to edit your original post as [SOLVED] if your problem has been fixed.
My main language is English. I speak very little Portuguese, and a whole lot of gibberish.

Lexdale
Level 1
Level 1
Posts: 18
Joined: Sun Mar 06, 2016 8:08 am

Re: Compile a Kernel and install it = impossible?

Postby Lexdale » Mon Jun 19, 2017 12:42 pm

@Laurent85

Unofficial kernel?
Isn't every kernel official? I always used to grab kernels from here when compiling then: https://www.kernel.org/

Some odd if what you're saying is correct, that kernels are tied to some particular kernels.

The compiling and installation of the kernel is a side-project of mine, and I must do it the old fashion way and not through the update-manager.
I find it very odd the the most popular Linux dist does not support compiling and installation of kernels.

What if I want to enable NFS-module in Kernel to run in Linux Mint? Then I would have to compile and install it the old fashion way.
Are you saying that this can't be done and that I can never enable modules like NFS in Mint?

Compiling and installing kernels was never a problem in Ubuntu and I always used to compile kernels before I changed to Linux Mint. It seems weird that it's now a huge problem in Mint because Mint is based on Ubuntu.

Thoughts on this ?

Still awaiting a solution to this compiling & install -kernel-problem.

User avatar
Laurent85
Level 12
Level 12
Posts: 4392
Joined: Tue May 26, 2015 10:11 am
Location: Vendée, France

Re: Compile a Kernel and install it = impossible?

Postby Laurent85 » Mon Jun 19, 2017 1:22 pm

You are trying to install a core component of the system not coming from official repositories, hence not supported by the distribution. If it does not work, I mean, that's not a Mint issue, so consider posting your request in the Other topics forum section.
Image
H: Pedro, est-ce le chant du fufu ou l'odeur du poivrier,
H: Je me sens une autre femme ?
P: Honorine, viens sous les palétuviers.
H: Sous les palétuviers ? Oh ! Vous en avez de ces mots.

User avatar
Flemur
Level 12
Level 12
Posts: 4112
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Compile a Kernel and install it = impossible?

Postby Flemur » Mon Jun 19, 2017 1:38 pm

FWIW, here's my kernel compiling adventure....
viewtopic.php?f=42&t=113329
I think the steps depend on where you get your kernel source...
Mint 18.1 Xfce/fluxbox/pulse-less - Xubuntu 16.10/fluxbox/pulse-less
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?

Lexdale
Level 1
Level 1
Posts: 18
Joined: Sun Mar 06, 2016 8:08 am

Re: Compile a Kernel and install it = impossible?

Postby Lexdale » Mon Jun 19, 2017 3:22 pm

Flemur wrote:FWIW, here's my kernel compiling adventure....
viewtopic.php?f=42&t=113329
I think the steps depend on where you get your kernel source...


So I tried this, but didn't work. Same error: when booting with new kernel it hangs at "Loading initial ramdisk …"

User avatar
Schultz
Level 5
Level 5
Posts: 581
Joined: Thu Feb 25, 2016 8:57 pm

Re: Compile a Kernel and install it = impossible?

Postby Schultz » Mon Jun 19, 2017 3:30 pm

Lexdale wrote:
Isn't every kernel official?

Not by Mint.

Lexdale
Level 1
Level 1
Posts: 18
Joined: Sun Mar 06, 2016 8:08 am

Re: Compile a Kernel and install it = impossible?

Postby Lexdale » Mon Jun 19, 2017 4:15 pm

Schultz wrote:
Lexdale wrote:
Isn't every kernel official?

Not by Mint.


How do I download the source for a Mint Kernel then? Let's say I want to download a particular version, like 3.19.

User avatar
Flemur
Level 12
Level 12
Posts: 4112
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Compile a Kernel and install it = impossible?

Postby Flemur » Mon Jun 19, 2017 4:51 pm

Lexdale wrote:
Schultz wrote:
Lexdale wrote:
Isn't every kernel official?

Not by Mint.

How do I download the source for a Mint Kernel then? Let's say I want to download a particular version, like 3.19.

Look up "linux-source" in synaptic, e.g.

Package "linux-source-4.10.0" :
Linux kernel source for version 4.10.0 with Ubuntu patches
This package provides the source code for the Linux kernel version 4.10.0.
This package is mainly meant for other packages to use, in order to build
custom flavours.

I don't see 3.19 there.
Mint 18.1 Xfce/fluxbox/pulse-less - Xubuntu 16.10/fluxbox/pulse-less
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?

User avatar
Laurent85
Level 12
Level 12
Posts: 4392
Joined: Tue May 26, 2015 10:11 am
Location: Vendée, France

Re: Compile a Kernel and install it = impossible?

Postby Laurent85 » Tue Jun 20, 2017 6:41 am

Lexdale wrote:How do I download the source for a Mint Kernel then? Let's say I want to download a particular version, like 3.19.

Mint uses Ubuntu kernel packages. The Ubuntu kernel sources are available from the git repositories at http://kernel.ubuntu.com/git/
Image
H: Pedro, est-ce le chant du fufu ou l'odeur du poivrier,
H: Je me sens une autre femme ?
P: Honorine, viens sous les palétuviers.
H: Sous les palétuviers ? Oh ! Vous en avez de ces mots.

Lexdale
Level 1
Level 1
Posts: 18
Joined: Sun Mar 06, 2016 8:08 am

Re: Compile a Kernel and install it = impossible?

Postby Lexdale » Tue Jun 20, 2017 7:26 pm

Laurent85 wrote:
Lexdale wrote:How do I download the source for a Mint Kernel then? Let's say I want to download a particular version, like 3.19.

Mint uses Ubuntu kernel packages. The Ubuntu kernel sources are available from the git repositories at http://kernel.ubuntu.com/git/


Exaktly how do I browse this site for specific kernels? What am I supposed to search for? I'm not seeing any structure like in the official Kernel.org : https://www.kernel.org/pub/

I'm only seeing lots of stuff that I don't even know it is.

And, how do I download from here? do I use "git clone https://.. ... " ?

User avatar
Laurent85
Level 12
Level 12
Posts: 4392
Joined: Tue May 26, 2015 10:11 am
Location: Vendée, France

Re: Compile a Kernel and install it = impossible?

Postby Laurent85 » Tue Jun 20, 2017 11:07 pm

Kernel sources for xenial are available from this repositority http://kernel.ubuntu.com/git/ubuntu/ubuntu-xenial.git

If you don't know git, you will have to learn the basics beforehand.

To clone the repo locally use :

Code: Select all

git clone git://kernel.ubuntu.com/ubuntu/ubuntu-xenial.git
Image
H: Pedro, est-ce le chant du fufu ou l'odeur du poivrier,
H: Je me sens une autre femme ?
P: Honorine, viens sous les palétuviers.
H: Sous les palétuviers ? Oh ! Vous en avez de ces mots.

Lexdale
Level 1
Level 1
Posts: 18
Joined: Sun Mar 06, 2016 8:08 am

Re: Compile a Kernel and install it = impossible?

Postby Lexdale » Wed Jun 21, 2017 3:37 pm

Just used clone git http:// .. .. But still don't understand how to download a specific kernel from there.
How do I git clone /download kernel 3.17 ?

Thanks
Last edited by Lexdale on Wed Jun 21, 2017 5:04 pm, edited 1 time in total.

JeremyB
Level 16
Level 16
Posts: 6633
Joined: Fri Feb 21, 2014 8:17 am

Re: Compile a Kernel and install it = impossible?

Postby JeremyB » Wed Jun 21, 2017 4:50 pm

I haven't built my own kernel for LM18 but I did for LM17 and I didn't make any manual changes to the grub file. After I had the kernel installed, I just ran sudo update-grub

You may also want to use menu config rather than old config if you are going to build older kernels than the one running

User avatar
Laurent85
Level 12
Level 12
Posts: 4392
Joined: Tue May 26, 2015 10:11 am
Location: Vendée, France

Re: Compile a Kernel and install it = impossible?

Postby Laurent85 » Wed Jun 21, 2017 11:28 pm

Image
H: Pedro, est-ce le chant du fufu ou l'odeur du poivrier,
H: Je me sens une autre femme ?
P: Honorine, viens sous les palétuviers.
H: Sous les palétuviers ? Oh ! Vous en avez de ces mots.

User avatar
trytip
Level 5
Level 5
Posts: 676
Joined: Tue Jul 05, 2016 1:20 pm

Re: Compile a Kernel and install it = impossible?

Postby trytip » Thu Jun 22, 2017 12:10 am

The compiling and installation of the kernel is a side-project of mine, and I must do it the old fashion way and not through the update-manager.


if the above is true then you would have more help asking in the kernel forum not the mint forum. https://www.kernel.org/


Return to “Installation & Boot”

Who is online

Users browsing this forum: excollier, swati123 and 9 guests