Rebuild the official Ubuntu kernel – Ubuntu 16.04 LTS

Author:

There are multiple reasons to rebuild the official kernel of a Linux distro but this is not the purpose of this article

just cannot miss the chance to write that all the kernels are built therefore optimized for the very first 64bit Intel/AMD processor! But come on who wants the most important piece of software to be optimized not for his new and expensive processor but for one released 15 years ago???

. Here we are going to show you how to recompile the latest official Ubuntu kernel of Ubuntu 16.04 LTS – the one, which comes with the apt packages system, because this kernel comes with the latest and greatest patches of the Ubuntu team. You should not confuse this howto with the one, which compile a vanilla kernel or the mainline kernel from http://kernel.ubuntu.com/~kernel-ppa/mainline/. So if you want a new kernel or the latest from kernel.org this is the right tutorial for Ubuntu – Build your own kernel under Ubuntu using mainline (latest) kernel. The official latest kernel in the Ubuntu repository is not always the latest one from kernel.org, but you can be sure it is probably most secure one, because there are additional modifications, configurations and tests by the team. Here you can see what versions of the kernel are the officials in Ubuntu: https://wiki.ubuntu.com/Kernel/Support

STEP 1) Choose the kernel to rebuild.

Here you can list all Ubuntu kernels in the package management system (more information in List all kernels available to install under Ubuntu):

myuser@srv1:~$ apt update
.....
myuser@srv1:~$ apt list linux-*image-*
Listing... Done
linux-image-3.4.0-4-goldfish/xenial 3.4.0-4.27 i386
linux-image-4.10.0-1004-gcp/xenial-updates,xenial-security 4.10.0-1004.4 amd64
.....
linux-image-4.15.0-38-generic/xenial-updates 4.15.0-38.41~16.04.1 amd64
linux-image-4.15.0-38-lowlatency/xenial-updates 4.15.0-38.41~16.04.1 amd64
.....
.....

We trimmed the output.
Check your current version with:

myuser@srv1:~$ uname -a
Linux srv1.localhost 4.4.0-131-generic #157-Ubuntu SMP Thu Jul 12 15:51:36 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

So we want to build and install new kernel – “linux-image-4.15.0-38-generic/xenial-updates 4.15.0-38.41~16.04.1”. If you want to rebuild your currently installed kernel (for example in our case – 4.4.0-131-generic) you must remove it – check out below in the additional sections.

STEP 2) Install the dependencies for the rebuild process

We used a freshly installed Ubuntu server minimal installation so the following command should be complete for all cases:

sudo apt install build-essential libudev-dev libncurses5-dev libpci-dev libelf-dev flex kernel-wedge bison libssl-dev bc gawk dpkg-dev autoconf automake libtool python 

STEP 3) Configure the package management system to use source packages

To download the source you first should enable them in the repository source list file:

/etc/apt/sources.list

– because this file is important do not use “sed” or another tool to just replace the commented “# deb-src” with “deb-src”. Open it with your favorite editor and uncomment each “deb-src” URL, which “deb” is uncommented, too. For example (just a portion of the file):

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted

It will turn into:

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted

Then you must run update to download the metadata for the source packages.

sudo apt update

We included the whole file in the output section below the steps.

STEP 4) Download the sources and additional dependency check

sudo apt build-dep linux-image-unsigned-4.15.0-38-generic
mkdir kernel
cd kernel/
apt source linux-image-unsigned-4.15.0-38-generic

The last command will download the code and it will unpack it under “linux-hwe-4.15.0”.
Here what we have in our current directory – the source of the kernel:

myuser@srv1:~/kernel$ ls -al
total 164204
drwxrwxr-x  3 myuser myuser      4096 Oct 25 14:56 .
drwxr-xr-x  4 myuser myuser      4096 Oct 25 14:55 ..
drwxrwxr-x 30 myuser myuser      4096 Oct 25 14:56 linux-hwe-4.15.0
-rw-r--r--  1 myuser myuser  10464708 Oct 11 13:03 linux-hwe_4.15.0-38.41~16.04.1.diff.gz
-rw-r--r--  1 myuser myuser      6108 Oct 11 13:03 linux-hwe_4.15.0-38.41~16.04.1.dsc
-rw-r--r--  1 myuser myuser 157656459 Jun 18 08:23 linux-hwe_4.15.0.orig.tar.gz

It is important to mention that only package with “-unsigned” in the name will download the whole source of the kernel (patched with Ubuntu/Debian build system – for fakeroot build process), the other packages (without -unsigned in the names) won’t download the whole source and therefore you cannot follow this tutorial, you cannot build kernel without “-unsigned”, because you cannot signed them with the Ubuntu private key – so you cannot generate at the end of the build process kernel deb packages with name without “-unsigned”. Indeed if you really want you can sign the kernel and the modules with a key, but you must use your own – and it is really complex process including generating multiple keys and installing them in the firmware of your motherboard (this article does not include and it is not intended to have information on this purpose).

STEP 5) Build the kernel

Change the directory to the kernel sources and execute the following commands. The line with “editconfigs” means you will have to edit the kernel settings if you do not want to edit anything just skip the line by not executing the command. If you edited the kernel configs you should see some checks after you leave the kernel configuration – these checks all must pass to be sure the kernel will be compiled successfully (look below to see the real output).

