summaryrefslogtreecommitdiffstats
path: root/ship/src/remaster_arch_shack_installstick
diff options
context:
space:
mode:
authormakefu <root@pigstarter.de>2014-03-14 23:29:05 +0100
committermakefu <root@pigstarter.de>2014-03-14 23:29:05 +0100
commit311442dd6e7ca87c4490af1127d1bd942ed02f2e (patch)
treeb325663ce21031d66a4fb3a9d57e830c76c42a5b /ship/src/remaster_arch_shack_installstick
parenta5c8fb018527b8642e6be01a9e2fc1af7cb80cb7 (diff)
parentd13ad30fdbf0638cf019f9e3888e5c1c6afd11ef (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_installstick49
1 files changed, 20 insertions, 29 deletions
diff --git a/ship/src/remaster_arch_shack_installstick b/ship/src/remaster_arch_shack_installstick
index 364e1958..3ad985af 100755
--- a/ship/src/remaster_arch_shack_installstick
+++ b/ship/src/remaster_arch_shack_installstick
@@ -5,42 +5,38 @@
## 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"
-echo "$outdir/$outfile"
-auto_url=euer.krebsco.de/arch_autoinstall
+bdir=${bdir:-$HOME/build/arch}
+isodir=$bdir/iso
+isomnt=$bdir/isomount
+rootdir=$bdir/root
+outdir=$bdir/out
+auto_url=${2:-conf.krebsco.de/arch_autoinstall}
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}"
-esudo "$@"
-
-#punani install genisoimage
-
+info "auto_url is $auto_url"
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"
+ 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"
@@ -55,7 +51,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.
@@ -63,12 +59,11 @@ Just Wait until everything finished.
- Make sure that RJ45 is connected
- you can bail out of the progress at any time with CTRL-C
-- if anything went wrong,you can run the installer again at:
- /krebs/autoinstall
-
+ /krebs/autoinstall (args)
EOD
/krebs/autoinstall
EOL
+
mkdir /krebs
cat > /krebs/autoinstall <<EOL
internet() { ping -w 1 google.de >/dev/null 2>&1; }
@@ -80,7 +75,7 @@ done
echo "Grabbing current version of install-script from $auto_url"
echo
echo "AGENTS ARE GOOOOOOOOOOO!"
-curl $auto_url 2>/dev/null | sh
+curl "$auto_url" 2>/dev/null | sh -s "\\\$@"
EOL
chmod 755 /krebs/autoinstall
EOF
@@ -88,26 +83,22 @@ EOF
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"
+ 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"
rm -f "${outdir}/${outfile}"
xorriso -as mkisofs \
-iso-level 3 \
-full-iso9660-filenames \
- -volid "$arch_label" \
+ -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"