hieuhtr / Blog

Don’t be lazy. Don’t make excuses. No one cares. Work fucking harder.
Other
6 stars 2 forks source link

Linux kernel on Linode server #33

Open hieuhtr opened 7 years ago

hieuhtr commented 7 years ago

Problem?

Cannot install livepatch trên ubuntu 16.04, server thuê ở linode Error log:

$ sudo snap install canonical-livepatch
error: cannot perform the following tasks:
- Setup snap "core" (1577) security profiles (cannot setup apparmor for snap "core": cannot load apparmor profile "snap.core.hook.configure": cannot load apparmor profile: exit status 1
apparmor_parser output:
Cache read/write disabled: interface file missing. (Kernel needs AppArmor 2.4 compatibility patch.)
Warning: unable to find a suitable fs in /proc/mounts, is it mounted?
Use --subdomainfs to override.
)
- Setup snap "core" (1577) security profiles (cannot load apparmor profile "snap.core.hook.configure": cannot load apparmor profile: exit status 1
apparmor_parser output:
Cache read/write disabled: interface file missing. (Kernel needs AppArmor 2.4 compatibility patch.)
Warning: unable to find a suitable fs in /proc/mounts, is it mounted?
Use --subdomainfs to override.
)

Investigate

Check thấy kernel ở /boot/ và từ uname -a khác nhau. WHY? Linode nếu để chế độ default thì họ sẽ dùng một bản linux kernel được tuỳ biến riêng

Một phát hiện thú vị.

Tại sao họ lại custom?

Không rõ. Nhưng mình có thể vô linode manager dashboard -> profile -> chọn được kernel version mình muốn dùng -> reboot là apply được ngay? Đây có thể là lý do cho họ custom kernel

Vậy kernel này được store ở đâu?

#Fetch kernel version
$ uname -a
Linux snode 4.9.15-x86_64-linode81 #1 SMP Fri Mar 17 09:47:36 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux

#Find it
$ sudo find / -name "4.9.15-x86_64-linode81"
/lib/modules/4.9.15-x86_64-linode81

#List all Linode's kernel
lib/modules$ ls -lh
total 24K
drwxr-xr-x 5 root root 4.0K Sep  9  2016 4.4.0-36-generic
drwxr-xr-x 2 root root 4.0K Sep  9  2016 4.6.5-x86_64-linode71
drwxr-xr-x 2 root root 4.0K Sep 15  2016 4.7.0-x86_64-linode72
drwxr-xr-x 2 root root 4.0K Apr 13 14:40 4.9.15-x86_64-linode81
drwxr-xr-x 2 root root 4.0K Apr  1 12:35 4.9.7-x86_64-linode80
drwxr-xr-x 2 root root 4.0K Sep  9  2016 grub-2.00-17-linode.img