This repository has been archived by the owner on Jun 7, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
020-install-packages.sh
executable file
·76 lines (63 loc) · 2.63 KB
/
020-install-packages.sh
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
#!/bin/sh
# 020-install-packages.sh: Setup pacman configuration and install base system.
#
# Copyright 2013, 2014 Sudaraka Wijesinghe <sudaraka.org/contact>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
BASE_PKG='base base-devel syslinux wireless_tools wpa_supplicant gvim sudo yaourt rsync wget git nfs-utils bc haveged openssh rfkill bash-completion alsa-utils alsa-oss alsa-plugins fuse wxgtk2.8';
BASE_IGNORE='jfsutils,reiserfsprogs,xfsprogs,vi,nano,lvm2,netctl,heirloom-mailx,mdadm,pcmciautils';
if [ 'kernel' == "$1" ]; then
BASE_PKG="$BASE_PKG linux linux-firmware";
else
BASE_IGNORE="$BASE_IGNORE,linux,linux-firmware";
fi;
echo '';
echo '020-install-packages Copyright 2013, 2014 Sudaraka Wijesinghe';
echo 'This program comes with ABSOLUTELY NO WARRANTY;';
echo 'This is free software, and you are welcome to redistribute it';
echo 'under certain conditions under GNU GPLv3 or later.';
echo '';
echo 'IMPORTANT: Make sure you have the following pacman directories mounted.';
echo ' /var/cache/pacman/pkg';
echo ' /var/lib/pacman/sync';
read -n1 -s -p 'Press any key to continue';
echo '';
echo '';
echo 'Creating pacman configuration...';
# Make pacman ignore packages depended on Mono and Java
sed 's/#\(IgnorePkg\s*=\)/\1 mono mono-tools *-openjdk-headless/' \
/etc/pacman.conf > /mnt/etc/pacman.conf 2>/dev/null;
# Add archlinux.fr repository for Yaourt
cat >> /mnt/etc/pacman.conf << EOF
[archlinuxfr]
Server = http://repo.archlinux.fr/\$arch
SigLevel = Optional
EOF
# Install base system
pacman -Sy --quiet -r /mnt --config /mnt/etc/pacman.conf \
--ignore $BASE_IGNORE $BASE_PKG
echo '';
# Restore original pacman configuration file
echo 'Restoring pacman configuration file...';
mv /mnt/etc/pacman.conf{,.pacnew} >/dev/null 2>&1
mv /mnt/etc/pacman.conf{.pacorig,} >/dev/null 2>&1
# WPA configuration
if [ -f /root/wifi.conf ]; then
echo 'Copying WPA configuration file...';
cp /{root,mnt/etc/wpa_supplicant}/wifi.conf >/dev/null 2>&1;
fi;
# copy resolv.conf to new system
cp {,/mnt}/etc/resolv.conf >/dev/null 2>&1;
echo '';