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

How to boot a kernel with different cmdline? #378

Open
irsl opened this issue Jul 12, 2018 · 2 comments
Open

How to boot a kernel with different cmdline? #378

irsl opened this issue Jul 12, 2018 · 2 comments

Comments

@irsl
Copy link

irsl commented Jul 12, 2018

Hi,

I need cgroup_enable=memory swapaccount=1 parameters added to my kernel command line arguments so that I could better limit memory consumption of my Docker containers.
I was googleing around but couldn't find any articles describing the proper way of accomplishing this with a Scaleway baremetal server.

If you could give me a hint, I'd appreciate it.

@irsl
Copy link
Author

irsl commented Jul 13, 2018

So, by reading the initrd source code, I guess something like the following server tags should do the work (I didn't have the time to test it yet):

KEXEC_KERNEL=latest
KEXEC_INITRD=http://169.254.42.24/initrd/initrd-Linux-x86_64-v3.12.7.gz KEXEC_APPEND="cgroup_enable=memory swapaccount=1"

The initrd url is coming from scw-metadata.

@irsl
Copy link
Author

irsl commented Jul 15, 2018

Had chance to experiment with it today. I learned:

The feature I was looking for is enabled by default on the bootscript/kernel combo (x86_64-mainline-lts-4.9-4.9.93-rev1) the SCW system assigned to me, without the need to specify anything explicitly at command line.

The approach above works, but the latest keyword at the kernel tag boots a vanilla OS kernel which did not recognize the ethernet interface for me. Instead of that I managed to make it work with the kernel url coming from the metadata:

KEXEC_KERNEL=http://169.254.42.24/kernel/x86_64-mainline-lts-4.9-4.9.93-rev1/vmlinuz-4.9.93
KEXEC_INITRD=http://169.254.42.24/initrd/initrd-Linux-x86_64-v3.14.4.gz
KEXEC_APPEND=foobar

root@scw-f12581:~# cat /proc/cmdline
showopts console=ttyS1,9600n8 nousb vga=0 root=/dev/nbd0 scaleway boot=local nbd.max_part=16 is_in_kexec=yes foobar

The official kernels 4.15.11 and 4.14.33 did not even boot (the root file system could not be mounted by initrd under /newroot). The 4.9.* kernels still unable to reboot and even cause file system corruption.
Nice system ;-)

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

1 participant