evolinx-beryllium/aik/cleanup.sh
Hilledkinged e8bc1251a7 Initial Evolinx beryllium bootimage creator
// About this first creator
* Features automated bootimage creation for ebbg and tianma panels
* Creates custom ramdisk with its own init system to boot over into sdcard rootfs
* Includes some firmware blobs for ramdisk ( such as gpu, wlan and etc taht gets loaded initially )

// TODO
* Create automated rootfs flasher that can be used with twrp
2024-03-05 14:57:25 +02:00

41 lines
909 B
Bash
Executable File

#!/bin/bash
# AIK-Linux/cleanup: reset working directory
# osm0sis @ xda-developers
case $1 in
--help) echo "usage: cleanup.sh [--local] [--quiet]"; exit 1;
esac;
case $(uname -s) in
Darwin|Macintosh)
statarg="-f %Su";
readlink() { perl -MCwd -e 'print Cwd::abs_path shift' "$2"; }
;;
*) statarg="-c %U";;
esac;
aik="${BASH_SOURCE:-$0}";
aik="$(dirname "$(readlink -f "$aik")")";
bin="$aik/bin";
case $1 in
--local) shift;;
*) cd "$aik";;
esac;
chmod -R 755 "$bin" "$aik"/*.sh;
chmod 644 "$bin/magic" "$bin/androidbootimg.magic" "$bin/boot_signer.jar" "$bin/avb/"* "$bin/chromeos/"*;
if [ -d ramdisk ] && [ "$(stat $statarg ramdisk | head -n 1)" = "root" -o ! "$(find ramdisk 2>&1 | cpio -o >/dev/null 2>&1; echo $?)" -eq "0" ]; then
sudo=sudo;
fi;
$sudo rm -rf ramdisk split_img *new.* || exit 1;
case $1 in
--quiet) ;;
*) echo "Working directory cleaned.";;
esac;
exit 0;