Howto add boot parameter as argument for the boot.cmd for kernel ...

Started by winfried, December 06, 2023, 07:26:48 PM

Previous topic - Next topic

winfried

I want to add a kernel boot parameter, here "systemd.unified_cgroup_hierarchy=0", to the boot command, to test it I did:
In /boot/boot.cmd I added this to:

setenv bootargs "root=PARTUUID=${partuuid} rootwait console=${console} panic=${panic} loglevel=${loglevel} ${optargs} systemd.unified_cgroup_hierarchy=0"

Then I run
mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scrlike described in the bottom of the file and rebooted and it worked.

But at top of the file boot.cmd it is noted as "Auto-generated on:...", so I fear this will be overwritten by next upgrade of kernel or a module or so...

Question: What is the correct way to add a boot argument, which will survive upgrades ?

Some background info:

For the supervised installation of homeassistant at the moment to work we need "cgroup v2" to be disabled for the docker stuff and I got the warning:

"[warn] Could not find /etc/default/grub or /boot/firmware/cmdline.txt failed to switch to cgroup v1"

Since there is none of these files, since we have "uboot" system, it could not handle it.

Reading the OLIMAGE GUIDE, searching the forum: no find for an answer, and I am no "uboot" specialist.

Any advice is welcome.

mfg
 winfried
---- Atelier Algorythmics --- [url="http://algo.mur.at/"]http://algo.mur.at/[/url] ----

LubOlimex

It is better to ask the homeassistant community.

Boot parameters are usually done in /boot/uEnv.txt but I am not sure if this is what you need to get it working. From what I read they add what you want into cmdline.txt.



Technical support and documentation manager at Olimex

winfried

Thank you for response.

QuoteBoot parameters are usually done in /boot/uEnv.txt but I am not sure if this is what you need to get it working. From what I read they add what you want into cmdline.txt.
Thanks, that is the proper file: I added this line in "uEnv.txt" instead of "boot.cmd" and compiled again and it worked:
optargs=systemd.unified_cgroup_hierarchy=0
But there is also a line in top of uEnv.txt stating that is "# Auto-generated...", so I fear it will be overwritten.

Quote from: LubOlimex on December 07, 2023, 08:21:33 AMIt is better to ask the homeassistant community.

Ok, but there is a note, that there is no help on unsupported hardware, I choose "raspberrypi3" as a match [1], and Olimage "bullseye" with backports instead of "bookworm" and all works, except: if I get it to work maybe it will be supported in future.[2] But I can try to ask there.

Since Olimex is doing the Olimage, which proved to be very stable on my installation, maybe somebody here knows, if there is config file like "/boot/firmware/cmdline.txt" on raspberry, which will not be overwritten.

[1]  https://github.com/home-assistant/supervised-installer
[2] https://github.com/home-assistant/architecture/blob/master/adr/0014-home-assistant-supervised.md
---- Atelier Algorythmics --- [url="http://algo.mur.at/"]http://algo.mur.at/[/url] ----

winfried

#3
Trying to understand the uboot tools, since the uboot system is responsible for setting bootargs:

The Debian package installed by default from Olimex "u-boot-tools-olinuxino", which has the commands: `/usr/bin/fw_printenv` and `/usr/bin/fw_setenv`.

But these programs, does not work:

   /usr/bin/fw_printenv
   Read error on /uboot.env: Attempted to read 131072 bytes but got 8192

Not sure, it is only on mine installation or on others and still not grasping, which program generates the "uEnv.txt".
---- Atelier Algorythmics --- [url="http://algo.mur.at/"]http://algo.mur.at/[/url] ----

LubOlimex

Maybe try editing /boot/boot.cmd and then recompile with

# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr
Technical support and documentation manager at Olimex

winfried

Quote
QuoteBoot parameters are usually done in /boot/uEnv.txt, but I am not sure if this is what you need to get it working. From what I read, they add what you want into cmdline.txt.
Thanks, that is the proper file: I added this line in "uEnv.txt" instead of "boot.cmd" and compiled again and it worked:
optargs=systemd.unified_cgroup_hierarchy=0
But there is also a line in top of uEnv.txt stating that is "# Auto-generated...", so I fear it will be overwritten.

Further testing, what could possibly overwrite bootargs in `uEnv.txt`:
- reinstalled olimex linux-image
- generated list of overlays with `olinuxino-overlay`

result: no overwrite of my bootargs in `uEnv.txt`

It seems it is safe to add bootargs in `uEnv.txt`, so I will mark this as solved for me, for now.

mfg winfried

PS.: Still no clue what generates the lines in `uEnv.txt`:
"# Auto-generated on: 2023-11-06 08:42:17.818882
  # Generated UUID: a96d9e26-b867-4daa-accd-9dee79e0d00f "

If anybody knows, please note here.
---- Atelier Algorythmics --- [url="http://algo.mur.at/"]http://algo.mur.at/[/url] ----