Created
July 27, 2018 11:34
-
-
Save Zrubi/47274c7e1f89efc9a7887ac48a3976b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# uImage generator for U-Boot | |
# place this file to /etc/kernel/postinst.d/ directory, | |
# and make it executable | |
# reference: https://forum.doozan.com/read.php?2,12096 | |
uImage="/boot/uImage" | |
die () { | |
echo >&2 "Error: $@" | |
echo >&2 "uImage generation failed - exiting." | |
exit 1 | |
} | |
echo "Generating uImage for U-Boot:" | |
if [ "$#" -eq 2 ]; then | |
if [ ! -z "$1" ] && [ -f "$2" ];then | |
name="Linux-$1" | |
file="$2" | |
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n ${name} -d ${file} ${uImage} | |
else | |
die "wrong arguments: '$1', '$2'" | |
fi | |
else | |
die "2 arguments required, $# provided" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment