Skip to contentSkip to conversation

quoting semicolons inside nested "run" scripts?

U-Boot Joe Buehler 2 participants 3 messages Apr 7, 2010 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

I am having difficulties getting a semicolon into the LINUX kernel's mtdparts command line parameter.

I want to do something like this:

bootcmd=run aaa
aaa=run bbb
bbb=run linux
linux=blah blah blah ${mtdparts}
mtdparts=mtdparts=blah1;blah2

I cannot figure out the quoting to get "blah2" passed to the kernel. I have tried various things but it always gets stripped.

Joe Buehler

#3 lore raw
In reply to a message not in the archive

Dear Joe Buehler,

please keep the mailing list on Cc:

Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 4 lines

What exactly is your problem? U-Boot is trying use the same quoting rules as /bin/sh, so standard escaping with '\' or by enclosing the variable devinitions in '...' works fine.

To make it a bit more concrete, here is one attempt on my part:

Quoted 12 lines

VadaTech AMC22x# printenv
printenv
baudrate=115200
download_baudrate=115200
bootloader_flash_update=protect off $(uboot_flash_addr) +$(uboot_flash_size);erase $(uboot_flash_addr) +$(uboot_flash_size);cp.b $(fileaddr) $(uboot_flash_addr) $(uboot_flash_size);run nuke_env burn_app=erase $(flash_unused_addr) +$(filesize);cp.b $(fileaddr) $(flash_unused_addr) $(filesize)
bf=bootoct $(flash_unused_addr) forceboot numcores=$(numcores) nuke_env=protect off $(env_addr) +$(env_size); erase $(env_addr) +$(env_size)

...

That's really difficult to read as your mailer wrapped long lines so it's pretty difficult to see where one definition ends and where the next one starts. Please fix your mailer NOT to wrap linwes when posting code like here.

Quoted 8 lines

doboot=run bootlinnfs
bootlinnfs=bootoctlinux 17c00000 mem=2048 coremask=0x003 root=/dev/nfs rw nfsroot=10.32.89.176:/QSCOPE1GIG2a ip=10.32.89.175:10.32.89.176:10.32.89.1:255.255.255.0:qscope_xx:mgmt0:off ${mtdparts}
bootlindisk=bootoctlinux 17c00000 mem=2048 coremask=0x003 root=/dev/sda1 rw ${mtdparts}
bootqos=bootoct 18c00000 coremask=0xFFC heap=0x800000 stack=0x800000

...

Quoted 15 lines

mtdparts=mtdparts=phys_mapped_flash:384K(uboot),128K(ubootenv),32256K(user);user_flash:16384K(kernel),16384K(spirentqos)

Environment size: 1649/131068 bytes
VadaTech AMC22x# run doboot
run doboot
argv[2]: mem=2048
argv[3]: coremask=0x003
argv[4]: root=/dev/nfs
argv[5]: rw
argv[6]: nfsroot=10.32.89.176:/QSCOPE1GIG2a
argv[7]:
ip=10.32.89.175:10.32.89.176:10.32.89.1:255.255.255.0:qscope_xx:mgmt0:off argv[8]: mtdparts=phys_mapped_flash:384K(uboot),128K(ubootenv),32256K(user) ELF file is 64 bit
(rest omitted...)

Hm... it seems you are running some prorpietary code here. The mainline version of U-Boot does not know any such commands as "bootoctlinux" or "bootoct".

Quoted 3 lines

The mtdparts argument to the kernel has been cut off at the semicolon. So what should I put in the value of the mtdparts environment variable so uboot does not eat the semicolon?

I'm sorry, but I don't know what sort of argument handling is implemented in the "bootoctlinux" command, and if or how variable sustitution is implemented on these arguments. Normally the "mtdparts" settings are part of the "bootargs" variable that gets passed to the Linux kernel.

As you are using unknown, proprietary code here there is little we can do to help.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Der Dativ ist dem Genitiv sein Tod.
#4 lore raw

As a workaround for my issue I just modified the MTD command line parameter parser in the LINUX kernel to accept & as an alternative to ;.

Joe Buehler