Return to Level1Techs.com

Proper Installation of New Kernel on OpenSUSE LEAP [A how to]

linux
opensuse
kernel

#1

Hi guys Heimdallr here… some of you may know me by earlier names such as cynicrf and the ever infamous rootz31820 but we wont go there lol. If you dont know… Dont Ask lol

Having written how to’s before and thanks to @Kat in the lounge I felt the need to write this one since there is quite a bit of misinformation and cutting corners on the other internet guides on the internet.

For this guide I will be installing linux kernel 4.12 though this applies to any kernel that can be installed. Screenshots of my terminal will be provided. OpenSUSE is unique in that everything I am doing via the CLI (Command Line Interface) can be done in the GUI unlike many other distributions thanks to YaST2. However I am a true believer in good command line skills and hard knocks linux schooling (which means I prefer you to get in break it beyond repair and fix it the hard way). So for this guide we will be using the CLI and I do hope for no breakage :wink:

@wendell given that you use SUSE or at least have used suse to an extensive degree before. If you feel that my process has made a mistep anywhere feel free to correct me

Step Zero: Because Zero is a number and this is essential

UNINSTALL YOUR PROPRIETARY DRIVERS FIRST. You can reinstall them afterwards.

Step one: Ascertain your current Kernel

Before we begin we need to know what kernel we are beginning with. This can be accomplished using screenfetch as you see above however I will provide a Uname example as its universally installed on the distribution.

uname -r

As you can see i am running the distribution default 4.4 variant with suse specific patches.

If you would like more information run the following command:

uname -a

Basically this gives you the date of the build and more information about the kernel.

This step is important because we need to know what kernel is the mainline for when we enable multiple kernel support on OpenSUSE (Disabled by default)

Step Two: Enable Multiple Kernel Support

Now, let us make the system to support multiple kernel configurations. This is to ensure our system should contain both latest or chosen kernel and mainline Kernel.

Im lazy so I use nano but vi will work just fine to edit this configuration. We need to edit he zypper configuration file and modified some lines.

sudo vi /etc/zypp/zypp.conf

or if preffered install nano (sudo zypper in nano) then run

sudo nano /etc/zypp/zypp.conf

ctrl+w type multiversion will get you to the sections you need in nano

( I HAVE no clue whats going on there) so The arrows are my forward slashes… @wendell something is weird here) My bad actually lol

After the quick edit you should be able to get into the editor and modified these lines …

multiversion = provides:multiversion(kernel) ==>
multiversion = provides:multiversion(kernel) 

multiversion.kernels = latest,latest-1,running, ==> multiversion.kernels = latest,latest-1,running,oldest

oldest will specify the mainline as can be seen from the code in the config below and in my screenshot

## Comma separated list of kernel packages to keep installed in parallel, if the
## above multiversion variable is set. Packages can be specified as
## 2.6.32.12-0.7 - Exact version to keep
## latest        - Keep kernel with the highest version number
## latest-N      - Keep kernel with the Nth highest version number
## running       - Keep the running kernel
## oldest        - Keep kernel with the lowest version number (the GA kernel)
## oldest+N      - Keep kernel with the Nth lowest version number
##
## Note: This entry is not evaluated by libzypp, but by the
##       purge-kernels service (via /sbin/purge-kernels).
##
## Default: Do not delete any kernels if multiversion = provides:multiversion(kernel) is set

I seriously do not know what is going on with the command window lol I will look into it later on my forums settings perhaps.

Here is the screenshot with the two lines in view.

Save and close the file in your editor.

Step Three: Obtaining Kernel Source

OpenSUSE has a repository specifically for the latest kernel though its never used on the shipped system as stability is preferred. The repository is called the OpenSUSE Kernel HEAD Repository and at the time of me writing this 4.12 is currently the latest kernel in there.

* Due to odd occurances early in the post I will no longer be using code blocks.

To add a repository with zypper we use zypper ar

sudo zypper ar -f http://download.opensuse.org/repositories/Kernel:/HEAD/standard/ kernel-repo

As you can see in the screenshot zypper informs you of the repository being added via its succes report which also lets you know the important properties of the repository in the configuration.

Step 4: Kernel Installation

