summaryrefslogtreecommitdiffstats
path: root/ship/src/remaster_arch_filehooker
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2014-03-13 21:05:45 +0100
committermakefu <github@syntax-fehler.de>2014-03-13 21:05:45 +0100
commitb61b596741a1ae3be0c188a648efd9ad619407bb (patch)
treeff476ca3f70f138c734b6a79dcb831f2e25b0b4c /ship/src/remaster_arch_filehooker
parent323ca2ae1a5eb668ae6577e7eb43c62c61735709 (diff)
generalize install stick remastering
Diffstat (limited to 'ship/src/remaster_arch_filehooker')
-rwxr-xr-xship/src/remaster_arch_filehooker106
1 files changed, 0 insertions, 106 deletions
diff --git a/ship/src/remaster_arch_filehooker b/ship/src/remaster_arch_filehooker
deleted file mode 100755
index 54f0b082..00000000
--- a/ship/src/remaster_arch_filehooker
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/sh
-#@include core
-#@include iso
-#@mainifyme
-
-## TODO: provide a parameter which defines what to be done in the new iso root
-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
-auto_url=conf.krebsco.de/filehooker_install
-info "bdir is at $bdir"
-[ ! -e "$isofile" ] && die "$isofile does not exist."
-esudo "$@"
-arch_label="$(get_volid "$isofile")"
-info "Arch iso label is ${arch_label}"
-
-
-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
- die 'we are not root enough to mount the iso.'
-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 'not mounted'"
-
- info "Starting of the rootdir verkrepelung"
- # do the magic here
- arch-chroot $rootdir/$arch <<EOF
- cat >> /root/.zshrc<<EOL
-cat << EOD
-This is the Krebs Autoinstaller, we will do all the right things.
-Just Wait until everything finished.
-
-- Make sure that RJ45 is connected
-- you can bail out of the progress at any time with CTRL-C
-
- /krebs/autoinstall <install-disk (/dev/sdx)>
-EOD
-# /krebs/autoinstall
-EOL
-
- : \${1?\$0 <install-disk (/dev/sdx)>}
- mkdir /krebs
- cat > /krebs/autoinstall <<EOL
-internet() { ping -w 1 google.de >/dev/null 2>&1; }
-while ! internet;do
- echo "no Internet yet, waiting ..."
- sleep 3
-done
-
-echo "Grabbing current version of install-script from $auto_url"
-echo
-echo "AGENTS ARE GOOOOOOOOOOO!"
-curl $auto_url 2>/dev/null | sh -s "\\\$@"
-EOL
-chmod 755 /krebs/autoinstall
-EOF
- info "deleting old squashfs"
- rm "$isodir/arch/$arch/root-image.fs.sfs"
- info "creating squashfs at $isodir/arch/$arch/root-image.fs.sfs"
- umount "$rootdir/$arch"
- mksquashfs "$outdir/$arch/root-image.fs" "$isodir/arch/$arch/root-image.fs.sfs"
-done
-
-info "creating Iso Image"
-rm -f "${outdir}/${outfile}"
-xorriso -as mkisofs \
- -iso-level 3 \
- -full-iso9660-filenames \
- -volid "ARCH_201311" \
- -appid "Shackspace Krebs Installer" \
- -publisher "Shackspace/Krebs" \
- -preparer "prepared by krebs" \
- -eltorito-boot isolinux/isolinux.bin \
- -eltorito-catalog isolinux/boot.cat \
- -no-emul-boot -boot-load-size 4 -boot-info-table \
- -isohybrid-mbr ${isomnt}/isolinux/isohdpfx.bin \
- -output "${outdir}/${outfile}" \
- "$isodir"
-