summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xinitramfs-tools/hooks/samizdat4
-rw-r--r--initramfs-tools/scripts/samizdat7
-rwxr-xr-xpatchroot.sh38
3 files changed, 49 insertions, 0 deletions
diff --git a/initramfs-tools/hooks/samizdat b/initramfs-tools/hooks/samizdat
index c71dada..d09c660 100755
--- a/initramfs-tools/hooks/samizdat
+++ b/initramfs-tools/hooks/samizdat
@@ -15,6 +15,10 @@ for c in $path_execs; do CopyExec "$(which $c)" /bin; done
15CopyExec /bin/openvt /bin/OpenVT 15CopyExec /bin/openvt /bin/OpenVT
16CopyExec /sbin/losetup /bin/LoSetup 16CopyExec /sbin/losetup /bin/LoSetup
17 17
18CopyExec patchroot.sh /patchroot/patchroot.sh
19CopyExec /etc/apt/sources.list /patchroot/sources.list
20CopyExec initrd-dependencies.txt /patchroot/initrd-dependencies.txt
21
18absolute_path_copies='/lib/terminfo/l/linux' 22absolute_path_copies='/lib/terminfo/l/linux'
19 23
20for f in $absolute_path_copies; do CopyExec "$f" "$f"; done 24for f in $absolute_path_copies; do CopyExec "$f" "$f"; done
diff --git a/initramfs-tools/scripts/samizdat b/initramfs-tools/scripts/samizdat
index 2bc16f8..374d95d 100644
--- a/initramfs-tools/scripts/samizdat
+++ b/initramfs-tools/scripts/samizdat
@@ -9,8 +9,15 @@ mountroot()
9 bootmenu 9 bootmenu
10 bootwait root-mounted 10 bootwait root-mounted
11 chvt 1 11 chvt 1
12 patchroot
13}
12 14
15patchroot()
16{
17 echo -n 'Patching root... ' >&2
13 sed -i -e 's/^root:x:/root::/' /root/etc/passwd 18 sed -i -e 's/^root:x:/root::/' /root/etc/passwd
19 cp /patchroot/* /root/root/
20 echo 'done.' >&2
14} 21}
15 22
16samizdat_install_udev_rules() 23samizdat_install_udev_rules()
diff --git a/patchroot.sh b/patchroot.sh
new file mode 100755
index 0000000..e211377
--- /dev/null
+++ b/patchroot.sh
@@ -0,0 +1,38 @@
1#!/bin/sh
2
3pkgs='avahi-daemon git tmux btrfs-tools/jessie-backports sshfs'
4pkgs="$pkgs $(cat initrd-dependencies.txt)"
5pkgs="$pkgs linux-image-$(uname -r)"
6
7default_sources_list()
8{
9 cat <<'END'
10deb http://httpredir.debian.org/debian jessie main non-free
11deb http://security.debian.org jessie/updates main non-free
12deb http://httpredir.debian.org/debian jessie-backports main non-free
13deb-src http://httpredir.debian.org/debian jessie main non-free
14deb-src http://security.debian.org jessie/updates main non-free
15deb-src http://httpredir.debian.org/debian jessie-backports main 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 [ "$(ifquery -a --list)" = lo ]; then
34 # No configured interfaces. Do something!
35 dhclient $(network_devs)
36fi
37apt-get update
38apt-get -y install --no-upgrade $pkgs