blob: e3da50125dda5ec7a09c99e073114f5d7d97bfc5 (
plain)
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
|
#!/bin/bash
#Temporal is a file that contains parameters to use when access to chroot
partition(){
#Search and show the Hard Disks to select
aux=$(ls /dev/sd?)
index=0
for i in $aux; do
hdds[$index]="${i} ${i#/*/} off"
index=$((index+1))
done
hdd=$(dialog --stdout --radiolist "Selecciona Disco Duro" 20 70 50 ${hdds[@]})
#If exist the line delete
if (cat /root/.install-systemd-mate/temporal | grep "hdd=") &>/dev/null
then
sed -i -e '/hdd=*/d' /root/.install-systemd-mate/temporal
fi
#And add the new line with new parameter
echo "hdd=$hdd" >> /root/.install-systemd-mate/temporal
selection=$(dialog --stdout --menu "Metodo de Particionado" 20 70 50 \
1 "Usar todo o disco con swap (1GB) and /" \
2 "Usar gparted para personalizar" )
case $selection in
1)
umount /mnt &> /dev/null
#Create msdos partition table
parted -s $hdd -- mklabel msdos
#Create partition swap and /
parted -s $hdd -- mkpart primary 1MiB 1000MiB mkpart primary 1000MiB -1s
#Boot option partition /
parted -s $hdd -- set 2 boot on
#Format and partitions and mount /
(echo t; echo 1; echo 82; echo w) | fdisk $hdd
mkswap ${hdd}1
mkfs.ext4 ${hdd}2
mount ${hdd}2 /mnt
;;
2)
gparted $hdd
#Search and show the partitions that select before.
aux=$(ls $hdd?)
index=0;
for i in $aux; do
partitions[$index]="${i} ${i#/*/} off"
index=$((index+1))
done
partition=$(dialog --stdout --radiolist "Montar particion /" 20 70 50 ${partitions[@]})
#Mount partition /
umount /mnt &> /dev/null
mount $partition /mnt
#Ask if you want mount other partitions
other=0
while [ $other != 3 ]; do
other=$(dialog --stdout --menu "¿Montar outra particion?" 20 70 50 1 "/home" 2 "/boot" 3 "No")
case $other in
1)
umount /mnt/home &> /dev/null
mkdir /mnt/home &> /dev/null
mount $(dialog --stdout --radiolist "Montar particion /home" 20 70 50 ${partitions[@]}) /mnt/home
;;
2)
umount /mnt/boot &> /dev/null
mkdir /mnt/boot &> /dev/null
mount $(dialog --stdout --radiolist "Mount particion /boot" 20 70 50 ${partitions[@]}) /mnt/boot
;;
*)
other=3
;;
esac
done
;;
esac
}
pacman -Sy archlinux-keyring archlinux32-keyring parabola-keyring --noconfirm
pacman-key --populate archlinux archlinux32 parabola
pacman-key --refresh-keys
option=0
while [ option != 7 ]; do
option=$(dialog --stdout --menu "Instalación CLI de Parabola" 20 70 50 \
1 "Formatear e Montar Particiones" \
2 "Instalar Sistema Base" \
3 "Instalar GRUB" \
4 "Configuración do Sistema" \
5 "(Opcional) Instalar Escritorio/Aplicaciones de Live DVD" \
6 "Crear Conta de Usuario" \
7 "Salir" )
case $option in
1)
partition
;;
2)
#Install base system
pacstrap /mnt
pacstrap /mnt dialog
;;
3)
#Install grub
pacstrap /mnt grub grub2-theme-gnuaxiom
#Enable Parabola theme for grub
sed -i 's|^#GRUB_THEME=.*|GRUB_THEME=/boot/grub/themes/parabola-laf/theme.txt|' /mnt/etc/default/grub
;;
4)
#Generate fstab and acces to chroot to do System Config
genfstab -p /mnt >> /mnt/etc/fstab
cp /root/.install-systemd-mate/temporal /mnt
cp /root/.install-systemd-mate/systemConfig.sh /mnt
chmod +x /mnt/systemConfig.sh
arch-chroot /mnt /systemConfig.sh
rm -r /mnt/systemConfig.sh
;;
5)
#Packages to the X11 live
packages=( $( cat ./packages ) )
#Install packages
pacstrap /mnt ${packages[@]}
user=$(cat /root/.install-systemd-mate/temporal | grep "userName" )
#Copy skel in the new system and desktop's background
cp -a /etc/skel/ /mnt/etc/
#Uncomment to allow members of group wheel to execute any command
sed -i 's|[#] [%]wheel ALL=[(]ALL[)] ALL|%wheel ALL=(ALL) ALL|' /mnt/etc/sudoers
#Enable services
cp -a /root/.install-systemd-mate/x11.sh /mnt
#Enable services with systemd
chmod +x /mnt/x11.sh
arch-chroot /mnt /x11.sh
rm /mnt/x11.sh
;;
6)
#Create a new username and save in temporal, to use after
if (cat /root/.install-systemd-mate/temporal | grep "userName=") &>/dev/null
then
sed -i -e '/userName=*/d' /root/.install-systemd-mate/temporal
fi
echo "userName=$(dialog --stdout --inputbox "Introduce un nome de usuario" 8 40)" >> /root/.install-systemd-mate/temporal
cp /root/.codecheck /mnt
cp /root/.install-systemd-mate/temporal /mnt
cp /root/.install-systemd-mate/userAccount.sh /mnt
chmod +x /mnt/userAccount.sh
arch-chroot /mnt /userAccount.sh
rm -r /mnt/userAccount.sh
;;
*)
#Delete temporal file and umount partitions
rm -r /mnt/.codecheck
rm -r /mnt/temporal
umount /mnt/boot &> /dev/null
umount /mnt/home &> /dev/null
umount /mnt &> /dev/null
exit
;;
esac
done
|