Commit 03a8c5fd authored by Benoit Rat's avatar Benoit Rat Committed by Alessandro Rubini

build: Rename --compress to --pack and move from flasher to build-all script

parent 2d7654cc
...@@ -17,19 +17,17 @@ ...@@ -17,19 +17,17 @@
showhelp() showhelp()
{ {
echo "Usage: $0 [options] MAC [<firmware>.tar.gz] [DEV]\n" printf "Usage: $0 [options] MAC [<firmware>.tar.gz] [DEV]\n\n"
echo "MAC:\t MAC address in hexadecimal seperated by ':' (i.e, AB:CD:EF:01:23:45)" printf "MAC:\t MAC address in hexadecimal seperated by ':' (i.e, AB:CD:EF:01:23:45)\n"
echo "<firmware>.tar.gz: Use the file in the firmware to flash the device" printf "<firmware>.tar.gz: Use the file in the firmware to flash the device\n"
echo "DEV:\t The usb device (by default it is /dev/ttyACM0)" printf "DEV:\t The usb device (by default it is /dev/ttyACM0)\n"
echo "Options: " printf "Options: \n"
echo "\t-h|--help\t\t Show this help message" printf "\t-h|--help\t\t Show this help message\n"
echo "\t-m|--mode\t\t can be: default, df (dataflash), nf (nandflash), test, compress." printf "\t-m|--mode\t\t can be: default, df (dataflash), nf (nandflash), test.\n"
echo "\t-e \t\t\t Completely erase the memory (Can erase your configuration)" printf "\t-e \t\t\t Completely erase the memory (Can erase your configuration)\n"
echo "\t--build\t\t\t Use file that you have build in the WRS_OUTPUT_DIR" printf "\t--build\t\t\t Use file that you have build in the WRS_OUTPUT_DIR\n"
echo "\t--test\t\t\t Use file for testing the switch (not available)" printf "\t--test\t\t\t Use file for testing the switch (not available)\n"
echo "\t--silent\t\t Don't ask MAC or S/N and use default 02:0B:AD:C0:FF:EE" printf "\t--silent\t\t Don't ask MAC or S/N and use default 02:0B:AD:C0:FF:EE\n\n"
echo ""
exit 0 exit 0
} }
...@@ -190,13 +188,6 @@ elif [ "x$memmode" = "xnf" ]; then ...@@ -190,13 +188,6 @@ elif [ "x$memmode" = "xnf" ]; then
nf=1 nf=1
elif [ "x$memmode" = "xtest" ]; then elif [ "x$memmode" = "xtest" ]; then
test=1 test=1
elif [ "x$memmode" = "xcompress" ]; then
cp ${at91bs} /tmp/at91bootstrap.bin
cp ${barebox} /tmp/barebox.bin
cp ${kernel} /tmp/zImage
cp ${rootfs} /tmp/wrs-image.jffs2.img
tar -czvf "wrs-firmware-$(date +%y%m%d).tar.gz" -C /tmp/ at91bootstrap.bin barebox.bin zImage wrs-image.jffs2.img
exit 0
else else
df=1 df=1
nf=1 nf=1
......
...@@ -50,11 +50,24 @@ showhelp() { ...@@ -50,11 +50,24 @@ showhelp() {
echo " --clean Remove all the previous configuration" echo " --clean Remove all the previous configuration"
echo " --fetch Force fetching the new download files" echo " --fetch Force fetching the new download files"
echo " --list List the different building steps" echo " --list List the different building steps"
echo " --pack Create a tar.gz package with the files in ${WRS_OUTPUT_DIR}/images/"
echo " --step=[00-09] Perform one specific step" echo " --step=[00-09] Perform one specific step"
echo "" echo ""
exit 0; exit 0;
} }
pack()
{
name=$(git describe --exact-match --tags HEAD &> /dev/null)
if [ $? -ne "0" ]; then
name=$(date +%y%m%d)"-"$(git log --abbrev-commit --pretty=oneline -1 | cut -d" " -f1)
fi
echo "Packing into wrs-firmware-$name.tar.gz";
tar -czvf "wrs-firmware-$name.tar.gz" -C ${WRS_OUTPUT_DIR}/images/ at91bootstrap.bin barebox.bin zImage wrs-image.jffs2.img
exit 0
}
## Menu to select the function in case we have an argument ## Menu to select the function in case we have an argument
...@@ -64,6 +77,7 @@ if [ -n "$1" ]; then ...@@ -64,6 +77,7 @@ if [ -n "$1" ]; then
--clean) rm -f $WRS_DONE_DIR/0*;; --clean) rm -f $WRS_DONE_DIR/0*;;
--fetch) echo "To be done";; --fetch) echo "To be done";;
--list) cd $WRS_DONE_DIR; ls 0*; exit 0;; --list) cd $WRS_DONE_DIR; ls 0*; exit 0;;
--pack) pack; exit 0;;
--step=0[0-9]) num=`echo $1 | sed -e 's/--step=//'`; rm -vf $WRS_DONE_DIR/${num}-*;; --step=0[0-9]) num=`echo $1 | sed -e 's/--step=//'`; rm -vf $WRS_DONE_DIR/${num}-*;;
*) showhelp;; *) showhelp;;
esac esac
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment