diff --git a/Rootfs/CentOS/README.md b/Rootfs/CentOS/README.md new file mode 100644 index 0000000..c96bcc3 --- /dev/null +++ b/Rootfs/CentOS/README.md @@ -0,0 +1,16 @@ +This folder has the SAME CONTENT as CentOS_Stream folder, content was kept here for backward compatibility, so user that didn't update AnLinux app to the latest version can also install CentOS Stream if they are using 64bit device. + +This folder will be removed in the next end year update. + + +These image are CentOS Stream image, which is download by podman from here: [stream9-minimal](https://quay.io/repository/centos/centos?tab=tags&tag=stream9) + +Command to pull: + +Only 2 arch is available: amd64, arm64 + +> podman pull --arch=arm64 quay.io/centos/centos:stream9-minimal + +Command to save the file: + +> podman save --format docker-archive -o stream9-arm64.tar centos:stream9-minimal \ No newline at end of file diff --git a/Rootfs/CentOS/amd64/centos-rootfs-amd64.tar.xz b/Rootfs/CentOS/amd64/centos-rootfs-amd64.tar.xz new file mode 100644 index 0000000..c058028 Binary files /dev/null and b/Rootfs/CentOS/amd64/centos-rootfs-amd64.tar.xz differ diff --git a/Rootfs/CentOS/arm64/centos-rootfs-arm64.tar.xz b/Rootfs/CentOS/arm64/centos-rootfs-arm64.tar.xz new file mode 100644 index 0000000..15a86a9 Binary files /dev/null and b/Rootfs/CentOS/arm64/centos-rootfs-arm64.tar.xz differ diff --git a/Scripts/Installer/CentOS/README.md b/Scripts/Installer/CentOS/README.md new file mode 100644 index 0000000..424d5d1 --- /dev/null +++ b/Scripts/Installer/CentOS/README.md @@ -0,0 +1,3 @@ +This folder has the SAME CONTENT as CentOS_Stream folder, content was kept here for backward compatibility, so user that didn't update AnLinux app to the latest version can also install CentOS Stream if they are using 64bit device. + +This folder will be removed in the next end year update. diff --git a/Scripts/Installer/CentOS/centos_stream.sh b/Scripts/Installer/CentOS/centos_stream.sh new file mode 100644 index 0000000..3faeaa8 --- /dev/null +++ b/Scripts/Installer/CentOS/centos_stream.sh @@ -0,0 +1,106 @@ +#!/data/data/com.termux/files/usr/bin/bash +folder=centos_stream-fs +if [ -d "$folder" ]; then + first=1 + echo "skipping downloading" +fi +tarball="centos_stream-rootfs.tar.xz" +if [ "$first" != 1 ];then + if [ ! -f $tarball ]; then + echo "Download Rootfs, this may take a while base on your internet speed." + case `dpkg --print-architecture` in + aarch64) + archurl="arm64" ;; + arm) + archurl="armhf" ;; + amd64) + archurl="amd64" ;; + x86_64) + archurl="amd64" ;; + i*86) + archurl="i386" ;; + x86) + archurl="i386" ;; + *) + echo "unknown architecture"; exit 1 ;; + esac + wget "https://raw.githubusercontent.com/EXALAB/AnLinux-Resources/master/Rootfs/CentOS/${archurl}/centos_stream-rootfs-${archurl}.tar.xz" -O $tarball + fi + cur=`pwd` + mkdir -p "$folder" + cd "$folder" + echo "Decompressing Rootfs, please be patient." + proot --link2symlink tar -xJf ${cur}/${tarball} --exclude='dev'||: + + echo "Setting up name server" + echo "127.0.0.1 localhost" > etc/hosts + echo "nameserver 8.8.8.8" > etc/resolv.conf + echo "nameserver 8.8.4.4" >> etc/resolv.conf + cd "$cur" +fi +mkdir -p centos-binds +mkdir -p centos-fs/tmp +bin=start-centos_stream.sh +echo "writing launch script" +cat > $bin <<- EOM +#!/bin/bash +cd \$(dirname \$0) +pulseaudio --start +## For rooted user: pulseaudio --start --system +## unset LD_PRELOAD in case termux-exec is installed +unset LD_PRELOAD +command="proot" +command+=" --link2symlink" +command+=" -0" +command+=" -r $folder" +if [ -n "\$(ls -A centos-binds)" ]; then + for f in centos-binds/* ;do + . \$f + done +fi +command+=" -b /dev" +command+=" -b /proc" +command+=" -b centos-fs/root:/dev/shm" +## uncomment the following line to have access to the home directory of termux +#command+=" -b /data/data/com.termux/files/home:/root" +## uncomment the following line to mount /sdcard directly to / +#command+=" -b /sdcard" +command+=" -w /root" +command+=" /usr/bin/env -i" +command+=" HOME=/root" +command+=" PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/games:/usr/local/games" +command+=" TERM=\$TERM" +command+=" LANG=C.UTF-8" +command+=" /bin/bash --login" +com="\$@" +if [ -z "\$1" ];then + exec \$command +else + \$command -c "\$com" +fi +EOM + +echo "Setting up pulseaudio so you can have music in distro." + +pkg install pulseaudio -y + +if grep -q "anonymous" ~/../usr/etc/pulse/default.pa;then + echo "module already present" +else + echo "load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" >> ~/../usr/etc/pulse/default.pa +fi + +echo "exit-idle-time = -1" >> ~/../usr/etc/pulse/daemon.conf +echo "Modified pulseaudio timeout to infinite" +echo "autospawn = no" >> ~/../usr/etc/pulse/client.conf +echo "Disabled pulseaudio autospawn" +echo "export PULSE_SERVER=127.0.0.1" >> centos-fs/etc/profile +echo "Setting Pulseaudio server to 127.0.0.1" + +echo "fixing shebang of $bin" +termux-fix-shebang $bin +echo "making $bin executable" +chmod +x $bin +echo "removing image for some space" +rm $tarball +echo "You can now launch CentOS with the ./${bin} script"