樹心幽徑

« 20190105將Fedora17的Linux核心由3.9.10-100.fc17 更新成linux-3.19.8 | Main | 20190107在windows7安裝strawberryperl及模組Path::Tiny、Spreadsheet::Read並使用perl語言來列出目錄內容(p1.pl)及讀取EXCEL工作表(p2.pl) »

20190105-0107將Ubuntu1604的Linux核心由4.4.0-121更新成linux-4.20.0
2019/01/05,12:42

REF:https://newtoypia.blogspot.com/2013/12/gnupg-pgp.html

(1)取得最新版核心:

$ wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.20.tar.xz

2019-01-05 12:49:54 (202 KB/s) - ‘linux-4.20.tar.xz’ saved [104257836/104257836]
(2)linux-4.20.tar.xz解壓為linux-4.20.tar

$ xz -d -v linux-4.20.tar.xz

$ stat linux-4.20.tar
  File: 'linux-4.20.tar'
  Size: 854773760     Blocks: 1669488    IO Block: 4096   普通檔案
Device: 821h/2081d    Inode: 2753463     Links: 1
Access: (0664/-rw-rw-r--)  Uid: ( 1000/ treehrt)   Gid: ( 1000/ treehrt)
Access: 2019-01-05 12:49:54.000000000 +0800
Modify: 2018-12-24 15:52:05.000000000 +0800
Change: 2019-01-05 12:57:22.127564476 +0800
 Birth: -

(3)$ wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.20.tar.sign

(4)$ gpg --verify linux-4.20.tar.sign

gpg: `/home/treehrt/.gnupg/pubring.gpg' 鑰匙圈已建立
gpg: 假設被簽署的資料在 `linux-4.20.tar'
gpg: 由 2018年12月24日 (週一) 15時46分48秒 CST 建立的簽章, 使用 RSA 金鑰 ID 6092693E
gpg: 無法檢查簽章: 找不到公鑰

(5) $gpg --keyserver keyserver.ubuntu.com  --recv-keys 6092693E
gpg: 正在請求金鑰 6092693E 自 hkp 伺服器 keyserver.ubuntu.com
gpg: /home/treehrt/.gnupg/trustdb.gpg: 建立了信任資料庫
gpg: 金鑰 6092693E: 公鑰 "Greg Kroah-Hartman <gregkh@linuxfoundation.org>" 已匯入
gpg: 金鑰 6092693E: 公鑰 "Greg Kroah-Hartman (Linux kernel stable release signing key) <greg@kroah.com>" 已匯入
gpg: 金鑰 6092693E: 公鑰 "Totally Legit Signing Key <mallory@example.org>" 已匯入
gpg: 沒有找到任何徹底信任的金鑰
gpg: 處理總量: 3
gpg:               已匯入: 3  (RSA: 3)

