Skip to contentSkip to conversation

Read Kernel Command Line Options From a Text File

DISCUSSION Matteo Guglielmi 1 participant 1 message Jul 10, 2021

lore
Share & tools
lore
#0 lore raw

Dear All,

I would need to read additional kernel options from a text file.

So far I've managed to read a text file from a tftp server into

memory as follow:

# define and reads text file into memory (file name is based on
# the onboard nic's mac address e.g.: 01-e4-5f-01-0f-0a-d8)

setexpr params_filename gsub '\\(..\\):' '\\\\1-' 01-$ethaddr

setenv tftp_prefix nodes/

echo "Downloading options..."

tftpboot ${ramdisk_addr_r} ${tftp_prefix}${params_filename}

Now,

how do I get the whole memory content into a u-boot variable?

I've tried this command but it picks up only name=value pairs:

env import -t -r ${ramdisk_addr_r} ${filesize}

but I need the whole thing inside a single u-boot variable since it may look like something this:

opt1 opt2 opt3_with_options=par1,par2 opt4

In other words, what I'd need is something like this:

setenv more_options opt1 opt2 opt3_with_options=par1,par2 opt4

by pulling out the data from ${ramdisk_addr_r} ${filesize}.

Any help is really appreciated.