added buildrelease() for release process
also changed image comparing at sysupgrade to sha256 and added the related tool Signed-off-by: Jan Kraus <mayosemmel@gmail.com> Reviewed-by: Tim Niemeyer <tim@tn-x.org> Reviewed-by: Tobias Klaus <tk+ff@meskal.net>
This commit is contained in:
parent
1050923f24
commit
da1199a55b
|
@ -12,6 +12,7 @@ CONFIG_ATH_USER_REGD=y
|
|||
# CONFIG_BUSYBOX_CONFIG_FEATURE_NTPD_SERVER is not set
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_WGET_TIMEOUT=y
|
||||
CONFIG_BUSYBOX_CONFIG_HTTPD=y
|
||||
CONFIG_BUSYBOX_CONFIG_SHA256SUM=y
|
||||
CONFIG_CLEAN_IPKG=y
|
||||
CONFIG_FASTD_ENABLE_CIPHER_NULL=y
|
||||
CONFIG_FASTD_ENABLE_MAC_UHASH=y
|
||||
|
|
|
@ -44,19 +44,19 @@ fi
|
|||
FILE="${FIRMWARE_COMMUNITY}-${VERSION}-${SOC}-generic-${BOARD}-squashfs-sysupgrade.bin"
|
||||
echo -ne "Downloading $FILE\n\n"
|
||||
wget $(uci get firmware.upgrade.path)/${FILE}
|
||||
wget $(uci get firmware.upgrade.path)/${FILE}.md5
|
||||
wget $(uci get firmware.upgrade.path)/${FILE}.sha256
|
||||
|
||||
echo -ne "\ndone. Comparing md5 sums: "
|
||||
md5sum -c ${FILE}.md5
|
||||
echo -ne "\ndone. Comparing sha256 sums: "
|
||||
sha256sum -c ${FILE}.sha256
|
||||
ret=$?
|
||||
echo
|
||||
if [ $ret -ne 0 ]; then
|
||||
echo -ne "md5 sums do not match. Try restarting this script to redownload the firmware.\n\n"
|
||||
echo -ne "sha256 sums do not match. Try restarting this script to redownload the firmware.\n\n"
|
||||
rm -f ${FILE}*
|
||||
exit 1
|
||||
else
|
||||
while true; do
|
||||
read -p "md5 sums correct. Should I start upgrading the firmware (y/N)? " yn
|
||||
read -p "sha256 sums correct. Should I start upgrading the firmware (y/N)? " yn
|
||||
case $yn in
|
||||
[Yy] ) echo -ne "\nStarting firmware upgrade. Don't touch me until I reboot.\n\n\n"; sysupgrade ${FILE}; break;;
|
||||
[Nn]|* ) echo -ne "\nAborting firmware upgrade.\n\n"; rm -f ${FILE}*; exit 0;;
|
||||
|
|
|
@ -12,6 +12,7 @@ CONFIG_ATH_USER_REGD=y
|
|||
# CONFIG_BUSYBOX_CONFIG_FEATURE_NTPD_SERVER is not set
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_WGET_TIMEOUT=y
|
||||
CONFIG_BUSYBOX_CONFIG_HTTPD=y
|
||||
CONFIG_BUSYBOX_CONFIG_SHA256SUM=y
|
||||
CONFIG_CLEAN_IPKG=y
|
||||
CONFIG_FASTD_ENABLE_CIPHER_NULL=y
|
||||
CONFIG_FASTD_ENABLE_MAC_UHASH=y
|
||||
|
|
|
@ -12,6 +12,7 @@ CONFIG_ATH_USER_REGD=y
|
|||
# CONFIG_BUSYBOX_CONFIG_FEATURE_NTPD_SERVER is not set
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_WGET_TIMEOUT=y
|
||||
CONFIG_BUSYBOX_CONFIG_HTTPD=y
|
||||
CONFIG_BUSYBOX_CONFIG_SHA256SUM=y
|
||||
CONFIG_CLEAN_IPKG=y
|
||||
CONFIG_FASTD_ENABLE_CIPHER_NULL=y
|
||||
CONFIG_FASTD_ENABLE_MAC_UHASH=y
|
||||
|
|
30
buildscript
30
buildscript
|
@ -279,6 +279,25 @@ cp_firmware() {
|
|||
done
|
||||
}
|
||||
|
||||
buildrelease() {
|
||||
if [ "$1" = "all" ];then
|
||||
buildall
|
||||
elif [ "$1" = "fast" ];then
|
||||
build fast
|
||||
elif [ "$1" = "all" ] && [ "$2" = "fast" ];then
|
||||
buildall fast
|
||||
else
|
||||
build
|
||||
fi
|
||||
cd bin
|
||||
for binary in *.bin; do
|
||||
md5sum "$binary" > ./"$binary".md5
|
||||
sha256sum "$binary" > ./"$binary".sha256
|
||||
done
|
||||
cd ..
|
||||
echo -e "VERSION:$version" > ./bin/release.nfo
|
||||
}
|
||||
|
||||
clean() {
|
||||
/bin/rm -rf bin $builddir src/openwrt
|
||||
|
||||
|
@ -416,6 +435,16 @@ case "$1" in
|
|||
buildall "$2" "$3"
|
||||
fi
|
||||
;;
|
||||
"release")
|
||||
if [ "$2" = help ]; then
|
||||
echo "This option builds the firmware for a given board. It also creates hash sums and a the file release.nfo"
|
||||
echo
|
||||
echo "Usage: $0 $1 [all] [fast]"
|
||||
echo
|
||||
else
|
||||
buildrelease "$2"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "This is the Build Environment Script of the Freifunk Community Franken."
|
||||
echo
|
||||
|
@ -427,6 +456,7 @@ case "$1" in
|
|||
echo " config openwrt"
|
||||
echo " build [fast|debug]"
|
||||
echo " buildall <community-file> [fast]"
|
||||
echo " release [all] [fast]"
|
||||
echo " clean"
|
||||
echo ""
|
||||
echo "If you need help to one of these options just type: $0 <command> help"
|
||||
|
|
Loading…
Reference in New Issue