summaryrefslogtreecommitdiffstats
path: root/ship/src
diff options
context:
space:
mode:
authortv <tv@nomic.retiolum>2013-11-12 15:33:49 +0100
committertv <tv@nomic.retiolum>2013-11-12 15:33:49 +0100
commit021dd964ba41665562430e87f75ed53380459a68 (patch)
tree55f88e2391539b40afc2c952a66dcb2c43f2db30 /ship/src
parenta6012ff33c05593f4c73b7de55ce09915b6327f9 (diff)
parent8b60dff25e85921fe533f621a1b5d0f8149bf38f (diff)
Merge branch 'master' of https://github.com/krebscode/painload
Diffstat (limited to 'ship/src')
-rwxr-xr-xship/src/remaster_iso64
-rwxr-xr-xship/src/tor_publish_ssh17
2 files changed, 67 insertions, 14 deletions
diff --git a/ship/src/remaster_iso b/ship/src/remaster_iso
new file mode 100755
index 00000000..a10034c9
--- /dev/null
+++ b/ship/src/remaster_iso
@@ -0,0 +1,64 @@
+#!/bin/sh
+#@include core
+set -efu
+isofile=${1:-archlinux-2013.06.01-dual.iso}
+outfile=$(basename ${isofile%.iso}.krebs.iso)
+info "outfile will be at $outfile"
+bdir=${bdir:-$HOME/build/arch}
+isodir=$bdir/iso
+isomnt=$bdir/isomount
+rootdir=$bdir/root
+outdir=$bdir/out
+info "bdir is at $bdir"
+[ ! -e "$isofile" ] && die "$isofile does not exist,bailing out"
+esudo "$@"
+
+
+#punani install genisoimage
+
+
+info "cleanup root dir"
+rm -rf $bdir
+mkdir -p $isomnt $rootdir
+info "mounting isofile ($isofile)"
+if is_root;then
+ mount -t iso9660 -o loop,ro $isofile $isomnt
+else
+ error "we are not root enough to mount the iso. Bailing Out"
+ exit 1
+
+fi
+defer "info 'unmounting $isomnt';umount $isomnt"
+
+info "copying from '$isomnt' to '$isodir'"
+cp -a "$isomnt" "$isodir"
+defer "info 'removing $isodir';rm -rf $isodir"
+info "extracting root-image squashfs"
+# we will not touch the kernel ... yet
+
+for arch in x86_64 i686;do
+ info "unpacking $isomnt/arch/$arch/root-image.fs.sfs"
+ mkdir -p "$outdir/$arch"
+ defer "info 'removing $outdir/$arch';rm -rf $outdir/$arch"
+ mkdir -p "$rootdir/$arch"
+ defer "info 'removing $rootdir/$arch';rm -rf $rootdir/$arch"
+ unsquashfs -f -d "$outdir/$arch" "$isodir/arch/$arch/root-image.fs.sfs"
+
+ mount "$outdir/$arch/root-image.fs" "$rootdir/$arch"
+ defer "info 'unmounting $rootdir/$arch';umount $rootdir/$arch"
+
+ info "Starting of the rootdir verkrepelung"
+ # do the magic here
+ arch-chroot $rootdir/$arch <<EOF
+ uname -a
+EOF
+ info "creating squashfs at $isodir/arch/$arch/root-image.fs.sfs"
+ mksquashfs "$outdir/$arch/root-image.fs" "$isodir/arch/$arch/root-image.fs.sfs" -noappend
+done
+
+info "creating Iso Image"
+genisoimage -l -r -J -V "ARCH_$(date +%Y%m)" \
+ -b isolinux/isolinux.bin -no-emul-boot \
+ -boot-load-size 4 -boot-info-table -c isolinux/boot.cat \
+ -o "$outdir/$outfile" "$isodir" | to_dots
+
diff --git a/ship/src/tor_publish_ssh b/ship/src/tor_publish_ssh
index df904444..14cb9cb4 100755
--- a/ship/src/tor_publish_ssh
+++ b/ship/src/tor_publish_ssh
@@ -2,24 +2,13 @@
#@include core
#@include network
#@include punani
-# can be set via env:
-# torrc - path to torrc (default: /etc/tor/torrc )
-# hidden_service_dir - path to hidden service (default: /var/lib/tor/hidden_service/ )
+#@include tor
+
-torrc=${torrc:-/etc/tor/torrc}
-hidden_service_dir=${hidden_service_dir:-/var/lib/tor/hidden_service/}
punani install tor
test -w "$torrc" || ( error "$torrc is not writable!"; exit 1 ) || exit 1
-if ! grep -q '^HiddenService' "$torrc" ;then
- info "adding hidden service to $torrc"
- cat >> "$torrc" << EOF
-HiddenServiceDir ${hidden_service_dir}
-HiddenServicePort 22 127.0.0.1:22
-EOF
-else
- info "HiddenServiceDir or Port already in $torrc, skipping!"
-fi
+configure_hidden_service
cat $hidden_service_dir/hostname | send_irc