Now we can install the kernel. Instead of the standard way Ubuntu and Fedora users are accustomed to OpenSUSE can have a specific part of the system or distribution upgraded via a specific repository. This is one of those features that keeps me on LEAP. Without further delay, run the following command to do distribution upgrade only from the Kernel HEAD repository. It means the Kernel will only be upgraded to the latest version from this repository. Please only update from trusted repositories.

sudo zypper dist-upgrade -r kernel-repo

Press a to always trust the repository and the upgrade process is complete. You can check the kernel you downloaded and reboot the system to use it via the command discussed earlier in this guide. HOWEVER Before rebooting if you have an Nvidia GPU you will want to edit the grub configuration to make sure nouveau.modeset=0 is a flag that is enabled due to the nature of nouveau. You probably are already familiar with this so I will leave this step out.

Screenshots too difficult LOL… here is a spit out of the terminal space

[email protected]:~> sudo zypper dist-upgrade -r kernel-repo
root's password:
Retrieving repository 'kernel-repo' metadata ------------------------------------------------------------------------------[\]

New repository or package signing key received:

  Repository:       kernel-repo                                   
  Key Name:         Kernel OBS Project <[email protected]>
  Key Fingerprint:  4529410A B52F94C4 03BAB484 ECEEF210 03579C1D  
  Key Created:      Fri 16 Jun 2017 08:16:45 AM MDT               
  Key Expires:      Sun 25 Aug 2019 08:16:45 AM MDT               
  Rpm Name:         gpg-pubkey-03579c1d-5943e84d                  


Do you want to reject the key, trust temporarily, or trust always? [r/t/a/? shows all options] (r): a
Retrieving repository 'kernel-repo' metadata ...........................................................................[done]
Building repository 'kernel-repo' cache ................................................................................[done]
Loading repository data...
Reading installed packages...
Computing distribution upgrade...

The following 5 NEW packages are going to be installed:
  kernel-default-4.12.0-2.1.g2399a91 kernel-default-devel-4.12.0-2.1.g2399a91 kernel-devel-4.12.0-2.1.g2399a91
  kernel-source-4.12.0-2.1.g2399a91 kernel-syms-4.12.0-2.1.g2399a91

The following 4 packages are going to be upgraded:
  kernel-firmware kernel-macros pesign-obs-integration ucode-amd

The following 4 packages are going to change vendor:
  kernel-firmware         openSUSE -> obs://build.opensuse.org/Kernel
  kernel-macros           openSUSE -> obs://build.opensuse.org/Kernel
  pesign-obs-integration  openSUSE -> obs://build.opensuse.org/Kernel
  ucode-amd               openSUSE -> obs://build.opensuse.org/Kernel


