Welcome! Log In Create A New Profile

Advanced

Confused by usb_set_bootargs (in order to use systemd)

Posted by runner3735 
Confused by usb_set_bootargs (in order to use systemd)
November 26, 2016 08:43AM
I have a pogoplug E02, have flashed the latest u-boot, and am successfully booting from the latest rootfs on a usb thumbdrive. I should also mention that I flashed the latest default u-boot environment as well.

I want to use systemd (it seems to be necessary to properly install pi-hole software). I see in 'Note 2' of the rootfs post, that I should alter bootargs as follows:

fw_setenv usb_set_bootargs 'setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts init=/bin/systemd'

But, I've looked through the latest default env, and there is no mention of usb_set_bootargs, so doing this would just create an unused variable, right?

There is, however, a set_bootargs variable as follows:

set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params

I think what I should do is this:

fw_setenv set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params init=/bin/systemd'

But it also doesn't look like custom_params is used anywhere, so does that mean I could instead do this:

fw_setenv custom_params 'init=/bin/systemd'

I'm afraid that might not work depending on the order in which the environment is parsed...i.e., if set_bootargs is defined before custom_params is defined, then this idea won't work.

It's also mentioned that I should use the uEnv.txt file to accomplish this, so could/should I create the uEnv.txt file with the following text:

custom_params=init=/bin/systemd
(this will only work if uEnv is imported before set_bootargs is defined...I'm guessing)

or

set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params init=/bin/systemd

It's my understanding that you don't use the single quotes in the uEnv.txt file...is that right?

Anyway, I'm just looking for the definitive way to get my pink pogo using systemd.

Thanks.
Re: Confused by usb_set_bootargs (in order to use systemd)
November 26, 2016 02:43PM
runner3735,

Best if you list your u-boot envs here and I'll show you where to set the variable. You might have customized these envs in your box already, so it's not safe to suggest any change without seeing them first.

However, to clarify your questions:

> fw_setenv usb_set_bootargs 'setenv bootargs
> console=$console root=$usb_root
> rootdelay=$usb_rootdelay
> rootfstype=$usb_rootfstype $mtdparts
> init=/bin/systemd'

>

This is an example only, it should be used as a guide to set your bootargs.

> But, I've looked through the latest default env,
> and there is no mention of usb_set_bootargs, so
> doing this would just create an unused variable,
> right?
>

Right.


Here is the default envs. Assuming you have not changed your default envs too much,

set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec

Note custom_params is undefined in the default envs. To run systemd, you would just do either:

1. Set the env permanently

fw_setenv custom_params 'init=/bin/systemd'

or

2. Use uEnv.txt: add this single line in the file.

custom_params=init=/bin/systemd

Note the syntax, single quote is used to make sure the env value is set correctly (with embedded special characters such as space and = sign). OTOH, in the uEnv.txt, the format is exactly the same as the output when you list them (no quote).

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: