summaryrefslogtreecommitdiffstats
path: root/ship/src/remaster_arch_shack_installstick
diff options
context:
space:
mode:
authormakefu <root@pigstarter.de>2014-03-12 10:29:34 +0100
committermakefu <root@pigstarter.de>2014-03-12 10:29:34 +0100
commitb25891641316dcaf5c469a22b96393e6e55fc5fe (patch)
treebe8ae41f42ecb7a74782c673b65bc1d0da106961 /ship/src/remaster_arch_shack_installstick
parent93237ac6cc818b64b25e4781370e747766cbbbd6 (diff)
parent7049ff613d9be726a00571c8a62c4e5a93bc78f5 (diff)
Merge branch 'master' of https://github.com/krebscode/painload
Diffstat (limited to 'ship/src/remaster_arch_shack_installstick')
-rwxr-xr-xship/src/remaster_arch_shack_installstick34
1 files changed, 19 insertions, 15 deletions
diff --git a/ship/src/remaster_arch_shack_installstick b/ship/src/remaster_arch_shack_installstick
index 5ac29473..364e1958 100755
--- a/ship/src/remaster_arch_shack_installstick
+++ b/ship/src/remaster_arch_shack_installstick
@@ -1,23 +1,26 @@
#!/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)
+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/filepimp_installer
+bdir="${bdir:-$HOME/build/arch}"
+isodir="$bdir/iso"
+isomnt="$bdir/isomount"
+rootdir="$bdir/root"
+outdir="$bdir/out"
+echo "$outdir/$outfile"
+auto_url=euer.krebsco.de/arch_autoinstall
info "bdir is at $bdir"
[ ! -e "$isofile" ] && die "$isofile does not exist."
+arch_label="$(get_volid "$isofile")"
+info "Arch iso label is ${arch_label}"
esudo "$@"
-
#punani install genisoimage
@@ -26,17 +29,18 @@ rm -rf $bdir
mkdir -p $isomnt $rootdir
info "mounting isofile ($isofile)"
if is_root;then
- mount -t iso9660 -o loop,ro $isofile $isomnt
+ 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"
+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"
@@ -51,7 +55,7 @@ for arch in x86_64 i686;do
info "Starting of the rootdir verkrepelung"
# do the magic here
- arch-chroot $rootdir/$arch <<EOF
+ arch-chroot "$rootdir/$arch" <<EOF
cat >> /root/.zshrc<<EOL
cat << EOD
This is the Krebs Autoinstaller, we will do all the right things.
@@ -96,14 +100,14 @@ rm -f "${outdir}/${outfile}"
xorriso -as mkisofs \
-iso-level 3 \
-full-iso9660-filenames \
- -volid "ARCH_201311" \
+ -volid "$arch_label" \
-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 \
+ -isohybrid-mbr "${isomnt}/isolinux/isohdpfx.bin" \
-output "${outdir}/${outfile}" \
"$isodir"