diff --git a/TODO.org b/TODO.org index 3d9180d..9548aa9 100644 --- a/TODO.org +++ b/TODO.org @@ -1,11 +1,11 @@ # --- TODO -* TODO [#A] try kernel.org kernel -* TODO [#A] add --clean -* TODO [#B] build rootfs from slackwarearm-current +* TODO [#B] try kernel.org kernel +* TODO [#C] build rootfs from slackwarearm-current ftp://ftp.arm.slackware.com/slackwarearm/slackwarearm-devtools/minirootfs/scripts/ -* TODO [#B] compile out-of-tree -* TODO [#B] switch userland to hard-float binaries +* TODO [#C] compile out-of-tree +* TODO [#C] switch userland to hard-float binaries +* DONE add --clean * DONE package the kernel in a real slackware package * DONE offer pre-built binaries * DONE configure by passing --parameters diff --git a/build.sh b/build.sh index 92c8dbc..38d9f35 100755 --- a/build.sh +++ b/build.sh @@ -25,10 +25,22 @@ PACKAGE_BINARIES=false BINARIES_DIR=$CWD/binaries +function cleanall() { + for i in u-boot-sunxi sunxi-tools linux-sunxi; do + ( cd $DEST/$i + make clean CROSS_COMPILE=$CROSS_COMPILE ) + done +} + # commandline arguments processing while [ "x$1" != "x" ] do case "$1" in + --clean ) + shift + cleanall + exit -1 + ;; -c | --compile ) shift COMPILE="true" @@ -89,6 +101,7 @@ do -h | --help ) echo -e "Usage: run as root: $0 " echo -e "Options:" + echo -e "\t--clean" echo -e "\t-c | --compile" echo -e "\t-dc | --dont-compile (default)" echo -e "\t-d | --display [\"HDMI\"|\"VGA\"] (default: $CUBIETRUCK_DISPLAY)" @@ -97,7 +110,7 @@ do echo -e "\t-r | --rootfs-version [\"version number\"] (default: $ROOTFS_VERSION)" echo -e "\t-s | --image-size [size in MB] (default: $IMAGE_SIZE_MB)" echo -e "\t-o | --output [/directory/] (default: $DEST)" - echo -e "\t --package-binaries" + echo -e "\t--package-binaries" echo -e "\t\tpackage compiled binaries into $BINARIES_DIR-$VERSION.tar.xz" echo -e "\t\t(combine with --compile)" echo -e "\t-v | --image-version [\"version number\"] (default: $VERSION)" @@ -112,8 +125,6 @@ done # --- Script -------------------------------------------------------------------- mkdir -p $DEST -echo "Building Cubietruck-Slackware in $DEST from $CWD" - if [ "$COMPILE" = "true" ]; then mkdir -p $BINARIES_DIR