0
votes

I am trying to replace linux kernel in Ubuntu 20.04 over QEMU (not sure QEMU is relevant) but I am getting the next error:

  INSTALL arch/x86/crypto/aegis128-aesni.ko
At main.c:160:
- SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:69
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:76
sign-file: : No such file or directory
make[1]: *** [scripts/Makefile.modinst:33: arch/x86/crypto/aegis128-aesni.ko] Error 1
make: *** [Makefile:1482: _modinst_] Error 2

I am following the next steps:

  1. create a new empty image by running the next command:
    ./qemu-img create -f qcow2 ../ubuntu-desktop-20.04.qcow2 60G

I create 60G cause we will need to compile the kernel in QEMU.

  1. download ubuntu ISO file (https://ubuntu.com/download/desktop). run ubuntu with ubuntu-desktop-20.04.qcow2 and the new ubutnu ISO file:
build/qemu-system-x86_64 -cpu host -enable-kvm -boot d -m 2G -drive if=virtio,file=<full path to ubutnu image>/ubuntu-desktop-20.04.qcow2 -cdrom <full path to ubutnu iso>/ubuntu-20.04.2.0-desktop-amd64.iso

and install ubuntu. I created username "guest" and password "1234"

start qemu with the new installed ubuntu:

build/qemu-system-x86_64  \
    -cpu host -enable-kvm \
    -m 16G \
    -vnc :0 \
    -drive if=virtio,file=<full path to ubutnu image>/ubuntu-desktop-20.04.qcow2,cache=none \
    -device e1000,netdev=net0 \
    -netdev user,id=net0,hostfwd=tcp::55556-:22

and login into it via vnc. enabling ssh: install ssh and enable it permanently :

sudo apt install ssh
sudo -s
systemctl enable ssh
exit

try to enter with ssh:

ssh guest@localhost -p 55556

you will get the next error:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:kaSFtMxfTugjSHZJi1E1lCA5+GzBL5F8UuEQhgavVKo.
Please contact your system administrator.
Add correct host key in /home/yehuda.s/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/yehuda.s/.ssh/known_hosts:22
  remove with:
ssh-keygen -f "/home/yehuda.s/.ssh/known_hosts" -R "[localhost]:55556"
ECDSA host key for [localhost]:55556 has changed and you have requested strict checking.
Host key verification failed.

run the next command:

ssh-keygen -f "/home/yehuda.s/.ssh/known_hosts" -R "[localhost]:55556"

and than try to ssh again.

install:

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

download the wanted kernel (can be taken from https://www.kernel.org/) into qemu.I downloaded 5.12.13. cd into the downloaded folder and extract the files:

tar -xvf linux-tar.xz

cd into linux-5.12.13 and copy the config of the current ubutnu kernel into this folder:

cp -v /boot/config-$(uname -r) .config

In the .config file you copied from /boot find the lines CONFIG_SYSTEM_TRUSTED_KEY and CONFIG_MODULE_SIG_KEY and remove their value (leaving empty "").

run:

make menuconfig #- and config this as you want (I did nothing)...
make -j
make modules_install

I saw : https://www.reddit.com/r/linuxquestions/comments/byinth/cannot_stat_archx86cryptoaegis128aesniko_no_such/ and https://unix.stackexchange.com/questions/389484/aes-x86-64-ko-no-such-file-or-directory-for-module-installation-failure-after-4#389511 errors and tried their suggestions - but it didn't work

1

1 Answers

0
votes

solved it... after running

cp -v /boot/config-$(uname -r) .config

need to run

make localmodconfig

press enter to take all the defaults, and than continue with

make
sudo make modules_install
sudo make install

found it here https://rev2.vasanthdeveloper.com/compiling-the-linux-kernel-on-ubuntu-debian/index.html