Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include kernel config file #113

Open
yzhao1012 opened this issue Jun 1, 2022 · 11 comments
Open

Include kernel config file #113

yzhao1012 opened this issue Jun 1, 2022 · 11 comments

Comments

@yzhao1012
Copy link

Description

IIUC, Lima uses a Ubuntu distro.

Ubuntu has a kernel config file that includes the value of all of the kernel source configuration entries.
Ubuntu puts that file at /boot/config-$(uname -r).

Pixie (px.dev) reads this config file at runtime, to determine the right configuration entry for compiling C code to BPF byte code using BCC.

Let me know if I could help with any changes.

@afbjorklund
Copy link
Member

afbjorklund commented Jun 2, 2022

It seems to be there, for the "default":

anders@lima-default:/home/anders$ ls /boot/
System.map-5.15.0-25-generic  config-5.15.0-25-generic  efi  grub  initrd.img  initrd.img-5.15.0-25-generic  initrd.img.old  vmlinuz  vmlinuz-5.15.0-25-generic  vmlinuz.old

Maybe you are thinking of alpine-lima ?

It uses a "Live CD" boot mechanism, and the kernel config is elsewhere.

lima-alpine:/home/anders$ ls /boot
ls: /boot: No such file or directory

Currently it is at /media/cdrom/boot/config-virt, for the "virt" kernel.

@yzhao1012
Copy link
Author

Oh nice, let me verify the /media/cdrom/boot/config-virt.

For background, my use case is with https://github.com/rancher-sandbox/rancher-desktop, which uses lima to create VM.
I'll also submit an issue at rancher-sandbox's repo to gather their suggestions.

@afbjorklund
Copy link
Member

One approach is to use CONFIG_IKCONFIG_PROC, which makes it available in /proc/config.gz.

But making the config file configurable is probably also a viable approach, and default to /boot files ?

@jandubois
Copy link
Member

It is available at /media/sr0/boot/config-virt

@afbjorklund
Copy link
Member

afbjorklund commented Jun 2, 2022

It is available at /media/sr0/boot/config-virt

Right, seems like the mountpoint changed in 3.15.


lima-alpine:/home/anders/alpine-lima$ more /etc/fstab 
/dev/cdrom      /media/cdrom    iso9660 noauto,ro 0 0
/dev/usbdisk    /media/usb      vfat    noauto,ro 0 0
#LIMA-START
#LIMA-END
lima-alpine:/home/anders/alpine-lima$ ls -l /dev/cdrom
lrwxrwxrwx    1 root     root             3 Jun  2 16:45 /dev/cdrom -> sr0

Should be the same thing.

@jandubois
Copy link
Member

Should be the same thing.

But somehow it isn't:

lima-rancher-desktop:~$ more /etc/fstab
/dev/cdrom      /media/cdrom    iso9660 noauto,ro 0 0
/dev/usbdisk    /media/usb      vfat    noauto,ro 0 0
#LIMA-START
#LIMA-END
lima-rancher-desktop:~$ ls -l /dev/cdrom
lrwxrwxrwx    1 root     root             3 Jun  2 16:38 /dev/cdrom -> sr0
lima-rancher-desktop:~$ ls /media/cdrom
lima-rancher-desktop:~$ ls /media/sr0
alpine.apkovl.tar.gz  apks                  boot                  efi

@afbjorklund
Copy link
Member

Indeed confusing.

/etc/fstab:/dev/cdrom	/media/cdrom	iso9660	noauto,ro 0 0
/etc/mtab:/dev/sr0 /media/sr0 iso9660 ro,relatime,nojoliet,check=s,map=n,blocksize=2048,iocharset=utf8 0 0

Wonder who mounts things ?

@jandubois
Copy link
Member

I think it is just

mkmntdirs
mount -a

@yzhao1012
Copy link
Author

yzhao1012 commented Jun 2, 2022

I am not familiar with filesystem setups, but is there a way to ssh to the Lima VM, so that I could manually examine my local VM setup in rancher-desktop?

@jandubois
Copy link
Member

I've already replied in rancher-sandbox/rancher-desktop#2324 (comment)

@dimaqq
Copy link

dimaqq commented Aug 29, 2023

It's not on cdrom:

$ sudo find /media/cdrom/
/media/cdrom/
/media/cdrom/boot
/media/cdrom/boot/00-modprobe.sh
/media/cdrom/boot/01-alpine-ash-as-bash.sh
/media/cdrom/boot/04-persistent-data-volume.sh
/media/cdrom/boot/05-lima-disks.sh
/media/cdrom/boot/05-rosetta-volume.sh
/media/cdrom/boot/06-etc-hosts.sh
/media/cdrom/boot/07-etc-environment.sh
/media/cdrom/boot/08-shell-prompt.sh
/media/cdrom/boot/09-host-dns-setup.sh
/media/cdrom/boot/10-alpine-prep.sh
/media/cdrom/boot/11-colorterm-environment.sh
/media/cdrom/boot/20-rootless-base.sh
/media/cdrom/boot/25-guestagent-base.sh
/media/cdrom/boot/30-install-packages.sh
/media/cdrom/boot/35-setup-packages.sh
/media/cdrom/boot/40-install-containerd.sh
/media/cdrom/boot.sh
/media/cdrom/etc_environment
/media/cdrom/lima-guestagent
/media/cdrom/lima.env
/media/cdrom/meta-data
/media/cdrom/network-config
/media/cdrom/user-data
/media/cdrom/util
/media/cdrom/util/compare_version.sh

It is however, on a different mount (tried as root)

mkmntdirs
mount -a 
less /media/vda/boot/config-virt

@AkihiroSuda AkihiroSuda transferred this issue from lima-vm/lima Sep 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants