Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Fixed bugs in fedora and manjaro installation #2

Merged
merged 1 commit into from
May 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 40 additions & 24 deletions penguin
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,11 @@ function distroArchive() {
esac
archurl="https://github.com/Techriz/AndronixOrigin/blob/master/Rootfs/Fedora/${archname}/fedora-rootfs-${archname}.tar.xz?raw=true"
fi
rootfs=rootfs="fedora-rootfs-${archname}.tar.xz"
if [[ $archname != "" ]]; then
rootfs="fedora-rootfs-${archname}.tar.xz"
else
rootfs="fedora-rootfs.tar.xz"
fi
;;
kali)
if [[ $version != "" && $version != "21.2" ]]; then
Expand Down Expand Up @@ -812,10 +816,12 @@ function distroArchive() {
[partab]="https://github.com/AndronixApp/AndronixOrigin/raw/master/Rootfs/Manjaro/manjaro.partab"
[partac]="https://github.com/AndronixApp/AndronixOrigin/raw/master/Rootfs/Manjaro/manjaro.partac"
)
rootfs=rootfs="manjaro-rootfs-${archname}.tar.xz"
rootfs="manjaro-rootfs.tar.xz"
;;
nethunter)
;;
parrot)
;;
nethunter) ;;
parrot) ;;
ubuntu)
archname="arm64"
if [[ $version == 22.04 ]]; then
Expand Down Expand Up @@ -892,19 +898,19 @@ function distroArchive() {
fi
done
echo "$(stdio stdout building $distro $rootfs)"
cat ${images}/${distro}/${distro}.parta* > $images/$rootfs
cat ${images}/${distro}/${distro}.parta* > ${images}/${distro}/${rootfs}
if [[ $? -ne 0 ]]; then
echo -e "$(stdio stderr building $distro $rootfs)\n"
exit 1
fi
for part in ${!archurl[@]}; do
inputRemove=
readline "remove" ${distro}/${distro}.${part} "Y"
readline ${distro}.${part} "remove" "Y"
if [[ ${inputRemove,,} == "y" ]]; then
rm ${images}/${distro}/${distro}.${part}
if [[ $? -ne 0 ]]; then
echo -e "$(stdio stderr remove ${distro}/${distro}.${part})\n"
readline "remove" "skip" "Y"
readline "skip" "remove" "Y"
if [[ ${inputSkip,,} == "n" ]]; then
echo -e "$(stdio stderr remove aborted)\n"
exit 1
Expand Down Expand Up @@ -1334,7 +1340,7 @@ function distroConfig() {
if [[ $? -ne 0 ]]; then
echo "$(stdio stderr remove $folder/etc/resolv.conf)"
inputRemove=
readline "remove" "skip" "Y"
readline "skip" "remove" "Y"
if [[ ${inputSkip,,} == "n" ]]; then
echo -e "$(stdio stderr remove aborted)\n"
exit 1
Expand Down Expand Up @@ -1362,7 +1368,7 @@ function distroConfig() {
if [[ $? -ne 0 ]]; then
echo "$(stdio stderr $distro remove $folder/:root/.bash_profile)"
inputRemove=
readline "remove" "skip" "Y"
readline "skip" "remove" "Y"
if [[ ${inputSkip,,} == "n" ]]; then
echo -e "$(stdio stderr $distro remove aborted)\n"
exit 1
Expand Down Expand Up @@ -1437,7 +1443,7 @@ function distroConfig() {
if [[ $? -ne 0 ]]; then
echo "$(stdio stderr $distro remove $folder/:root/.bash_profile)"
inputSkip=
readline "remove" "skip" "Y"
readline "skip" "remove" "Y"
if [[ ${inputSkip,,} == "n" ]]; then
echo -e "$(stdio stderr $distro remove aborted)\n"
exit 1
Expand Down Expand Up @@ -1673,7 +1679,7 @@ function distroConfig() {
if [[ $? -ne 0 ]]; then
echo "$(stdio stderr $distro remove $folder/:root/.bash_profile)"
inputRemove=
readline "remove" "skip" "Y"
readline "skip" "remove" "Y"
if [[ ${inputSkip,,} == "n" ]]; then
echo -e "$(stdio stderr $distro remove aborted)\n"
exit 1
Expand Down Expand Up @@ -1763,7 +1769,7 @@ function distroConfig() {
if [[ $? -ne 0 ]]; then
echo "$(stdio stderr $distro remove $folder/:root/.bash_profile)"
inputRemove=
readline "remove" "skip" "Y"
readline "skip" "remove" "Y"
if [[ ${inputSkip,,} == "n" ]]; then
echo -e "$(stdio stderr $distro remove aborted)\n"
exit 1
Expand Down Expand Up @@ -2201,7 +2207,7 @@ function distroConfig() {
if [[ $? -ne 0 ]]; then
echo "$(stdio stderr $distro remove /:root/.bash_profile)"
inputSkip=
readline "remove" "skip" "Y"
readline "skip" "remove" "Y"
if [[ ${inputSkip,,} == "n" ]]; then
echo -e "$(stdio stderr $distro remove aborted)\n"
exit 1
Expand All @@ -2213,7 +2219,7 @@ function distroConfig() {
if [[ $? -ne 0 ]]; then
echo "$(stdio stderr $distro remove /:etc.resolve.conf)"
inputSkip=
readline "remove" "skip" "Y"
readline "skip" "remove" "Y"
if [[ ${inputSkip,,} == "n" ]]; then
echo -e "$(stdio stderr $distro remove aborted)\n"
exit 1
Expand Down Expand Up @@ -2581,7 +2587,7 @@ function distroConfig() {
if [[ $? -ne 0 ]]; then
echo "$(stdio stderr $distro remove /:usr/local/bin/\*)"
inputSkip=
readline "remove" "skip" "Y"
readline "skip" "remove" "Y"
if [[ ${inputSkip,,} == "n" ]]; then
echo -e "$(stdio stderr $distro remove aborted)\n"
exit 1
Expand Down Expand Up @@ -2675,7 +2681,7 @@ function distroConfig() {
if [[ $? -ne 0 ]]; then
echo "$(stdio stderr $distro remove /:usr/local/bin/\*)"
inputSkip=
readline "remove" "skip" "Y"
readline "skip" "remove" "Y"
if [[ ${inputSkip,,} == "n" ]]; then
echo -e "$(stdio stderr $distro remove aborted)\n"
exit 1
Expand Down Expand Up @@ -2815,7 +2821,7 @@ function distroConfig() {
if [[ $? -ne 0 ]]; then
echo "$(stdio stderr $distro remove /:usr/local/bin/\*)"
inputSkip=
readline "remove" "skip" "Y"
readline "skip" "remove" "Y"
if [[ ${inputSkip,,} == "n" ]]; then
echo -e "$(stdio stderr $distro remove aborted)\n"
exit 1
Expand Down Expand Up @@ -3215,7 +3221,7 @@ function distroExtract() {
extension=$(basename -- $archive)
extension=${extension##*.}
if [[ ${extension,,} == "xz" ]]; then
options=xzvf
options=Jxvf
fi
for i in ${!excludes[@]}; do
excludes[$i]="--exclude=\"${excludes[$i]}\""
Expand All @@ -3236,7 +3242,7 @@ function distroExtract() {
rm "${archive}"
if [[ $? -ne 0 ]]; then
echo -e "$(stdio stderr $distro remove $rootfs)\n"
readline "remove" "skip" "Y"
readline "skip" "remove" "Y"
if [[ ${inputSkip,,} == "n" ]]; then
echo -e "$(stdio stderr $distro remove aborted)\n"
exit 1
Expand Down Expand Up @@ -4009,16 +4015,26 @@ function penguin() {
# readline [prefix] [label] [default]
function readline() {
stdin $@
if [[ $1 != "" ]]; then
if [[ $2 != "" ]]; then
if [[ "$1" != "" ]]; then
if [[ "$2" != "" ]]; then
read input
if [[ $3 != "" ]]; then
if [[ "$3" != "" ]]; then
if [[ $input == "" ]]; then
input=$3
input="$3"
fi
fi
if [[ $input != "" ]]; then
eval "input${2^}=\"$input\""
if [[ $environment == "production" ]]; then
eval "input${2^}=\"$input\"" >> /dev/null 2>&1
else
eval "input${2^}=\"$input\""
fi
if [[ $? -ne 0 ]]; then
echo -e "$(stderr assign input stream)"
echo -e " $(puts error when assign the input stream value into variable)"
echo -e " $(puts please activate development mode for debug it)\n"
exit 1
fi
echo -e "\x20\x20\c"
echo -e "\x1b[1;32mstdin\c"
echo -e "\x1b[1;38;5;70m<\c"
Expand Down