Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
koudis committed May 6, 2022
1 parent ff5dfe6 commit 6c4dc3d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 15 deletions.
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,24 +77,34 @@ You can easily build and track dependencies for your project, download then and
- Docker >= 20.10 (installed by official Docker documentation)
- git >= 2.25

Standalone binaries are built for Linux kernel >= 5.10.0-9-amd64

## Build

The project requires go >= 1.18.

```
go get system/bap-builder
cd bap-builder
go build
go get bringauto/bap-builder
go build bringauto/bap-builder
```

## Build standalone binaries

There is a script `build.sh` by that we can build a complete release package.

Additional requirements for `build.sh`:

- zip
- uname
- sed

## FAQ

### Q: I have got a wierd error

Many errors are caused by problem with SSh connection to the Docker container
or impossibility to start Docker container.


In this case

- check if there are no running docker container that
Expand Down
31 changes: 20 additions & 11 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,22 @@

set -e

INSTALL_DIR="./install_dir"
VERSION=$(sed -E -n 's/version=([^=]+)/\1/p' < version.txt)
MACHINE=$(uname -m | sed -E 's/_/-/')

INSTALL_DIR="./bap_${VERSION}_${MACHINE}-linux"
INSTALL_DIR_TOOLS="./bap_tools_${VERSION}_${MACHINE}-linux"

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

if [[ -d ${INSTALL_DIR_TOOLS} ]]; then
echo "${INSTALL_DIR_TOOLS} 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 @@ -29,22 +38,22 @@ pushd tools/lsb_release
popd

mkdir -p "${INSTALL_DIR}"
mkdir -p "${INSTALL_DIR}/tools"
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/"
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}/
zip -r "bringauto-packager-tools_v${VERSION}_${MACHINE}-linux.zip" ${INSTALL_DIR_TOOLS}/

rm -fr install_dir
rm -fr "${INSTALL_DIR}"
rm -fr "${INSTALL_DIR_TOOLS}"

0 comments on commit 6c4dc3d

Please sign in to comment.