cd linux-hwe-4.15.0
chmod a+x debian/rules
chmod a+x debian/scripts/*
chmod a+x debian/scripts/misc/*
fakeroot debian/rules clean
fakeroot debian/rules editconfigs
fakeroot debian/rules binary

Here is what will see if you choose to edit the kernel configuration (multiple configs for multiple kernel types – 64bit – generic, low latency, i386, etc).

main menu
Edit default kernel configuration – editconfigs

It will take a while to compile the kernel and all modules for generic, low latency and some additional packages like Linux tools and more. Here is what you will be end up with in the parent directory of the kernel sources:

myuser@srv1:~/kernel$ ls -1 ../
block-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
crypto-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
fat-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
fb-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
firewire-core-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
floppy-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
fs-core-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
fs-secondary-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
input-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
ipmi-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
irda-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
kernel-image-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
linux-cloud-tools-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb
linux-cloud-tools-4.15.0-38-lowlatency_4.15.0-38.41~16.04.1_amd64.deb
linux-headers-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb
linux-headers-4.15.0-38-lowlatency_4.15.0-38.41~16.04.1_amd64.deb
linux-headers-4.15.0-38_4.15.0-38.41~16.04.1_all.deb
linux-hwe-4.15.0
linux-hwe-cloud-tools-4.15.0-38_4.15.0-38.41~16.04.1_amd64.deb
linux-hwe-tools-4.15.0-38_4.15.0-38.41~16.04.1_amd64.deb
linux-hwe-udebs-generic_4.15.0-38.41~16.04.1_amd64.udeb
linux-hwe_4.15.0-38.41~16.04.1.diff.gz
linux-hwe_4.15.0-38.41~16.04.1.dsc
linux-hwe_4.15.0-38.41~16.04.1_amd64.tar.gz
linux-hwe_4.15.0.orig.tar.gz
linux-image-unsigned-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb
linux-image-unsigned-4.15.0-38-lowlatency_4.15.0-38.41~16.04.1_amd64.deb
linux-modules-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb
linux-modules-4.15.0-38-lowlatency_4.15.0-38.41~16.04.1_amd64.deb
linux-modules-extra-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb
linux-source-4.15.0_4.15.0-38.41~16.04.1_all.deb
linux-tools-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb
linux-tools-4.15.0-38-lowlatency_4.15.0-38.41~16.04.1_amd64.deb
md-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
message-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
mouse-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
multipath-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
nfs-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
nic-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
nic-pcmcia-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
nic-shared-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
nic-usb-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
parport-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
pata-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
pcmcia-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
pcmcia-storage-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
plip-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
ppp-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
sata-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
scsi-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
serial-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
storage-core-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
usb-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
virtio-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb
vlan-modules-4.15.0-38-generic-di_4.15.0-38.41~16.04.1_amd64.udeb

STEP 5) Install the newly compiled kernel

You can install the kernel and the extras, then reboot the server to load the kernel. Be careful to include all the dependencies from the local install, because the setup will pull missing from the official repository(if you install with apt, not dpkg) Check out the real output to see how apt suggest what to install additionally and what it downloads locally. If you do not use “sudo apt install” but “sudo dpkg -i” it will fail if a dependency is missing.

sudo apt install ./linux-headers-4.15.0-38_4.15.0-38.41~16.04.1_all.deb ./linux-headers-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb ./linux-image-unsigned-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb ./linux-modules-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb ./linux-modules-extra-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb ./linux-tools-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb ./linux-hwe-tools-4.15.0-38_4.15.0-38.41~16.04.1_amd64.deb 
sudo reboot
uname -a
Linux srv1.localhost 4.15.0-38-generic #41~16.04.1 SMP Thu Oct 25 17:48:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

The whole output of the build process

myuser@srv1:~$ sudo apt update
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]
Hit:2 http://us.archive.ubuntu.com/ubuntu xenial InRelease                            
Get:3 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]           
Get:4 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [868 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages [776 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [697 kB]
Get:8 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe i386 Packages [639 kB]
Fetched 3302 kB in 1s (1715 kB/s)                        
Reading package lists... Done
Building dependency tree       
Reading state information... Done
52 packages can be upgraded. Run 'apt list --upgradable' to see them.
myuser@srv1:~$ sudo apt install build-essential libudev-dev libncurses5-dev libpci-dev libelf-dev flex kernel-wedge bison libssl-dev bc gawk dpkg-dev autoconf automake libtool python
sudo: unable to resolve host srv1.localhost
Reading package lists... Done
Building dependency tree       
Reading state information... Done
gawk is already the newest version (1:4.1.3+dfsg-0.1).
The following additional packages will be installed:
  autotools-dev binutils cpp cpp-5 debhelper dh-strip-nondeterminism fakeroot g++ g++-5 gcc gcc-5 gettext intltool-debian libalgorithm-diff-perl libalgorithm-diff-xs-perl
  libalgorithm-merge-perl libarchive-zip-perl libasan2 libasprintf-dev libatomic1 libbison-dev libc-dev-bin libc6-dev libcc1-0 libcilkrts5 libcroco3 libdpkg-perl
  libfakeroot libfile-fcntllock-perl libfile-stripnondeterminism-perl libfl-dev libgcc-5-dev libgettextpo-dev libgettextpo0 libgomp1 libisl15 libitm1 liblsan0 libltdl-dev
  libltdl7 libmail-sendmail-perl libmpc3 libmpx0 libpython-stdlib libpython2.7-minimal libpython2.7-stdlib libquadmath0 libssl-doc libstdc++-5-dev
  libsys-hostname-long-perl libtimedate-perl libtinfo-dev libtsan0 libubsan0 libudev1 libunistring0 linux-libc-dev m4 make manpages-dev po-debconf python-minimal
  python2.7 python2.7-minimal udev zlib1g-dev
Suggested packages:
  autoconf-archive gnu-standards autoconf-doc binutils-doc bison-doc cpp-doc gcc-5-locales dh-make debian-keyring g++-multilib g++-5-multilib gcc-5-doc libstdc++6-5-dbg
  gcc-multilib gdb gcc-doc gcc-5-multilib libgcc1-dbg libgomp1-dbg libitm1-dbg libatomic1-dbg libasan2-dbg liblsan0-dbg libtsan0-dbg libubsan0-dbg libcilkrts5-dbg
  libmpx0-dbg libquadmath0-dbg gettext-doc autopoint glibc-doc libtool-doc ncurses-doc libstdc++-5-doc gfortran | fortran95-compiler gcj-jdk make-doc libmail-box-perl
  python-doc python-tk python2.7-doc binfmt-support
The following NEW packages will be installed:
  autoconf automake autotools-dev bc binutils bison build-essential cpp cpp-5 debhelper dh-strip-nondeterminism dpkg-dev fakeroot flex g++ g++-5 gcc gcc-5 gettext
  intltool-debian kernel-wedge libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libarchive-zip-perl libasan2 libasprintf-dev libatomic1
  libbison-dev libc-dev-bin libc6-dev libcc1-0 libcilkrts5 libcroco3 libdpkg-perl libelf-dev libfakeroot libfile-fcntllock-perl libfile-stripnondeterminism-perl libfl-dev
  libgcc-5-dev libgettextpo-dev libgettextpo0 libgomp1 libisl15 libitm1 liblsan0 libltdl-dev libltdl7 libmail-sendmail-perl libmpc3 libmpx0 libncurses5-dev libpci-dev
  libpython-stdlib libpython2.7-minimal libpython2.7-stdlib libquadmath0 libssl-dev libssl-doc libstdc++-5-dev libsys-hostname-long-perl libtimedate-perl libtinfo-dev
  libtool libtsan0 libubsan0 libudev-dev libunistring0 linux-libc-dev m4 make manpages-dev po-debconf python python-minimal python2.7 python2.7-minimal zlib1g-dev
The following packages will be upgraded:
  libudev1 udev
2 upgraded, 79 newly installed, 0 to remove and 50 not upgraded.
Need to get 51.5 MB of archives.
After this operation, 192 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 udev amd64 229-4ubuntu21.5 [993 kB]
....
....
myuser@srv1:~$ sudo nano /etc/apt/sources.list
myuser@srv1:~$ cat /etc/apt//sources.list
# 

# deb cdrom:[Ubuntu-Server 16.04.5 LTS _Xenial Xerus_ - Release amd64 (20180731)]/ xenial main restricted

#deb cdrom:[Ubuntu-Server 16.04.5 LTS _Xenial Xerus_ - Release amd64 (20180731)]/ xenial main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ xenial universe
deb-src http://us.archive.ubuntu.com/ubuntu/ xenial universe
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://us.archive.ubuntu.com/ubuntu/ xenial multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu xenial partner
# deb-src http://archive.canonical.com/ubuntu xenial partner

deb http://security.ubuntu.com/ubuntu xenial-security main restricted
deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://security.ubuntu.com/ubuntu xenial-security universe
deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu xenial-security multiverse
deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse
myuser@srv1:~$ sudo apt update
sudo: unable to resolve host srv1.localhost
Hit:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
Get:2 http://security.ubuntu.com/ubuntu xenial-security/main Sources [136 kB]    
Hit:3 http://us.archive.ubuntu.com/ubuntu xenial InRelease
Hit:4 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease               
Get:5 http://security.ubuntu.com/ubuntu xenial-security/restricted Sources [2116 B]           
Get:6 http://security.ubuntu.com/ubuntu xenial-security/universe Sources [78.4 kB]
Get:7 http://security.ubuntu.com/ubuntu xenial-security/multiverse Sources [2088 B]                   
Hit:8 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease                                  
Get:9 http://us.archive.ubuntu.com/ubuntu xenial/main Sources [868 kB]
Get:10 http://us.archive.ubuntu.com/ubuntu xenial/restricted Sources [4808 B]
Get:11 http://us.archive.ubuntu.com/ubuntu xenial/universe Sources [7728 kB]
Get:12 http://us.archive.ubuntu.com/ubuntu xenial/multiverse Sources [179 kB]
Get:13 http://us.archive.ubuntu.com/ubuntu xenial-updates/main Sources [323 kB]
Get:14 http://us.archive.ubuntu.com/ubuntu xenial-updates/restricted Sources [2528 B]
Get:15 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe Sources [224 kB]
Get:16 http://us.archive.ubuntu.com/ubuntu xenial-updates/multiverse Sources [8384 B]
Fetched 9556 kB in 3s (2855 kB/s)                         
Reading package lists... Done
Building dependency tree       
Reading state information... Done
50 packages can be upgraded. Run 'apt list --upgradable' to see them.
myuser@srv1:~$ sudo apt build-dep linux-image-unsigned-4.15.0-38-generic
sudo: unable to resolve host srv1.localhost
Reading package lists... Done
Picking 'linux-hwe' as source package instead of 'linux-image-unsigned-4.15.0-38-generic'
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  asciidoc binutils-dev dh-systemd docbook-dsssl docbook-utils docbook-xml docbook-xsl docutils-common fontconfig-config fonts-dejavu-core fonts-font-awesome fonts-lato
  ghostscript gsfonts jadetex libaudit-dev libavahi-client3 libavahi-common-data libavahi-common3 libcups2 libcupsfilters1 libcupsimage2 libdw-dev libdw1 libexpat1-dev
  libfontconfig1 libgraphite2-3 libgs9 libgs9-common libharfbuzz-icu0 libharfbuzz0b libiberty-dev libice6 libijs-0.35 libjbig0 libjbig2dec0 libjpeg-turbo8 libjpeg8
  libjs-jquery libjs-modernizr libjs-sphinxdoc libjs-underscore libkpathsea6 liblcms2-2 liblzma-dev libnewt-dev libnuma-dev libosp5 libostyle1c2 libpaper-utils libpaper1
  libpixman-1-0 libpng12-dev libpoppler58 libpotrace0 libptexenc1 libpython-dev libpython2.7 libpython2.7-dev libsgmls-perl libslang2-dev libsm6 libsp1c2 libsynctex1
  libtexlua52 libtexluajit2 libtiff5 libunwind-dev libunwind8 libunwind8-dev libxaw7 libxi6 libxml2-utils libxmu6 libxpm4 libxt6 libzzip-0-13 lynx lynx-common
  makedumpfile openjade pkg-config poppler-data python-alabaster python-babel python-babel-localedata python-dev python-docutils python-jinja2 python-markupsafe
  python-pkg-resources python-pygments python-roman python-six python-sphinx python-sphinx-rtd-theme python-tz python2.7-dev sgml-data sgmlspl sharutils sp sphinx-common
  sphinx-rtd-theme-common t1utils tex-common texlive-base texlive-binaries texlive-fonts-recommended texlive-generic-recommended texlive-latex-base
  texlive-latex-recommended tipa transfig uuid-dev x11-common xdg-utils xmlto xsltproc
0 upgraded, 119 newly installed, 0 to remove and 50 not upgraded.
Need to get 117 MB of archives.
After this operation, 367 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 fonts-lato all 2.0-1 [2693 kB]
....
....
myuser@srv1:~$ mkdir kernel
myuser@srv1:~$ cd kernel/
myuser@srv1:~/kernel$ apt source linux-image-unsigned-4.15.0-38-generic
Reading package lists... Done
Picking 'linux-hwe' as source package instead of 'linux-image-unsigned-4.15.0-38-generic'
NOTICE: 'linux-hwe' packaging is maintained in the 'Git' version control system at:
git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/xenial -b hwe
Please use:
git clone git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/xenial -b hwe
to retrieve the latest (possibly unreleased) updates to the package.
Need to get 168 MB of source archives.
Get:1 http://us.archive.ubuntu.com/ubuntu xenial-updates/main linux-hwe 4.15.0-38.41~16.04.1 (dsc) [6108 B]
Get:2 http://us.archive.ubuntu.com/ubuntu xenial-updates/main linux-hwe 4.15.0-38.41~16.04.1 (tar) [158 MB]
Get:3 http://us.archive.ubuntu.com/ubuntu xenial-updates/main linux-hwe 4.15.0-38.41~16.04.1 (diff) [10.5 MB]                                                              
Fetched 168 MB in 19s (8448 kB/s)                                                                                                                                          
gpgv: Signature made Wed Oct 10 20:06:01 2018 UTC using RSA key ID 70E1162B
gpgv: Can't check signature: public key not found
dpkg-source: warning: failed to verify signature on ./linux-hwe_4.15.0-38.41~16.04.1.dsc
dpkg-source: info: extracting linux-hwe in linux-hwe-4.15.0
dpkg-source: info: unpacking linux-hwe_4.15.0.orig.tar.gz
dpkg-source: info: applying linux-hwe_4.15.0-38.41~16.04.1.diff.gz
dpkg-source: info: upstream files that have been modified: 
 linux-hwe-4.15.0/Documentation/ABI/testing/debugfs-aufs
 linux-hwe-4.15.0/Documentation/ABI/testing/sysfs-aufs
....
....
myuser@srv1:~/kernel$ ls -al
total 164204
drwxrwxr-x  3 myuser myuser      4096 Oct 25 14:56 .
drwxr-xr-x  4 myuser myuser      4096 Oct 25 14:55 ..
drwxrwxr-x 30 myuser myuser      4096 Oct 25 14:56 linux-hwe-4.15.0
-rw-r--r--  1 myuser myuser  10464708 Oct 11 13:03 linux-hwe_4.15.0-38.41~16.04.1.diff.gz
-rw-r--r--  1 myuser myuser      6108 Oct 11 13:03 linux-hwe_4.15.0-38.41~16.04.1.dsc
-rw-r--r--  1 myuser myuser 157656459 Jun 18 08:23 linux-hwe_4.15.0.orig.tar.gz
myuser@srv1:~/kernel$ cd linux-hwe-4.15.0
myuser@srv1:~/kernel/linux-hwe-4.15.0$ chmod a+x debian/rules
myuser@srv1:~/kernel/linux-hwe-4.15.0$ chmod a+x debian/scripts/*
myuser@srv1:~/kernel/linux-hwe-4.15.0$ chmod a+x debian/scripts/misc/*
myuser@srv1:~/kernel/linux-hwe-4.15.0$ fakeroot debian/rules clean
for i in debian.hwe/control.stub.in; do                                 \
  new=`echo $i | sed 's/\.in$//'`;                                      \
  cat $i | sed -e 's/PKGVER/4.15.0/g'                              \
        -e 's/ABINUM/38/g'                                       \
        -e 's/SRCPKGNAME/linux-hwe/g'                             \
        -e 's/=HUMAN=/64 bit x86/g'                                    \
  > $new;                                                               \
done
flavours="debian.hwe/control.d/vars.generic debian.hwe/control.d/vars.generic-lpae debian.hwe/control.d/vars.lowlatency";\
for i in $flavours; do                                                  \
  /bin/bash -e debian/scripts/control-create $i "true" |        \
        sed -e 's/PKGVER/4.15.0/g'                                  \
        -e 's/ABINUM/38/g'                                       \
        -e 's/SRCPKGNAME/linux-hwe/g'                             \
        -e 's/=HUMAN=/64 bit x86/g'                                    \
        >> debian.hwe/control.stub;                                             \
done
echo "# placebo control.stub for kernel-wedge flow change" >debian/control.stub
cp debian.hwe/control.stub debian/control
export KW_DEFCONFIG_DIR=debian.hwe/d-i && \
export KW_CONFIG_DIR=debian.hwe/d-i && \
LANG=C kernel-wedge gen-control 4.15.0-38 | \
        perl -f debian/scripts/misc/kernel-wedge-arch.pl amd64 \
        >>/home/myuser/kernel/linux-hwe-4.15.0/debian/control
dh_testdir
dh_testroot
dh_clean
# d-i stuff
rm -rf debian.hwe/d-i-amd64
# Generated on the fly.
rm -f debian.hwe/d-i/firmware/amd64/kernel-image
# normal build junk
rm -rf debian.hwe/abi/4.15.0-38.41~16.04.1
rm -rf /home/myuser/kernel/linux-hwe-4.15.0/debian/build
rm -f /home/myuser/kernel/linux-hwe-4.15.0/debian/stamps/stamp-*
rm -rf debian.hwe/linux-*
# This gets rid of the d-i packages in control
cp -f debian.hwe/control.stub debian/control
cp debian.hwe/changelog debian/changelog
# Install the copyright information.
cp debian.hwe/copyright debian/copyright
# Install the retpoline extractor.
cp debian/scripts/retpoline-extract-one scripts/ubuntu-retpoline-extract-one
# If we have a reconstruct script use it.
[ -f debian.hwe/reconstruct ] && bash debian.hwe/reconstruct
# Remove generated intermediate files
rm -f debian/control.stub debian.hwe/control.stub
myuser@srv1:~/kernel/linux-hwe-4.15.0$ fakeroot debian/rules editconfigs
dh_testdir;
/bin/bash -e debian/scripts/misc/kernelconfig editconfigs
Do you want to edit config: amd64/config.flavour.generic? [Y/n] Y
make[1]: Entering directory '/home/myuser/kernel/linux-hwe-4.15.0'
make[2]: Entering directory '/home/myuser/kernel/linux-hwe-4.15.0/build'
  HOSTCC  scripts/basic/fixdep
  GEN     ./Makefile
  HOSTCC  scripts/kconfig/mconf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTCC  scripts/kconfig/lxdialog/checklist.o
  HOSTCC  scripts/kconfig/lxdialog/util.o
  HOSTCC  scripts/kconfig/lxdialog/inputbox.o
  HOSTCC  scripts/kconfig/lxdialog/textbox.o
  HOSTCC  scripts/kconfig/lxdialog/yesno.o
  HOSTCC  scripts/kconfig/lxdialog/menubox.o
  HOSTLD  scripts/kconfig/mconf
scripts/kconfig/mconf  Kconfig
security/Kconfig:393:warning: defaults for choice values not supported
security/Kconfig:397:warning: defaults for choice values not supported
security/Kconfig:401:warning: defaults for choice values not supported
security/Kconfig:405:warning: defaults for choice values not supported
security/Kconfig:409:warning: defaults for choice values not supported
.config:4921:warning: override: M686 changes choice state
configuration written to .config

*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.

make[2]: Leaving directory '/home/myuser/kernel/linux-hwe-4.15.0/build'
make[1]: Leaving directory '/home/myuser/kernel/linux-hwe-4.15.0'
Do you want to edit config: amd64/config.flavour.lowlatency? [Y/n] n
make[1]: Entering directory '/home/myuser/kernel/linux-hwe-4.15.0'
make[2]: Entering directory '/home/myuser/kernel/linux-hwe-4.15.0/build'
  GEN     ./Makefile
  HOSTCC  scripts/kconfig/conf.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf  --silentoldconfig Kconfig
security/Kconfig:393:warning: defaults for choice values not supported
security/Kconfig:397:warning: defaults for choice values not supported
security/Kconfig:401:warning: defaults for choice values not supported
security/Kconfig:405:warning: defaults for choice values not supported
security/Kconfig:409:warning: defaults for choice values not supported
.config:4921:warning: override: M686 changes choice state
#
# configuration written to .config
#
make[2]: Leaving directory '/home/myuser/kernel/linux-hwe-4.15.0/build'
make[1]: Leaving directory '/home/myuser/kernel/linux-hwe-4.15.0'
Running splitconfig.pl for amd64

Reading config's ...
  processing config.flavour.generic ... done.
  processing config.flavour.lowlatency ... done.

Merging lists ... 
   processing config.flavour.generic ... done.
   processing config.flavour.lowlatency ... done.

Creating common config ... done.

Creating stub configs ...
  processing config.flavour.generic ... done.
  processing config.flavour.lowlatency ... done.
Do you want to edit config: i386/config.flavour.generic? [Y/n] n
make[1]: Entering directory '/home/myuser/kernel/linux-hwe-4.15.0'
make[2]: Entering directory '/home/myuser/kernel/linux-hwe-4.15.0/build'
  HOSTCC  scripts/basic/fixdep
  GEN     ./Makefile
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf  --silentoldconfig Kconfig
security/Kconfig:393:warning: defaults for choice values not supported
security/Kconfig:397:warning: defaults for choice values not supported
security/Kconfig:401:warning: defaults for choice values not supported
security/Kconfig:405:warning: defaults for choice values not supported
security/Kconfig:409:warning: defaults for choice values not supported
.config:4921:warning: override: M686 changes choice state
#
# configuration written to .config
#
make[2]: Leaving directory '/home/myuser/kernel/linux-hwe-4.15.0/build'
make[1]: Leaving directory '/home/myuser/kernel/linux-hwe-4.15.0'
Do you want to edit config: i386/config.flavour.lowlatency? [Y/n] n
make[1]: Entering directory '/home/myuser/kernel/linux-hwe-4.15.0'
make[2]: Entering directory '/home/myuser/kernel/linux-hwe-4.15.0/build'
  HOSTCC  scripts/basic/bin2c
  GEN     ./Makefile
scripts/kconfig/conf  --silentoldconfig Kconfig
security/Kconfig:393:warning: defaults for choice values not supported
security/Kconfig:397:warning: defaults for choice values not supported
security/Kconfig:401:warning: defaults for choice values not supported
security/Kconfig:405:warning: defaults for choice values not supported
security/Kconfig:409:warning: defaults for choice values not supported
.config:4921:warning: override: M686 changes choice state
#
# configuration written to .config
#
make[2]: Leaving directory '/home/myuser/kernel/linux-hwe-4.15.0/build'
make[1]: Leaving directory '/home/myuser/kernel/linux-hwe-4.15.0'
Running splitconfig.pl for i386

Reading config's ...
  processing config.flavour.generic ... done.
  processing config.flavour.lowlatency ... done.

Merging lists ... 
   processing config.flavour.lowlatency ... done.
   processing config.flavour.generic ... done.

Creating common config ... done.

Creating stub configs ...
  processing config.flavour.lowlatency ... done.
  processing config.flavour.generic ... done.
Do you want to edit config: armhf/config.flavour.generic? [Y/n] n
make[1]: Entering directory '/home/myuser/kernel/linux-hwe-4.15.0'
make[2]: Entering directory '/home/myuser/kernel/linux-hwe-4.15.0/build'
  HOSTCC  scripts/basic/fixdep
  GEN     ./Makefile
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf  --silentoldconfig Kconfig
security/Kconfig:393:warning: defaults for choice values not supported
security/Kconfig:397:warning: defaults for choice values not supported
security/Kconfig:401:warning: defaults for choice values not supported
security/Kconfig:405:warning: defaults for choice values not supported
security/Kconfig:409:warning: defaults for choice values not supported
#
# configuration written to .config
#
make[2]: Leaving directory '/home/myuser/kernel/linux-hwe-4.15.0/build'
make[1]: Leaving directory '/home/myuser/kernel/linux-hwe-4.15.0'
Do you want to edit config: armhf/config.flavour.generic-lpae? [Y/n] n
make[1]: Entering directory '/home/myuser/kernel/linux-hwe-4.15.0'
make[2]: Entering directory '/home/myuser/kernel/linux-hwe-4.15.0/build'
  HOSTCC  scripts/basic/bin2c
  GEN     ./Makefile
scripts/kconfig/conf  --silentoldconfig Kconfig
security/Kconfig:393:warning: defaults for choice values not supported
security/Kconfig:397:warning: defaults for choice values not supported
security/Kconfig:401:warning: defaults for choice values not supported
security/Kconfig:405:warning: defaults for choice values not supported
security/Kconfig:409:warning: defaults for choice values not supported
#
# configuration written to .config
#
make[2]: Leaving directory '/home/myuser/kernel/linux-hwe-4.15.0/build'
make[1]: Leaving directory '/home/myuser/kernel/linux-hwe-4.15.0'
Running splitconfig.pl for armhf

Reading config's ...
  processing config.flavour.generic ... done.
  processing config.flavour.generic-lpae ... done.

Merging lists ... 
   processing config.flavour.generic-lpae ... done.
   processing config.flavour.generic ... done.

Creating common config ... done.

Creating stub configs ...
  processing config.flavour.generic-lpae ... done.
  processing config.flavour.generic ... done.
Do you want to edit config: arm64/config.flavour.generic? [Y/n] n
make[1]: Entering directory '/home/myuser/kernel/linux-hwe-4.15.0'
make[2]: Entering directory '/home/myuser/kernel/linux-hwe-4.15.0/build'
  HOSTCC  scripts/basic/fixdep
  GEN     ./Makefile
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf  --silentoldconfig Kconfig
security/Kconfig:393:warning: defaults for choice values not supported
security/Kconfig:397:warning: defaults for choice values not supported
security/Kconfig:401:warning: defaults for choice values not supported
security/Kconfig:405:warning: defaults for choice values not supported
security/Kconfig:409:warning: defaults for choice values not supported
#
# configuration written to .config
#
make[2]: Leaving directory '/home/myuser/kernel/linux-hwe-4.15.0/build'
make[1]: Leaving directory '/home/myuser/kernel/linux-hwe-4.15.0'
Do you want to edit config: arm64/config.flavour.snapdragon? [Y/n] n
make[1]: Entering directory '/home/myuser/kernel/linux-hwe-4.15.0'
make[2]: Entering directory '/home/myuser/kernel/linux-hwe-4.15.0/build'
  HOSTCC  scripts/basic/bin2c
  GEN     ./Makefile
scripts/kconfig/conf  --silentoldconfig Kconfig
security/Kconfig:393:warning: defaults for choice values not supported
security/Kconfig:397:warning: defaults for choice values not supported
security/Kconfig:401:warning: defaults for choice values not supported
security/Kconfig:405:warning: defaults for choice values not supported
security/Kconfig:409:warning: defaults for choice values not supported
#
# configuration written to .config
#
make[2]: Leaving directory '/home/myuser/kernel/linux-hwe-4.15.0/build'
make[1]: Leaving directory '/home/myuser/kernel/linux-hwe-4.15.0'
Running splitconfig.pl for arm64

Reading config's ...
  processing config.flavour.generic ... done.
  processing config.flavour.snapdragon ... done.

Merging lists ... 
   processing config.flavour.snapdragon ... done.
   processing config.flavour.generic ... done.

Creating common config ... done.

Creating stub configs ...
  processing config.flavour.snapdragon ... done.
  processing config.flavour.generic ... done.
Do you want to edit config: ppc64el/config.flavour.generic? [Y/n] n
make[1]: Entering directory '/home/myuser/kernel/linux-hwe-4.15.0'
make[2]: Entering directory '/home/myuser/kernel/linux-hwe-4.15.0/build'
  HOSTCC  scripts/basic/fixdep
  GEN     ./Makefile
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf  --silentoldconfig Kconfig
security/Kconfig:393:warning: defaults for choice values not supported
security/Kconfig:397:warning: defaults for choice values not supported
security/Kconfig:401:warning: defaults for choice values not supported
security/Kconfig:405:warning: defaults for choice values not supported
security/Kconfig:409:warning: defaults for choice values not supported
.config:6827:warning: override: POWER8_CPU changes choice state
#
# configuration written to .config
#
make[2]: Leaving directory '/home/myuser/kernel/linux-hwe-4.15.0/build'
make[1]: Leaving directory '/home/myuser/kernel/linux-hwe-4.15.0'
Running splitconfig.pl for ppc64el

Reading config's ...
  processing config.flavour.generic ... done.

Merging lists ... 
   processing config.flavour.generic ... done.

Creating common config ... done.

Creating stub configs ...
  processing config.flavour.generic ... done.
Do you want to edit config: s390x/config.flavour.generic? [Y/n] n
make[1]: Entering directory '/home/myuser/kernel/linux-hwe-4.15.0'
make[2]: Entering directory '/home/myuser/kernel/linux-hwe-4.15.0/build'
  HOSTCC  scripts/basic/fixdep
  GEN     ./Makefile
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf  --silentoldconfig Kconfig
security/Kconfig:393:warning: defaults for choice values not supported
security/Kconfig:397:warning: defaults for choice values not supported
security/Kconfig:401:warning: defaults for choice values not supported
security/Kconfig:405:warning: defaults for choice values not supported
security/Kconfig:409:warning: defaults for choice values not supported
.config:10944:warning: override: VIRT_CPU_ACCOUNTING_NATIVE changes choice state
#
# configuration written to .config
#
make[2]: Leaving directory '/home/myuser/kernel/linux-hwe-4.15.0/build'
make[1]: Leaving directory '/home/myuser/kernel/linux-hwe-4.15.0'
Running splitconfig.pl for s390x

Reading config's ...
  processing config.flavour.generic ... done.

Merging lists ... 
   processing config.flavour.generic ... done.

Creating common config ... done.

Creating stub configs ...
  processing config.flavour.generic ... done.
Reading config's ...
  processing config.common.amd64 ... done.
  processing config.common.arm64 ... done.
  processing config.common.armhf ... done.
  processing config.common.i386 ... done.
  processing config.common.ppc64el ... done.
  processing config.common.s390x ... done.

Merging lists ... 
   processing config.common.i386 ... done.
   processing config.common.amd64 ... done.
   processing config.common.armhf ... done.
   processing config.common.ppc64el ... done.
   processing config.common.arm64 ... done.
   processing config.common.s390x ... done.

Creating common config ... done.

Creating stub configs ...
  processing config.common.i386 ... done.
  processing config.common.amd64 ... done.
  processing config.common.armhf ... done.
  processing config.common.ppc64el ... done.
  processing config.common.arm64 ... done.
  processing config.common.s390x ... done.

Running config-check for all configurations ...

check-config: /tmp/tmp.ndV7jWaClO/CONFIGS/amd64-config.flavour.generic: loading config
check-config: /home/myuser/kernel/linux-hwe-4.15.0/debian.hwe/config/annotations loading annotations
check-config: 89/89 checks passed -- exit 0
check-config: /tmp/tmp.ndV7jWaClO/CONFIGS/amd64-config.flavour.lowlatency: loading config
check-config: /home/myuser/kernel/linux-hwe-4.15.0/debian.hwe/config/annotations loading annotations
check-config: 89/89 checks passed -- exit 0
check-config: /tmp/tmp.ndV7jWaClO/CONFIGS/i386-config.flavour.generic: loading config
check-config: /home/myuser/kernel/linux-hwe-4.15.0/debian.hwe/config/annotations loading annotations
check-config: 89/89 checks passed -- exit 0
check-config: /tmp/tmp.ndV7jWaClO/CONFIGS/i386-config.flavour.lowlatency: loading config
check-config: /home/myuser/kernel/linux-hwe-4.15.0/debian.hwe/config/annotations loading annotations
check-config: 89/89 checks passed -- exit 0
check-config: /tmp/tmp.ndV7jWaClO/CONFIGS/armhf-config.flavour.generic: loading config
check-config: /home/myuser/kernel/linux-hwe-4.15.0/debian.hwe/config/annotations loading annotations
check-config: 89/89 checks passed -- exit 0
check-config: /tmp/tmp.ndV7jWaClO/CONFIGS/armhf-config.flavour.generic-lpae: loading config
check-config: /home/myuser/kernel/linux-hwe-4.15.0/debian.hwe/config/annotations loading annotations
check-config: 89/89 checks passed -- exit 0
check-config: /tmp/tmp.ndV7jWaClO/CONFIGS/arm64-config.flavour.generic: loading config
check-config: /home/myuser/kernel/linux-hwe-4.15.0/debian.hwe/config/annotations loading annotations
check-config: 89/89 checks passed -- exit 0
check-config: /tmp/tmp.ndV7jWaClO/CONFIGS/arm64-config.flavour.snapdragon: loading config
check-config: /home/myuser/kernel/linux-hwe-4.15.0/debian.hwe/config/annotations loading annotations
check-config: 89/89 checks passed -- exit 0
check-config: /tmp/tmp.ndV7jWaClO/CONFIGS/ppc64el-config.flavour.generic: loading config
check-config: /home/myuser/kernel/linux-hwe-4.15.0/debian.hwe/config/annotations loading annotations
check-config: 89/89 checks passed -- exit 0
check-config: /tmp/tmp.ndV7jWaClO/CONFIGS/s390x-config.flavour.generic: loading config
check-config: /home/myuser/kernel/linux-hwe-4.15.0/debian.hwe/config/annotations loading annotations
check-config: 89/89 checks passed -- exit 0
rm -rf build
myuser@srv1:~/kernel/linux-hwe-4.15.0$ fakeroot debian/rules binary
Debug: install-headers
dh_testdir
dh_testroot
dh_prep
install -d /home/myuser/kernel/linux-hwe-4.15.0/debian/linux-headers-4.15.0-38/usr/src/linux-headers-4.15.0-38
find . -path './debian' -prune -o -path './debian.hwe' -prune \
  -o -path './include/*' -prune \
  -o -path './scripts/*' -prune -o -type f \
  \( -name 'Makefile*' -o -name 'Kconfig*' -o -name 'Kbuild*' -o \
     -name '*.sh' -o -name '*.pl' -o -name '*.lds' \) \
  -print | cpio -pd --preserve-modification-time /home/myuser/kernel/linux-hwe-4.15.0/debian/linux-headers-4.15.0-38/usr/src/linux-headers-4.15.0-38
18829 blocks
cp -a scripts include /home/myuser/kernel/linux-hwe-4.15.0/debian/linux-headers-4.15.0-38/usr/src/linux-headers-4.15.0-38
(find arch -name include -type d -print | \
        xargs -n1 -i: find : -type f) | \
        cpio -pd --preserve-modification-time /home/myuser/kernel/linux-hwe-4.15.0/debian/linux-headers-4.15.0-38/usr/src/linux-headers-4.15.0-38
cpio: /home/myuser/kernel/linux-hwe-4.15.0/debian/linux-headers-4.15.0-38/usr/src/linux-headers-4.15.0-38/arch/arm64/include/asm/Kbuild not created: newer or same age version exists
cpio: /home/myuser/kernel/linux-hwe-4.15.0/debian/linux-headers-4.15.0-38/usr/src/linux-headers-4.15.0-38/arch/arm64/include/uapi/asm/Kbuild not created: newer or same age version exists
cpio: /home/myuser/kernel/linux-hwe-4.15.0/debian/linux-headers-4.15.0-38/usr/src/linux-headers-4.15.0-38/arch/mips/include/asm/Kbuild not created: newer or same age version exists
cpio: /home/myuser/kernel/linux-hwe-4.15.0/debian/linux-headers-4.15.0-38/usr/src/linux-headers-4.15.0-38/arch/mips/include/uapi/asm/Kbuild not created: newer or same age version exists
cpio: /home/myuser/kernel/linux-hwe-4.15.0/debian/linux-headers-4.15.0-38/usr/src/linux-headers-4.15.0-38/arch/s390/include/asm/Kbuild not created: newer or same age version exists
cpio: /home/myuser/kernel/linux-hwe-4.15.0/debian/linux-headers-4.15.0-38/usr/src/linux-headers-4.15.0-38/arch/s390/include/uapi/asm/Kbuild not created: newer or same age version exists
cpio: /home/myuser/kernel/linux-hwe-4.15.0/debian/linux-headers-4.15.0-38/usr/src/linux-headers-4.15.0-38/arch/sh/include/asm/Kbuild not created: newer or same age version exists
cpio: /home/myuser/kernel/linux-hwe-4.15.0/debian/linux-headers-4.15.0-38/usr/src/linux-headers-4.15.0-38/arch/sh/include/uapi/asm/Kbuild not created: newer or same age version exists
cpio: /home/myuser/kernel/linux-hwe-4.15.0/debian/linux-headers-4.15.0-38/usr/src/linux-headers-4.15.0-38/arch/powerpc/include/asm/Kbuild not created: newer or same age version exists
cpio: /home/myuser/kernel/linux-hwe-4.15.0/debian/linux-headers-4.15.0-38/usr/src/linux-headers-4.15.0-38/arch/powerpc/include/uapi/asm/Kbuild not created: newer or same age version exists
cpio: /home/myuser/kernel/linux-hwe-4.15.0/debian/linux-headers-4.15.0-38/usr/src/linux-headers-4.15.0-38/arch/um/include/asm/Kbuild not created: newer or same age version exists
cpio: /home/myuser/kernel/linux-hwe-4.15.0/debian/linux-headers-4.15.0-38/usr/src/linux-headers-4.15.0-38/arch/arc/include/asm/Kbuild not created: newer or same age version exists
cpio: /home/myuser/kernel/linux-hwe-4.15.0/debian/linux-headers-4.15.0-38/usr/src/linux-headers-4.15.0-38/arch/arc/include/uapi/asm/Kbuild not created: newer or same age version exists
cpio: /home/myuser/kernel/linux-hwe-4.15.0/debian/linux-headers-4.15.0-38/usr/src/linux-headers-4.15.0-38/arch/c6x/include/asm/Kbuild not created: newer or same age version exists
....
....
myuser@srv1:~/kernel$ sudo apt install ./linux-headers-4.15.0-38_4.15.0-38.41~16.04.1_all.deb ./linux-headers-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb ./linux-image-unsigned-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb ./linux-modules-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb ./linux-modules-extra-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb ./linux-tools-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb ./linux-hwe-tools-4.15.0-38_4.15.0-38.41~16.04.1_amd64.deb 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'linux-headers-4.15.0-38' instead of './linux-headers-4.15.0-38_4.15.0-38.41~16.04.1_all.deb'
Note, selecting 'linux-headers-4.15.0-38-generic' instead of './linux-headers-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb'
Note, selecting 'linux-image-unsigned-4.15.0-38-generic' instead of './linux-image-unsigned-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb'
Note, selecting 'linux-modules-4.15.0-38-generic' instead of './linux-modules-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb'
Note, selecting 'linux-modules-extra-4.15.0-38-generic' instead of './linux-modules-extra-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb'
Note, selecting 'linux-tools-4.15.0-38-generic' instead of './linux-tools-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb'
Note, selecting 'linux-hwe-tools-4.15.0-38' instead of './linux-hwe-tools-4.15.0-38_4.15.0-38.41~16.04.1_amd64.deb'
The following additional packages will be installed:
  linux-tools-common
Suggested packages:
  fdutils linux-hwe-tools
The following NEW packages will be installed:
  linux-headers-4.15.0-38 linux-headers-4.15.0-38-generic linux-hwe-tools-4.15.0-38 linux-image-unsigned-4.15.0-38-generic linux-modules-4.15.0-38-generic
  linux-modules-extra-4.15.0-38-generic linux-tools-4.15.0-38-generic linux-tools-common
0 upgraded, 8 newly installed, 0 to remove and 55 not upgraded.
Need to get 134 kB/67.8 MB of archives.
After this operation, 342 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 /home/myuser/kernel/linux-headers-4.15.0-38_4.15.0-38.41~16.04.1_all.deb linux-headers-4.15.0-38 all 4.15.0-38.41~16.04.1 [11.1 MB]
Get:2 /home/myuser/kernel/linux-headers-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb linux-headers-4.15.0-38-generic amd64 4.15.0-38.41~16.04.1 [1209 kB]
Get:3 /home/myuser/kernel/linux-hwe-tools-4.15.0-38_4.15.0-38.41~16.04.1_amd64.deb linux-hwe-tools-4.15.0-38 amd64 4.15.0-38.41~16.04.1 [1426 kB]
Get:4 /home/myuser/kernel/linux-modules-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb linux-modules-4.15.0-38-generic amd64 4.15.0-38.41~16.04.1 [13.1 MB]
Get:5 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 linux-tools-common all 4.4.0-138.164 [134 kB]
Get:6 /home/myuser/kernel/linux-image-unsigned-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb linux-image-unsigned-4.15.0-38-generic amd64 4.15.0-38.41~16.04.1 [8034 kB]
Get:7 /home/myuser/kernel/linux-modules-extra-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb linux-modules-extra-4.15.0-38-generic amd64 4.15.0-38.41~16.04.1 [32.7 MB]
Get:8 /home/myuser/kernel/linux-tools-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb linux-tools-4.15.0-38-generic amd64 4.15.0-38.41~16.04.1 [152 kB]
Fetched 134 kB in 0s (178 kB/s)
Selecting previously unselected package linux-headers-4.15.0-38.
(Reading database ... 84620 files and directories currently installed.)
Preparing to unpack .../linux-headers-4.15.0-38_4.15.0-38.41~16.04.1_all.deb ...
Unpacking linux-headers-4.15.0-38 (4.15.0-38.41~16.04.1) ...
Selecting previously unselected package linux-headers-4.15.0-38-generic.
Preparing to unpack .../linux-headers-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb ...
Unpacking linux-headers-4.15.0-38-generic (4.15.0-38.41~16.04.1) ...
Selecting previously unselected package linux-tools-common.
Preparing to unpack .../linux-tools-common_4.4.0-138.164_all.deb ...
Unpacking linux-tools-common (4.4.0-138.164) ...
Selecting previously unselected package linux-hwe-tools-4.15.0-38.
Preparing to unpack .../linux-hwe-tools-4.15.0-38_4.15.0-38.41~16.04.1_amd64.deb ...
Unpacking linux-hwe-tools-4.15.0-38 (4.15.0-38.41~16.04.1) ...
Selecting previously unselected package linux-modules-4.15.0-38-generic.
Preparing to unpack .../linux-modules-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb ...
Unpacking linux-modules-4.15.0-38-generic (4.15.0-38.41~16.04.1) ...
Selecting previously unselected package linux-image-unsigned-4.15.0-38-generic.
Preparing to unpack .../linux-image-unsigned-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb ...
Unpacking linux-image-unsigned-4.15.0-38-generic (4.15.0-38.41~16.04.1) ...
Selecting previously unselected package linux-modules-extra-4.15.0-38-generic.
Preparing to unpack .../linux-modules-extra-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb ...
Unpacking linux-modules-extra-4.15.0-38-generic (4.15.0-38.41~16.04.1) ...
Selecting previously unselected package linux-tools-4.15.0-38-generic.
Preparing to unpack .../linux-tools-4.15.0-38-generic_4.15.0-38.41~16.04.1_amd64.deb ...
Unpacking linux-tools-4.15.0-38-generic (4.15.0-38.41~16.04.1) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up linux-headers-4.15.0-38 (4.15.0-38.41~16.04.1) ...
Setting up linux-headers-4.15.0-38-generic (4.15.0-38.41~16.04.1) ...
Setting up linux-tools-common (4.4.0-138.164) ...
Setting up linux-hwe-tools-4.15.0-38 (4.15.0-38.41~16.04.1) ...
Setting up linux-modules-4.15.0-38-generic (4.15.0-38.41~16.04.1) ...
Setting up linux-image-unsigned-4.15.0-38-generic (4.15.0-38.41~16.04.1) ...
I: /vmlinuz.old is now a symlink to boot/vmlinuz-4.4.0-131-generic
I: /initrd.img.old is now a symlink to boot/initrd.img-4.4.0-131-generic
I: /vmlinuz is now a symlink to boot/vmlinuz-4.15.0-38-generic
I: /initrd.img is now a symlink to boot/initrd.img-4.15.0-38-generic
Setting up linux-modules-extra-4.15.0-38-generic (4.15.0-38.41~16.04.1) ...
Setting up linux-tools-4.15.0-38-generic (4.15.0-38.41~16.04.1) ...
Processing triggers for linux-image-unsigned-4.15.0-38-generic (4.15.0-38.41~16.04.1) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.15.0-38-generic
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
/etc/kernel/postinst.d/x-grub-legacy-ec2:
locale: Cannot set LC_ALL to default locale: No such file or directory
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-4.4.0-131-generic
Found kernel: /boot/vmlinuz-4.15.0-38-generic
Found kernel: /boot/vmlinuz-4.4.0-131-generic
Replacing config file /run/grub/menu.lst with new version
Updating /boot/grub/menu.lst ... done

/etc/kernel/postinst.d/zz-update-grub:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.0-38-generic
Found initrd image: /boot/initrd.img-4.15.0-38-generic
Found linux image: /boot/vmlinuz-4.4.0-131-generic
Found initrd image: /boot/initrd.img-4.4.0-131-generic
done
myuser@srv1:~/kernel$ sudo reboot

One thought on “Rebuild the official Ubuntu kernel – Ubuntu 16.04 LTS”

  1. Pingback: Kernerl build and install – Mags Forum Technology

Leave a Reply

Your email address will not be published. Required fields are marked *