Skip to content

Commit 6511d76

Browse files
Merge pull request #33 from 23xvx/add-support-platform-termux
Fix typo
2 parents 16aaa62 + 0116579 commit 6511d76

File tree

7 files changed

+28
-244
lines changed

7 files changed

+28
-244
lines changed

.github/scripts/build-kinetic.sh

Lines changed: 0 additions & 98 deletions
This file was deleted.

.github/workflows/build-udroid.yml

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -42,36 +42,3 @@ jobs:
4242
with:
4343
name: jammy-raw-amd64
4444
path: jammy-amd64
45-
BuildKineticRaw:
46-
name: build Kinetc (22.10)
47-
runs-on: ubuntu-latest
48-
steps:
49-
- name: checkout repository
50-
uses: actions/checkout@v3
51-
52-
- name: Docker Setup QEMU
53-
uses: docker/setup-qemu-action@v2
54-
55-
- name: Satify Dependencies
56-
run: sudo apt-get update; sudo apt-get install git build-essential binfmt-support qemu-user-static debootstrap -y
57-
58-
- name: Trigger fs-cook
59-
run: sudo bash .github/scripts/build-kinetic.sh
60-
61-
- name: save arm64 builds
62-
uses: actions/upload-artifact@v2
63-
with:
64-
name: kinetic-raw-arm64
65-
path: kinetic-arm64
66-
67-
- name: save armhf builds
68-
uses: actions/upload-artifact@v2
69-
with:
70-
name: kinetic-raw-armhf
71-
path: kinetic-armhf
72-
73-
- name: save amd64 builds
74-
uses: actions/upload-artifact@v2
75-
with:
76-
name: kinetic-raw-amd64
77-
path: kinetic-amd64

