3 ###################################################
4 ## This is the official installer for instantOS ##
5 ###################################################
7 if ! whoami | grep -iq '^root'; then
8 echo "not running as root, switching"
9 curl -Lg git.io/instantarch | sudo bash
13 if [ -e /usr/share/liveutils ]; then
14 pgrep instantmenu || echo "preparing installation
15 OK" | instantmenu -c -bw 4 -l 2 &
20 curl -s 'https://raw.githubusercontent.com/instantOS/instantLOGO/master/ascii.txt' | sed 's/^/ /g'
25 # prevent multiple instances from being launched
26 if [ -e /tmp/instantarchpid ]; then
28 if kill -0 "$(cat /tmp/instantarchpid)"; then
29 notify-send "installer already running, please do not start multiple instances"
32 echo "$$" >/tmp/instantarchpid
35 if ! command -v imenu; then
36 touch /tmp/removeimenu
40 echo "updating mirrorlist"
41 curl -s https://raw.githubusercontent.com/instantOS/instantOS/master/repo.sh | bash
44 curl -s https://raw.githubusercontent.com/instantOS/imenu/master/imenu.sh >/usr/bin/imenu
45 chmod 755 /usr/bin/imenu
47 while ! command -v imenu; do
48 echo "installing imenu"
49 curl -s https://raw.githubusercontent.com/instantOS/imenu/master/imenu.sh >/usr/bin/imenu
50 chmod 755 /usr/bin/imenu
54 if [ -e /usr/share/liveutils ]; then
57 echo "$@" >/opt/instantprogress
61 if command -v python; then
62 echo "import time; time.sleep(10009)" | python &
67 while [ -z "$CONTINUEINSTALLATION" ]; do
68 if ! pacman -Sy --noconfirm || ! pacman -S git --noconfirm --needed; then
70 pacman -Sy --noconfirm
72 export CONTINUEINSTALLATION="true"
77 [ -e instantARCH ] && rm -rf instantARCH
79 if [ "$1" = "test" ]; then
80 echo "switching to testing branch"
81 git clone --single-branch --branch testing --depth=1 https://github.com/instantos/instantARCH.git
82 export INSTANTARCHTESTING="true"
84 git clone --depth=1 https://github.com/instantos/instantARCH.git
87 cd instantARCH || exit 1
89 # use alternative versions of the installer
93 if ! [ -e /root/manualarch ]; then
94 echo "no manual instantARCH version found. Please clone it to /root/manualarch"
100 cp -r /root/manualarch/* .
101 export INSTANTARCHMANUAL="true"
104 echo "running normal installer version"
114 ./artix/preinstall.sh
116 if [ -n "$INSTANTARCHTESTING" ]; then
117 echo "install config"
121 [ -e /usr/share/liveutils ] && pkill instantmenu
123 cd /root/instantARCH || exit
126 if ! [ -e /opt/instantos/installcanceled ]; then
127 imenu -m "ask failed"
128 echo "ask failed" && exit
130 rm /opt/instantos/installcanceled
131 pkill instantosinstall
140 ./localinstall.sh 2>&1 | tee /opt/localinstall &&
141 echo "system install" &&
142 ./systeminstall.sh 2>&1 | tee /opt/systeminstall
147 sudo pkill instantmenu
151 echo "uploading installation log"
152 cat /opt/localinstall >/opt/install.log
154 if [ -e /opt/systeminstall ]; then
155 cat /opt/systeminstall >>/opt/install.log
159 cp /root/instantARCH/data/netrc ~/.netrc
160 curl -n -F 'f:1=@install.log' ix.io
161 dialog --msgbox "installation failed
162 please go to https://instantos.github.io/instantos.github.io/support
163 for assistance or error reporting" 1000 1000
167 # ask to reboot, upload error data if install failed
168 if ! [ -e /opt/installfailed ] || ! [ -e /opt/installsuccess ]; then
169 if command -v installapplet; then
170 notify-send "rebooting"
172 if iroot logging; then
179 echo "installaion failed"
180 echo "uploading error data"
184 if [ -e /tmp/removeimenu ]; then
188 echo "installation finished"