Configure grub with Ubuntu Core 20

Well, I increased my storage in / and ran, the .snap was created, but I have another problem now, using this .snap to generate img. The mistake is with “a model of grade higher than dangerous”. I didn’t find practical solutions on how to solve it. (With --extra-snaps the flag is not found).

you will need to use a grade: dangerous model …

Perfect, thanks for the answers, last question, I hope kk.

I added the cmdline.extra file in gadget and performed the steps to create the .snap and use it with the image, but there wasn’t the expected change when I ran it, am I doing the correct process for this change to occur? Example: in my cmdline.extra I have mitigations=off, this was to disable mitigations, but on the right side of the print with lscpu it is possible to verify that mitigations it is normally the same as the other versions. :s

does cat /proc/cmdline show your changes ?

No, it’s:

$ cat /proc/cmdline

snapd_recovery_mode=run console=ttyS0 console=tty1 panic=-1

so this has definitely not worked … i’m not exactly sure where the cmdline.extra file needs to go though (perhaps @ijohnson can chime in here)

…but do you see it in /snap/pc/current somewhere ?

I didn’t find it, I also used grep to be sure. Should the entire cmdline file be in this directory?

I’ll repeat the process of 0 in another directory to be sure, but this line I didn’t find it in OS :s

i assume you will likely need to add something to snapcraft.yaml to make it put it in place …

1 Like

Yeah it’s not enough to just add that file to the snapcraft sources, you need to add it to the snap itself, you should do either:

  1. just unpack the existing snap with unsquashfs pc_XYZ.snap and then add the cmdline.extra to squashfs-root, then re-pack with snap pack squashfs-root
  2. Add something to the snapcraft.yaml which adds this file to the snap when running snapcraft, i.e. the dump plugin for example
1 Like

i assume that would be in the top-level dir (just because even the documentation is silent about where to put it) ?

Yes the top level directory of the snap, we should document that more clearly I think

1 Like

Oh nice, well, I did 1 and it worked, in 2 I was confused kk, but I found a pull closed a few minutes ago about it on github, and they alsochanged snapcraft.yarm (alias I didn’t understand what SNAPCRAFT_PART_INSTALL would be) at https ://github.com/ snapcore / pc-amd64-gadget / pull / 53 .

Thank you, really, @ogra and @ijohnson, I plan to learn more about these details, for now it’s perfect!

I agree that it would help a lot to have more details in the documentation. (I can try to collaborate with what I can too)

1 Like

@degville can we please add the info that the files need to go into the toplevel dir of the gadget to:

1 Like

Thanks for pinging me - there have been a couple of questions related to this exact topic. I’m just trying the process myself and I’ll update the doc when I have it working.

2 Likes

I’ve now updated the Customising UC20 kernel command line arguments document to state the custom kernel command line file needs to be in the top level of the gadget, and also to provide a walk-through of the unsquashfs-based modification process (Customising UC20 kernel command line arguments). Let me know if I can add anything else that might be helpful.

I think it’s also worth moving the Customising UC20 kernel command line doc over to the Ubuntu Core docs.

i’d use a better example cmdline, mitigations=off (turn off all meltdown and spectre security patches in the kernel), is probably not a good general purpose demo line …

i’d turn it into something more generic like:

echo "option1=foo option2=bar" > squashfs-root/cmdline.extra

Good plan, thanks - I’ll update it now.