Skip to content

Commit

Permalink
dcu: do not fail on cbfstool remove
Browse files Browse the repository at this point in the history
Signed-off-by: Maciej Pijanowski <[email protected]>
  • Loading branch information
macpijan committed Nov 15, 2023
1 parent 04b8f78 commit 6817e69
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions dcu
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,10 @@ dcu_logo_command() {

echo "Setting ${LOGO_FILE} as custom logo"
convert -background None ${LOGO_FILE} BMP3:/tmp/logo.bmp
"${CBFSTOOL}" "${DASHARO_ROM}" remove -n logo.bmp -r BOOTSPLASH > /dev/null 2> /dev/null
CBFSTOOL_ERR="$(cbfstool ${DASHARO_ROM} add -f /tmp/logo.bmp -r BOOTSPLASH -n logo.bmp -t raw -c lzma 2>&1)"
# We do not care if this one fails. It can fail if serial_number is not
# already, there, which is fine.
"${CBFSTOOL}" "${DASHARO_ROM}" remove -n logo.bmp -r BOOTSPLASH > /dev/null 2> /dev/null || true
CBFSTOOL_ERR="$(${CBFSTOOL} ${DASHARO_ROM} add -f /tmp/logo.bmp -r BOOTSPLASH -n logo.bmp -t raw -c lzma 2>&1)"
rm /tmp/logo.bmp

if echo "${CBFSTOOL_ERR}" | grep -q "too big"; then
Expand Down
6 changes: 4 additions & 2 deletions src/logo_command.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ fi

echo "Setting ${LOGO_FILE} as custom logo"
convert -background None ${LOGO_FILE} BMP3:/tmp/logo.bmp
"${CBFSTOOL}" "${DASHARO_ROM}" remove -n logo.bmp -r BOOTSPLASH > /dev/null 2> /dev/null
CBFSTOOL_ERR="$(cbfstool ${DASHARO_ROM} add -f /tmp/logo.bmp -r BOOTSPLASH -n logo.bmp -t raw -c lzma 2>&1)"
# We do not care if this one fails. It can fail if serial_number is not
# already, there, which is fine.
"${CBFSTOOL}" "${DASHARO_ROM}" remove -n logo.bmp -r BOOTSPLASH > /dev/null 2> /dev/null || true
CBFSTOOL_ERR="$(${CBFSTOOL} ${DASHARO_ROM} add -f /tmp/logo.bmp -r BOOTSPLASH -n logo.bmp -t raw -c lzma 2>&1)"
rm /tmp/logo.bmp

if echo "${CBFSTOOL_ERR}" | grep -q "too big"; then
Expand Down

0 comments on commit 6817e69

Please sign in to comment.