OSDN Git Service

fix locale settings
[instantos/instantARCH.git] / topinstall.sh
1 #!/bin/bash
2
3 # print logo
4 echo ""
5 echo ""
6 curl -s 'https://raw.githubusercontent.com/instantOS/instantLOGO/master/ascii.txt' | sed 's/^/    /g'
7 echo ""
8 echo ""
9
10 if ! whoami | grep -iq '^root'; then
11     echo "please run this as root"
12     exit
13 fi
14
15 if ! command -v imenu; then
16     curl -s https://raw.githubusercontent.com/instantOS/imenu/master/imenu.sh >/usr/local/bin/imenu
17     chmod 755 /usr/local/bin/imenu
18 fi
19
20 touch /tmp/climenu
21
22 # only runs on arch based distros
23 if ! grep -Eiq '(arch|manjaro)' /etc/os-release; then
24     echo "system does not appear to be arch based.
25 instantARCH only works on arch based systems like Arch and Manjaro
26 are you sure you want to run this?" | imenu -C || {
27         imenu -m "installation canceled"
28         exit
29     }
30 fi
31
32 touch /opt/topinstall
33
34 pacman -Sy --noconfirm
35
36 # todo: askmirrors
37
38 pacman -S git --noconfirm --needed
39
40 cd /root
41 [ -e instantARCH ] && rm -rf instantARCH
42 git clone --depth=1 https://github.com/instantos/instantARCH.git
43 cd instantARCH
44
45 chmod +x *.sh
46 chmod 755 ./*/*.sh
47
48 mkdir config
49
50 ./depend/depend.sh
51
52 # do all actions requiring user input first
53 ./topask.sh
54
55 if ! command -v mhwd && iroot automirror; then
56     pacman -S reflector --noconfirm --needed
57     echo "selecting fastest mirror"
58     reflector --latest 40 --protocol http --protocol https --sort rate --save /etc/pacman.d/mirrorlist
59     pacman -Sy --noconfirm
60 fi
61
62 ./init/init.sh
63
64 pacman -S --noconfirm --needed base \
65     linux linux-headers \
66     linux-lts linux-lts-headers \
67     linux-firmware
68
69 ./depend/system.sh
70 ./chroot/chroot.sh
71 ./chroot/drivers.sh
72 ./network/network.sh
73 ./bootloader/config.sh
74
75 if ! ls /home/ | grep -q ..; then
76     ./user/modify.sh
77 else
78     ./user/user.sh
79 fi
80
81 ./lang/timezone.sh
82 ./lang/locale.sh
83 ./lang/xorg.sh
84 ./instantos/install.sh
85
86 echo "finished installing instantOS"
87 imenu -c "a reboot is required. reboot now?" && touch /tmp/instantosreboot
88 rm /tmp/climenu
89
90 [ -e /usr/local/bin/imenu ] && rm /usr/local/bin/imenu
91 [ -e /tmp/instantosreboot ] && reboot