§2023-11-07
- root@hc4Bookworm:/# apt-cache search linux-source
alexlai@hc4Bookworm:~$ sudo apt-cache search linux-source
linux-source - Linux kernel source (meta-package)
linux-source-6.1 - Linux kernel source for version 6.1 with Debian patches
alexlai@hc4Bookworm:~$ cd build/src
alexlai@hc4Bookworm:~/build/src$ apt source linux-source-6.1
alexlai@hc4Bookworm:~/build/src$ ls -l
total 410396
drwxr-xr-x 28 alexlai alexlai 4096 Nov 8 15:54 linux-6.1.55
-rw-r--r-- 1 alexlai alexlai 1576156 Sep 29 12:26 linux_6.1.55-1.debian.tar.xz
-rw-r--r-- 1 alexlai alexlai 290924 Sep 29 12:26 linux_6.1.55-1.dsc
-rw-r--r-- 1 alexlai alexlai 137442320 Sep 29 12:26 linux_6.1.55.orig.tar.xz <---
-rw-r--r-- 1 alexlai alexlai 280923060 Nov 6 10:37 stage3-arm64-systemd-20231105T230202Z.tar.xz
- cp kernel source and config file
cp -v linux_6.1.55.orig.tar.xz
into /mnt/gentoo/usr/src/cp -v /boot/config-6.1.0-odroid-arm64 /mnt/gentoo/usr/src/
- in chroot mode, make
(chroot) hc4Bookworm /usr/src # tar xvf linux_6.1.55.orig.tar.xz
(chroot) hc4Bookworm /usr/src # cd linux-6.1.55
(chroot) hc4Bookworm /usr/src # cp -v ../config-6.1.0-odroid-arm64 .config
(chroot) hc4Bookworm /usr/src # make oldconfig <-- there are lot of new option, just take the default
(chroot) hc4Bookworm /usr/src # make menuconfig <--verify Platform Selection, only Amlogi and Rockchip are selected
(chroot) hc4Bookworm /usr/src # time make -j4
- mount /boot partition and edit /etc/frstab
(chroot) hc4Bookworm /usr/src/linux-6.1.55 # mount /dev/sda1 /boot
(chroot) hc4Bookworm /usr/src/linux-6.1.55 # lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 298.1G 0 disk
├─sda1 8:1 0 1.9G 0 part /boot
├─sda2 8:2 0 7.5G 0 part [SWAP]
├─sda3 8:3 0 29.8G 0 part /etc/resolv.conf
└─sda4 8:4 0 89.4G 0 part /
(chroot) hc4Bookworm /usr/src/linux-6.1.55 # ls -l /boot
total 23912
-rw-r--r-- 1 root root 3858715 Jun 30 10:08 System.map-6.1.0-odroid-arm64
-rw-r--r-- 1 root root 4450 Nov 8 14:13 boot.scr
-rw-r--r-- 1 root root 4450 Nov 8 14:20 boot.scr.bak
-rw-r--r-- 1 root root 231625 Jun 30 10:08 config-6.1.0-odroid-arm64
-rw-r--r-- 1 root root 96 Nov 8 11:13 config.ini
lrwxrwxrwx 1 root root 53 Nov 8 11:25 dtb -> dtbs/6.1.0-odroid-arm64/amlogic/meson64_odroidhc4.dtb
lrwxrwxrwx 1 root root 53 Nov 8 11:25 dtb-6.1.0-odroid-arm64 -> dtbs/6.1.0-odroid-arm64/amlogic/meson64_odroidhc4.dtb
drwxr-xr-x 3 root root 4096 Nov 8 11:15 dtbs
drwxr-xr-x 2 root root 4096 Nov 8 11:25 grub
lrwxrwxrwx 1 root root 29 Nov 8 11:15 initrd.img -> initrd.img-6.1.0-odroid-arm64
-rw-r--r-- 1 root root 10137159 Nov 8 11:25 initrd.img-6.1.0-odroid-arm64
lrwxrwxrwx 1 root root 29 Nov 8 11:15 initrd.img.old -> initrd.img-6.1.0-odroid-arm64
drwx------ 2 root root 16384 Nov 8 10:50 lost+found
lrwxrwxrwx 1 root root 40 Nov 8 11:25 overlays -> dtbs/6.1.0-odroid-arm64/amlogic/overlays
lrwxrwxrwx 1 root root 26 Nov 8 11:15 vmlinuz -> vmlinuz-6.1.0-odroid-arm64
-rw-r--r-- 1 root root 10206439 Jun 30 10:08 vmlinuz-6.1.0-odroid-arm64
lrwxrwxrwx 1 root root 26 Nov 8 11:15 vmlinuz.old -> vmlinuz-6.1.0-odroid-arm64
- /etc/fstab
#LABEL=boot
UUID=ac9d7b07-7497-4689-81a2-280b5fe65bb8 /boot ext4 defaults 1 2
#LABEL=root, gentoo
UUID=42de3002-a04a-4907-8ac2-bbfb0a14825e / xfs defaults 0 1
#LABEL=swap
UUID=df6cd3a5-59d6-4db3-9b9b-110786289ebd none swap sw 0 0
make modules_install
andmake install
(chroot) hc4Bookworm /usr/src/linux-6.1.55 # make modules_install
sed: can't read modules.order: No such file or directory
make: *** [Makefile:1576: __modinst_pre] Error 2
(chroot) hc4Bookworm /usr/src/linux-6.1.55 # make modules
UPD include/generated/compile.h
CALL scripts/checksyscalls.sh
CHK kernel/kheaders_data.tar.xz
GEN kernel/kheaders_data.tar.xz
make[2]: *** [kernel/Makefile:156: kernel/kheaders_data.tar.xz] Error 127
make[1]: *** [scripts/Makefile.build:500: kernel] Error 2
make: *** [Makefile:2014: .] Error 2