gdamjan / secure-boot

UEFI SecureBoot for ArchLinux
58 stars 3 forks source link

Fix parsing /proc/cmdline #10

Closed maximbaz closed 3 years ago

maximbaz commented 3 years ago

The current syntax in master for copying /proc/cmdline doesn't work in POSIX shell and leaves cmdline empty and system unbootable. I didn't see a reason to treat /proc/cmdline and /etc/kernel/cmdline differently when extracting cmdline, so I refactored a little to use the same code.

What do you think?

gdamjan commented 3 years ago

I didn't see a reason to treat /proc/cmdline and /etc/kernel/cmdline differently when extracting cmdline

I wanted to leave /proc/cmdline as is.

doesn't work in POSIX shell

btw, what doesn't work exactly?

gdamjan commented 3 years ago

doesn't work in POSIX shell

btw, what doesn't work exactly?

this: ?

echo -n `</proc/cmdline` >

I guess the

`< …`

shortcut?

maximbaz commented 3 years ago

This line, yes, my /bin/sh is dash and this echo produces an empty string, so my cmdline was empty. I will be on laptop soon to test and give you a more precise answer 🙂

maximbaz commented 3 years ago
$ echo "some content" > /tmp/test
$ echo `< /tmp/test`

$ echo `grep . < /tmp/test`
some content
$ echo `cat /tmp/test`
some content
gdamjan commented 3 years ago

I can also use cp /proc/cmdline $DEST perhaps

maximbaz commented 3 years ago

I leave the choice up to you, just close this PR whenever you fix it in master one way or another 😉

gdamjan commented 3 years ago

fixed in dd2ae2510ea5c56993412a82e245d605cce84f94