You are not logged in.
Pages: 1
I have a feeling I'm missing something obvious but I haven't been able to find an answer either with google or in the wiki.
I've been trying to find a tool that parses efi variables, as in printing in clean plaintext the contents of a boot variable. I know I can use efivar -p to dump the contents of the variable (or just access it directly in /sys/firmware/efi/efivars) but it's full of what seems to be padding and you have to have a good idea of what is what.
I was wondering is there is any tool that will parse the contents of the variable and prints the label, loader, extra arguments and any other useful info in a clear easy to read (and copy paste) way.
Edit:
Typo in title
Last edited by R00KIE (2016-09-09 21:47:39)
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline
efibootmgr -v?
I'm not entirely sure I understand what you're asking. If I got it wrong, then please ignore me
Offline
That's close, better than the output of efivar but it still has some sort of padding, I would be nice to get a "clean" output.
Example output;
Boot0000* SED PBA HD(1,GPT,5172ab62-b344-4f2a-8036-0904c95233f3,0x800,0xf7df)/File(\vmlinuz-linux)i.n.i.t.r.d.=./.i.n.t.e.l.-.u.c.o.d.e...i.m.g. .i.n.i.t.r.d.=./.l.i.n.u.x.p.b.a...i.m.g. .l.i.b.a.t.a...a.l.l.o.w._.t.p.m.=.1. .l.o.g.l.e.v.e.l.=.0. .q.u.i.e.t.
As you can see it is full of dots, it should be possible to get just plaintext. Maybe it is because I have added the extra parameters as ucs-2 as described in the wiki[1].
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline
you can just edit those out with, for instance, sed or awk, and likely awk is the tool you should look at since you want to parse the variables anyway
Offline
The following does what I've been after
efibootmgr -v | awk 'match($0,/(.*File\(\\.*\))(.*)/,line){ line[2]=gensub(/(.)(\.)/,"\\1","g",line[2]); print line[1]" "line[2] }'
This will match only the entries where a file is loaded from disk, for what I want it is enough: easily copy paste extra parameters, loader and label.
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline
Pages: 1