[Arm-netbook] CONFIG_CMDLINE, override uboot parameters

Peter Steenbergen p.steenbergen at j1nx.nl
Wed Feb 20 09:17:31 GMT 2013


Thanks Piyush,

I know about the uboot saved parameters. The whole point is that I do not
want to touch the by the factory flashed uboot. There are now three
CONFIG_CMDLINE options
1) CONFIG_CMDLINE_BOOTLOADER == Always use the ones passed by the bootloader
2 CONFIG_CMDLINE_FORCE == Always use the under CMDLINE defined parameters,
ignore the ones passed by the bootloader
3) CONFIG_EXTEND == Insert parameters and APPEND the ones passed by the
bootloader. This is designed such, that you can define missing parameters
not defined by the bootloader.

With the latter, if you define a parameter which is also passed by the
bootloader, the by CMDLINE configured one wil be overwritten by the one
passed from the bootloader. This is simply because the function to fill for
instance the rootfstype parameter is called twice.

What I am basically are looking for is a fourth config option,
CONFIG_CMDLINE_OVERRIDE, where the by the bootloader passed parameters are
being appended by the ones defined in the CMDLINE. It is basically the
EXTEND, but then the other way around. It still EXTENDS the ones not
defined by the bootloader, but if you define a parameter in the kernel
which is also set by the CMDLINE the ones from the bootloader are
overwritten by the ones defined in the kernel.

At this moment, a quick hack has been applied to set a boolean for the
rootfstype one;
https://github.com/j1nx/buildroot-linux-kernel-m3/commit/52476f9f911ee9c08acda0976331aa5465ff16a7
But a fourth CONFIG parameter will solve the same issue for any other
possible parameters. The thing is; I can't believe I am the only one that
wants to override uboot parameters. It might be already out there...

Cheers


On Wed, Feb 20, 2013 at 3:32 AM, Piyush Verma <piyush.pv at gmail.com> wrote:

> While booting we can stop at uboot prompt.
>
> there we can see all environment variable with printenv.
> we can change it by setenv. don't forget to save it by saveenv after
> changing environment variable.
>
> bootargs is the environment variable where we can pass all rootfs details.
>
> Does it solve ur issue ?
>
> On Wed, Feb 20, 2013 at 4:01 AM, Peter Steenbergen <p.steenbergen at j1nx.nl>wrote:
>
>> I am running into an issue with my Amlogic XBMC development. Before I go
>> out searching the dark secrets of the linux kernel, I thought why not ask
>> you guys first.
>>
>> There is this patch;
>>
>> http://lists.infradead.org/pipermail/linux-arm-kernel/2011-April/047506.html
>> Which is used often. It adds the CONFIG_CMDLINE_EXTEND to the possible
>> CMDLINE options. It is designed to prepend the cmdline parameters in case
>> there are missing values. The passed parameters by uboot are then appended
>> to the ones from CONFIG_CMDLINE.
>>
>> This all works fine if you indeed are missing parameters, but what if i
>> want to overwrite/override an already by uboot passed parameter? (like
>> root= and rootfstype=)
>>
>> I don't want to FORCE everything, because I then have to take over the
>> complete line as passed by uboot. If I do that I will loose the parameters
>> set by variables within uboot (MAC)
>>
>> If I set them in CMDLINE, then the ones passed from uboot are appended
>> and overriding the ones from CMDLINE.
>>
>> I also do not want to change uboot as that is still kind of tricky on the
>> Amlogic boxes.
>>
>> Do anyone of you guys have some tips and/or directions?
>>
>> thanks
>>
>> _______________________________________________
>> arm-netbook mailing list arm-netbook at lists.phcomp.co.uk
>> http://lists.phcomp.co.uk/mailman/listinfo/arm-netbook
>> Send large attachments to arm-netbook at files.phcomp.co.uk
>>
>
>
>
> --
> Thanks & Regards
>
> Piyush Verma
>
>
> _______________________________________________
> arm-netbook mailing list arm-netbook at lists.phcomp.co.uk
> http://lists.phcomp.co.uk/mailman/listinfo/arm-netbook
> Send large attachments to arm-netbook at files.phcomp.co.uk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.phcomp.co.uk/pipermail/arm-netbook/attachments/20130220/c7e110fc/attachment.html 


More information about the arm-netbook mailing list