Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Freifunk Hochstift
Firmware
Commits
e9c27316
Commit
e9c27316
authored
8 years ago
by
Karsten Böddeker
Browse files
Options
Downloads
Patches
Plain Diff
build.sh: some improvements
parent
31ffc909
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
build.sh
+47
-37
47 additions, 37 deletions
build.sh
with
47 additions
and
37 deletions
build.sh
+
47
−
37
View file @
e9c27316
...
...
@@ -130,17 +130,23 @@ GLUON_COMMIT=$(git rev-list --max-count=1 HEAD)
### CHECKOUT SITE REPO
progress
"Checking out SITE REPO ..."
pushd
${
SITE_DIR
}
>
/dev/null
# TODO: check if site got modified locally and bail out if necessary
if
[
-z
"
${
SITE_ID
}
"
]
;
then
# no specific site given - get the most current one
git checkout
-q
${
BRANCH
}
;
git pull
[
"
$?
"
-eq
"0"
]
||
abort
"Failed to get newest '
${
BRANCH
}
' in site repository, mimimi."
else
# fetch site repo updates
git fetch
||
true
# commit given - use this one
git checkout
-q
${
SITE_ID
}
[
"
$?
"
-eq
"0"
]
||
abort
"Failed to checkout requested site commit '
${
SITE_ID
}
', mimimi."
if
[
$(
git remote |
wc
-l
)
>=
1
]
;
then
git fetch
# TODO: check if site got modified locally and bail out if necessary
if
[
-z
"
${
SITE_ID
}
"
]
;
then
# no specific site given - get the most current one
git checkout
-q
${
BRANCH
}
if
[
git branch
-r
|
grep
${
BRANCH
}
]
;
then
git rebase
[
"
$?
"
-eq
"0"
]
||
abort
"Failed to get newest '
${
BRANCH
}
' in site repository, mimimi."
fi
else
# fetch site repo updates
git fetch
||
true
# commit given - use this one
git checkout
-q
${
SITE_ID
}
[
"
$?
"
-eq
"0"
]
||
abort
"Failed to checkout requested site commit '
${
SITE_ID
}
', mimimi."
fi
fi
SITE_COMMIT
=
$(
git rev-list
--max-count
=
1 HEAD
)
popd
>
/dev/null
#${SITE_DIR}
...
...
@@ -149,7 +155,7 @@ popd > /dev/null #${SITE_DIR}
progress
"Applying Patches ..."
git checkout
-B
patching
"
${
BASE
}
"
if
[
-d
"
${
PATCH_DIR
}
"
-a
"
$(
echo
${
PATCH_DIR
}
/
*
.patch
)
"
]
;
then
git am
${
PATCH_DIR
}
/
*
.patch
||
(
git am
--whitespace
=
nowarn
${
PATCH_DIR
}
/
*
.patch
||
(
git am
--abort
git checkout patched
git branch
-D
patching
...
...
@@ -162,7 +168,7 @@ git branch -M patched
### DIRCLEAN
if
[
-d
"
${
GLUON_BUILD_DIR
}
/"
-a
"
${
CLEAN
}
"
==
"dirclean"
]
;
then
progress
"Cleaning your build environment ..."
progress
"Cleaning your build environment
(make dirclean)
..."
make dirclean
fi
...
...
@@ -175,7 +181,7 @@ popd > /dev/null #${CODE_DIR}
### set reasonable defaults for ${TARGETS} and ${BRANCH} if unset
if
[
-z
"
${
TARGETS
}
"
]
;
then
TARGETS
=
$(
make list-targets |
sed
-e
's/^[[:space:]]*//'
-e
's/[[:space:]]*$//'
)
info
"building all tagets: '
${
TARGETS
}
'"
info
"building all ta
r
gets: '
${
TARGETS
}
'"
fi
if
[
"
${
BRANCH
}
"
==
"experimental"
-a
-z
"
${
VERSION
}
"
]
;
then
VERSION
=
$(
make default-release
)
...
...
@@ -224,53 +230,57 @@ for target in ${TARGETS} ; do
[
"
${
AUTOUPDATER
}
"
!=
"off"
]
&&
export
GLUON_BRANCH
=
"
${
AUTOUPDATER
}
"
# prepare build environment for our current target
progress
"Preparing build environment
for target
${
target
}
."
progress
"
${
target
}
:
Preparing build environment."
if
[
"
${
CLEAN
}
"
==
"clean"
]
;
then
make clean
[
"
$?
"
-eq
"0"
]
||
abort
"Unable to clean environment
for target-platform
${
target
}
."
[
"
$?
"
-eq
"0"
]
||
abort
"
${
target
}
:
Unable to clean environment."
fi
make
-j
${
MAKEJOBS
}
prepare-target
${
MAKE_PARAM
}
[
"
$?
"
-eq
"0"
]
||
abort
"Unable to build environment
for target-platform
${
target
}
."
[
"
$?
"
-eq
"0"
]
||
abort
"
${
target
}
:
Unable to build environment."
# need to have a toolchain for the particular target
progress
"Building toolchain
for target
${
target
}
."
progress
"
${
target
}
:
Building toolchain."
make
-j
${
MAKEJOBS
}
toolchain/install
${
MAKE_PARAM
}
[
"
$?
"
-eq
"0"
]
||
abort
"Unable to build toolchain
for target-platform
${
target
}
."
[
"
$?
"
-eq
"0"
]
||
abort
"
${
target
}
:
Unable to build toolchain."
# now we can start building the images for the target platform
progress
"Building FFHO-flavoured Gluon firmware
for target
${
target
}
. You'd better go and fetch some c0ffee!"
progress
"
${
target
}
:
Building FFHO-flavoured Gluon firmware. You'd better go and fetch some c0ffee!"
make
-j
${
MAKEJOBS
}
prepare
${
MAKE_PARAM
}
[
"
$?
"
-eq
"0"
]
||
abort
"
Fai
le
d
to build firmware
for target-platform
${
target
}
."
[
"
$?
"
-eq
"0"
]
||
abort
"
${
target
}
: Unab
le to build firmware."
# finally compile the firmware binaries
progress
"Compiling binary firmware images."
progress
"
${
target
}
:
Compiling binary firmware images."
make
-j
${
MAKEJOBS
}
images
${
MAKE_PARAM
}
[
"
$?
"
-eq
"0"
]
||
abort
"
Fai
le
d
to assemble images
for target-platform
${
target
}
."
[
"
$?
"
-eq
"0"
]
||
abort
"
${
target
}
: Unab
le to assemble images."
# compile the modules
progress
"Compiling modules."
progress
"
${
target
}
:
Compiling modules."
make
-j
${
MAKEJOBS
}
modules
${
MAKE_PARAM
}
[
"
$?
"
-eq
"0"
]
||
abort
"
Fai
le
d
to build modules
for target-platform
${
target
}
."
[
"
$?
"
-eq
"0"
]
||
abort
"
${
target
}
: Unab
le to build modules."
done
popd
>
/dev/null
#${CODE_DIR}
# compress all binaries into 7z archive
progress
"Assembling images.7z ..."
pushd
${
IMAGE_DIR
}
>
/dev/null
[
-e
"
${
OUTPUT_DIR
}
/
${
BRANCH
}
/images.7z"
]
&&
rm
"
${
OUTPUT_DIR
}
/
${
BRANCH
}
/images.7z"
7z a
-mmt
=
on
-xr
!
*
.manifest
"
${
OUTPUT_DIR
}
/
${
BRANCH
}
/images.7z"
./sysupgrade/
*
./factory/
*
[
"
$?
"
-eq
"0"
]
||
abort
"Failed to assemble images (did you install p7zip-full?)."
popd
>
/dev/null
#${IMAGE_DIR}
if
[
-d
"
${
IMAGE_DIR
}
"
]
;
then
progress
"Assembling images.7z ..."
pushd
${
IMAGE_DIR
}
>
/dev/null
[
-e
"
${
OUTPUT_DIR
}
/
${
BRANCH
}
/images.7z"
]
&&
rm
"
${
OUTPUT_DIR
}
/
${
BRANCH
}
/images.7z"
7z a
-mmt
=
on
-xr
!
*
.manifest
"
${
OUTPUT_DIR
}
/
${
BRANCH
}
/images.7z"
./sysupgrade/
*
./factory/
*
[
"
$?
"
-eq
"0"
]
||
abort
"Failed to assemble images (did you install p7zip-full?)."
popd
>
/dev/null
#${IMAGE_DIR}
fi
# compress modules into 7z archive
progress
"Assembling modules.7z ..."
pushd
${
MODULE_DIR
}
>
/dev/null
[
-e
"
${
OUTPUT_DIR
}
/
${
BRANCH
}
/modules.7z"
]
&&
rm
"
${
OUTPUT_DIR
}
/
${
BRANCH
}
/modules.7z"
7z a
-mmt
=
on
"
${
OUTPUT_DIR
}
/
${
BRANCH
}
/modules.7z"
./
*
>
/dev/null
[
"
$?
"
-eq
"0"
]
||
abort
"Failed to assemble modules."
popd
>
/dev/null
#${MODULE_DIR}
if
[
-d
"
${
MODULE_DIR
}
"
]
;
then
progress
"Assembling modules.7z ..."
pushd
${
MODULE_DIR
}
>
/dev/null
[
-e
"
${
OUTPUT_DIR
}
/
${
BRANCH
}
/modules.7z"
]
&&
rm
"
${
OUTPUT_DIR
}
/
${
BRANCH
}
/modules.7z"
7z a
-mmt
=
on
"
${
OUTPUT_DIR
}
/
${
BRANCH
}
/modules.7z"
./
*
>
/dev/null
[
"
$?
"
-eq
"0"
]
||
abort
"Failed to assemble modules."
popd
>
/dev/null
#${MODULE_DIR}
fi
# generate and copy manifests
progress
"Generating and copying manifest ..."
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment