#41 Fix label parsing in OLPC boot scripts
Merged 4 years ago by pbrobinson. Opened 4 years ago by lkundrak.
lkundrak/arm-image-installer lr/sad-forth  into  master

file modified
+1 -1
@@ -51,7 +51,7 @@ 

           4drop

           \ If we see a label, but already have boot-device set, then

           \ we drop the rest instead of proceeding to read another entry

-          boot-device and 0<>  if  drop 0  then

+          boot-device swap drop 0<>  if  drop 0  then

        else

           2dup " kernel" $=  if  2over unix-to-ofw-path to boot-device  else

           2dup " linux"  $=  if  2over unix-to-ofw-path to boot-device  else

For simplicity's sake, the extlinux.conf parser doesn't present a menu.
In an event of trouble, the user could just break into the OFW FORTH shell.
What it's supposed to do is to just parse the first entry, and not
proceed to read further if it encounters another label.

When a label is encountered, a check is done to see if "boot-device" variable
is already set. This does not work as intended -- a bit-wise "and" is done
between the variable address and length, as opposed to a logical one.
Bummer. Let's just check the size against zero and drop the address check.
The address is constant and always non-zero anyway.

Pull-Request has been merged by pbrobinson

4 years ago
Metadata