user2719735
user2719735

Reputation: 107

How to set user environment variable in syslinux mboot.c32 boot loader

I need to set a user environment variable in syslinux mboot.c32 boot menu, and then read it back when I am in the OS. Is there a way to do that?

Upvotes: -1

Views: 202

Answers (1)

Tim Roberts
Tim Roberts

Reputation: 54767

You can set kernel command line variables in the APPEND line (similar to root=/dev/sda1 and console=tty0), and the whole kernel command line is available after boot in /proc/cmdline. A tiny sed script could turn that into an environment variable.

Upvotes: 1

Related Questions