CONTRIBUTING.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ fs-cooks uses debootstrap to pull core Linux packages to build linux traballs, a
88
the top-level contains some example build scripts which are lightweight to build and beginning of directories
99
```
1010
.
11-
├── build-hirsute-raw.sh -> cook.sh
12-
├── build-impish-raw.sh
11+
├── build-jammy.sh -> cook.sh
1312
├── cook.sh
1413
├── build
1514
├── core
@@ -26,8 +25,6 @@ here:
2625
<hr>
2726

2827
**important files/folders to notice**
29-
###### `~/core/defaults`
30-
defaults folder contains some heavy templates to build DE ready tarballs like mate,xfce4,kde
3128
###### `~/plugins/envsetup`
3229
contains functions that can be used for cmd line building and integrating in scripts
3330
- useful functions in `envsetup`:
@@ -50,12 +47,11 @@ do_build "out/udroid-test" "arm64"
5047
5148
```bash
5249
source plugins/envsetup
53-
SUITE=impish
50+
SUITE=jammy
5451
do_build "out/fs" "arm64"
5552
```
5653
### Quick build scripts
57-
- `build-impish-raw.sh`: to build raw ubuntu 21.10 tarballs
58-
- `build-hirsute-raw.sh`: to build raw ubuntu 21.04 tarballs
54+
- `build-jammy.sh`: to build raw ubuntu 22.04 tarballs
5955
> others are experimental ( may break things )
6056
6157
### functions ( <kbd>v1.0</kbd> )
@@ -74,11 +70,15 @@ do_build "out/fs" "arm64"
7470
- `do_second_stage()`: if foreign arch triggers second stage
7571
- - `do_qemu_user_emulation()` sets up qemu binaries in chroot
7672
- `do_chroot_ae()`: to run command in chroot
77-
- - `run_cmd()`: alternative for `do_chroot_are()`
73+
- - `do_chroot_proot_ae` : use **proot** instead of chroot in termux
74+
- - `run_cmd()`: alternative for `do_chroot_ae()`
75+
- - `run_shell_script()` : to run a specific script, alternative for `do_chroot_ae()`
76+
- - `install_pkg()` : to install a specific package inside chroot, alternative for `do_chroot_ae()`
7877
- `do_compress()`: takes care of compressing tarballs without messy device file
7978
- - `do_tar_gzip()`: to compress in gzip format
8079
- - `do_tar_bzip()`: to compress in bzip format
8180
- - `do_tar_lz4()`: to compress in lzip/lz4 format
81+
- - `do_tar_zstd()` : to compress in zstd format
8282
- `arch_translate()`: takes care of translating arch to find qemu static builds
8383
- `COPY()`: to copy files to target filesystem
8484
- `die()`: to echo an error message & exit if `ENABLE_EXIT` is set to true

build-kinetic.sh

Lines changed: 0 additions & 82 deletions
This file was deleted.

plugins/envsetup

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# SOFTWARE.
2525

2626
export ROOT_DIR
27-
export BUILD_PALTFORM="linux"
27+
export BUILD_PLATFORM="linux"
2828

2929
_c_magneta="\e[95m"
3030
_c_green="\e[32m"
@@ -40,12 +40,12 @@ msg() { echo -e "${*} \e[0m" >&2;:;}
4040

4141
# Check if environment is Termux
4242
if [ "$(uname -o)" = "Android" ]; then
43-
export FS_COOK_PLATFORM="termux"
43+
export BUILD_PLATFORM="termux"
4444
fi
4545

4646
# sudo check
4747
if [ "$(id -u)" != "0" ]; then
48-
if [ "$FS_COOK_PLATFORM" == "termux" ]; then
48+
if [ "$BUILD_PLATFORM" == "termux" ]; then
4949
SUDO=""
5050
else
5151
if command -v sudo &>/dev/null; then
@@ -111,7 +111,7 @@ do_mount() {
111111

112112
do_unmount()
113113
{
114-
if [ "$FS_COOK_PLATFORM" == "termux" ]; then
114+
if [ "$BUILD_PLATFORM" == "termux" ]; then
115115
lshout "Skip unmount for termux"
116116
else
117117
local chroot_dir=$1
@@ -241,7 +241,7 @@ foreign_arch() {
241241

242242
includes_packages() {
243243
# comma sperated values
244-
includes="bzip2 pv ${INCLUDE_PACKAGES}"
244+
includes="bzip2 pv openssl zstd ${INCLUDE_PACKAGES}"
245245
# environment variable INCLUDE_PACKAGES
246246
export includes
247247
x=0
@@ -266,7 +266,7 @@ do_build() {
266266
foreign_arch "$arch"
267267

268268
#Disable cross architecture building in Termux
269-
if [ "$FS_COOK_PLATFORM" == "termux" ]; then
269+
if [ "$BUILD_PLATFORM" == "termux" ]; then
270270
case $worker_arch in
271271
aarch64) termux_arch="arm64" ;;
272272
arm*) termux_arch="armhf" ;;
@@ -322,11 +322,10 @@ do_build() {
322322
_debootstrap=$(which debootstrap)
323323
fi
324324

325-
if [ "$FS_COOK_PLATFORM" == "termux" ]; then
325+
if [ "$BUILD_PLATFORM" == "termux" ]; then
326326
dpkg_depends_on debootstrap
327327
_debootstrap="$(which debootstrap)"
328328
FOREIGN=""
329-
ENABLE_USER_SETUP=false
330329
fi
331330

332331
(
@@ -340,7 +339,7 @@ do_build() {
340339
$MIRROR
341340
) || die "Couldn't debootstrap..."
342341

343-
if [ "$FS_COOK_PLATFORM" == "termux" ]; then
342+
if [ "$BUILD_PLATFORM" == "termux" ]; then
344343
lshout "Skipping second stage for termux"
345344
arch_translate "$arch"
346345
else
@@ -411,7 +410,6 @@ setup_user() {
411410
cp plugins/setup-user.sh $chroot_dir
412411
sed -i "s/FS_USER/$FS_USER/g" $chroot_dir/setup-user.sh
413412
sed -i "s/FS_PASS/$FS_PASS/g" $chroot_dir/setup-user.sh
414-
install_pkg "openssl"
415413
run_cmd "chmod +x /setup-user.sh"
416414
run_cmd "/bin/bash /setup-user.sh"
417415
run_cmd "rm -rf /setup-user.sh"
@@ -471,7 +469,7 @@ do_chroot_root_ae() {
471469
}
472470

473471
do_chroot_ae() {
474-
if [ $BUILD_PALTFORM == "termux" ]; then
472+
if [ $BUILD_PLATFORM == "termux" ]; then
475473
do_chroot_proot_ae "$@"
476474
else
477475
do_chroot_root_ae "$@"
@@ -484,7 +482,7 @@ do_compress() {
484482
export chroot_dir=$1
485483
TARGET_FILE="$(basename ${chroot_dir})"
486484

487-
if [ "$FS_COOK_PLATFORM" == "termux" ]; then
485+
if [ "$BUILD_PLATFORM" == "termux" ]; then
488486
if [ ! -d "$chroot_dir" ]; then
489487
lshout "Skip compressing $chroot_dir "
490488
return 0
@@ -499,7 +497,7 @@ do_compress() {
499497
zstd) do_tar_zstd ;;
500498
*)
501499
shout "Unknown compression type"
502-
shout "all compression: lz,gzip,bzip2"
500+
shout "all compression: lz,gzip,bzip2,zstd"
503501
die "Giving up!!"
504502
;;
505503
esac
@@ -605,8 +603,7 @@ install_pkg()
605603

606604
banner
607605

608-
if [ "$FS_COOK_PLATFORM" == "termux" ]; then
606+
if [ "$BUILD_PLATFORM" == "termux" ]; then
609607
lshout "Running on termux"
610-
BUILD_PALTFORM="termux"
611608
fi
612609

0 commit comments

Comments
 (0)