OSDN Git Service

add imenu hybrid mode
[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     imenu -m "preparing installation" &
20 else
21     # print logo
22     echo ""
23     echo ""
24     curl -s 'https://raw.githubusercontent.com/instantOS/instantLOGO/master/ascii.txt' | sed 's/^/    /g'
25     echo ""
26     echo ""
27 fi
28
29 if ! command -v imenu; then
30     touch /tmp/removeimenu
31 fi
32
33 # download imenu
34 curl -s https://raw.githubusercontent.com/instantOS/imenu/master/imenu.sh >/usr/bin/imenu
35 chmod 755 /usr/bin/imenu
36
37 while ! command -v imenu; do
38     echo "installing imenu"
39     curl -s https://raw.githubusercontent.com/instantOS/imenu/master/imenu.sh >/usr/bin/imenu
40     chmod 755 /usr/bin/imenu
41 done
42
43 setinfo() {
44     if [ -e /usr/share/liveutils ]; then
45         pkill instantmenu
46     fi
47     echo "$@" >/opt/instantprogress
48 }
49
50 # sort mirrors
51 pacman -Sy --noconfirm
52 if command -v pacstrap; then
53     pacman -S reflector --noconfirm
54     echo "selecting fastest mirror"
55     reflector --latest 40 --protocol http --protocol https --sort rate --save /etc/pacman.d/mirrorlist
56 fi
57
58 # install dependencies
59 pacman -Sy --noconfirm
60 pacman -S git --noconfirm --needed
61
62 cd /root
63 [ -e instantARCH ] && rm -rf instantARCH
64 git clone --depth=1 https://github.com/instantos/instantARCH.git
65 cd instantARCH
66
67 ./depend/depend.sh
68 cd /root/instantARCH
69 ./ask.sh || exit
70
71 chmod +x *.sh
72 chmod +x **/*.sh
73 echo "local install"
74 ./localinstall.sh
75 echo "in-system install"
76 ./systeminstall.sh
77
78 if [ -e /tmp/removeimenu ]; then
79     rm /usr/bin/imenu
80 fi
81
82 echo "installation finished"