summaryrefslogtreecommitdiff
path: root/src/patchroot.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/patchroot.sh')
-rwxr-xr-xsrc/patchroot.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/patchroot.sh b/src/patchroot.sh
new file mode 100755
index 0000000..738beac
--- /dev/null
+++ b/src/patchroot.sh
@@ -0,0 +1,43 @@
1#!/bin/sh
2
3pkgs='avahi-daemon git tmux btrfs-tools/jessie-backports sshfs eject'
4pkgs="$pkgs $(cat initrd-dependencies.txt)"
5pkgs="$pkgs linux-image-$(uname -r)/jessie-backports"
6
7default_sources_list()
8{
9 cat <<'END'
10deb http://httpredir.debian.org/debian jessie main contrib non-free
11deb http://security.debian.org jessie/updates main contrib non-free
12deb http://httpredir.debian.org/debian jessie-backports main contrib non-free
13deb-src http://httpredir.debian.org/debian jessie main contrib non-free
14deb-src http://security.debian.org jessie/updates main contrib non-free
15deb-src http://httpredir.debian.org/debian jessie-backports main contrib non-free
16END
17}
18
19network_devs()
20{
21 ip -oneline link |
22 while read _ dev _; do
23 echo ${dev%:}
24 done
25}
26
27if [ -e /root/sources.list ]; then
28 cp /root/sources.list /etc/apt/sources.list
29else
30 default_sources_list > /etc/apt/sources.list
31fi
32
33if [ -e /sys/module/hid_apple/parameters/fnmode ]; then
34 echo 2 > /sys/module/hid_apple/parameters/fnmode
35fi
36echo options hid_apple fnmode=2 > /etc/modprobe.d/apple.conf
37
38if [ "$(ifquery -a --list)" = lo ]; then
39 # No configured interfaces. Do something!
40 dhclient $(network_devs)
41fi
42apt-get update
43apt-get -y install --no-upgrade $pkgs