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