diff options
Diffstat (limited to 'rootfs')
-rw-r--r-- | rootfs/.gitignore | 1 | ||||
-rw-r--r-- | rootfs/Makefile | 10 | ||||
-rwxr-xr-x | rootfs/prefetch-packages.sh | 4 | ||||
-rwxr-xr-x | rootfs/samizdat-hostname.sh | 26 | ||||
-rwxr-xr-x | rootfs/samizdat-patch-root.sh | 3 | ||||
-rwxr-xr-x | rootfs/samizdat-update-apt-cache.sh (renamed from rootfs/patchroot.sh) | 12 | ||||
-rw-r--r-- | rootfs/samizdat-wip.yaml | 12 | ||||
-rw-r--r-- | rootfs/samizdat.patch.yaml | 12 | ||||
-rw-r--r-- | rootfs/samiztest.yaml | 9 |
9 files changed, 64 insertions, 25 deletions
diff --git a/rootfs/.gitignore b/rootfs/.gitignore new file mode 100644 index 0000000..477634d --- /dev/null +++ b/rootfs/.gitignore | |||
@@ -0,0 +1 @@ | |||
*~tmp | |||
diff --git a/rootfs/Makefile b/rootfs/Makefile index 6696c14..9e4e15a 100644 --- a/rootfs/Makefile +++ b/rootfs/Makefile | |||
@@ -6,7 +6,13 @@ endif | |||
6 | 6 | ||
7 | sudo := $(shell [ "$$(id -u)" = 0 ] || echo sudo) | 7 | sudo := $(shell [ "$$(id -u)" = 0 ] || echo sudo) |
8 | 8 | ||
9 | rootfs = samiztest | 9 | rootfs ?= samizdat.btrfs |
10 | patchfs ?= samizdat.patch.btrfs | ||
10 | 11 | ||
11 | all: | 12 | .PHONY: all rootfs patchfs |
13 | all: rootfs $(ifneq $(patchfs),,patchfs) | ||
14 | |||
15 | rootfs $(rootfs): | ||
12 | $(sudo) $(fsmgr) build $(rootfs) | 16 | $(sudo) $(fsmgr) build $(rootfs) |
17 | patchfs $(patchfs): $(rootfs) | ||
18 | $(sudo) $(fsmgr) build $(patchfs) | ||
diff --git a/rootfs/prefetch-packages.sh b/rootfs/prefetch-packages.sh new file mode 100755 index 0000000..3d19c14 --- /dev/null +++ b/rootfs/prefetch-packages.sh | |||
@@ -0,0 +1,4 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | apt-get -yd install baresip wicd connman network-manager | ||
4 | apt-mark install baresip | ||
diff --git a/rootfs/samizdat-hostname.sh b/rootfs/samizdat-hostname.sh new file mode 100755 index 0000000..52837ba --- /dev/null +++ b/rootfs/samizdat-hostname.sh | |||
@@ -0,0 +1,26 @@ | |||
1 | #!/bin/sh | ||
2 | hostnames() | ||
3 | { | ||
4 | cat <<EOF | ||
5 | adam | ||
6 | billy | ||
7 | cletus | ||
8 | doris | ||
9 | elaine | ||
10 | frank | ||
11 | gilbert | ||
12 | hilda | ||
13 | EOF | ||
14 | } | ||
15 | |||
16 | next_hostname() | ||
17 | { | ||
18 | h=$(hostname) || exit | ||
19 | hostnames | sed -n "/^${h}\$/ {n;p;q}" || exit | ||
20 | } | ||
21 | |||
22 | set -x | ||
23 | hostname=$(next_hostname) | ||
24 | [ "$hostname" ] || hostname=$(hostnames | head -n1) | ||
25 | printf '%s\n' "$hostname" > /etc/hostname | ||
26 | sed -i -e 's/\blocalhost\b/& '"$hostname"'/' /etc/hosts | ||
diff --git a/rootfs/samizdat-patch-root.sh b/rootfs/samizdat-patch-root.sh new file mode 100755 index 0000000..296ef78 --- /dev/null +++ b/rootfs/samizdat-patch-root.sh | |||
@@ -0,0 +1,3 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | true | ||
diff --git a/rootfs/patchroot.sh b/rootfs/samizdat-update-apt-cache.sh index 76eb26a..83751a3 100755 --- a/rootfs/patchroot.sh +++ b/rootfs/samizdat-update-apt-cache.sh | |||
@@ -1,11 +1,8 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | hostname=adam | 2 | # TODO: Write this in fsmgr |
3 | echo $hostname > /etc/hostname | ||
4 | sed -i -e 's/\blocalhost\b/& '"$hostname"'/' /etc/hosts | ||
5 | 3 | ||
6 | . /etc/os-release | 4 | . /etc/os-release |
7 | 5 | ||
8 | # TODO: Write this in fsmgr | ||
9 | cat <<END > /etc/apt/sources.list | 6 | cat <<END > /etc/apt/sources.list |
10 | deb http://httpredir.debian.org/debian ${VERSION_CODENAME} main #contrib non-free | 7 | deb http://httpredir.debian.org/debian ${VERSION_CODENAME} main #contrib non-free |
11 | deb http://security.debian.org ${VERSION_CODENAME}/updates main #contrib non-free | 8 | deb http://security.debian.org ${VERSION_CODENAME}/updates main #contrib non-free |
@@ -15,9 +12,8 @@ END | |||
15 | set -- /var/lib/apt/lists/*_Packages | 12 | set -- /var/lib/apt/lists/*_Packages |
16 | if [ -f "$1" ] | 13 | if [ -f "$1" ] |
17 | then | 14 | then |
18 | # apt database validity demonstration | 15 | apt-get update || exit |
19 | apt-get update | ||
20 | apt-cache dumpavail | dpkg --update-avail - | 16 | apt-cache dumpavail | dpkg --update-avail - |
21 | apt-get -yd install iso-codes # baresip | 17 | else |
22 | apt-mark install baresip | 18 | false |
23 | fi | 19 | fi |
diff --git a/rootfs/samizdat-wip.yaml b/rootfs/samizdat-wip.yaml index 36d6fe7..afb92ea 100644 --- a/rootfs/samizdat-wip.yaml +++ b/rootfs/samizdat-wip.yaml | |||
@@ -1,12 +1,12 @@ | |||
1 | parent: kernel | 1 | parent: kernel |
2 | unpack-only: false | 2 | unpack-only: false |
3 | packages: | 3 | packages: |
4 | - ../openssh-client_7.9p1-10_$(debarch).deb | 4 | - ../openssh-client_8.3p1-1_$(debarch).deb |
5 | - ../openssh-server_7.9p1-10_$(debarch).deb | 5 | - ../openssh-server_8.3p1-1_$(debarch).deb |
6 | - ../openssh-sftp-server_7.9p1-10_$(debarch).deb | 6 | - ../openssh-sftp-server_8.3p1-1_$(debarch).deb |
7 | # ../openssh-tests_7.9p1-10_$(debarch).deb | 7 | # ../openssh-tests_8.3p1-1_$(debarch).deb |
8 | - ../ssh_7.9p1-10_all.deb | 8 | - ../ssh_8.3p1-1_all.deb |
9 | - ../ssh-askpass-gnome_7.9p1-10_$(debarch).deb | 9 | - ../ssh-askpass-gnome_8.3p1-1_$(debarch).deb |
10 | 10 | ||
11 | - dnsutils | 11 | - dnsutils |
12 | - cron | 12 | - cron |
diff --git a/rootfs/samizdat.patch.yaml b/rootfs/samizdat.patch.yaml new file mode 100644 index 0000000..d2d5314 --- /dev/null +++ b/rootfs/samizdat.patch.yaml | |||
@@ -0,0 +1,12 @@ | |||
1 | parent: samizdat | ||
2 | seedme: 600000000 | ||
3 | apt-update: true | ||
4 | binaries: | ||
5 | - './samizdat-update-apt-cache.sh' | ||
6 | - './samizdat-patch-root.sh' | ||
7 | - './samizdat-hostname.sh' | ||
8 | chroot-commands: | ||
9 | - "/usr/local/bin/samizdat-update-apt-cache.sh" | ||
10 | - "/usr/local/bin/samizdat-patch-root.sh" | ||
11 | - "/usr/local/bin/samizdat-hostname.sh" | ||
12 | |||
diff --git a/rootfs/samiztest.yaml b/rootfs/samiztest.yaml deleted file mode 100644 index 42ca627..0000000 --- a/rootfs/samiztest.yaml +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | parent: samizdat | ||
2 | binaries: | ||
3 | - './patchroot.sh' | ||
4 | seedme: 600000000 | ||
5 | apt-update: true | ||
6 | |||
7 | chroot-commands: | ||
8 | - "/usr/local/bin/patchroot.sh" | ||
9 | |||