-
Notifications
You must be signed in to change notification settings - Fork 1
/
config
executable file
·76 lines (72 loc) · 3.06 KB
/
config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
#Floflis 1.0 - in homenage to Ian Murdock; the creator of Diaspora; the creator of Grooveshark, and all others made victim by the power collude of Microsoft+Meta/Facebook.
osbuild="2312_1"
# support custom OS Build
#osbuildcodename="\"Eusoumafoca\""
osbuildcodename="\"CorreriaBrasileira\""
# support custom OS Build Codename
osname="Floflis"
# support custom OS Name
osversion="1.0"
# support custom OS Version
osfullname="$osname $osversion build $osbuild $osbuildcodename"
# support custom OS FullName
updatepatch="0"
# support custom OS Updatepatch
year="2023"
layer="dna"
nxtlayer="core"
distrobase="blank"
user="blank"
# install="new" # new, ok
specialbuildattempt="47"
case "${nameOutS}"$(uname -s) in
Linux*) flofmach="Linux";;
Darwin*) flofmach="Mac";;
CYGWIN*) flofmach="Cygwin";; # if 64-bit, Cygwin isn't detected
msys*) flofmach="msysWindows";;
MINGW*) flofmach="MinGw";;
SunOS*) flofmach="Solaris";;
bsd*) flofmach="BSD";;
FreeBSD*) flofmach="FreeBSD";;
GNU*) flofmach="GNU";;
*) flofmach="UNKNOWN:${nameOutD}"
esac
if [[ $(echo $PREFIX | grep -o "com.termux") == "com.termux" ]];
then
flofmach="Termux" #from https://foosel.net/til/how-to-detect-termux-in-a-script/
#FLOPREFIX="$PREFIX"
FLOPREFIX="/data/data/com.termux/files/" #should later be improved, instead returning $PREFIX but cutting "usr"
else
FLOPREFIX="/"
fi
export FLOPREFIX
export flofmach
#echo ${flofmach}
#- Task: found a more complete, let's work on it later: https://gist.github.com/takuzoo3868/730000af7491dc354b0d38510493f982
#- Task: also https://stackoverflow.com/questions/394230/how-to-detect-the-os-from-a-bash-script
case "${nameOutD}"$(awk -F= '/^NAME/{print $2}' /etc/os-release | tr -d '"') in
Debian*) flofdistro=Debian;;
Floflis*) flofdistro=Floflis;;
Ubuntu*) flofdistro=Ubuntu;;
Fedora*) flofdistro=Fedora;; #from https://wuhrr.wordpress.com/2020/06/19/detect-os-and-distro-in-bash/
Raspbian*) flofdistro=Raspbian;; #from https://wuhrr.wordpress.com/2020/06/19/detect-os-and-distro-in-bash/
*) flofdistro="UNKNOWN:${nameOutD}"
esac
#echo ${flofdistro}
unameOutM="$(uname -m)"
case "${unameOutM}" in
i286) flofarch="286";;
i586) flofarch="586";;
i386) flofarch="386";;
i686) flofarch="386";;
x86_64) flofarch="amd64";;
arm) dpkg --print-flofarch | grep -q "arm64" && flofarch="arm64" || flofarch="arm";;
aarch64) flofarch="arm64";; # really necessary? don't the previous do the same?
armv7l) flofarch="armv7l";; #inspo from https://stackoverflow.com/a/29167402 HAVE TO VOTE
armv7hl) flofarch="armv7hl";; #inspo from https://stackoverflow.com/a/29167402 HAVE TO VOTE ; SAME AS PREVIOUS
riscv64) flofarch="riscv64"
esac
#echo ${flofarch}
export flofarch && export flofdistro
export osbuild && export osbuildcodename && export osname && export osversion && export osfullname && export updatepatch && export year && export layer && export nxtlayer && export distrobase && export user && export specialbuildattempt