vmware / photon

Minimal Linux container host
https://vmware.github.io/photon
Other
3.01k stars 703 forks source link

Managed combo of Photon OS Linux Kernel with API Headers - any howto? #957

Closed dcasota closed 4 years ago

dcasota commented 4 years ago

Could you provide some information on how to keep the Photon OS Linux kernel with the API Headers on the same version?

On my test env P30rev2 the Linux kernel uname -r shows up as 4.19.84-2.ph3. tdnf update -y and tdnf install linux-api-headers already were applied. Actually the latest linux-api-headers version shows up as 4.19.84-1.ph3. No hurry to install the latest api headers. Is there a best practice to enforce the Photon OS Linux kernel with the linux-api-headers let's say to a specified version 4.19.84-1 ?

Tinkering with

tdnf downgrade linux 4.19.84-1.ph3
tdnf downgrade linux-api-headers 4.19.84-1.ph3

resulted in some strange package version availability behaviour:

root@photonos [ ~ ]# tdnf downgrade linux 4.19.84-1.ph3
No package 4.19.84-1.ph3 available

Downgrading:
linux                                                  x86_64                      4.19.84-1.ph3                        photon-updates                 25.44M 26676195

Total installed size:  25.44M 26676195
Is this ok [y/N]:y

Downloading:
linux                                 21745427    100%
Testing transaction
Running transaction
Installing/Updating: linux-4.19.84-1.ph3.x86_64
initrd generation of kernel 4.19.84-1.ph3 will be triggered later
initrd of kernel 4.19.84-2.ph3 removed
Removing: linux-4.19.84-2.ph3.x86_64
(re)generate initramfs for 4.19.84-1.ph3, transfilertriggerin 2.0-4.ph3
Creating /boot/initrd.img-4.19.84-1.ph3

Complete!
root@photonos [ ~ ]# tdnf downgrade linux-api-headers 4.19.84-1.ph3

No package 4.19.84-1.ph3 available

Downgrading:
linux-api-headers                                      noarch                      4.19.82-1.ph3                        photon-updates                   4.55M 4775526

Total installed size:   4.55M 4775526
Is this ok [y/N]:Exiting on user Command
root@photonos [ ~ ]#
YustasSwamp commented 4 years ago

Could you provide some information on how to keep the Photon OS Linux kernel with the API Headers on the same version?

May I ask, why do you need exact same version for linux-api-headers?

If you want to build modules for current kernel version then you need to have same version for linux-devel. But I do not know the case where you need same version of linux-api-headers.

dcasota commented 4 years ago

What do you mean with "to have same version for linux-devel"?

I'm learning Photon OS. The use case is make .vhd-ified ISO images on Photon OS. It would be nice to have more choice.

I'm trying make Vboxmanage of VirtualBox work on Photon OS. On a Msft box vboxmanage installs successfully and makes a .vhd-ified ISO image.

vboxmanage convertfromraw J:\Some_Customized-A00.iso J:\isoboot.vdi
vboxmanage modifyhd J:\isoboot.vdi --resizebyte 334495744
vboxmanage convertfromraw J:\isoboot.vdi J:\isoboot.vhd --format VHD --variant Fixed

On Photon OS the installation ends with

root@photonos [ ~ ]# sh Virt*
Verifying archive integrity... All good.
Uncompressing VirtualBox for Linux installation.............
VirtualBox Version 6.0.14 r133895 (2019-10-10T18:54:03Z) installer
Removing previous installation of VirtualBox 6.0.14 r133895 from /opt/VirtualBox
Installing VirtualBox to /opt/VirtualBox
Python found: python, installing bindings...
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.

There were problems setting up VirtualBox.  To re-start the set-up process, run
  /sbin/vboxconfig
as root.  If your system is using EFI Secure Boot you may need to sign the
kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load
them. Please see your Linux system's documentation for more information.

VirtualBox has been installed successfully.

You will find useful information about using VirtualBox in the user manual
  /opt/VirtualBox/UserManual.pdf
and in the user FAQ
  http://www.virtualbox.org/wiki/User_FAQ

We hope that you enjoy using VirtualBox.

The installation log file is at /var/log/vbox-install.log.
root@photonos [ ~ ]#

uname -r displayed a different version than the installed linux-api-headers package. Didn't figured out yet how to solve This system is currently not set up to build kernel modules. Afaik apt-get is Ubuntu-only and there is no 1:1 matching to tdnf packages.

dcasota commented 4 years ago

Should close the case. For the moment I'm lost at the beginning of make a vhd-ified ISO on Photon OS. Vboxmanage convertfromraw does not work properly with many bootable CDs. I got informed that I can't convert a bootable ISO that way.

dcasota commented 4 years ago

Finally solved. Simply used the Azure VHD of PhotonOS as virtual hardware. It preserves the .vhd characteristics when making run msdos tools for Linux, Syslinux bootloader and custom ISO files on it.