-
Notifications
You must be signed in to change notification settings - Fork 0
/
runit-go
executable file
·129 lines (117 loc) · 3.39 KB
/
runit-go
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
#!/bin/bash
HERE=$(
HERE=$(dirname $0)
[ -n "$HERE" ] && cd "$HERE"
pwd
)
. $HERE/funcs
#make a package list
[ ! -f "$HERE/old-pkgs.lst" ] && installed_packages >"$HERE/old-pkgs.lst"
#save /etc/systemd
[ ! -f "$HERE/etc_systemd.tar.bz2" ] && (cd /etc && tar cjf "$HERE/etc_systemd.tar.bz2" systemd)
tmp="$HOME/tmp"
[ ! -d $tmp ] && mkdir $tmp && chmod og-rwx $tmp
HOSTNAME="$(cat /proc/sys/kernel/hostname)"
LTZ="$(readlink /etc/localtime)"
LTZ="${LTZ#/usr/share/zoneinfo/}"
KEYBOARD="$(localectl status | sed -n -e'/VC Keymap:/{s/^.*:\s*//;s/\s*$//;p}')"
sudo sed -i -e'/^#\[testing\]/{
n
a\
[obarun]\
SigLevel=Never\
Server=http://www.obarun.org/src/$arch
}' /etc/pacman.conf
pacman -Syy
# update and get basic stuff
pacman -Su --noconfirm
pacman -S --needed base-devel git jshon expac sudo --needed --noconfirm
#get an aur installer
if ! is_package_installed packer-combined; then
(cd /tmp
wget https://bitbucket.org/replabrobin/packer/get/tip.tar.gz
tar xvf tip.tar.gz
cd replabrobin-packer-*
./packer -S packer-combined --noconfirm --noedit
cd ..
rm -rf replabrobin-packer-*
)
fi
pacman -S util-linux-nosystemd
# as it says
remove_systemd
#and these
pkg_remove --noconfirm --nodeps udev dbus procps-ng \
syslog-ng mkinitcpio polkit upower udisks2 \
util-linux libutil-linux
#now our desired replacements
for pkg in \
arch-runit \
arch-runit-services \
eudev-obarun \
eudev-systemdcompat \
dbus-nosystemd \
procps-ng-nosystemd \
syslog-ng-nosystemd \
mkinitcpio-nosystemd \
socklog \
polkit-consolekit \
consolekit \
upower-pm-utils \
udisks2-nosystemd \
;do
packer -S ${pkg} --skippgpcheck --noconfirm --noedit --makepkg-log ${tmp}/${pkg}.makepkg.log
done
#rebuild the initramfs
mkinitcpio -p linux
if is_package_installed "xorg-server" ; then
#avoid bringing in xorg-server
for pkg in \
xorg-xwrapper \
desktop-privileges \
;do
packer -S ${pkg} --noconfirm --noedit --makepkg-log ${tmp}/${pkg}.makepkg.log
done
fi
#set up our rc.conf
if [ -r /etc/rc.conf ]; then
sed -i -e'/^#HOSTNAME=/s/^.*$/HOSTNAME='"$HOSTNAME"'/
/^#TIMEZONE=/s[^.*$[TIMEZONE='"$LTZ"'[
/^#KEYMAP=/s[^.*$[KEYMAP='"${KEYBOARD}"'[
/^#FONT=/s[^.*$[FONT=lat9w-16[' /etc/rc.conf
else
(
echo "HOSTNAME='$HOSTNAME'"
echo "HARDWARECLOCK='UTC'"
echo "TIMEZONE='${LTZ}'"
echo "KEYMAP='${KEYBOARD}'"
echo "FONT='lat9w-16'"
) > /etc/rc.conf
fi
#for those like me that may have oblogout installed
if [ -r /etc/oblogout.conf ]; then
sed -i -e'/^\s*[commands]/,${
/^shutdown\s*=/s[^.*$[shutdown = /home/robin/bin/robin-sleep poweroff[
/^restart\s*=/s[^.*$[restart = /home/robin/bin/robin-sleep reboot[
/^hibernate\s*=/s[^.*$[hibernate = /home/robin/bin/robin-sleep hibernate[
/^suspend\s*=/s[^.*$[suspend = /home/robin/bin/robin-sleep suspend[
}
/^\s*buttons\s*=/s[^.*$[buttons = cancel, logout, suspend, hibernate, restart, shutdown, lock[' /etc/oblogout.conf
fi
#ensure we have a log user and group
if ! id -g log 2>/dev/null; then
groupadd -g 19 log
fi
if ! id -u log 2>/dev/null; then
useradd -M -g log -l -s /usr/bin/nologin -c 'socklog user' -r -u 19 log
fi
#link in some useful things
for x in unix klog; do
[ ! -d "/etc/sv/socklog-$x" ] && socklog-conf $x nobody log
ln -s ../../../sv/socklog-$x /etc/runit/runsvdir/current
done
pacman -R networkmanager --noconfirm
--aurpkg 'networkmanager-consolekit-[0-9]*'
pacman -S network-manager-nosystemd
packer -R ppp modemmanager rp-pppoe --noconfirm
installed_packages >"$HERE/new-pkgs.lst"