(6)$ gpg --verify linux-4.20.tar.sign
gpg: 假設被簽署的資料在 `linux-4.20.tar'
gpg: 由 2018年12月24日 (週一) 15時46分48秒 CST 建立的簽章, 使用 RSA 金鑰 ID 6092693E
gpg: 完好的簽章來自於 "Greg Kroah-Hartman <gregkh@linuxfoundation.org>"
gpg:                 亦即 "Greg Kroah-Hartman <gregkh@kernel.org>"
gpg:                 亦即 "Greg Kroah-Hartman (Linux kernel stable release signing key) <greg@kroah.com>"
gpg: 警告: 這把金鑰並非以受信任的簽章所認證!
gpg:          沒有證據指出這個簽章屬於這個持有者.
主鑰指紋: 647F ???? 4894 ???? 4571  ???? 38DB ???? 6092 693E

(7)$ tar xvf linux-4.20.tar

$ ls linux-4.20
arch   certs    CREDITS  Documentation  firmware  include  ipc     Kconfig  lib       MAINTAINERS  mm   README   scripts   sound  usr
block  COPYING  crypto   drivers        fs        init     Kbuild  kernel   LICENSES  Makefile     net  samples  security  tools  virt

(8)拷用現有的組態為預設值建立核心組態

$ uname -r
4.4.0-121-generic

$ ls /boot/config-$(uname -r) -l
-rw-r--r-- 1 root root 193930  4月 13  2018 /boot/config-4.4.0-121-generic

$ cp -v /boot/config-$(uname -r)  linux-4.20/.config
'/boot/config-4.4.0-121-generic' -> 'linux-4.20/.config'

(9)  $ make menuconfig沒成功,要先裝ncurses

* Unable to find the ncurses package.

(10)安裝編繹套件成功 

$ sudo apt-get install build-essential libncurses-dev bison flex libssl-dev libelf-dev


(11)再次組態

$ sudo make menuconfig

(12)編譯核心

$ sudo make

(13)$  安裝模組:

sudo make modules_install

:

  INSTALL virt/lib/irqbypass.ko
  DEPMOD  4.20.0

(14)列出安裝的modules

$ ls -l /lib/modules/
總計 20
drwxr-xr-x 5 root root 4096  6月 19  2017 3.13.0-119-generic
drwxr-xr-x 5 root root 4096  6月 20  2017 3.13.0-121-generic
drwxr-xr-x 3 root root 4096  1月  5 20:30 4.20.0
drwxr-xr-x 5 root root 4096  4月 24  2018 4.4.0-121-generic
drwxr-xr-x 5 root root 4096 10月  4  2017 4.4.0-96-generic

(15)列出新編成功的核心,好像有點胖。

$ ls arch/x86/boot/bzImage -l
-rw-r--r-- 1 root root 7630400  1月  5 14:52 arch/x86/boot/bzImage

(16)進行核心安裝(會自動更新grub2開機組態,最新核心將為預設開機選項)

$  sudo make install
sh ./arch/x86/boot/install.sh 4.20.0 arch/x86/boot/bzImage \
    System.map "/boot"
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.20.0 /boot/vmlinuz-4.20.0
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.20.0 /boot/vmlinuz-4.20.0
update-initramfs: Generating /boot/initrd.img-4.20.0
W: Possible missing firmware /lib/firmware/i915/skl_dmc_ver1_27.bin for module i915
W: Possible missing firmware /lib/firmware/i915/kbl_dmc_ver1_04.bin for module i915
W: Possible missing firmware /lib/firmware/i915/cnl_dmc_ver1_07.bin for module i915
W: Possible missing firmware /lib/firmware/i915/glk_dmc_ver1_04.bin for module i915
W: Possible missing firmware /lib/firmware/i915/icl_dmc_ver1_07.bin for module i915
W: Possible missing firmware /lib/firmware/i915/kbl_guc_ver9_39.bin for module i915
W: Possible missing firmware /lib/firmware/i915/bxt_guc_ver9_29.bin for module i915
W: Possible missing firmware /lib/firmware/i915/skl_guc_ver9_33.bin for module i915(計八個)
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.20.0 /boot/vmlinuz-4.20.0
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.20.0 /boot/vmlinuz-4.20.0
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.20.0 /boot/vmlinuz-4.20.0
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.20.0 /boot/vmlinuz-4.20.0
正在產生 grub 設定檔 ...
找到 linux 映像檔:/boot/vmlinuz-4.20.0
找到 initrd 映像檔:/boot/initrd.img-4.20.0
找到 linux 映像檔:/boot/vmlinuz-4.20
找到 linux 映像檔:/boot/vmlinuz-4.4.0-121-generic
找到 initrd 映像檔:/boot/initrd.img-4.4.0-121-generic
找到 linux 映像檔:/boot/vmlinuz-4.4.0-96-generic
找到 initrd 映像檔:/boot/initrd.img-4.4.0-96-generic
找到 linux 映像檔:/boot/vmlinuz-3.13.0-121-generic
找到 initrd 映像檔:/boot/initrd.img-3.13.0-121-generic
找到 linux 映像檔:/boot/vmlinuz-3.13.0-119-generic
找到 initrd 映像檔:/boot/initrd.img-3.13.0-119-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
找到 Windows 7 (loader) [於 /dev/sda1]
找到 Windows Recovery Environment (loader) [於 /dev/sda2]
找到 Windows 7 (loader) [於 /dev/sda3]
找到 Fedora release 19 (Schrödinger’s Cat) [於 /dev/mapper/fedora-root]
完成

(17) $ ls /boot -l
總計 569388
-rw-r--r-- 1 root root   1171026  5月  3  2017 abi-3.13.0-119-generic
-rw-r--r-- 1 root root   1171026  6月 14  2017 abi-3.13.0-121-generic
-rw-r--r-- 1 root root   1244690  4月 13  2018 abi-4.4.0-121-generic
-rw-r--r-- 1 root root   1243375  9月 13  2017 abi-4.4.0-96-generic
-rw-r--r-- 1 root root    170101  5月  3  2017 config-3.13.0-119-generic
-rw-r--r-- 1 root root    170101  6月 14  2017 config-3.13.0-121-generic
:
-rw-r--r-- 1 root root    219781  1月  5 20:37 config-4.20.0
-rw-r--r-- 1 root root    193930  4月 13  2018 config-4.4.0-121-generic
-rw-r--r-- 1 root root    193843  9月 13  2017 config-4.4.0-96-generic
drwxr-xr-x 5 root root      4096  1月  5 20:41 grub
-rw-r--r-- 1 root root  32013098  4月 24  2018 initrd.img-3.13.0-119-generic
-rw-r--r-- 1 root root  32014991  4月 24  2018 initrd.img-3.13.0-121-generic
-rw-r--r-- 1 root root 375897711  1月  5 20:40 initrd.img-4.20.0
-rw-r--r-- 1 root root  39009184  4月 24  2018 initrd.img-4.4.0-121-generic
-rw-r--r-- 1 root root  38807914  4月 24  2018 initrd.img-4.4.0-96-generic
-rw-r--r-- 1 root root    182704  1月 28  2016 memtest86+.bin
-rw-r--r-- 1 root root    184380  1月 28  2016 memtest86+.elf
-rw-r--r-- 1 root root    184840  1月 28  2016 memtest86+_multiboot.bin
-rw-r--r-- 1 root root      1030  4月 13  2018 retpoline-4.4.0-121-generic
-rw------- 1 root root   2706722  5月  3  2017 System.map-3.13.0-119-generic
-rw------- 1 root root   2706906  6月 14  2017 System.map-3.13.0-121-generic

-rw-r--r-- 1 root root   3172751  1月  5 20:37 System.map-4.20.0
-rw------- 1 root root   3110719  4月 13  2018 System.map-4.4.0-121-generic
-rw------- 1 root root   3103807  9月 13  2017 System.map-4.4.0-96-generic
-rw------- 1 root root   5868368  5月  3  2017 vmlinuz-3.13.0-119-generic
-rw------- 1 root root   5868592  6月 14  2017 vmlinuz-3.13.0-121-generic
:

-rw-r--r-- 1 root root   7630400  1月  5 20:37 vmlinuz-4.20.0
-rw------- 1 root root   6886592  4月 13  2018 vmlinuz-4.4.0-121-generic
-rw------- 1 root root   6846336  9月 13  2017 vmlinuz-4.4.0-96-generic

(18) 重開機 $ reboot

(19)核心4.20.0 #1 SMP 於 Sat Jan 5 13:21:51安裝成功:

$ uname -a
Linux treehrt-BM6AE-BM1AE-BP1AE 4.20.0 #1 SMP Sat Jan 5 13:21:51 CST 2019 i686 i686 i686 GNU/Linux

 

(20) 用舊的核心開機取得機器資訊 以了解 missing firmware /lib/firmware/i915/skl_dmc_ver1_27.bin for module i915

$ uname -a
Linux treehrt-BM6AE-BM1AE-BP1AE 4.4.0-121-generic #145-Ubuntu SMP Fri Apr 13 13:46:32 UTC 2018 i686 i686 i686 GNU/Linux

$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller (rev 06)

$ cat /proc/cpuinfo | grep "model name"
model name    : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
model name    : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
model name    : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
model name    : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
model name    : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
model name    : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
model name    : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
model name    : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz

(21)用新核心開機成功,但有0.045843 TSC_DEADLINE firmware錯誤訊息

$ uname -a
Linux treehrt-BM6AE-BM1AE-BP1AE 4.20.0 #1 SMP Sat Jan 5 13:21:51 CST 2019 i686 i686 i686 GNU/Linux

treehrt@treehrt-BM6AE-BM1AE-BP1AE:~$  lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller (rev 06)

$  cat /proc/cpuinfo | grep "model name"
model name    : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
model name    : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
model name    : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
model name    : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
model name    : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
model name    : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
model name    : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
model name    : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz

 

 

 

(22)$  locate i915/skl_
/lib/firmware/i915/skl_dmc_ver1.bin
/lib/firmware/i915/skl_dmc_ver1_23.bin
/lib/firmware/i915/skl_dmc_ver1_26.bin
/lib/firmware/i915/skl_guc_ver1.bin
/lib/firmware/i915/skl_guc_ver1_1059.bin
/lib/firmware/i915/skl_guc_ver4.bin
/lib/firmware/i915/skl_guc_ver4_3.bin
/lib/firmware/i915/skl_guc_ver6.bin
/lib/firmware/i915/skl_guc_ver6_1.bin
/lib/firmware/i915/skl_huc_ver01_07_1398.bin

(23)

$cd /lib/firmware/i915/
$ ls
bxt_dmc_ver1_04.bin        kbl_dmc_ver1.bin           skl_guc_ver4_3.bin
bxt_dmc_ver1_05.bin        kbl_huc_ver02_00_1810.bin  skl_guc_ver4.bin
bxt_dmc_ver1_06.bin        skl_dmc_ver1_23.bin        skl_guc_ver6_1.bin
bxt_dmc_ver1_07.bin        skl_dmc_ver1_26.bin        skl_guc_ver6.bin
bxt_dmc_ver1.bin           skl_dmc_ver1.bin           skl_huc_ver01_07_1398.bin
bxt_huc_ver01_07_1398.bin  skl_guc_ver1_1059.bin
kbl_dmc_ver1_01.bin        skl_guc_ver1.bin

(24)

$ sudo wget https://github.com/wkennington/linux-firmware/raw/master/i915/skl_dmc_ver1_27.bin

$ sudo wget https://github.com/wkennington/linux-firmware/raw/master/i915/kbl_dmc_ver1_04.bin

$ sudo wget https://github.com/wkennington/linux-firmware/raw/master/i915/cnl_dmc_ver1_07.bin

$ sudo wget https://github.com/wkennington/linux-firmware/raw/master/i915/kbl_guc_ver9_39.bin

$ sudo wget https://github.com/wkennington/linux-firmware/raw/master/i915/bxt_guc_ver9_29.bin

$ sudo wget https://github.com/wkennington/linux-firmware/raw/master/i915/skl_guc_ver9_33.bin


(25)重裝核心:

$ cd /home/treehrt/linux-4.20

$  sudo make install
 

sh ./arch/x86/boot/install.sh 4.20.0 arch/x86/boot/bzImage \
    System.map "/boot"
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.20.0 /boot/vmlinuz-4.20.0
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.20.0 /boot/vmlinuz-4.20.0
update-initramfs: Generating /boot/initrd.img-4.20.0
W: Possible missing firmware /lib/firmware/i915/glk_dmc_ver1_04.bin for module i915
W: Possible missing firmware /lib/firmware/i915/icl_dmc_ver1_07.bin for module i915(還有二個)
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.20.0 /boot/vmlinuz-4.20.0
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.20.0 /boot/vmlinuz-4.20.0
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.20.0 /boot/vmlinuz-4.20.0
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.20.0 /boot/vmlinuz-4.20.0
正在產生 grub 設定檔 ...
找到 linux 映像檔:/boot/vmlinuz-4.20.0
找到 initrd 映像檔:/boot/initrd.img-4.20.0
找到 linux 映像檔:/boot/vmlinuz-4.20.0.old
找到 initrd 映像檔:/boot/initrd.img-4.20.0
找到 linux 映像檔:/boot/vmlinuz-4.20
找到 linux 映像檔:/boot/vmlinuz-4.4.0-121-generic
找到 initrd 映像檔:/boot/initrd.img-4.4.0-121-generic
找到 linux 映像檔:/boot/vmlinuz-4.4.0-96-generic
找到 initrd 映像檔:/boot/initrd.img-4.4.0-96-generic
找到 linux 映像檔:/boot/vmlinuz-3.13.0-121-generic
找到 initrd 映像檔:/boot/initrd.img-3.13.0-121-generic
找到 linux 映像檔:/boot/vmlinuz-3.13.0-119-generic
找到 initrd 映像檔:/boot/initrd.img-3.13.0-119-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
找到 Windows 7 (loader) [於 /dev/sda1]
找到 Windows Recovery Environment (loader) [於 /dev/sda2]
找到 Windows 7 (loader) [於 /dev/sda3]
找到 Fedora release 19 (Schrödinger’s Cat) [於 /dev/mapper/fedora-root]
完成


(26)

$ ls /boot -l|grep 4.20.0
-rw-r--r-- 1 root root    219781  1月  7 20:34 config-4.20.0
-rw-r--r-- 1 root root    219781  1月  5 20:37 config-4.20.0.old
-rw-r--r-- 1 root root 376119216  1月  7 20:37 initrd.img-4.20.0
-rw-r--r-- 1 root root   3172751  1月  7 20:34 System.map-4.20.0
-rw-r--r-- 1 root root   3172751  1月  5 20:37 System.map-4.20.0.old
-rw-r--r-- 1 root root   7630400  1月  7 20:34 vmlinuz-4.20.0
-rw-r--r-- 1 root root   7630400  1月  5 20:37 vmlinuz-4.20.0.old

(27)REBOOT

(28)補上缺少的i915 fireware

$cd /lib/firmware/i915/

$ sudo wget https://github.com/wkennington/linux-firmware/raw/master/i915/glk_dmc_ver1_04.bin

$ sudo wget https://github.com/wkennington/linux-firmware/raw/master/i915/icl_dmc_ver1_07.bin

(29)重安核心成功,終於沒再出現i915的警告。

$ cd /home/treehrt/linux-4.20
$  sudo make install

(30)reboot

仍有0.045843 TSC_DEADLINE firmware問題

tsc_deadline disabled due to errata please update microcode to version 0x3a (or later)

(31)$ sudo apt-get install intel-microcode
:

下列的額外套件將被安裝:
  iucode-tool
下列【新】套件將會被安裝:
  intel-microcode iucode-tool
:

下載:1 http://tw.archive.ubuntu.com/ubuntu xenial-updates/main i386 iucode-tool i386 1.5.1-1ubuntu0.1 [33.5 kB]
下載:2 http://tw.archive.ubuntu.com/ubuntu xenial-updates/main i386 intel-microcode i386 3.20180807a.0ubuntu0.16.04.1 [1,416 kB]

解開 iucode-tool (1.5.1-1ubuntu0.1) 中...
選取了原先未選的套件 intel-microcode。
準備解開 .../intel-microcode_3.20180807a.0ubuntu0.16.04.1_i386.deb ...
解開 intel-microcode (3.20180807a.0ubuntu0.16.04.1) 中...
Processing triggers for man-db (2.7.5-1) ...
設定 iucode-tool (1.5.1-1ubuntu0.1) ...
設定 intel-microcode (3.20180807a.0ubuntu0.16.04.1) ...
update-initramfs: deferring update (trigger activated)
intel-microcode: microcode will be updated at next boot
Processing triggers for initramfs-tools (0.122ubuntu8.11) ...
update-initramfs: Generating /boot/initrd.img-4.20.0

(32)reboot

(33)成功以新核心開機且不再有「tsc_deadline disabled due to errata please update microcode to version 0x3a (or later)」警告訊息。

$ date
一  1月  7 21:54:47 CST 2019

$ uname -a
Linux treehrt-BM6AE-BM1AE-BP1AE 4.20.0 #1 SMP Sat Jan 5 13:21:51 CST 2019 i686 i686 i686 GNU/Linux

迴響

 
Accessible and Valid XHTML 1.0 Strict and CSS Powered by LifeType