4 packages to upgrade, 5 new, 4  to change vendor.
Overall download size: 217.0 MiB. Already cached: 0 B. After the operation, additional 1.0 GiB will be used.
Continue? [y/n/...? shows all options] (y): y
Retrieving package kernel-default-4.12.0-2.1.g2399a91.x86_64                             (1/9),  62.0 MiB (330.2 MiB unpacked)
Retrieving: kernel-default-4.12.0-2.1.g2399a91.x86_64.rpm ..................................................[done (1.3 MiB/s)]
Retrieving package kernel-firmware-20170622-174.1.noarch                                 (2/9),  44.4 MiB (194.7 MiB unpacked)
Retrieving: kernel-firmware-20170622-174.1.noarch.rpm ......................................................[done (1.3 MiB/s)]
Retrieving package kernel-macros-4.12.0-2.1.g2399a91.noarch                              (3/9), 624.6 KiB (  6.3 KiB unpacked)
Retrieving: kernel-macros-4.12.0-2.1.g2399a91.noarch.rpm .................................................[done (749.8 KiB/s)]
Retrieving package pesign-obs-integration-10.0-33.1.x86_64                               (4/9),  30.4 KiB ( 57.9 KiB unpacked)
Retrieving: pesign-obs-integration-10.0-33.1.x86_64.rpm ................................................................[done]
Retrieving package ucode-amd-20170622-174.1.noarch                                       (5/9),  58.9 KiB ( 28.6 KiB unpacked)
Retrieving: ucode-amd-20170622-174.1.noarch.rpm ........................................................................[done]
Retrieving package kernel-devel-4.12.0-2.1.g2399a91.noarch                               (6/9),  11.5 MiB ( 55.2 MiB unpacked)
Retrieving: kernel-devel-4.12.0-2.1.g2399a91.noarch.rpm ....................................................[done (1.0 MiB/s)]
Retrieving package kernel-source-4.12.0-2.1.g2399a91.noarch                              (7/9),  94.6 MiB (640.9 MiB unpacked)
Retrieving: kernel-source-4.12.0-2.1.g2399a91.noarch.rpm ...................................................[done (1.5 MiB/s)]
Retrieving package kernel-default-devel-4.12.0-2.1.g2399a91.x86_64                       (8/9),   3.2 MiB (  4.1 MiB unpacked)
Retrieving: kernel-default-devel-4.12.0-2.1.g2399a91.x86_64.rpm ..........................................[done (941.7 KiB/s)]
Retrieving package kernel-syms-4.12.0-2.1.g2399a91.x86_64                                (9/9), 622.8 KiB (  345   B unpacked)
Retrieving: kernel-syms-4.12.0-2.1.g2399a91.x86_64.rpm .................................................................[done]
Checking for file conflicts: ...........................................................................................[done]
(1/9) Installing: kernel-default-4.12.0-2.1.g2399a91.x86_64 ............................................................[done]
Additional rpm output:
Creating initrd: /boot/initrd-4.12.0-2.g2399a91-default
dracut: Executing: /usr/bin/dracut --logfile /var/log/YaST2/mkinitrd.log --force /boot/initrd-4.12.0-2.g2399a91-default 4.12.0-2.g2399a91-default
modinfo: ERROR: Module processor not found.
modinfo: ERROR: Module usb_common not found.
modinfo: ERROR: Module crc16 not found.
modinfo: ERROR: Module autofs4 not found.
modinfo: ERROR: Module libahci not found.
modinfo: ERROR: Module virt_dma not found.
modinfo: ERROR: Module sd_mod not found.
modinfo: ERROR: Module gf128mul not found.
modinfo: ERROR: Module ctr not found.
modinfo: ERROR: Module mfd_core not found.
modinfo: ERROR: Module ahci not found.
modinfo: ERROR: Module drbg not found.
modinfo: ERROR: Module ecb not found.
modinfo: ERROR: Module libata not found.
modinfo: ERROR: Module scsi_mod not found.
dracut: *** Including module: bash ***
dracut: *** Including module: systemd ***
dracut: *** Including module: warpclock ***
dracut: *** Including module: systemd-initrd ***
dracut: *** Including module: i18n ***
dracut: Could not find FONT_MAP none!
dracut: *** Including module: drm ***
dracut: *** Including module: plymouth ***
dracut: *** Including module: btrfs ***
dracut: *** Including module: kernel-modules ***
dracut: *** Including module: resume ***
dracut: *** Including module: rootfs-block ***
dracut: *** Including module: suse-btrfs ***
dracut: *** Including module: terminfo ***
dracut: *** Including module: udev-rules ***
dracut: Skipping udev rule: 40-redhat.rules
dracut: Skipping udev rule: 50-firmware.rules
dracut: Skipping udev rule: 50-udev.rules
dracut: Skipping udev rule: 91-permissions.rules
dracut: Skipping udev rule: 80-drivers-modprobe.rules
dracut: *** Including module: dracut-systemd ***
dracut: *** Including module: haveged ***
dracut: *** Including module: usrmount ***
dracut: *** Including module: base ***
dracut: *** Including module: fs-lib ***
dracut: *** Including module: shutdown ***
dracut: *** Including module: suse ***
dracut: *** Including modules done ***
dracut: *** Installing kernel module dependencies and firmware ***
dracut: *** Installing kernel module dependencies and firmware done ***
dracut: *** Resolving executable dependencies ***
dracut: *** Resolving executable dependencies done***
dracut: *** Hardlinking files ***
dracut: *** Hardlinking files done ***
dracut: *** Stripping files ***
dracut: *** Stripping files done ***
dracut: *** Generating early-microcode cpio image ***
dracut: *** Constructing GenuineIntel.bin ****
dracut: *** Store current command line parameters ***
dracut: Stored kernel commandline:
dracut:  resume=UUID=69e6880d-f265-4f28-bf33-45502dd58641
dracut:  root=UUID=45397113-694f-4540-b23f-37cc370feb0b rootfstype=btrfs rootflags=rw,noatime,space_cache,subvolid=259,subvol=/@/.snapshots/1/snapshot,[email protected]/.snapshots/1/snapshot
dracut: *** Creating image file '/boot/initrd-4.12.0-2.g2399a91-default' ***
dracut: *** Creating initramfs image file '/boot/initrd-4.12.0-2.g2399a91-default' done ***


