Re: %s substitution

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2009-06-18 at 13:48 -0400, Warren Togami wrote:
> > # Kernel replaces first %s with host name, and falls back to the ip address
> > # if it isn't set. Only the first %s is substituted.
> > if [ "${path#*%s}" != "$path" ]; then
> 
> Wont this only match if the $path ends with %s?  The nfsroot.txt seems 
> to indicate it should be substituted if the %s appears anywhere in the 
> string.

It will match if %s is anywhere in the string, it will strip it out and
it will no longer match the original path. Then we go into the code that
does the actual substitution.

The nice part about working in shell scripts is that it takes 3 seconds
to test out something you don't understand.

> Also, did you verify that the ip format you generate is identical to the 
> "ASCII-representation of the client's IP address" as generated by the 
> kernel?

The kernel docs say IP address, but the actual kernel code uses the host
name if set and falls back to the IP address.
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux