update-grub은 grub 메뉴에 모든 커널을 추가하지 않습니다.

update-grub은 grub 메뉴에 모든 커널을 추가하지 않습니다.

우분투 21.10.

다음에 문서화된 대로 커널을 구축 중입니다.https://help.ubuntu.com/community/Kernel/Compile그리고https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel.

DEB_BUILD_OPTIONS=parallel=$(getconf _NPROCESSORS_ONLN) AUTOBUILD=1 NOEXTRAS=1 \
    fakeroot debian/rules binary-arch

이 컴파일 명령의 결과는 동일합니다.

make --jobs=$(getconf _NPROCESSORS_ONLN) bindeb-pkg \
    LOCALVERSION=-custom-$(git describe | tr '[:upper:]' '[:lower:]')

그러면 다음과 같은 .deb패키지가 생성됩니다.

$ ls -hal ../*.deb
-rw-r--r-- 1 amedee amedee 8,2M feb 26 02:17 ../linux-headers-5.13.19-ubuntu-5.13.0-22.22_5.13.19-ubuntu-5.13.0-22.22-6_amd64.deb
-rw-r--r-- 1 amedee amedee  70M feb 26 02:18 ../linux-image-5.13.19-ubuntu-5.13.0-22.22_5.13.19-ubuntu-5.13.0-22.22-6_amd64.deb
-rw-r--r-- 1 amedee amedee 1,2M feb 26 02:17 ../linux-libc-dev_5.13.19-ubuntu-5.13.0-22.22-6_amd64.deb

나는 다음과 같이 설치합니다 :

sudo dpkg --install \
    ../linux-headers-5.13.19-ubuntu-5.13.0-22.22_5.13.19-ubuntu-5.13.0-22.22-6_amd64.deb \
    ../linux-image-5.13.19-ubuntu-5.13.0-22.22_5.13.19-ubuntu-5.13.0-22.22-6_amd64.deb

이는 다음의 내용입니다 /boot.

$ ls -hal /boot/*5.13*
-rw-r--r-- 1 root root 252K nov  5 10:21 /boot/config-5.13.0-22-generic
-rw-r--r-- 1 root root 251K feb 26 02:15 /boot/config-5.13.19-ubuntu-5.13.0-22.22
-rw-r--r-- 1 root root  40M feb 22 16:21 /boot/initrd.img-5.13.0-22-generic
-rw-r--r-- 1 root root  37M feb 26 02:20 /boot/initrd.img-5.13.19-ubuntu-5.13.0-22.22
-rw------- 1 root root 5,7M nov  5 10:21 /boot/System.map-5.13.0-22-generic
-rw-r--r-- 1 root root 5,6M feb 26 02:15 /boot/System.map-5.13.19-ubuntu-5.13.0-22.22
-rw------- 1 root root 9,8M nov  5 13:51 /boot/vmlinuz-5.13.0-22-generic
-rw-r--r-- 1 root root 8,5M feb 26 02:15 /boot/vmlinuz-5.13.19-ubuntu-5.13.0-22.22

initramfs를 업데이트합니다(엄밀히 말하면 이미 완료되었기 때문에 필요하지 않지만 좋은 측정을 위해).

$ sudo update-initramfs -u -k all
update-initramfs: Generating /boot/initrd.img-5.13.19-ubuntu-5.13.0-22.22
update-initramfs: Generating /boot/initrd.img-5.13.0-22-generic

그런 다음 다음을 실행합니다 update-grub.

amedee@kerbol:~/repos/ubuntu-impish$ sudo update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.13.0-22-generic
Found initrd image: /boot/initrd.img-5.13.0-22-generic
Found linux image: /boot/vmlinuz-5.13.0-22-generic
Found initrd image: /boot/initrd.img-5.13.0-22-generic
Adding boot menu entry for UEFI Firmware Settings
done

내 컴파일된 커널 5.13.19-ubuntu-5.13.0-22.22update-grub. 수동으로 추가할 수 있다는 것을 알고 있지만 오타가 발생할 위험이 있습니다. 또한 git bisect. 제가 해결하고 있는 커널 문제는 최신 메인라인 커널에서는 발생하지 않으며 전부는 아니지만 일부 Ubuntu 21.10 커널에서만 발생합니다. 따라서 저는 단지 무언가를 배우고 호기심을 충족시키기 위해 이 작업을 수행합니다.

update-grub디렉터리 에서 컴파일된 커널을 /bootGrub 메뉴에 추가 하려면 어떻게 해야 합니까 ?

답변1

다음 세 가지 명령은 의 텍스트에 따라 실행 가능 비트를 끄고 09_lowlatency에 대한 비트를 켜서 이 문제를 해결합니다 .10_linux/etc/grub.d/README.lowlatency

# chmod -x /etc/grub.d/09_lowlatency
# chmod +x /etc/grub.d/10_linux
# update-grub

솔루션은 다음에서 찾았습니다.https://askubuntu.com/a/1228269/149519.

이제 예상대로 작동하는지 확인하려면 다음을 수행하세요.

$ ls -hal /boot ; echo ; sudo update-grub
total 107M
drwxr-xr-x  4 root root 4,0K feb 28 04:42 .
drwxr-xr-x 20 root root 4,0K feb 26 01:13 ..
-rw-r--r--  1 root root 252K nov  5 10:21 config-5.13.0-22-generic
-rw-r--r--  1 root root 251K feb 26 02:15 config-5.13.19-ubuntu-5.13.0-22.22
drwx------  4 root root 4,0K jan  1  1970 efi
drwxr-xr-x  5 root root 4,0K feb 28 04:42 grub
lrwxrwxrwx  1 root root   28 feb 28 04:26 initrd.img -> initrd.img-5.13.0-22-generic
-rw-r--r--  1 root root  40M feb 26 13:55 initrd.img-5.13.0-22-generic
-rw-r--r--  1 root root  37M feb 26 13:54 initrd.img-5.13.19-ubuntu-5.13.0-22.22
-rw-------  1 root root 5,7M nov  5 10:21 System.map-5.13.0-22-generic
-rw-r--r--  1 root root 5,6M feb 26 02:15 System.map-5.13.19-ubuntu-5.13.0-22.22
lrwxrwxrwx  1 root root   25 feb 28 04:27 vmlinuz -> vmlinuz-5.13.0-22-generic
-rw-------  1 root root 9,8M nov  5 13:51 vmlinuz-5.13.0-22-generic
-rw-r--r--  1 root root 8,5M feb 26 02:15 vmlinuz-5.13.19-ubuntu-5.13.0-22.22

Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.13.19-ubuntu-5.13.0-22.22
Found initrd image: /boot/initrd.img-5.13.19-ubuntu-5.13.0-22.22
Found linux image: /boot/vmlinuz-5.13.0-22-generic
Found initrd image: /boot/initrd.img-5.13.0-22-generic
Adding boot menu entry for UEFI Firmware Settings
done

관련 정보