Charles Steinkuehler <[EMAIL PROTECTED]> writes:

> Erich Titl wrote:
>
> | There is a possible bug in linuxrc (at least with the busybox of Bering)
> | when trying to create and mount the /tmp filesystem.
> |
> | Here is the output from /linuxrc.err
> |
> | mount -t tmpfs tmpfs /tmp -o size=20M
> | mount: Mounting tmpfs on /tmp failed: Invalid argument
> | mount -t tmpfs tmpfs /tmp -o size=20M
> |
> | I extended linuxrc a little to get the debug info. It appears as if the
> | tmpfs mount does not like the parameter substitution used for tmp_size
> |
> | here is the relevant code
> |
> | [ "$VERBOSE" ] && Lecho "Generating /tmp & /var/log partitions ..."
> | echo mount -t tmpfs tmpfs /tmp ${tmp_size:+-o size=$tmp_size} >>
> | /linuxrc.err
> | qt mount -t tmpfs tmpfs /tmp ${tmp_size:+-o size=$tmp_size}
> | echo  mount -t tmpfs tmpfs /tmp -o size=$tmp_size >> /linuxrc.err
> | qt mount -t tmpfs tmpfs /tmp -o size=$tmp_size
> |
> | as you can see, the second mount appears to work, this is with tmp_size
> | set to 20M in leaf.cfg
>
> I suspect the entire "-o size=20M" is being passed to mount as a single
> argument, causing the problem.

I think it only would be a single argument if there were quotes around
the ${:+} substitution:

[EMAIL PROTECTED]:\w# unset tmp_size; for arg in ${tmp_size:+-o size=$tmp_size} 
foo "${tmp_size:+-o size=$tmp_size}"; do echo "[$arg]"; done 
[foo]
[]
[EMAIL PROTECTED]:\w# tmp_size="20M"; for arg in ${tmp_size:+-o size=$tmp_size} 
foo "${tmp_size:+-o size=$tmp_size}"; do echo "[$arg]"; done
[-o]
[size=20M]
[foo]
[-o size=20M]
[EMAIL PROTECTED]:\w# 

(run on my BU box running the standard /bin/sh shell)

However, I'd try leaving out the space after the -o, i.e. I'd run it as

    mount -t tmpfs tmpfs /tmp ${tmp_size:+-osize=$tmp_size}

GruÃ,

Uli

Attachment: pgpdYNSF5qEi3.pgp
Description: PGP signature

Reply via email to