From b4515c8a07c71a81087368bdabda94db963b959f Mon Sep 17 00:00:00 2001 From: AnninoDr4 Date: Sat, 15 Jan 2022 12:49:48 +0530 Subject: [PATCH 1/8] added jammy build script --- build-jammy.sh | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 build-jammy.sh diff --git a/build-jammy.sh b/build-jammy.sh new file mode 100644 index 0000000..ce60d59 --- /dev/null +++ b/build-jammy.sh @@ -0,0 +1,70 @@ +#!/usr/bin/env bash +#shellcheck disable=SC1091 + +# this is an example file to BUILD raw file system +# export variable SUITE to set debootstrap suite name (default: hirsute) + +source plugins/envsetup + +export OVERRIDER_COMPRESSION_TYPE +export SUITE +export ENABLE_EXIT +export ENABLE_USER_SETUP + +SUITE="jammy" +frn="out/$SUITE-raw" +OVERRIDER_COMPRESSION_TYPE="gzip" +ENABLE_EXIT=true +ENABLE_USER_SETUP=false + +additional_setup() { +cat <<- EOF > $chroot_dir/etc/apt/sources.list +# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to +# newer versions of the distribution. +deb $MIRROR $SUITE main restricted +# deb-src $MIRROR $SUITE main restricted +## Major bug fix updates produced after the final release of the +## distribution. +deb $MIRROR $SUITE-updates main restricted +# deb-src $MIRROR $SUITE-updates main restricted +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team. Also, please note that software in universe WILL NOT receive any +## review or updates from the Ubuntu security team. +deb $MIRROR $SUITE universe +# deb-src $MIRROR $SUITE universe +deb $MIRROR $SUITE-updates universe +# deb-src $MIRROR $SUITE-updates universe +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team, and may not be under a free licence. Please satisfy yourself as to +## your rights to use the software. Also, please note that software in +## multiverse WILL NOT receive any review or updates from the Ubuntu +## security team. +deb $MIRROR $SUITE multiverse +# deb-src $MIRROR $SUITE multiverse +deb $MIRROR $SUITE-updates multiverse +# deb-src $MIRROR $SUITE-updates multiverse +## N.B. software from this repository may not have been tested as +## extensively as that contained in the main release, although it includes +## newer versions of some applications which may provide useful features. +## Also, please note that software in backports WILL NOT receive any review +## or updates from the Ubuntu security team. +deb $MIRROR $SUITE-backports main restricted universe multiverse +# deb-src $MIRROR $SUITE-backports main restricted universe multiverse +EOF + +} + +do_build "${frn}-arm64" arm64 +do_compress "${frn}-arm64" +do_build "${frn}-armhf" armhf +do_compress "${frn}-armhf" +do_build "${frn}-amd64" amd64 +do_compress "${frn}-amd64" + +do_unmount "${frn}-arm64" +do_unmount "${frn}-armhf" +do_unmount "${frn}-amd64" + +shout "Build complete..." +ls $frn*tar* + From 5f1d082be0ad46a9ebd9f655651fbf8e3a29efa1 Mon Sep 17 00:00:00 2001 From: AnninoDr4 Date: Sat, 15 Jan 2022 12:56:19 +0530 Subject: [PATCH 2/8] removed colors sourcing from all build scripts & making code look good --- build-impish-raw.sh | 27 +++++++++++++++------------ cook.sh | 24 ++++++++++++------------ 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/build-impish-raw.sh b/build-impish-raw.sh index 3d67588..492148b 100755 --- a/build-impish-raw.sh +++ b/build-impish-raw.sh @@ -5,16 +5,15 @@ # export variable SUITE to set debootstrap suite name (default: hirsute) source plugins/envsetup -source plugins/colors export OVERRIDER_COMPRESSION_TYPE export SUITE export ENABLE_EXIT export ENABLE_USER_SETUP -frn="out/impish-raw" -OVERRIDER_COMPRESSION_TYPE="gzip" SUITE="impish" +frn="out/${SUITE}-raw" +OVERRIDER_COMPRESSION_TYPE="gzip" ENABLE_EXIT=true ENABLE_USER_SETUP=false @@ -60,13 +59,17 @@ EOF } -do_build "${frn}-arm64" arm64 -do_compress "${frn}-arm64" -do_build "${frn}-armhf" armhf -do_compress "${frn}-armhf" -do_build "${frn}-amd64" amd64 -do_compress "${frn}-amd64" +do_build "${frn}-arm64" arm64 +do_compress "${frn}-arm64" +do_build "${frn}-armhf" armhf +do_compress "${frn}-armhf" +do_build "${frn}-amd64" amd64 +do_compress "${frn}-amd64" + +do_unmount "${frn}-arm64" +do_unmount "${frn}-armhf" +do_unmount "${frn}-amd64" + +shout "Build complete" +ls ${frn}*tar* -do_unmount "${frn}-arm64" -do_unmount "${frn}-armhf" -do_unmount "${frn}-amd64" diff --git a/cook.sh b/cook.sh index 95aa187..7e14a6f 100755 --- a/cook.sh +++ b/cook.sh @@ -5,13 +5,10 @@ # export variable SUITE to set debootstrap suite name (default: hirsute) source plugins/envsetup -source plugins/colors export OVERRIDER_COMPRESSION_TYPE export ENABLE_EXIT export ENABLE_USER_SETUP -# export FS_USER -# export FS_PASS frn="out/hirsute-raw" OVERRIDER_COMPRESSION_TYPE="gzip" @@ -59,13 +56,16 @@ deb $MIRROR $SUITE-backports main restricted universe multiverse EOF } -do_build "${frn}-arm64" arm64 -do_compress "${frn}-arm64" -do_build "${frn}-armhf" armhf -do_compress "${frn}-armhf" -do_build "${frn}-amd64" amd64 -do_compress "${frn}-amd64" +do_build "${frn}-arm64" arm64 +do_compress "${frn}-arm64" +do_build "${frn}-armhf" armhf +do_compress "${frn}-armhf" +do_build "${frn}-amd64" amd64 +do_compress "${frn}-amd64" -do_unmount "${frn}-arm64" -do_unmount "${frn}-armhf" -do_unmount "${frn}-amd64" +do_unmount "${frn}-arm64" +do_unmount "${frn}-armhf" +do_unmount "${frn}-amd64" + +shout "Build Complete.." +ls ${frn}*tar* From e598069532198d44e206ed381a74544e025d40ee Mon Sep 17 00:00:00 2001 From: AnninoDr4 Date: Sat, 15 Jan 2022 13:05:46 +0530 Subject: [PATCH 3/8] workflow event change run workflow only when a shell script or a yml file commited --- .github/workflows/build-udroid.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-udroid.yml b/.github/workflows/build-udroid.yml index b01dae7..d024d49 100644 --- a/.github/workflows/build-udroid.yml +++ b/.github/workflows/build-udroid.yml @@ -1,5 +1,9 @@ name: build-udroid -on: [push] +on: + push: + paths: + - '**.sh' + - '**.yml' jobs: BuildImpishRaw: name: build impish From dc445d714e33be165ffd731a5787e79d54aba914 Mon Sep 17 00:00:00 2001 From: AnninoDr4 Date: Sat, 15 Jan 2022 13:08:28 +0530 Subject: [PATCH 4/8] editor config for better dev time --- .editorconfig | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..8f96039 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,10 @@ +# editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true From a61847b80ebf9b1acb1e768e96d05a13e4400062 Mon Sep 17 00:00:00 2001 From: AnninoDr4 Date: Sat, 15 Jan 2022 13:16:42 +0530 Subject: [PATCH 5/8] update README new descriptions & badge fix --- README.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index da92a55..36bb4d6 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,22 @@ # fs-cook -[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FRandomCoderOrg%2Ffs-cook.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FRandomCoderOrg%2Ffs-cook?ref=badge_shield) +A project written in bash to make linux tarball building process easier -[![RawBuildTest](https://github.com/RandomCoderOrg/fs-cook/actions/workflows/build-raw.yml/badge.svg)](https://github.com/RandomCoderOrg/fs-cook/actions/workflows/build-raw.yml) +| | badges | +|--|-- | +|build tests ( `impish`, `hirsute`, `jammy` ) | [![build-udroid](https://github.com/RandomCoderOrg/fs-cook/actions/workflows/build-udroid.yml/badge.svg)](https://github.com/RandomCoderOrg/fs-cook/actions/workflows/build-udroid.yml) + | +| FOSS LICENSE | [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FRandomCoderOrg%2Ffs-cook.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FRandomCoderOrg%2Ffs-cook?ref=badge_shield) + | [DEV] Linux tarball building > ⚠️ warning this code is heavily experimental & work in progress! > > most of the feature/code may not work +## What this can do +- can build any latest ubuntu & debian varients +- supports cross architecture building ( requires `binfmt-support` enabled in kernel ) +- make fetch, build, pack process easier + ## License [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FRandomCoderOrg%2Ffs-cook.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FRandomCoderOrg%2Ffs-cook?ref=badge_large) From 97510bb38d8099ef827ea6429e25fb37ad8f805b Mon Sep 17 00:00:00 2001 From: AnninoDr4 Date: Sat, 15 Jan 2022 13:18:06 +0530 Subject: [PATCH 6/8] fix table --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 36bb4d6..8e6e50e 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ A project written in bash to make linux tarball building process easier | | badges | |--|-- | -|build tests ( `impish`, `hirsute`, `jammy` ) | [![build-udroid](https://github.com/RandomCoderOrg/fs-cook/actions/workflows/build-udroid.yml/badge.svg)](https://github.com/RandomCoderOrg/fs-cook/actions/workflows/build-udroid.yml) - | +|build tests ( `impish`, `hirsute`, `jammy` ) | [![build-udroid](https://github.com/RandomCoderOrg/fs-cook/actions/workflows/build-udroid.yml/badge.svg)](https://github.com/RandomCoderOrg/fs-cook/actions/workflows/build-udroid.yml) | + | FOSS LICENSE | [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FRandomCoderOrg%2Ffs-cook.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FRandomCoderOrg%2Ffs-cook?ref=badge_shield) | From 5b64b345fae446754340d9fc871af42a50b22771 Mon Sep 17 00:00:00 2001 From: Sonyu Annino <92148685+AnninoDr4@users.noreply.github.com> Date: Sat, 15 Jan 2022 13:18:40 +0530 Subject: [PATCH 7/8] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 8e6e50e..b1ed845 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,6 @@ A project written in bash to make linux tarball building process easier | | badges | |--|-- | |build tests ( `impish`, `hirsute`, `jammy` ) | [![build-udroid](https://github.com/RandomCoderOrg/fs-cook/actions/workflows/build-udroid.yml/badge.svg)](https://github.com/RandomCoderOrg/fs-cook/actions/workflows/build-udroid.yml) | - | FOSS LICENSE | [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FRandomCoderOrg%2Ffs-cook.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FRandomCoderOrg%2Ffs-cook?ref=badge_shield) | From 8345b7a99d2f9812a69dac3a3da2e5f9d8a135d2 Mon Sep 17 00:00:00 2001 From: AnninoDr4 Date: Sat, 15 Jan 2022 13:20:04 +0530 Subject: [PATCH 8/8] remove kali linux build out of scope! --- build-kali-big.sh | 74 ----------------------------------------------- build-kali-raw.sh | 47 ------------------------------ 2 files changed, 121 deletions(-) delete mode 100644 build-kali-big.sh delete mode 100755 build-kali-raw.sh diff --git a/build-kali-big.sh b/build-kali-big.sh deleted file mode 100644 index 86cf05a..0000000 --- a/build-kali-big.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env bash -#shellcheck disable=SC1091 - -# this is an example file to BUILD raw file system -# export variable SUITE to set debootstrap suite name (default: hirsute) - -################ -# kali build notice -# for best results use kali-linux host for building -# or try running with docker file in build/kali/raw - -source plugins/envsetup -source plugins/colors - -export OVERRIDER_COMPRESSION_TYPE -export ENABLE_EXIT -export SUITE -export OVERRIDER_MIRROR -export INCLUDE_PACKAGES -export DISABLE_LOCAL_DEBOOTSTRAP -export ENABLE_USER_SETUP -# export FS_USER -# export FS_PASS - -SUITE="kali-rolling" -# FS_USER="kali" -# FS_PASS="kali" # no need to sepecify FS_UID & FS_GID cause default is 1001 -OVERRIDER_MIRROR="http://http.kali.org/kali" -frn="out/${SUITE}-raw" -INCLUDE_PACKAGES="sudo apt-utils" -OVERRIDER_COMPRESSION_TYPE="gzip" -ENABLE_EXIT=true -DISABLE_LOCAL_DEBOOTSTRAP=true -ENABLE_USER_SETUP=false -PREFIX=$frn - -additional_setup() { - # install desktop - shout "installing desktop" - run_cmd apt update - run_cmd apt install -y kali-desktop-xfce4 - - # install kali-tools - shout "installing kali-tools... (This may take long time)" - run_cmd apt install -y kali-tools-information-gathering kali-tools-vulnerability kali-tools-web kali-tools-database kali-tools-passwords kali-tools-wireless kali-tools-reverse-engineering kali-tools-exploitation kali-tools-social-engineering kali-tools-sniffing-spoofing kali-tools-post-exploitation kali-tools-forensics kali-tools-reporting -} - -do_build "$PREFIX-arm64" arm64 -do_build "$PREFIX-armhf" armhf -do_build "$PREFIX-amd64" amd64 - -do_compress "$PREFIX-arm64" -do_compress "$PREFIX-armhf" -do_compress "$PREFIX-amd64" - -do_unmount "$PREFIX-arm64" -do_unmount "$PREFIX-armhf" -do_unmount "$PREFIX-amd64" - -shout "setting up rootfs!" -msg "creating $SUITE-{arm64,amd64,armhf} directories" -mkdir -pv $SUITE-big-{arm64,amd64,armhf} - -msg "copying tarballs to directories" -mv $frn-arm64*tar* $SUITE-arm64 -mv $frn-armhf*tar* $SUITE-armhf -mv $frn-amd64*tar* $SUITE-amd64 - -msg "calculating sha256sums" -sha256sum $frn-arm64*tar* > $SUITE-arm64/SHA256SUM -sha256sum $frn-armhf*tar* > $SUITE-arm64/SHA256SUM -sha256sum $frn-amd64*tar* > $SUITE-arm64/SHA256SUM - -shout "done" diff --git a/build-kali-raw.sh b/build-kali-raw.sh deleted file mode 100755 index 4e2a8a6..0000000 --- a/build-kali-raw.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env bash -#shellcheck disable=SC1091 - -# this is an example file to BUILD raw file system -# export variable SUITE to set debootstrap suite name (default: hirsute) - -################ -# kali build notice -# for best results use kali-linux host for building -# or try running with docker file in build/kali/raw - -source plugins/envsetup -source plugins/colors - -export OVERRIDER_COMPRESSION_TYPE -export ENABLE_EXIT -export SUITE -export OVERRIDER_MIRROR -export INCLUDE_PACKAGES -export DISABLE_LOCAL_DEBOOTSTRAP -export ENABLE_USER_SETUP -# export FS_USER -# export FS_PASS - -SUITE="kali-rolling" -# FS_USER="kali" -# FS_PASS="kali" # no need to sepecify FS_UID & FS_GID cause default is 1001 -OVERRIDER_MIRROR="http://http.kali.org/kali" -frn="out/${SUITE}-raw" -INCLUDE_PACKAGES="sudo apt-utils" -OVERRIDER_COMPRESSION_TYPE="gzip" -ENABLE_EXIT=true -DISABLE_LOCAL_DEBOOTSTRAP=true -ENABLE_USER_SETUP=false - -warn "for best results use kali-linux host for building" - -do_build "${frn}-arm64" arm64 -do_compress "${frn}-arm64" -do_build "${frn}-armhf" armhf -do_compress "${frn}-armhf" -do_build "${frn}-amd64" amd64 -do_compress "${frn}-amd64" - -do_unmount "${frn}-arm64" -do_unmount "${frn}-armhf" -do_unmount "${frn}-amd64"