m/p/efivarfs: allow multiple paths in LoadOption

The FilePathList in an EFI LOAD_OPTION technically allows multiple
device paths separated by end of path markers. These additional paths
beyond the first one do not have any standardized function, but some
EFI vendors use them to store data. Currently we fail to parse them
because they contain more than one end of path marker. Fix this by
adding an ExtraPaths field to LoadOption and implementing marshalling/
unmarshalling for it. I chose to use a separate field in the Go
struct because these additional paths do not have the same functionality
as the first one (they are not bootable).

Change-Id: I96df17915966a973a7553fe9864a0b3e6f6b61e8
Reviewed-on: https://review.monogon.dev/c/monogon/+/2037
Reviewed-by: Serge Bazanski <serge@monogon.tech>
Reviewed-by: Tim Windelschmidt <tim@monogon.tech>
Tested-by: Jenkins CI
diff --git a/metropolis/pkg/efivarfs/devicepath_test.go b/metropolis/pkg/efivarfs/devicepath_test.go
index b5823ac..ad81279 100644
--- a/metropolis/pkg/efivarfs/devicepath_test.go
+++ b/metropolis/pkg/efivarfs/devicepath_test.go
@@ -81,9 +81,13 @@
 			if !bytes.Equal(got, c.expected) {
 				t.Fatalf("expected %x, got %x", c.expected, got)
 			}
-			if _, err := UnmarshalDevicePath(got); err != nil {
+			_, rest, err := UnmarshalDevicePath(got)
+			if err != nil {
 				t.Errorf("failed to unmarshal value again: %v", err)
 			}
+			if len(rest) != 0 {
+				t.Errorf("rest is non-zero after single valid device path: %x", rest)
+			}
 		})
 	}
 }