summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoru <u@billy>2023-11-17 18:49:37 -0500
committeru <u@billy>2023-11-19 07:14:19 -0500
commit3bbb985b7f95a7c39f272bb716cfcc1bfe906c63 (patch)
treed198b6b2756914f42ca6dcaf9b671b26279cdb54 /src
parentd8c6be3b252ccb6379442d1ff3dd41e96290b3b6 (diff)
remove more samizdat-paths cruft
Diffstat (limited to 'src')
-rw-r--r--src/btrfs-send-root.sh45
-rw-r--r--src/dnsmasq-dhcp-script.sh82
-rw-r--r--src/samizdat-paths.in13
-rw-r--r--src/samizdat-paths.sh13
4 files changed, 0 insertions, 153 deletions
diff --git a/src/btrfs-send-root.sh b/src/btrfs-send-root.sh
deleted file mode 100644
index 8a3a513..0000000
--- a/src/btrfs-send-root.sh
+++ /dev/null
@@ -1,45 +0,0 @@
1#!/bin/sh
2. samizdat-paths.sh
3. var.sh
4. btrfs-functions.sh
5
6rootfs_uuid ()
7{
8 btrfs filesystem show / | sed -ne 's/.*uuid: //p'
9}
10
11remote_btrfs_receiver()
12{
13# ssh "$BTRFS_RECEIVE_DESTINATION_HOST" -- "sudo btrfs receive $(shellescape "$BTRFS_RECEIVE_DESTINATION_PATH")"
14 ssh "$BTRFS_RECEIVE_DESTINATION_HOST" -- \
15 "sudo sh sami/btrfs-receive-root.sh $(shellescape "$BTRFS_RECEIVE_DESTINATION_PATH") $(shellescape "$BTRFS_RECEIVE_SUBVOLUME_NAME")"
16}
17
18dummy_receiver()
19{
20 true
21}
22
23push_remote()
24{
25 $(ARGS_NE mnt src ssh_dst)
26
27 now=$(date +%F.%H%M%S) || die
28 snap_dir=$mnt/snapshot.$now
29 prev_dir=$mnt/SEED
30
31 case "$ssh_dst" in
32 *:*) ;;
33 *) return 1;;
34 esac
35 local BTRFS_RECEIVE_DESTINATION_PATH="${ssh_dst#*:}"
36 local BTRFS_RECEIVE_DESTINATION_HOST="${ssh_dst%%:*}"
37 local BTRFS_RECEIVE_SUBVOLUME_NAME="${snap_dir#$mnt/}"
38 push_helper false "$snap_dir" "$prev_dir" "$src" remote_btrfs_receiver
39}
40
41ssh_dst=d@fifty.local:sami/test_dest
42
43mkdir -p /mnt/rootfs || die
44mountpoint -q /mnt/rootfs || mount -o subvol=/ UUID=$(rootfs_uuid) /mnt/rootfs || die
45push_remote /mnt/rootfs / "$ssh_dst"
diff --git a/src/dnsmasq-dhcp-script.sh b/src/dnsmasq-dhcp-script.sh
deleted file mode 100644
index 7469447..0000000
--- a/src/dnsmasq-dhcp-script.sh
+++ /dev/null
@@ -1,82 +0,0 @@
1#!/bin/sh
2[ "$1" = tftp ] || exit 0
3. samizdat-paths.sh
4TFTP_ROOT=${samizdat_isolinux_dir}
5TFTP_FILE=$4
6TFTP_FILE_SIZE=$3
7CLIENT_IP=$3
8
9# dnsmasq clears the environment. kiki needs at least $HOME
10export USER=root
11export MAIL=/var/mail/root
12export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
13export LANG=en_US.UTF-8
14export HOME=/root
15export LANGUAGE=en_US:en
16export LOGNAME=root
17
18debug()
19{
20 LOGDIR=/var/log/dnsmasq-dhcp-script
21 mkdir -p "$LOGDIR"
22 exec > "$LOGDIR/$$.log" 2>&1
23 set -x
24}
25
26new_child()
27{
28 child_dir=$samizdat_child_dir/child.$$
29 if [ -d "$child_dir" ]; then
30 rmdir "$child_dir" || exit 1
31 fi
32
33 sh -x "$(which keygen.sh)" "$child_dir" || return
34 tar --exclude '*~' -zcf "$child_dir"/gnupghome.tar -C "$child_dir"/root/.gnupg . || return
35
36 tftp_dir="${TFTP_ROOT}"/"$CLIENT_IP"
37 if [ ! -d "$tftp_dir" ]; then
38 ATOMIC=y
39 dest_dir="$tftp_dir"~
40
41 # DNSMASQ DOCUMENTATION IS WRONG OMFG
42 # Otherwise this symlink farm would be unnecessary
43
44 mkdir -p "$dest_dir"
45 (cd "$dest_dir" && ln -sf ../* . && rm "$CLIENT_IP"~) || return
46 else
47 dest_dir="$tftp_dir"
48 fi
49
50 chown dnsmasq "$child_dir" "$child_dir"/gnupghome.tar
51 ln -sf "$child_dir"/gnupghome.tar "$dest_dir"/
52
53 if [ "$ATOMIC" ]; then
54 mv -T "$dest_dir" "$tftp_dir"
55 fi
56}
57
58cleanup_after_fail()
59{
60 umount "$child_dir"
61 rmdir "$child_dir"
62}
63
64exit_unless_needed()
65{
66
67 case "$TFTP_FILE" in
68 "${TFTP_ROOT}/linux/vmlinuz")
69 ;;
70 "${TFTP_ROOT}/${CLIENT_IP}/linux/vmlinuz")
71 [ -e "${TFTP_ROOT}/${CLIENT_IP}/gnupghome.tar" ] && exit
72 ;;
73 *) exit
74 ;;
75 esac
76}
77
78exit_unless_needed
79
80debug
81
82(new_child || cleanup_after_fail) &
diff --git a/src/samizdat-paths.in b/src/samizdat-paths.in
deleted file mode 100644
index c3037d3..0000000
--- a/src/samizdat-paths.in
+++ /dev/null
@@ -1,13 +0,0 @@
1# Note: this file is both shell script and make file
2
3samizdat_libdir=PREFIX/lib/samizdat-rhizome
4samizdat_bindir=PREFIX/bin
5
6 samizdat_initrd_files_dir=${samizdat_libdir}/initrd
7 samizdat_child_dir=${samizdat_libdir}/child
8 samizdat_isolinux_dir=${samizdat_libdir}/isolinux
9 samizdat_linux_dir=${samizdat_libdir}/isolinux/linux
10 samizdat_grub_efi_dir=${samizdat_libdir}/grub-efi
11samizdat_initramfs_conf_dir=/etc/initramfs-tools
12
13samizdat_iso_dir=.
diff --git a/src/samizdat-paths.sh b/src/samizdat-paths.sh
deleted file mode 100644
index 6548564..0000000
--- a/src/samizdat-paths.sh
+++ /dev/null
@@ -1,13 +0,0 @@
1# Note: this file is both shell script and make file
2samizdat_libdir=/usr/local/lib/samizdat-rhizome
3samizdat_bindir=/usr/local/bin
4
5 samizdat_initrd_files_dir=${samizdat_libdir}/initrd
6 samizdat_child_dir=${samizdat_libdir}/child
7 samizdat_isolinux_dir=${samizdat_libdir}/isolinux
8 samizdat_linux_dir=${samizdat_libdir}/isolinux/linux
9 samizdat_grub_efi_dir=${samizdat_libdir}/grub-efi
10samizdat_initramfs_conf_dir=${samizdat_libdir}/initramfs-tools
11
12samizdat_iso_dir=.
13samizdat_execs_dir=${samizdat_bindir}