diff --git a/build-jammy.sh b/build-jammy.sh index 6b12ca4..87ecbe1 100755 --- a/build-jammy.sh +++ b/build-jammy.sh @@ -76,4 +76,4 @@ do_unmount "${frn}-armhf" do_unmount "${frn}-amd64" shout "Build Complete.." -ls ${frn}*tar* +ls ${frn}*.* diff --git a/cook.sh b/cook.sh index fb22104..be39d53 100755 --- a/cook.sh +++ b/cook.sh @@ -72,4 +72,4 @@ do_unmount "${frn}-armhf" do_unmount "${frn}-amd64" shout "Build Complete.." -ls ${frn}*tar* +ls ${frn}*.* diff --git a/plugins/envsetup b/plugins/envsetup index 5ce455e..4845b2f 100755 --- a/plugins/envsetup +++ b/plugins/envsetup @@ -418,6 +418,7 @@ setup_user() { } do_chroot_proot_ae() { + dpkg_depends_on proot local chroot_dir=$1 shift local cmd_string=$* @@ -495,6 +496,7 @@ do_compress() { bzip2) do_tar_bzip ;; gzip) do_tar_gzip ;; lz) do_tar_lz4 ;; + zstd) do_tar_zstd ;; *) shout "Unknown compression type" shout "all compression: lz,gzip,bzip2" @@ -548,6 +550,20 @@ do_tar_bzip() { $SUDO cp "${chroot_dir}/${TARGET_FILE}.tar.xz" out } +do_tar_zstd() { + shout "installing zstd..." + install_pkg "zstd" + shout "starting compression..." + $SUDO cp "plugins/zst-packer.sh" "${chroot_dir}" + do_chroot_ae \ + "$chroot_dir" \ + "chmod +x /zst-packer.sh" + do_chroot_ae \ + "$chroot_dir" \ + "/bin/bash /zst-packer.sh ${TARGET_FILE}" + $SUDO cp "${chroot_dir}/${TARGET_FILE}.zst" out +} + run_cmd() { local command=$* do_chroot_ae "$chroot_dir" "$command" diff --git a/plugins/j-packer.sh b/plugins/j-packer.sh index 947660f..31f0406 100755 --- a/plugins/j-packer.sh +++ b/plugins/j-packer.sh @@ -7,7 +7,7 @@ tar \ --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/mnt/*,/media/*,/lost+found/*} \ --exclude="*.l2s.*" \ --exclude=/${0} \ - --exclude="/${target}.tar.gz" \ + --exclude="/${target}.tar.xz" \ --exclude-caches-all \ --one-file-system \ -cpf \ diff --git a/plugins/lz-packer.sh b/plugins/lz-packer.sh index 70445cd..0b9deb6 100755 --- a/plugins/lz-packer.sh +++ b/plugins/lz-packer.sh @@ -7,7 +7,7 @@ tar \ --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/mnt/*,/media/*,/lost+found/*} \ --exclude="*.l2s.*" \ --exclude=/${0} \ - --exclude="/${target}.tar.gz" \ + --exclude="/${target}.tar.lz" \ --exclude-caches-all \ --one-file-system \ -cpf \ diff --git a/plugins/zst-packer.sh b/plugins/zst-packer.sh new file mode 100644 index 0000000..804e591 --- /dev/null +++ b/plugins/zst-packer.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +target=$1 + +tar \ + --exclude={/data,/apex,/vendor,/system,/sdcard} \ + --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/mnt/*,/media/*,/lost+found/*} \ + --exclude="*.l2s.*" \ + --exclude=/${0} \ + --exclude="/${target}.zst" \ + --exclude-caches-all \ + --one-file-system \ + -cpf \ + - / -P \ + | pv -s $(($(du -skx / | awk '{print $1}') * 1024)) |\ + zstd > /"${target}".zst diff --git a/setup.sh b/setup.sh index f5ce8c6..2293fee 100755 --- a/setup.sh +++ b/setup.sh @@ -4,7 +4,7 @@ if [ "$(uname -o)" = "Android" ]; then echo "Running in Termux" apt update - apt install debootstrap which -y + apt install debootstrap which proot -y else if [ "$(id -u)" != "0" ]; then if ! command -v sudo >/dev/null 2>&1; then