On Thu, 7 Apr 2016, Maxim Sobolev wrote:

Hi Bruce, thanks for the input! I will see if I can move that piece into
loader.8 and extend it a bit from the source "documentation".

Thanks.

I checked what happens for space and newline as field separators.  They
both to work in -current.  The newline form is less backwards compatible
and has other problems, so it should never be used.

Quoting for the spaces and newlines is painful, and also unclearly
documented.  I noticed these problems:
- in the static env source file, IIRC spaces don't work despite the
  strings being quoted, so I use hex escapes.  Octal escapes might
  work.  I doubt that the format is documented.  It is either not
  just C string format, or there is a problem with outer quotes being
  removed.
- in the default loader.conf and device.hints, everything is quoted with
  literal double quotes, even though most of the strings don't have
  whitespace.  I don't know if this is needed.  Quoting has a lot of
  documentation in loader.8
- the 'show' command in at least old versions of loader strips quotes,
  even in strings with whitespace.  Setting setting foo=123 and
  foo="123" both give 123.  Hex escapes are documented to work in the
  parser, but don't work from the command line (\x20 becomes x20), so
  so my use of them in kernel.env wouldn't work in loader.  Octal
  escapes are docmented to work in the parser, and work from the command
  line.
- when I got the octal escape sequence for newline wrong in loader, it
  did no OPOST processing like it does for newline, so it displayed a
  strange glyph (whatever is in the BIOS font).  Kernel error messages
  did the same.  For syscons, boot messages use the BIOS font.  I think
  vt would not display anything for control characters.
- when mountroot tries a device that doesn't exist, it prints the
  confusing errno 19.  19 is ENODEV.  ENODEV means ENOENT for the device.
  Documentation of this was broken by nmount in mount.2.  It still refers
  to the ufs_args struct which is not used by nmount and is no longer
  documented (except via this broken pointer) in mount.2.
- quoting is needed for strings with spaces or escape sequences: setting
  either foo=1 2 3 or foo=1\0402\0403 are syntax errors.
- loader.8, when viewed using man, has a few instances of excessive
  quoting too.  I not see that this a markup error.  Double quotes for
  string literals are rendered on a text terminal as 2 single quote
  characters each.  The string literals should be marked up as literals,
  especially the quotes in them, so that the quotes are rendered literally.
- loader.conf.5 barely documents quoting.  It just says that settings have
  the form variable="value".  The double quotes are correctly rendered for
  this but are misrendered in all examples.

Bruce
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to