diff --git a/usr.sbin/bsdinstall/scripts/jail b/usr.sbin/bsdinstall/scripts/jail --- a/usr.sbin/bsdinstall/scripts/jail +++ b/usr.sbin/bsdinstall/scripts/jail @@ -61,11 +61,13 @@ rm -rf $BSDINSTALL_TMPETC mkdir $BSDINSTALL_TMPETC mkdir -p $1 || error "mkdir failed for $1" +rm -rf $TMPDIR/bsdinstall-installscript-* if [ -n "$SCRIPT" ] then - split -a 2 -p '^#!.*' "$SCRIPT" $TMPDIR/bsdinstall-installscript- - . $TMPDIR/bsdinstall-installscript-aa + split -a 2 -p '^#!.*' "$SCRIPT" $TMPDIR/bsdinstall-installscript- + mv $TMPDIR/bsdinstall-installscript-aa $TMPDIR/bsdinstall-installscript-options + . $TMPDIR/bsdinstall-installscript-options fi test ! -d $BSDINSTALL_DISTDIR && mkdir -p $BSDINSTALL_DISTDIR @@ -147,7 +149,7 @@ # Run post-install script if [ -f $TMPDIR/bsdinstall-installscript-ab ]; then - cp $TMPDIR/bsdinstall-installscript-ab $BSDINSTALL_CHROOT/tmp/installscript + cat $TMPDIR/bsdinstall-installscript-?? >$BSDINSTALL_CHROOT/tmp/installscript chmod a+x $BSDINSTALL_CHROOT/tmp/installscript mount -t devfs devfs "$BSDINSTALL_CHROOT/dev" chroot $BSDINSTALL_CHROOT /tmp/installscript $@ 2>&1 diff --git a/usr.sbin/bsdinstall/scripts/script b/usr.sbin/bsdinstall/scripts/script --- a/usr.sbin/bsdinstall/scripts/script +++ b/usr.sbin/bsdinstall/scripts/script @@ -88,10 +88,12 @@ f_dprintf "Began Installation at %s" "$( date )" rm -rf $BSDINSTALL_TMPETC mkdir $BSDINSTALL_TMPETC +rm -rf $TMPDIR/bsdinstall-installscript-* split -a 2 -p '^#!.*' "$SCRIPT" $TMPDIR/bsdinstall-installscript- -. $TMPDIR/bsdinstall-installscript-aa +mv $TMPDIR/bsdinstall-installscript-aa $TMPDIR/bsdinstall-installscript-options +. $TMPDIR/bsdinstall-installscript-options : ${DISTRIBUTIONS="kernel.txz base.txz"}; export DISTRIBUTIONS export BSDINSTALL_DISTDIR @@ -159,7 +161,7 @@ # Run post-install script if [ -f $TMPDIR/bsdinstall-installscript-ab ]; then - cp $TMPDIR/bsdinstall-installscript-ab $BSDINSTALL_CHROOT/tmp/installscript + cat $TMPDIR/bsdinstall-installscript-?? >$BSDINSTALL_CHROOT/tmp/installscript chmod a+x $BSDINSTALL_CHROOT/tmp/installscript chroot $BSDINSTALL_CHROOT /tmp/installscript $@ 2>&1 rm $BSDINSTALL_CHROOT/tmp/installscript