[coreboot] [PATCH]Filo: rework device string parser

Georgi, Patrick Patrick.Georgi at secunet.com
Thu Mar 17 14:08:34 CET 2011


Hi,

attached patches rework the device string parser in FILO so it should be
easier to understand, and adds some more ways to specify
devices/partitions. Specifically:

2-refactor-dev-parsing.diff:
- copy_path_to_filo_bootline() erases the target location instead
  of expecting the callers to do so
- callers of copy_path_to_filo_bootline() don't erase the target
  variables themselves.

This fixes an issue where the function is called without the variable
being erased. I couldn't think of any plausible scenario in which the
old behaviour is desirable.


3-rewrite-drive-specification-parser.diff:
- copy_path_to_filo_bootline is rewritten for clarity.
- copy_path_to_filo_bootline now supports @address syntax in grub-style
  device names.
- use strtoul instead of a custom number parser (theoretically allows
  for >99 disks/partitions, but I guess we'll never have to work with
  that)

The old implementation of the function was a mess of hidden state
dragged around in incidental configuration in variables. The current
code flow should be easier to follow.

4-handle-partition-only-changes.diff:
- Allow new syntax "(,N)" (grub-style) or "N:" (filo/linux-style) which
  simply switches to a different partition on the current device.

Use case: one partition with filo.lst, another with kernels, filo.lst
references the kernel as "5:/boot/kernel" and it works no matter the
drive name.

Signed-off-by: Patrick Georgi <patrick.georgi at secunet.com>

-- 
Patrick Georgi
SINA-Development - High Security
secunet Security Networks AG - Mergenthalerallee 77 - 65760 Eschborn, Germany
Phone +49 201 54 54-3610 - Fax +49 201 54 54-1325 - www.secunet.com 

Sitz: Kronprinzenstraße 30, 45128 Essen / Amtsgericht Essen HRB 13615
Vorstand: Dr. Rainer Baumgart (Vors.), Thomas Koelzer, Thomas Pleines
Aufsichtsratsvorsitzender: Dr. Karsten Ottenberg

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2-refactor-dev-parsing.diff
Type: text/x-patch
Size: 2534 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20110317/f1094967/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3-rewrite-drive-specification-parser.diff
Type: text/x-patch
Size: 5062 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20110317/f1094967/attachment-0001.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 4-handle-partition-only-changes.diff
Type: text/x-patch
Size: 626 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20110317/f1094967/attachment-0002.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20110317/f1094967/attachment.sig>


More information about the coreboot mailing list