Skip to content
This repository has been archived by the owner on Aug 11, 2023. It is now read-only.

Commit

Permalink
Fix interpretation of backslash escapes
Browse files Browse the repository at this point in the history
Fixes: 53e6b66
  • Loading branch information
andreyv committed Nov 12, 2022
1 parent 53e6b66 commit 4926075
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sbupdate
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ function update_image() {
# https://www.kernel.org/doc/Documentation/x86/microcode.txt
objcopy \
--add-section .osrel="/etc/os-release" --change-section-vma .osrel=0x20000 \
--add-section .cmdline=<(echo -n "${cmdline}\0") --change-section-vma .cmdline=0x30000 \
--add-section .cmdline=<(printf "%s\0" "${cmdline}") --change-section-vma .cmdline=0x30000 \
--add-section .splash="${SPLASH}" --change-section-vma .splash=0x40000 \
--add-section .linux="${linux}" --change-section-vma .linux=0x2000000 \
--add-section .initrd=<(cat "${INITRD_PREPEND[@]}" "${initrd}") --change-section-vma .initrd=0x3000000 \
Expand Down

3 comments on commit 4926075

@solsticedhiver
Copy link

@solsticedhiver solsticedhiver commented on 4926075 Nov 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

echo -e -n "${cmdline}\0" would have worked too, I guess

@andreyv
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would also interpret backslashes inside ${cmdline}, changing its meaning.

@solsticedhiver
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. my bad.

Please sign in to comment.