樹心幽徑

« 20180726rebuild kernel In ubuntu 1604 | Main | 20180910-13安裝xml程式庫libxml2-dev並設計測試程式xml2.c用來解讀gpx航跡檔 »

20180727makeUbuntuKernel4.17.0
2018/07/27,22:28

REF:https://jerrynest.io/ubuntu-16-04-compile-linux-kernel/

(1)下載:$ sudo wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.17.10.tar.xz
:
2018-07-27 14:27:47 (1.58 MB/s) - ‘linux-4.17.10.tar.xz’ saved [102182824/102182824]

(2)解開:$ sudo tar -xJf linux-4.17.10.tar.xz

$ ls linux*
linux-4.17.10.tar.xz

linux-4.17.10:
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
ubuntu@ubuntu:/media/ubuntu/89443b33-e7a5-4a5a-b7c5-f26b698b4886/home/treehrt$

(3)

$ sudo mv linux-4.17.10 ../../usr/src

$ ls ../../usr/src
linux-4.17.10            linux-headers-4.13.0-45-generic  linux-headers-4.15.0-29-generic  linux-headers-4.4.0-130-generic
linux-headers-4.13.0-45  linux-headers-4.15.0-29          linux-headers-4.4.0-130          vboxhost-5.2.14

(4)

$ cd ../../usr/src

$ sudo ln -s linux-4.17.10 linux

$ ls -l
total 28
lrwxrwxrwx  1 root root   13  7月 27 14:42 linux -> linux-4.17.10
drwxrwxr-x 25 root root 4096  7月 25 09:26 linux-4.17.10
drwxr-xr-x 27 root root 4096  6月 15 13:46 linux-headers-4.13.0-45
drwxr-xr-x  7 root root 4096  6月 15 13:46 linux-headers-4.13.0-45-generic
drwxr-xr-x 27 root root 4096  7月 25 09:27 linux-headers-4.15.0-29
drwxr-xr-x  8 root root 4096  7月 25 09:27 linux-headers-4.15.0-29-generic
drwxr-xr-x 27 root root 4096  7月 10 04:53 linux-headers-4.4.0-130
drwxr-xr-x  7 root root 4096  7月 10 04:53 linux-headers-4.4.0-130-generic
lrwxrwxrwx  1 root root   32  6月 29 14:00 vboxhost-5.2.14 -> ../share/virtualbox/src/vboxhost

(5)

$ sudo cp /boot/config-4.4.0-21-generic ./.config

(6)$ sudo make menuconfig
  HOSTCC  scripts/basic/fixdep
 *** Unable to find the ncurses libraries or the
:

make: *** [menuconfig] Error 2

(7)$ sudo apt-get install libncurses-dev
:
設定 libncurses5-dev:i386 (6.0+20160213-1ubuntu1) ...

(8)sudo cp /boot/config-4.4.0-21-generic  .

(9) sudo apt-get install bison

(10) sudo apt-get install flex

(11)$ sudo make menuconfig
(12) sudo make 失敗
  HOSTCC  scripts/kconfig/conf.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf  --syncconfig Kconfig
Makefile:970: *** "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel".  Stop.

(13) sudo apt-get install libelf-dev

(14) sudo make 又失敗

:

scripts/sign-file.c:25:30: fatal error: openssl/opensslv.h: 沒有此一檔案或目錄

(15) sudo apt-get install openssl

(16)

sudo apt-get install libssl-dev

sudo apt-get install  kernel-package libncurses5-dev libc6-dev libssl-dev build-essential

(17) sudo make

終於編譯成功

(18)編譯模組: sudo make modules

(19)安裝模組:sudo make modules_install

(20)安裝核心: sudo make install

W: Possible missing firmware /lib/firmware/i915/bxt_guc_ver9_29.bin for module i915

正在產生 grub 設定檔 ...
找到 linux 映像檔:/boot/vmlinuz-4.17.10
找到 initrd 映像檔:/boot/initrd.img-4.17.10
找到 linux 映像檔:/boot/vmlinuz-4.17.10.old
找到 initrd 映像檔:/boot/initrd.img-4.17.10
找到 linux 映像檔:/boot/vmlinuz-4.4.0-21-generic
找到 initrd 映像檔:/boot/initrd.img-4.4.0-21-generic
找到 Ubuntu 16.04.4 LTS (16.04) [於 /dev/sdc2]
完成

21)lspci | grep VGA


00:02.0 VGA compatible controller: Intel Corporation Device 3e92
treehrt@treehrt-System-Product-Name:/boot/grub$

(22) cat /proc/cpuinfo | grep "model name"


model name    : Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
model name    : Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
model name    : Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
model name    : Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
model name    : Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
model name    : Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
model name    : Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
model name    : Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
treehrt@treehrt-System-Product-Name:/boot/grub$

(23)sudo update-initramfs -u -k all

:

update-initramfs: Generating /boot/initrd.img-4.17.10
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/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
update-initramfs: Generating /boot/initrd.img-4.4.0-21-generic

 

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.bintreehrt@treehrt-fire:~$ treehrt@treehrt-fire:~$  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)ok but cannot X

