diff --git a/README.md b/README.md index 0b23947..36b253f 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ mount_image - Kali Linux, Installed on /data/kali - Manjaro ARM, Installed on /data/manjaro - Ubuntu, Installed on /data/ubuntu +- Void Linux, Installed on /data/void ...more distro added soon diff --git a/module.prop b/module.prop index 3ff121c..de9c077 100644 --- a/module.prop +++ b/module.prop @@ -1,6 +1,6 @@ id=lhroot name=Linux Chroot Installer -version=v2.0.0 +version=v2.1.0 versionCode=1 author=FerryAr description=Systemless linux chroot installer and chroot boot script diff --git a/system/bin/bootlinux b/system/bin/bootlinux index ffad28f..027ac5b 100755 --- a/system/bin/bootlinux +++ b/system/bin/bootlinux @@ -4,6 +4,4 @@ SCRIPT_PATH=$(readlink -f $0) . ${SCRIPT_PATH%/*}/bootlinux_env -if [ $# -eq 0 ]; then - $busybox chroot $mnt /usr/bin/env su -l -fi +$busybox chroot $mnt /usr/bin/env su -l diff --git a/system/bin/bootlinux_init b/system/bin/bootlinux_init index 7797cad..9e470df 100644 --- a/system/bin/bootlinux_init +++ b/system/bin/bootlinux_init @@ -21,7 +21,14 @@ f_checkforroot(){ ######### VARIABLES ######### mnt= -if [ -d "/data/alpine" ]; then +if [ -n "$1" ]; then + if [ -d "$1" ]; then + mnt=$1 + else + echo "Directory $1 does not found" + exit 1 + fi +elif [ -d "/data/alpine" ]; then mnt=/data/alpine elif [ -d "/data/debian" ]; then mnt=/data/debian @@ -35,6 +42,8 @@ elif [ -d "/data/fedora" ]; then mnt=/data/fedora elif [ -d "/data/manjaro" ]; then mnt=/data/manjaro +elif [ -d "/data/void" ]; then + mnt=/data/void else echo "No chroot installed"; exit 1 diff --git a/system/bin/killlinux b/system/bin/killlinux index 0971ad9..e34d870 100755 --- a/system/bin/killlinux +++ b/system/bin/killlinux @@ -10,7 +10,14 @@ else exit fi export bin=/system/bin -if [ -d "/data/alpine" ]; then +if [ -n "$1" ]; then + if [ -d "$1" ]; then + export mnt="$1" + else + echo "Directory $1 not exist" + exit 1 + fi +elif [ -d "/data/alpine" ]; then export mnt=/data/alpine elif [ -d "/data/debian" ]; then export mnt=/data/debian @@ -24,6 +31,8 @@ elif [ -d "/data/arch" ]; then export mnt=/data/arch elif [ -d "/data/manjaro" ]; then export mnt=/data/manjaro +elif [ -d "/data/void" ]; then + export mnt="/data/void" else echo "No chroot installed" exit 1 diff --git a/system/bin/lhroot b/system/bin/lhroot index e47b783..ebb3b12 100755 --- a/system/bin/lhroot +++ b/system/bin/lhroot @@ -155,6 +155,43 @@ ubuntu () { echo "You can now launch Ubuntu with the bootlinux script" } +void () { + folder="/data/void" + if [ -d "$folder" ]; then + first=1 + echo "skipping downloading" + fi + tmp="/data/local/tmp" + tarball="$tmp/void.tar.xz" + archurl= + if [ "$first" != 1 ]; then + if [ ! -f $tarball ]; then + echo "Downloading Rootfs, please wait..." + case $ARCH in + arm) + archurl="armhf" ;; + arm64) + archurl="arm64" ;; + x86) + archurl="i386" ;; + x64) + archurl="amd64" ;; + *) + abort "unknown arch" ;; + esac + wget "https://raw.githubusercontent.com/FerryAr/lhroot-repo/main/Rootfs/Void/${archurl}/void-rootfs-${archurl}.tar.xz" -qO $tarball & e_spinner + fi + mkdir -p "$folder" + cd "$folder" + echo "Decompressing Rootfs..." + tar xfJ ${tarball} 2> /dev/null||: + cd $HOME + fi + echo "Removing rootfs tarball for some space" + rm $tarball + echo "You can now launch Void with bootlinux script" +} + arch_arm () { folder="/data/arch" if [ -d "$folder" ]; then @@ -163,7 +200,7 @@ arch_arm () { fi tmp="/data/local/tmp" tarball="$tmp/arch.tar.gz" - if [ "$first != 1" ]; then + if [ "$first" != 1 ]; then if [ ! -f $tarball ]; then echo "Downloading Rootfs, please wait..." archurl= @@ -334,6 +371,7 @@ install_chroot () { echo "6. Kali Linux" echo "7. Manjaro" echo "8. Ubuntu" + echo "9. Void Linux" read -r choice?'--> ' echo " " case $choice in @@ -346,6 +384,7 @@ install_chroot () { 6) kali ;; 7) manjaro ;; 8) ubuntu ;; + 9) void ;; esac done } @@ -359,6 +398,7 @@ remove_chroot () { kali="/data/kali" fedora="/data/fedora" manjaro="/data/manjaro" + void="/data/void" if [ -d "$alpine" ]; then installed=true lmount=$alpine @@ -380,6 +420,9 @@ remove_chroot () { elif [ -d "$manjaro" ]; then installed=true lmount=$manjaro + elif [ -d "$void" ]; then + installed=true + lmount=$void else : fi