Browse Source

update buildscript for lede based gluon

Karsten Böddeker 6 years ago
parent
commit
b6941088c2
2 changed files with 13 additions and 46 deletions
  1. 0 15
      Makefile
  2. 13 31
      build.sh

+ 0 - 15
Makefile

@@ -1,15 +0,0 @@
-all:
-
-LC_ALL:=C
-LANG:=C
-
-GLUONDIR:=${CURDIR}/src
-
-include $(GLUONDIR)/include/gluon.mk
-include $(GLUONDIR)/targets/targets.mk
-
-list-targets:
-	@echo '$(GLUON_TARGETS)'
-
-default-release:
-	@echo '$(DEFAULT_GLUON_RELEASE)'

+ 13 - 31
build.sh

@@ -33,12 +33,12 @@ MY_DIR=$(readlink -f "${MY_DIR}")
 DEFAULT_KEY_DIR="${MY_DIR}/opkg-keys"
 DEFAULT_VERSIONS_DIR="${MY_DIR}/versions"
 CODE_DIR="${MY_DIR}/src"
-GLUON_BUILD_DIR="${CODE_DIR}/build"
+GLUON_BUILD_DIR="${CODE_DIR}/lede"
 SITE_DIR="${CODE_DIR}/site"
 PATCH_DIR="${SITE_DIR}/patches"
 OUTPUT_DIR="${MY_DIR}/output"
 IMAGE_DIR="${CODE_DIR}/output/images"
-MODULE_DIR="${CODE_DIR}/output/modules"
+PACKAGES_DIR="${CODE_DIR}/output/packages"
 MANIFEST_DIR="${CODE_DIR}/output/images/sysupgrade"
 SITE_GEN_SCRIPT="${CODE_DIR}/packages/ffho/ffho/ffho-site-generate/scripts/gen-site-conf.lua"
 SRV_URL="firmware.in.ffho.net"
@@ -112,10 +112,10 @@ if [ ! -d "${SITE_DIR}" ]; then
 	[ "$?" -eq "0" ] || abort "Failed to fetch SITE repository."
 fi
 
-pushd ${CODE_DIR} > /dev/null
 
 ### CHECKOUT GLUON
 progress "Checking out GLUON '${BASE}' ..."
+pushd ${CODE_DIR} > /dev/null
 # check if gluon got modified and bail out if necessary
 [ "$(git status --porcelain)" ] && abort "Local changes to peers directory. Cowardly refusing to update gluon repository." >&2
 git fetch
@@ -178,7 +178,6 @@ fi
 progress "Preparing the build environment (make update) ..."
 make update
 [ "$?" -eq "0" ] || abort "Failed to update the build environment, mimimi."
-popd > /dev/null #${CODE_DIR}
 
 ### set reasonable defaults for ${TARGETS} and ${BRANCH} if unset
 if [ -z "${TARGETS}" ]; then
@@ -186,9 +185,10 @@ if [ -z "${TARGETS}" ]; then
         info "building all targets: '${TARGETS}'"
 fi
 if [ "${BRANCH}" == "experimental" -a -z "${VERSION}" ] ; then
-        VERSION=$(make default-release)
+        VERSION=$(make show-release)
         info "EXPERIMENTAL FIRMWARE: using version tag '${VERSION}'"
 fi
+popd > /dev/null #${CODE_DIR}
 
 # we are now ready to produce the firmware images, so let's "save" our state
 build_info_path="${VERSIONS_DIR}/${VERSION}"
@@ -232,34 +232,16 @@ for target in ${TARGETS} ; do
 	export GLUON_TARGET="${target}"
 
 	# prepare build environment for our current target
-	progress "${target}: Preparing build environment."
 	if [ "${CLEAN}" == "clean" ]; then
+		progress "${target}: Preparing build environment. (make clean)"
 		make clean
 		[ "$?" -eq "0" ] || abort "${target}: Unable to clean environment."
 	fi
 
-	make -j ${MAKEJOBS} prepare-target ${MAKE_PARAM}
-	[ "$?" -eq "0" ] || abort "${target}: Unable to build environment."
-
-	# need to have a toolchain for the particular target 
-	progress "${target}: Building toolchain."
-	make -j ${MAKEJOBS} toolchain/install ${MAKE_PARAM}
-	[ "$?" -eq "0" ] || abort "${target}: Unable to build toolchain."
-
 	# now we can start building the images for the target platform
 	progress "${target}: Building FFHO-flavoured Gluon firmware. You'd better go and fetch some c0ffee!"
-	make -j ${MAKEJOBS} prepare ${MAKE_PARAM}
+	make -j ${MAKEJOBS} ${MAKE_PARAM}
 	[ "$?" -eq "0" ] || abort "${target}: Unable to build firmware."
-
-	# finally compile the firmware binaries
-	progress "${target}: Compiling binary firmware images."
-	make -j ${MAKEJOBS} images ${MAKE_PARAM}
-	[ "$?" -eq "0" ] || abort "${target}: Unable to assemble images."
-
-	# compile the modules
-	progress "${target}: Compiling modules."
-	make -j ${MAKEJOBS} modules ${MAKE_PARAM}
-	[ "$?" -eq "0" ] || abort "${target}: Unable to build modules."
 done
 
 # generate manifest
@@ -277,12 +259,12 @@ if [ "${PUBLISH}" -eq "1" ]; then
 		[ "$?" -eq "0" ] || abort "Failed to copy firmware images."
 	fi
 
-	# copying modules to the server
-	if [ -d "${MODULE_DIR}" ]; then
-		progress "Copying modules ..."
-		MODULE_DIR=$(find ${MODULE_DIR}/ -maxdepth 1 -name *${VERSION})
-		rsync -rlutzc -e ssh ${MODULE_DIR}/ ${SRV_USER}@${SRV_URL}:${SRV_PATH}/${VERSION}/modules
-		[ "$?" -eq "0" ] || abort "Failed to copy modules."
+	# copying packages to the server
+	if [ -d "${PACKAGES_DIR}" ]; then
+		progress "Copying packages ..."
+		PACKAGES_DIR=$(find ${PACKAGES_DIR}/ -maxdepth 1 -name *${VERSION})
+		rsync -rlutzc -e ssh ${PACKAGES_DIR}/ ${SRV_USER}@${SRV_URL}:${SRV_PATH}/${VERSION}/packages
+		[ "$?" -eq "0" ] || abort "Failed to copy packages."
 	fi
 
 	# copy manifest and the build info file