(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

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

:2018-07-29 16:12:19 (742 KB/s) - ‘skl_guc_ver9_33.bin’ saved [147520/147520]

 

(25)

treehrt@treehrt-fire:/usr/src/linux$ sudo make installsh ./arch/x86/boot/install.sh 4.17.10 arch/x86/boot/bzImage \        System.map "/boot"run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.17.10 /boot/vmlinuz-4.17.10run-parts: executing /etc/kernel/postinst.d/dkms 4.17.10 /boot/vmlinuz-4.17.10run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.17.10 /boot/vmlinuz-4.17.10update-initramfs: Generating /boot/initrd.img-4.17.10run-parts: executing /etc/kernel/postinst.d/pm-utils 4.17.10 /boot/vmlinuz-4.17.10run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.17.10 /boot/vmlinuz-4.17.10run-parts: executing /etc/kernel/postinst.d/update-notifier 4.17.10 /boot/vmlinuz-4.17.10run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.17.10 /boot/vmlinuz-4.17.10正在產生 grub 設定檔 ...找到 linux 映像檔:/boot/vmlinuz-4.17.10.bak找到 initrd 映像檔:/boot/initrd.img-4.17.10.bak找到 linux 映像檔:/boot/vmlinuz-4.17.10找到 initrd 映像檔:/boot/initrd.img-4.17.10找到 linux 映像檔:/boot/vmlinuz-4.17.10.old找到 initrd 映像檔:/boot/initrd.img-4.17.10找到 linux 映像檔:/boot/vmlinuz-4.15.0-29-generic找到 initrd 映像檔:/boot/initrd.img-4.15.0-29-generic找到 linux 映像檔:/boot/vmlinuz-4.13.0-45-generic找到 initrd 映像檔:/boot/initrd.img-4.13.0-45-generic找到 Ubuntu 16.04.5 LTS (16.04) [於 /dev/sdc5]Adding boot menu entry for EFI firmware configuration完成treehrt@treehrt-fire:/usr/src/linux$

 

(26)

root@treehrt-fire:/home/treehrt# cat /var/log/Xorg.0.log|grep EE        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.[     7.898] (EE)[     7.898] (EE) Backtrace:[     7.899] (EE) 0: /usr/lib/xorg/Xorg (xorg_backtrace+0x4e) [0x55e8dc5d16ce][     7.899] (EE) 1: /usr/lib/xorg/Xorg (0x55e8dc41f000+0x1b6a69) [0x55e8dc5d5a69][     7.899] (EE) 2: /lib/x86_64-linux-gnu/libc.so.6 (0x7fa2576e3000+0x354b0) [0x7fa2577184b0][     7.899] (EE) 3: /usr/lib/xorg/modules/drivers/intel_drv.so (0x7fa2538a4000+0x75dad) [0x7fa253919dad][     7.899] (EE) 4: /usr/lib/xorg/modules/drivers/intel_drv.so (0x7fa2538a4000+0x40d4c) [0x7fa2538e4d4c][     7.899] (EE) 5: /usr/lib/xorg/modules/drivers/intel_drv.so (0x7fa2538a4000+0x42cc1) [0x7fa2538e6cc1][     7.899] (EE) 6: /usr/lib/xorg/modules/drivers/intel_drv.so (0x7fa2538a4000+0x46179) [0x7fa2538ea179][     7.899] (EE) 7: /usr/lib/xorg/modules/drivers/intel_drv.so (0x7fa2538a4000+0x4968e) [0x7fa2538ed68e][     7.899] (EE) 8: /usr/lib/xorg/modules/drivers/intel_drv.so (0x7fa2538a4000+0x3a13f) [0x7fa2538de13f][     7.899] (EE) 9: /usr/lib/xorg/modules/drivers/intel_drv.so (0x7fa2538a4000+0x3a342) [0x7fa2538de342][     7.899] (EE) 10: /usr/lib/xorg/Xorg (0x55e8dc41f000+0x13d341) [0x55e8dc55c341][     7.899] (EE) 11: /usr/lib/xorg/Xorg (0x55e8dc41f000+0x4fd47) [0x55e8dc46ed47][     7.899] (EE) 12: /usr/lib/xorg/Xorg (0x55e8dc41f000+0x53d9f) [0x55e8dc472d9f][     7.899] (EE) 13: /usr/lib/xorg/Xorg (0x55e8dc41f000+0x57e13) [0x55e8dc476e13][     7.899] (EE) 14: /lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main+0xf0) [0x7fa257703830][     7.899] (EE) 15: /usr/lib/xorg/Xorg (_start+0x29) [0x55e8dc461069][     7.899] (EE)[     7.899] (EE) Segmentation fault at address 0x7c[     7.899] (EE)[     7.899] (EE) Caught signal 11 (Segmentation fault). Server aborting[     7.899] (EE)[     7.899] (EE)[     7.899] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.[     7.899] (EE)[     7.957] (EE) Server terminated with error (1). Closing log file.

 

(27)

sudo apt-get purge xorg "xserver-*"
sudo apt-get purge lightdm plymouth
sudo rm -rf /etc/X11/xorg
sudo apt-get autoremove

(28)
sudo apt-get install xauth xorg openbox lightdm plymouth
sudo apt-get install ubuntu-desktop
sudo reboot
(29)sudo apt purge virtualbox-5.0


迴響

 
Accessible and Valid XHTML 1.0 Strict and CSS Powered by LifeType