Based on: https://askubuntu.com/a/741770
I compiled the kernel with PREEMPT_RT previously (notes here: ). Then I extracted the .deb files following these instructions: https://askubuntu.com/questions/1340273/is-there-any-way-to-extract-content-of-vdi-file (As the shared folder from Virtualbox did not work for me).
sudo apt-add-repository ppa:cubic-wizard/release
sudo apt install cubic
Follow the prompts, choose a folder to work on, choose the ISO to base it on...
and you'll be dropped in a virtual environment (chroot) inside of the image.
Copy files (rt .deb files) by dragging them into the terminal window.
Install them with dpkg -i *.deb
.
Click next, edit the fields on image name and so on (I added "RT"), go next, check the compression type (I left it at gzip after failing with lzma).