mobile-nixos icon indicating copy to clipboard operation
mobile-nixos copied to clipboard

In a device default.nix, only add **required** kernel command-line options.

Open samueldr opened this issue 4 years ago • 2 comments

I need to go back to every devices, and see what every options do, but it started strictly as a list of options that android uses when it boots.

Though with time it was found that most, if not all, are not actually needed? So in practice a repo cleanup needs to happen to add back only the required command-line arguments.


Useful options should instead be controlled through options.

E.g. an option set to control serial console vs. on-display console with failing assertions on devices without the selected ones.

Let's look at the pinephone description:

The vt.global_cursor_default=0 option should be controlled similarly, possibly adding it to the command-line when the on-display console isn't used.

Then panic=10 should outright be removed. This is now controlled through a default (undocumented) change to the kernel configuration instead, and is 1 second long.

Finally, consoleblank=0 is... probably not needed? I'm not even sure why it's there, I probably cargo culted it from another distro.

samueldr avatar Mar 12 '21 01:03 samueldr

I had previously noticed many devices have buildvariant set, which is mostly only used by the Android userspace, and probably should not be set in mobile-nixos.

(I just looked through a device kernel and found that the buildvariant option was used in drivers/md/dm-android-verity.c, but removing the option still shouldn't be a problem since we aren't using this android dm-verity module in mobile-nixos.)

danielfullmer avatar Mar 12 '21 19:03 danielfullmer

Yes, at first I was copying all cmdline options as extracted by unpackbootimg. I'm shifting the definition from "all options in the kernel cmdline" to "strictly what is required".

Since, as you say, many options will only be used by an Android userspace.

samueldr avatar Mar 12 '21 20:03 samueldr