From be7f471ff83fc68b09ddde94a45a58d665849d3b Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 13 Nov 2013 10:46:51 +0100 Subject: ship: remaster_iso -> remaster_arch_iso --- ship/src/remaster_arch_iso | 94 ++++++++++++++++++++++++++++++++++++++++++++++ ship/src/remaster_iso | 84 ----------------------------------------- 2 files changed, 94 insertions(+), 84 deletions(-) create mode 100755 ship/src/remaster_arch_iso delete mode 100755 ship/src/remaster_iso (limited to 'ship') diff --git a/ship/src/remaster_arch_iso b/ship/src/remaster_arch_iso new file mode 100755 index 00000000..dcbdb7ec --- /dev/null +++ b/ship/src/remaster_arch_iso @@ -0,0 +1,94 @@ +#!/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 +auto_url=euer.krebsco.de/autoinstall +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 'not mounted'" + + info "Starting of the rootdir verkrepelung" + # do the magic here + arch-chroot $rootdir/$arch <> /root/.zshrc< /krebs/autoinstall </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 +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" +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" + diff --git a/ship/src/remaster_iso b/ship/src/remaster_iso deleted file mode 100755 index c11f1f57..00000000 --- a/ship/src/remaster_iso +++ /dev/null @@ -1,84 +0,0 @@ -#!/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 -auto_url=euer.krebsco.de/autoinstall -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 'not mounted'" - - info "Starting of the rootdir verkrepelung" - # do the magic here - arch-chroot $rootdir/$arch <> /root/.zshrc< /krebs/autoinstall </dev/null | sh -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" -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" - -- cgit v1.2.3