Describe the bug
The printf command used in build.sh has a compatibility issue.
In POSIX, Hexadecimal escaping can be ambiguous. This causes build.sh to write fatally incorrect values when writing parameters in build process.
As a result, the following error occurs during the boot step:
Booting from Hard Disk...
Stage1: I/O error
Dash printf builtin does not honor \xNN to print hexadecimal:
"\0ddd", where ddd is a zero, one, two, or three-digit octal number that shall be converted to a byte with the numeric value specified by the octal number
Describe the bug The printf command used in build.sh has a compatibility issue. In POSIX, Hexadecimal escaping can be ambiguous. This causes build.sh to write fatally incorrect values when writing parameters in build process. As a result, the following error occurs during the boot step:
Dash printf builtin does not honor \xNN to print hexadecimal:
Bash printf builtin:
How to fix According to POSIX, we have to use octal escaping when we want to output bytes with the printf command. https://pubs.opengroup.org/onlinepubs/9699919799/utilities/printf.html