OSDN Git Service

fix preparation setup
[instantos/instantARCH.git] / archinstall.sh
1 #!/bin/bash
2
3 ###################################################
4 ## This is the official installer for instantOS  ##
5 ## instantOS is migrating from calamares to this ##
6 ###################################################
7
8 # main script calling others
9
10 # DO NOT USE ON ACTUAL HARDWARE YET
11
12 if ! whoami | grep -iq '^root'; then
13     echo "not running as root, switching"
14     curl -Lg git.io/instantarch | sudo bash
15     exit
16 fi
17
18 if [ -e /usr/share/liveutils ]; then
19     echo "preparing isntallation
20 OK" | instantmenu -c -bw 4 -l 2 &
21     sleep 1
22 else
23     # print logo
24     echo ""
25     echo ""
26     curl -s 'https://raw.githubusercontent.com/instantOS/instantLOGO/master/ascii.txt' | sed 's/^/    /g'
27     echo ""
28     echo ""
29 fi
30
31 if ! command -v imenu; then
32     touch /tmp/removeimenu
33 fi
34
35 # download imenu
36 curl -s https://raw.githubusercontent.com/instantOS/imenu/master/imenu.sh >/usr/bin/imenu
37 chmod 755 /usr/bin/imenu
38
39 while ! command -v imenu; do
40     echo "installing imenu"
41     curl -s https://raw.githubusercontent.com/instantOS/imenu/master/imenu.sh >/usr/bin/imenu
42     chmod 755 /usr/bin/imenu
43 done
44
45 setinfo() {
46     if [ -e /usr/share/liveutils ]; then
47         pkill instantmenu
48     fi
49     echo "$@" >/opt/instantprogress
50 }
51
52 # sort mirrors
53 pacman -Sy --noconfirm
54 if command -v pacstrap; then
55     pacman -S reflector --noconfirm
56     echo "selecting fastest mirror"
57     reflector --latest 40 --protocol http --protocol https --sort rate --save /etc/pacman.d/mirrorlist
58 fi
59
60 # install dependencies
61 pacman -Sy --noconfirm
62 pacman -S git --noconfirm --needed
63
64 cd /root
65 [ -e instantARCH ] && rm -rf instantARCH
66 git clone --depth=1 https://github.com/instantos/instantARCH.git
67 cd instantARCH
68
69 ./depend/depend.sh
70 cd /root/instantARCH
71 ./ask.sh || exit
72
73 chmod +x *.sh
74 chmod +x **/*.sh
75 echo "local install"
76 ./localinstall.sh
77 echo "in-system install"
78 ./systeminstall.sh
79
80 if [ -e /tmp/removeimenu ]; then
81     rm /usr/bin/imenu
82 fi
83
84 echo "installation finished"