From 5fad94d3f0436662d8abdafd6d4736b081665e5f Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Fri, 29 Apr 2016 17:55:45 -0400 Subject: path independence achieved? --- Makefile | 34 ++++++++++++++-------------------- initramfs-tools/hooks/samizdat | 2 -- src/initrd.sh | 4 ++-- src/keygen.sh | 2 +- src/samizdat-paths.sh | 19 ++++++++++++------- src/xorriso-usb.sh | 2 +- 6 files changed, 30 insertions(+), 33 deletions(-) diff --git a/Makefile b/Makefile index f986b4d..1a80964 100644 --- a/Makefile +++ b/Makefile @@ -1,26 +1,20 @@ -PACKAGE=samizdat-rhizome -prefix=/usr/local -exec_prefix=${prefix} -bindir=${exec_prefix}/bin -# libdir=${exec_prefix}/lib -# includedir=${prefix}/include -# datarootdir=${prefix}/share -# datadir=${datarootdir} -# mandir=${datarootdir}/man -# infodir=${datarootdir}/info -# docdir=${datarootdir}/doc/${PACKAGE} -# sysconfdir=$(prefix)/etc -# libexecdir=$(exec_prefix)/libexec - all: @echo unimplemented bin_programs=$(addprefix src/, xorriso-usb.sh btrfs-functions.sh btrfs-receive-root.sh btrfs-send-root.sh var.sh grub-efi.sh keygen.sh initrd.sh samizdat-paths.sh qemu.sh) -data_files= -libexec_programs= -install: - install ${bin_programs} ${bindir} +initrd_files:=$(wildcard src/initrd/*) +initramfs_conf_files:=$(wildcard initramfs-tools/*) -# install ${libexec_programs} ${libexecdir} -# install ${data_files} ${datadir}/${PACKAGE} +include src/samizdat-paths.sh + +install: + install ${bin_programs} ${samizdat_bindir} + mkdir -p ${samizdat_initrd_files_dir} + mkdir -p ${samizdat_child_dir} + mkdir -p ${samizdat_grub_efi_dir} + mkdir -p ${samizdat_initramfs_conf_dir} + mkdir -p ${samizdat_isolinux_dir} + mkdir -p ${samizdat_linux_dir} + cp -r ${initrd_files} ${samizdat_initrd_files_dir} + cp -r ${initramfs_conf_files} ${samizdat_initramfs_conf_dir} diff --git a/initramfs-tools/hooks/samizdat b/initramfs-tools/hooks/samizdat index db2fd1c..c02b8c6 100755 --- a/initramfs-tools/hooks/samizdat +++ b/initramfs-tools/hooks/samizdat @@ -8,8 +8,6 @@ CopyExec() { copy_exec "$@" || exit 1; } PATH=/usr/local/bin:$PATH . samizdat-paths.sh -set -x - repo_execs=$(echo "${samizdat_initrd_files_dir}"/*) path_execs='mountpoint openvt rsync gpg2 gpg-agent pinentry-curses truncate cryptsetup mkfs.btrfs btrfs fsck.hfsplus' diff --git a/src/initrd.sh b/src/initrd.sh index 0bc1ed7..5c3013a 100755 --- a/src/initrd.sh +++ b/src/initrd.sh @@ -2,8 +2,8 @@ . samizdat-paths.sh -initrd=${samizdat_isolinux_dir}/linux/initrd.img -vmlinuz=${samizdat_isolinux_dir}/linux/vmlinuz +initrd=${samizdat_linux_dir}/initrd.img +vmlinuz=${samizdat_linux_dir}/vmlinuz version=$(uname -r) version=4.5.0-0.bpo.1-amd64 diff --git a/src/keygen.sh b/src/keygen.sh index 801010a..f952cec 100755 --- a/src/keygen.sh +++ b/src/keygen.sh @@ -2,7 +2,7 @@ gpg_set_ultimate_trust() { - local keygrip d + local keygrip keygrip=$(gpg -K --with-colons --with-fingerprint --with-fingerprint|sed -ne '/^sec/{n;p;q}'|cut -d: -f10) printf '%s:6:\n' "$keygrip" | gpg2 --import-ownertrust } diff --git a/src/samizdat-paths.sh b/src/samizdat-paths.sh index 94c4312..fc6468d 100644 --- a/src/samizdat-paths.sh +++ b/src/samizdat-paths.sh @@ -1,8 +1,13 @@ -samizdat_initrd_files_dir=/home/d/sami/src/initrd +# Note: this file is both shell script and make file +samizdat_libdir=/usr/local/lib/samizdat-rhizome +samizdat_bindir=/usr/local/bin + + samizdat_initrd_files_dir=${samizdat_libdir}/initrd + samizdat_child_dir=${samizdat_libdir}/child + samizdat_isolinux_dir=${samizdat_libdir}/isolinux + samizdat_linux_dir=${samizdat_libdir}/isolinux/linux + samizdat_grub_efi_dir=${samizdat_libdir}/grub-efi +samizdat_initramfs_conf_dir=${samizdat_libdir}/initramfs-tools + +samizdat_iso_dir=. samizdat_execs_dir=/home/d/src/samizdat -samizdat_child_dir=/home/d/sami/child -samizdat_isolinux_dir=/home/d/sami/isolinux -samizdat_grub_efi_dir=/home/d/sami/grub-efi -samizdat_iso_dir=/home/d/sami -samizdat_initramfs_conf_dir=/home/d/sami/initramfs-tools -PATH=/usr/local/samizdat/bin:${PATH} diff --git a/src/xorriso-usb.sh b/src/xorriso-usb.sh index 7ff9825..01fd436 100644 --- a/src/xorriso-usb.sh +++ b/src/xorriso-usb.sh @@ -6,7 +6,7 @@ outdev= volid=SamizdatLive gpg_iso_path=gnupghome gnupghome= -child_dir=$samizdat_child_dir +child_dir=$samizdat_child_dir/child.$$ vmlinuz_dir=$samizdat_isolinux_dir efi_dir=$samizdat_grub_efi_dir -- cgit v1.2.3