From 9a8f7c9e1a64cbb1007a9d6f5d3aaff1c9618319 Mon Sep 17 00:00:00 2001 From: hnzlmnn-ernw <83819013+hnzlmnn-ernw@users.noreply.github.com> Date: Thu, 9 Mar 2023 15:43:14 +0100 Subject: [PATCH 1/6] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index fff326a..c9666c4 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,9 @@ The following table shows the building status for the current toolset. The follo | Tool | Status | | ---- | ------ | -|[Nmap](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3A%22Nmap%22)|![Nmap](https://github.com/takeshixx/static-toolbox/workflows/Nmap/badge.svg)| -|[OpenSSH](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3A%22OpenSSH%22)|![OpenSSH](https://github.com/takeshixx/static-toolbox/workflows/OpenSSH/badge.svg)| -|[socat](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3A%22socat%22)|![socat](https://github.com/takeshixx/static-toolbox/workflows/socat/badge.svg)| -|[GDB & gdbserver](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3AGDB)|![GDB & gdbserver](https://github.com/takeshixx/static-toolbox/workflows/GDB%20&%20gdbserver/badge.svg)| -|[tcpdump](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3A%22tcpdump%22)|![tcpdump](https://github.com/takeshixx/static-toolbox/workflows/tcpdump/badge.svg)| +|[Nmap](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22Nmap%22)|![Nmap](https://github.com/ernw/static-toolbox/workflows/Nmap/badge.svg)| +|[OpenSSH](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22OpenSSH%22)|![OpenSSH](https://github.com/ernw/static-toolbox/workflows/OpenSSH/badge.svg)| +|[socat](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22socat%22)|![socat](https://github.com/ernw/static-toolbox/workflows/socat/badge.svg)| +|[GDB & gdbserver](https://github.com/ernw/static-toolbox/actions?query=workflow%3AGDB)|![GDB & gdbserver](https://github.com/ernw/static-toolbox/workflows/GDB%20&%20gdbserver/badge.svg)| +|[tcpdump](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22tcpdump%22)|![tcpdump](https://github.com/ernw/static-toolbox/workflows/tcpdump/badge.svg)| From b34b0980ef4f838f374bc85ed98f439166f59917 Mon Sep 17 00:00:00 2001 From: Dennis Heinze Date: Tue, 16 May 2023 09:29:08 +0200 Subject: [PATCH 2/6] Start strace --- .github/workflows/build-strace.yml | 158 +++++++++++++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 .github/workflows/build-strace.yml diff --git a/.github/workflows/build-strace.yml b/.github/workflows/build-strace.yml new file mode 100644 index 0000000..f9b19c8 --- /dev/null +++ b/.github/workflows/build-strace.yml @@ -0,0 +1,158 @@ +name: strace +on: + workflow_dispatch +jobs: + build-x86: + name: Build strace x86 + runs-on: ubuntu-latest + container: muslcc/x86_64:i686-linux-musl + outputs: + version: ${{ steps.build_strace.outputs.PACKAGED_VERSION }} + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Install testing dependencies + run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl + + - name: Build strace + id: build_strace + run: $GITHUB_WORKSPACE/build/targets/build_strace.sh x86 + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_strace.outputs.PACKAGED_NAME }} + path: ${{ steps.build_strace.outputs.PACKAGED_NAME_PATH }} + + build-x86_64: + name: Build strace x86_64 + runs-on: ubuntu-latest + container: muslcc/x86_64:x86_64-linux-musl + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Install testing dependencies + run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl + + - name: Build strace + id: build_strace + run: $GITHUB_WORKSPACE/build/targets/build_strace.sh x86_64 + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_strace.outputs.PACKAGED_NAME }} + path: ${{ steps.build_strace.outputs.PACKAGED_NAME_PATH }} + + build-armhf: + name: Build strace ARMHF + runs-on: ubuntu-latest + container: muslcc/x86_64:arm-linux-musleabihf + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Install testing dependencies + run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl + + - name: Install build compiler + run: /bin/sh -c "apk update && apk upgrade && apk add --no-cache curl rsync sudo util-linux && cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" + env: + ARCH: x86_64-linux-musl + HOST: http://musl.cc/ + TEMP: /tmp + USER: 0 + + - name: Build strace + id: build_strace + run: $GITHUB_WORKSPACE/build/targets/build_strace.sh armhf + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_strace.outputs.PACKAGED_NAME }} + path: ${{ steps.build_strace.outputs.PACKAGED_NAME_PATH }} + + build-aarch64: + name: Build strace AARCH64 + runs-on: ubuntu-latest + container: muslcc/x86_64:aarch64-linux-musl + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh + + - name: Install testing dependencies + run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl + + - name: Install build compiler + run: /bin/sh -c "apk update && apk upgrade && apk add --no-cache curl rsync sudo util-linux && cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" + env: + ARCH: x86_64-linux-musl + HOST: http://musl.cc/ + TEMP: /tmp + USER: 0 + + - name: Build strace + id: build_strace + run: $GITHUB_WORKSPACE/build/targets/build_strace.sh aarch64 + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.build_strace.outputs.PACKAGED_NAME }} + path: ${{ steps.build_strace.outputs.PACKAGED_NAME_PATH }} + + create-release: + name: Create strace Release + runs-on: ubuntu-latest + needs: [build-x86, build-x86_64, build-armhf, build-aarch64] + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Prepare Environment + run: mkdir /tmp/releases + + - name: Download Artifacts + uses: actions/download-artifact@v2 + with: + path: /tmp/releases + + - name: List Artifacts + run: ls -laR /tmp/releases + + - name: Tag Release + id: tag_release + run: | + set +e + if git rev-list "strace-v${{ needs.build-x86.outputs.version }}".. >/dev/null;then + echo "Tag for strace-v${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." + echo ::set-output name=NEW_RELEASE::"false" + else + git tag "strace-v${{ needs.build-x86.outputs.version }}" + git push origin "strace-v${{ needs.build-x86.outputs.version }}" + echo ::set-output name=NEW_RELEASE::"true" + fi + + - name: Create Release + uses: ncipollo/release-action@v1 + if: ${{ steps.tag_release.outputs.NEW_RELEASE == 'true' }} + with: + name: strace-v${{ needs.build-x86.outputs.version }} + tag: strace-v${{ needs.build-x86.outputs.version }} + artifacts: "/tmp/releases/*/*" + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 735d28224efda0bc465cd9060dffab731364c315 Mon Sep 17 00:00:00 2001 From: Dennis Heinze Date: Tue, 16 May 2023 09:51:29 +0200 Subject: [PATCH 3/6] Finish strace build --- .github/workflows/build-strace.yml | 12 +++++++++++- build/targets/build_strace.sh | 21 +++++++++++++-------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-strace.yml b/.github/workflows/build-strace.yml index f9b19c8..4d1192e 100644 --- a/.github/workflows/build-strace.yml +++ b/.github/workflows/build-strace.yml @@ -1,6 +1,8 @@ name: strace on: - workflow_dispatch + push: + branches: + - strace jobs: build-x86: name: Build strace x86 @@ -18,6 +20,14 @@ jobs: - name: Install testing dependencies run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl + - name: Install build compiler + run: /bin/sh -c "apk update && apk upgrade && apk add --no-cache curl rsync sudo util-linux && cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" + env: + ARCH: x86_64-linux-musl + HOST: http://musl.cc/ + TEMP: /tmp + USER: 0 + - name: Build strace id: build_strace run: $GITHUB_WORKSPACE/build/targets/build_strace.sh x86 diff --git a/build/targets/build_strace.sh b/build/targets/build_strace.sh index 9b9c442..16fe54d 100755 --- a/build/targets/build_strace.sh +++ b/build/targets/build_strace.sh @@ -10,34 +10,39 @@ fi source $GITHUB_WORKSPACE/build/lib.sh init_lib "$1" +VERSION="v6.3" + build_strace() { fetch "https://github.com/strace/strace" "${BUILD_DIRECTORY}/strace" git cd "${BUILD_DIRECTORY}/strace" git clean -fdx - git checkout v5.7 + git checkout "$VERSION" ./bootstrap CMD="CFLAGS=\"${GCC_OPTS}\" " CMD+="CXXFLAGS=\"${GXX_OPTS}\" " CMD+="LDFLAGS=\"-static -pthread\" " - if [ "$CURRENT_ARCH" != "x86" ] && [ "$CURRENT_ARCH" != "x86_64" ];then - CMD+="CC_FOR_BUILD=\"/i686-linux-musl-cross/bin/i686-linux-musl-gcc\" " - CMD+="CPP_FOR_BUILD=\"/i686-linux-musl-cross/bin/i686-linux-musl-g++\" " + if [ "$CURRENT_ARCH" != "x86_64" ];then + CMD+="CC_FOR_BUILD=\"/x86_64-linux-musl-cross/bin/x86_64-linux-musl-gcc\" " + CMD+="CPP_FOR_BUILD=\"/x86_64-linux-musl-cross/bin/x86_64-linux-musl-g++ -E\" " + CMD+="CXX_FOR_BUILD=\"/x86_64-linux-musl-cross/bin/x86_64-linux-musl-g++ -E\" " fi - CMD+="./configure --host=i486-linux-musl --target=$(get_host_triple)" + CMD+="./configure --disable-mpers --host=$(get_host_triple)" eval "$CMD" make CFLAGS="-w" -j4 - strip strace + strip "${BUILD_DIRECTORY}/strace/src/strace" } main() { build_strace local version - version=$(get_version "${BUILD_DIRECTORY}/strace/strace --version 2>&1 | head -n1 | awk '{print \$4}'") - cp "${BUILD_DIRECTORY}/strace/strace" "${OUTPUT_DIRECTORY}/strace" + version=$(get_version "${BUILD_DIRECTORY}/strace/src/strace -V 2>&1 | head -n1 | awk '{print \$4}'") + version_number=$(echo "$version" | cut -d"-" -f2) + cp "${BUILD_DIRECTORY}/strace/src/strace" "${OUTPUT_DIRECTORY}/strace${version}" echo "[+] Finished building strace ${CURRENT_ARCH}" echo ::set-output name=PACKAGED_NAME::"strace${version}" echo ::set-output name=PACKAGED_NAME_PATH::"${OUTPUT_DIRECTORY}/*" + echo ::set-output name=PACKAGED_VERSION::"${version_number}" } main From 20ee0f7d17e0849a80ade3fc2d6deaf2a1a1d987 Mon Sep 17 00:00:00 2001 From: Dennis Heinze Date: Fri, 19 May 2023 11:38:41 +0200 Subject: [PATCH 4/6] Clean + workflow dispatch --- .github/workflows/build-strace.yml | 4 +--- build/targets/build_strace.sh | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-strace.yml b/.github/workflows/build-strace.yml index 4d1192e..df90b2f 100644 --- a/.github/workflows/build-strace.yml +++ b/.github/workflows/build-strace.yml @@ -1,8 +1,6 @@ name: strace on: - push: - branches: - - strace + workflow_dispatch jobs: build-x86: name: Build strace x86 diff --git a/build/targets/build_strace.sh b/build/targets/build_strace.sh index 16fe54d..5853c98 100755 --- a/build/targets/build_strace.sh +++ b/build/targets/build_strace.sh @@ -24,7 +24,7 @@ build_strace() { if [ "$CURRENT_ARCH" != "x86_64" ];then CMD+="CC_FOR_BUILD=\"/x86_64-linux-musl-cross/bin/x86_64-linux-musl-gcc\" " CMD+="CPP_FOR_BUILD=\"/x86_64-linux-musl-cross/bin/x86_64-linux-musl-g++ -E\" " - CMD+="CXX_FOR_BUILD=\"/x86_64-linux-musl-cross/bin/x86_64-linux-musl-g++ -E\" " + CMD+="CXX_FOR_BUILD=\"/x86_64-linux-musl-cross/bin/x86_64-linux-musl-g++\" " fi CMD+="./configure --disable-mpers --host=$(get_host_triple)" eval "$CMD" From 98edf482f8536b3990ed25e951862d0c779c5158 Mon Sep 17 00:00:00 2001 From: Dennis Heinze Date: Fri, 19 May 2023 12:14:58 +0200 Subject: [PATCH 5/6] Fix deprecated set-output --- .github/workflows/build-strace.yml | 4 ++-- build/targets/build_strace.sh | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-strace.yml b/.github/workflows/build-strace.yml index df90b2f..c5a426a 100644 --- a/.github/workflows/build-strace.yml +++ b/.github/workflows/build-strace.yml @@ -149,11 +149,11 @@ jobs: set +e if git rev-list "strace-v${{ needs.build-x86.outputs.version }}".. >/dev/null;then echo "Tag for strace-v${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." - echo ::set-output name=NEW_RELEASE::"false" + echo "NEW_RELEASE=false" >> $GITHUB_OUTPUT else git tag "strace-v${{ needs.build-x86.outputs.version }}" git push origin "strace-v${{ needs.build-x86.outputs.version }}" - echo ::set-output name=NEW_RELEASE::"true" + echo "NEW_RELEASE=true" >> $GITHUB_OUTPUT fi - name: Create Release diff --git a/build/targets/build_strace.sh b/build/targets/build_strace.sh index 5853c98..b87db5c 100755 --- a/build/targets/build_strace.sh +++ b/build/targets/build_strace.sh @@ -40,9 +40,9 @@ main() { cp "${BUILD_DIRECTORY}/strace/src/strace" "${OUTPUT_DIRECTORY}/strace${version}" echo "[+] Finished building strace ${CURRENT_ARCH}" - echo ::set-output name=PACKAGED_NAME::"strace${version}" - echo ::set-output name=PACKAGED_NAME_PATH::"${OUTPUT_DIRECTORY}/*" - echo ::set-output name=PACKAGED_VERSION::"${version_number}" + echo "PACKAGED_NAME=strace${version}" >> $GITHUB_OUTPUT + echo "PACKAGED_NAME_PATH=${OUTPUT_DIRECTORY}/*" >> $GITHUB_OUTPUT + echo "PACKAGED_VERSION=${version_number}" >> $GITHUB_OUTPUT } main From fd09b1375d688127908ab903ba17e37dded4fe72 Mon Sep 17 00:00:00 2001 From: Dennis Heinze Date: Mon, 22 May 2023 14:04:57 +0200 Subject: [PATCH 6/6] Add strace badge to readme --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index fff326a..1918cc8 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,11 @@ The following table shows the building status for the current toolset. The follo | Tool | Status | | ---- | ------ | -|[Nmap](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3A%22Nmap%22)|![Nmap](https://github.com/takeshixx/static-toolbox/workflows/Nmap/badge.svg)| -|[OpenSSH](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3A%22OpenSSH%22)|![OpenSSH](https://github.com/takeshixx/static-toolbox/workflows/OpenSSH/badge.svg)| -|[socat](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3A%22socat%22)|![socat](https://github.com/takeshixx/static-toolbox/workflows/socat/badge.svg)| -|[GDB & gdbserver](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3AGDB)|![GDB & gdbserver](https://github.com/takeshixx/static-toolbox/workflows/GDB%20&%20gdbserver/badge.svg)| -|[tcpdump](https://github.com/takeshixx/static-toolbox/actions?query=workflow%3A%22tcpdump%22)|![tcpdump](https://github.com/takeshixx/static-toolbox/workflows/tcpdump/badge.svg)| +|[Nmap](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22Nmap%22)|![Nmap](https://github.com/ernw/static-toolbox/workflows/Nmap/badge.svg)| +|[OpenSSH](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22OpenSSH%22)|![OpenSSH](https://github.com/ernw/static-toolbox/workflows/OpenSSH/badge.svg)| +|[socat](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22socat%22)|![socat](https://github.com/ernw/static-toolbox/workflows/socat/badge.svg)| +|[GDB & gdbserver](https://github.com/ernw/static-toolbox/actions?query=workflow%3AGDB)|![GDB & gdbserver](https://github.com/ernw/static-toolbox/workflows/GDB%20&%20gdbserver/badge.svg)| +|[tcpdump](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22tcpdump%22)|![tcpdump](https://github.com/ernw/static-toolbox/workflows/tcpdump/badge.svg)| +|[strace](https://github.com/ernw/static-toolbox/actions?query=workflow%3A%22strace%22)|![strace](https://github.com/ernw/static-toolbox/workflows/strace/badge.svg)| +