Newer
Older
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
#!/bin/bash
## This script was made for provide obarun environment. This scripts is under license BEER-WARE.
# "THE BEER-WARE LICENSE" (Revision 42):
# <eric@obarun.org> wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return. Eric Vidal
#shopt -s extglob
## Check is the functions file exits
sourcing(){
local list
for list in /tmp/obarun-install-tmp/{common_functions,install_functions,install.conf}; do
if [[ -f "${list}" ]]; then
source "${list}"
else
echo_error " Missing file : ${list}"
exit
fi
done
unset list
}
sourcing
shellopts_save
shellopts_set_unset "extglob" 0
custo_once() {
local _tmp
_tmp="/tmp/obarun-install-tmp"
if [[ ! -d $_tmp ]]; then
mkdir -p -m0750 $_tmp || die " Impossible to create $_tmp"
fi
if [[ ! -e $_tmp/customize.${1} ]]; then
$1 || die " Cannot execute $_"
touch $_tmp/customize.${1}
fi
unset _tmp
}
## Customize menu
customizeChroot_menu
# reload source file before using changed variable
source /tmp/obarun-install-tmp/install.conf
custo_once config_custofile
## Define resolv.conf
def_resolv(){
define_resolv
}
custo_once def_resolv
## Uncomment server in mirrorlist
mirrorlist(){
echo_display " Uncomment server in mirrorlist"
sed -i "s/#Server/Server/g" /etc/pacman.d/mirrorlist
}
custo_once mirrorlist
## Pacman stuff
pac_sync(){
echo_display " Synchronize database..."
if [[ ! -d /var/lib/pacman/sync ]]; then
pacman -Syy
else
pacman -Sy
fi
}
custo_once pac_sync
## Configure pacman.conf
config_pac(){
echo_display " Change pacman.conf configuration"
sed -i "s:SigLevel = Never.*#:SigLevel = Required DatabaseOptional:" /etc/pacman.conf
sed -i "s:#SigLevel = PackageRequired:SigLevel = PackageRequired:" /etc/pacman.conf
}
custo_once config_pac
## Check if gpg exist, if not launch pacman-key and add gpg signature
custo_once check_gpg
############################## only modifie this script after this line ############################
## Prepare socklog and install socklog
create_log_user(){
echo_display " Create user log, add {root,$NEWUSER} at log group"
useradd -M -N -s /usr/bin/nologin log
gpasswd -a root log
gpasswd -a "$NEWUSER" log
}
custo_once create_log_user
install_socklog(){
echo_display " Install socklog-obarun"
pacman -S socklog-obarun --noconfirm
}
custo_once install_socklog
## Configure Runit services
config_runit(){
echo_display " Create symlink for runit"
ln -sf /etc/sv/dbus /etc/runit/runsvdir/base
ln -sf /etc/sv/klog /etc/runit/runsvdir/base
ln -sf /etc/sv/socklog-unix /etc/runit/runsvdir/base
ln -sf /etc/sv/networkmanager /etc/runit/runsvdir/base
}
custo_once config_runit
rc_local(){
sed -i '1s/^/#!\/bin\/bash\n/' /etc/rc.local
sed -i '$a/usr/bin/pacopts applytmp' /etc/rc.local
}
custo_once rc_local
## Configure pulseaudio
config_pulse(){
echo "load-module module-device-manager" >> /etc/pulse/default.pa
}
custo_once config_pulse
## Remove systemd stuff
rm_systemd(){
echo_display " Removing systemd stuff"
rm -r /usr/lib/systemd
}
custo_once rm_systemd
## Install bootloader
install_boot(){
echo_display " Do you want to install ${green}[syslinux]${reset}${bold} bootloader [y|n] :"
reply_answer
if (( ! $? )); then
syslinux_menu
fi
}
custo_once install_boot
shellopts_restore
echo_valid " Customization terminate"