Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
koudis committed Apr 29, 2022
1 parent f2298a4 commit ff5dfe6
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
go.sum
install_sysroot
localInstall
*.zip
43 changes: 26 additions & 17 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

set -e

INSTALL_DIR="./install_dir"

if [[ -d ${INSTALL_DIR} ]]; then
echo "${INSTALL_DIR} already exist. Delete it pls" >&2
exit 1
fi

go get bringauto/bap-builder
go get bringauto/tools/lsb_release
go get bringauto/tools/uname
Expand All @@ -21,21 +28,23 @@ pushd tools/lsb_release
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo -ldflags '-w'
popd

if [ -d install_dir ]; then
echo "install_dir already exist. Delete it pls" >&2
exit 1
fi
mkdir -p install_dir
mkdir -p install_dir/tools

cp bap-builder/bap-builder install_dir/
cp -r doc install_dir/
cp README.md install_dir/
cp LICENSE install_dir/
cp tools/lsb_release/lsb_release install_dir/tools/
cp tools/lsb_release/lsb_release.txt install_dir/tools/
cp tools/lsb_release/lsb_release_README.md install_dir/tools/
cp tools/uname/uname_README.md install_dir/tools/
cp tools/uname/uname install_dir/tools/
cp tools/uname/uname.txt install_dir/tools/
mkdir -p "${INSTALL_DIR}"
mkdir -p "${INSTALL_DIR}/tools"

cp bap-builder/bap-builder "${INSTALL_DIR}/"
cp -r doc "${INSTALL_DIR}/"
cp README.md "${INSTALL_DIR}/"
cp LICENSE "${INSTALL_DIR}/"
cp tools/lsb_release/lsb_release "${INSTALL_DIR}/tools/"
cp tools/lsb_release/lsb_release.txt "${INSTALL_DIR}/tools/"
cp tools/lsb_release/lsb_release_README.md "${INSTALL_DIR}/tools/"
cp tools/uname/uname_README.md "${INSTALL_DIR}/tools/"
cp tools/uname/uname "${INSTALL_DIR}/tools/"
cp tools/uname/uname.txt "${INSTALL_DIR}/tools/"


VERSION=$(sed -E -n 's/version=([^=]+)/\1/p' < version.txt)
MACHINE=$(uname -m | sed -E 's/_/-/')
zip -r "bringauto-packager_v${VERSION}_${MACHINE}-linux.zip" ${INSTALL_DIR}/

rm -fr install_dir
2 changes: 2 additions & 0 deletions example/docker/fleet-os/lsb_release.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Distributor ID: fleet-os
Release: 1
1 change: 1 addition & 0 deletions example/docker/fleet-os/uname.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Linux k14 5.10.0-9-amd64 #1 SMP Debian 5.10.70-1 (2021-09-30) aarch64 GNU/Linux
1 change: 1 addition & 0 deletions tools/lsb_release/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lsb_release
1 change: 1 addition & 0 deletions tools/uname/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uname
1 change: 1 addition & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version=0.2.0

0 comments on commit ff5dfe6

Please sign in to comment.