(2/9) Installing: kernel-firmware-20170622-174.1.noarch ................................................................[done]
(3/9) Installing: kernel-macros-4.12.0-2.1.g2399a91.noarch .............................................................[done]
(4/9) Installing: pesign-obs-integration-10.0-33.1.x86_64 ..............................................................[done]
(5/9) Installing: ucode-amd-20170622-174.1.noarch ......................................................................[done]
(6/9) Installing: kernel-devel-4.12.0-2.1.g2399a91.noarch ..............................................................[done]
(7/9) Installing: kernel-source-4.12.0-2.1.g2399a91.noarch .............................................................[done]
(8/9) Installing: kernel-default-devel-4.12.0-2.1.g2399a91.x86_64 ......................................................[done]
Additional rpm output:
Changing symlink /usr/src/linux-obj/x86_64/default from ../../linux-4.4.74-18.20-obj/x86_64/default to ../../linux-4.12.0-2.g2399a91-obj/x86_64/default


(9/9) Installing: kernel-syms-4.12.0-2.1.g2399a91.x86_64 ...............................................................[done]
Output of kernel-firmware-20170622-174.1.noarch.rpm %posttrans script:
    Creating initrd: /boot/initrd-4.12.0-2.g2399a91-default
    dracut: Executing: /usr/bin/dracut --logfile /var/log/YaST2/mkinitrd.log --force /boot/initrd-4.12.0-2.g2399a91-default 4.12.0-2.g2399a91-default
    modinfo: ERROR: Module processor not found.
    modinfo: ERROR: Module usb_common not found.
    modinfo: ERROR: Module crc16 not found.
    modinfo: ERROR: Module autofs4 not found.
    modinfo: ERROR: Module libahci not found.
    modinfo: ERROR: Module virt_dma not found.
    modinfo: ERROR: Module sd_mod not found.
    modinfo: ERROR: Module gf128mul not found.
    modinfo: ERROR: Module ctr not found.
    modinfo: ERROR: Module mfd_core not found.
    modinfo: ERROR: Module ahci not found.
    modinfo: ERROR: Module drbg not found.
    modinfo: ERROR: Module ecb not found.
    modinfo: ERROR: Module libata not found.
    modinfo: ERROR: Module scsi_mod not found.
    dracut: *** Including module: bash ***
    dracut: *** Including module: systemd ***
    dracut: *** Including module: warpclock ***
    dracut: *** Including module: systemd-initrd ***
    dracut: *** Including module: i18n ***
    dracut: Could not find FONT_MAP none!
    dracut: *** Including module: drm ***
    dracut: *** Including module: plymouth ***
    dracut: *** Including module: btrfs ***
    dracut: *** Including module: kernel-modules ***
    dracut: *** Including module: resume ***
    dracut: *** Including module: rootfs-block ***
    dracut: *** Including module: suse-btrfs ***
    dracut: *** Including module: terminfo ***
    dracut: *** Including module: udev-rules ***
    dracut: Skipping udev rule: 40-redhat.rules
    dracut: Skipping udev rule: 50-firmware.rules
    dracut: Skipping udev rule: 50-udev.rules
    dracut: Skipping udev rule: 91-permissions.rules
    dracut: Skipping udev rule: 80-drivers-modprobe.rules
    dracut: *** Including module: dracut-systemd ***
    dracut: *** Including module: haveged ***
    dracut: *** Including module: usrmount ***
    dracut: *** Including module: base ***
    dracut: *** Including module: fs-lib ***
    dracut: *** Including module: shutdown ***
    dracut: *** Including module: suse ***
    dracut: *** Including modules done ***
    dracut: *** Installing kernel module dependencies and firmware ***
    dracut: *** Installing kernel module dependencies and firmware done ***
    dracut: *** Resolving executable dependencies ***
    dracut: *** Resolving executable dependencies done***
    dracut: *** Hardlinking files ***
    dracut: *** Hardlinking files done ***
    dracut: *** Stripping files ***
    dracut: *** Stripping files done ***
    dracut: *** Generating early-microcode cpio image ***
    dracut: *** Constructing GenuineIntel.bin ****
    dracut: *** Store current command line parameters ***
    dracut: Stored kernel commandline:
    dracut:  resume=UUID=69e6880d-f265-4f28-bf33-45502dd58641
    dracut:  root=UUID=45397113-694f-4540-b23f-37cc370feb0b rootfstype=btrfs rootflags=rw,noatime,space_cache,subvolid=259,subvol=/@/.snapshots/1/snapshot,[email protected]/.snapshots/1/snapshot
    dracut: *** Creating image file '/boot/initrd-4.12.0-2.g2399a91-default' ***
    dracut: *** Creating initramfs image file '/boot/initrd-4.12.0-2.g2399a91-default' done ***
    Creating initrd: /boot/initrd-4.4.74-18.20-default
    dracut: Executing: /usr/bin/dracut --logfile /var/log/YaST2/mkinitrd.log --force /boot/initrd-4.4.74-18.20-default 4.4.74-18.20-default
    dracut: *** Including module: bash ***
    dracut: *** Including module: systemd ***
    dracut: *** Including module: warpclock ***
    dracut: *** Including module: systemd-initrd ***
    dracut: *** Including module: i18n ***
    dracut: Could not find FONT_MAP none!
    dracut: *** Including module: drm ***
    dracut: *** Including module: plymouth ***
    dracut: *** Including module: btrfs ***
    dracut: *** Including module: kernel-modules ***
    dracut: *** Including module: resume ***
    dracut: *** Including module: rootfs-block ***
    dracut: *** Including module: suse-btrfs ***
    dracut: *** Including module: terminfo ***
    dracut: *** Including module: udev-rules ***
    dracut: Skipping udev rule: 40-redhat.rules
    dracut: Skipping udev rule: 50-firmware.rules
    dracut: Skipping udev rule: 50-udev.rules
    dracut: Skipping udev rule: 91-permissions.rules
    dracut: Skipping udev rule: 80-drivers-modprobe.rules
    dracut: *** Including module: dracut-systemd ***
    dracut: *** Including module: haveged ***
    dracut: *** Including module: usrmount ***
    dracut: *** Including module: base ***
    dracut: *** Including module: fs-lib ***
    dracut: *** Including module: shutdown ***
    dracut: *** Including module: suse ***
    dracut: *** Including modules done ***
    dracut: *** Installing kernel module dependencies and firmware ***
    dracut: *** Installing kernel module dependencies and firmware done ***
    dracut: *** Resolving executable dependencies ***
    dracut: *** Resolving executable dependencies done***
    dracut: *** Hardlinking files ***
    dracut: *** Hardlinking files done ***
    dracut: *** Stripping files ***
    dracut: *** Stripping files done ***
    dracut: *** Generating early-microcode cpio image ***
    dracut: *** Constructing GenuineIntel.bin ****
    dracut: *** Store current command line parameters ***
    dracut: Stored kernel commandline:
    dracut:  resume=UUID=69e6880d-f265-4f28-bf33-45502dd58641
    dracut:  root=UUID=45397113-694f-4540-b23f-37cc370feb0b rootfstype=btrfs rootflags=rw,noatime,space_cache,subvolid=259,subvol=/@/.snapshots/1/snapshot,[email protected]/.snapshots/1/snapshot
    dracut: *** Creating image file '/boot/initrd-4.4.74-18.20-default' ***
    dracut: *** Creating initramfs image file '/boot/initrd-4.4.74-18.20-default' done ***

[email protected]:~> 

Final Thoughts

Well I should have changed my mirror to the fastest one available to me as my download speed of the packages was agonizingly slow. Once the command block quotes are fixed I will fix the guide but this is my way of installing the kernel properly. DO you think my step of also keeping the oldest updated is unnecessary? Feel free to start a discussion below on what you think or how you feel about this distributions installation process.

I know that while Linus Torvalds does not like how long it takes he praises the verification and steps the auto installation process takes to make sure its seemless to keep the work environment working. That being said I know he does not use it because installing kernel on SUSE takes longer then fedora and he is a get to it kind of person

*** ERRORS in DRACUT are normal rebooted and its working just fine

**** Errors in dracut were occuring because I did not install the proper skylake HUC GUC and DMC firmware from the intel page. You should do this