forked from hut/minirc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·32 lines (26 loc) · 1.04 KB
/
setup.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
#!/bin/sh
if [ "$1" != --force ]; then
echo "Please read the setup script and confirm that it doesn't break your system."
exit 1
fi
[ -z "$ROOT" ] && ROOT=
echo "==> Installing /sbin/rc, /etc/minirc.conf, /etc/inittab"
install -Dm755 rc "$ROOT"/sbin/rc
if [ -f "$ROOT"/etc/minirc.conf ]; then
echo ":: Warning: '$ROOT/etc/minirc.conf' already exists!"
echo " Moving it to '$ROOT/etc/minirc.conf.backup'."
mv "$ROOT"/etc/minirc.conf "$ROOT"/etc/minirc.conf.backup
fi
install -Dm644 minirc.conf "$ROOT"/etc/minirc.conf
install -Dm644 inittab "$ROOT"/etc/inittab
echo "==> Installing extras"
cd extra
install -Dm644 _minirc "$ROOT/usr/share/zsh/site-functions/_minirc"
install -Dm755 shutdown.sh "$ROOT/sbin/shutdown"
echo "==> Linking busybox to /sbin/{init,halt,poweroff,reboot}"
for i in init halt poweroff reboot; do
ln -sf $(which busybox) "$ROOT"/sbin/$i
done
echo ":: Append 'init=/sbin/init' to your kernel line in your bootloader"
echo " to replace your current init with minirc"
# Run "./setup.sh --force" to use the script