Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102171626
D43350.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D43350.diff
View Options
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,16 @@
rm -rf $BSDINSTALL_TMPETC
mkdir $BSDINSTALL_TMPETC
mkdir -p $1 || error "mkdir failed for $1"
+rm -f $TMPDIR/bsdinstall-installscript-setup
-if [ -n "$SCRIPT" ]
-then
- split -a 2 -p '^#!.*' "$SCRIPT" $TMPDIR/bsdinstall-installscript-
- . $TMPDIR/bsdinstall-installscript-aa
+if [ -n "$SCRIPT" ]; then
+ # split script into preamble and setup script at first shebang
+ awk 'BEGIN {pathb=ARGV[2]; ARGV[2]=""} /^#!/{b=1} {
+ if (b) print >pathb; else print}' \
+ "$SCRIPT" $TMPDIR/bsdinstall-installscript-setup \
+ >$TMPDIR/bsdinstall-installscript-preamble
+
+ . $TMPDIR/bsdinstall-installscript-preamble
fi
test ! -d $BSDINSTALL_DISTDIR && mkdir -p $BSDINSTALL_DISTDIR
@@ -146,8 +151,9 @@
cp /var/db/zoneinfo $1/var/db
# Run post-install script
-if [ -f $TMPDIR/bsdinstall-installscript-ab ]; then
- cp $TMPDIR/bsdinstall-installscript-ab $BSDINSTALL_CHROOT/tmp/installscript
+if [ -f $TMPDIR/bsdinstall-installscript-setup ]; then
+ cp $TMPDIR/bsdinstall-installscript-setup \
+ $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,15 @@
f_dprintf "Began Installation at %s" "$( date )"
rm -rf $BSDINSTALL_TMPETC
mkdir $BSDINSTALL_TMPETC
+rm -f $TMPDIR/bsdinstall-installscript-setup
-split -a 2 -p '^#!.*' "$SCRIPT" $TMPDIR/bsdinstall-installscript-
+# split script into preamble and setup script at first shebang
+awk 'BEGIN {pathb=ARGV[2]; ARGV[2]=""} /^#!/{b=1} {
+ if (b) print >pathb; else print}' \
+ "$SCRIPT" $TMPDIR/bsdinstall-installscript-setup \
+ >$TMPDIR/bsdinstall-installscript-preamble
-. $TMPDIR/bsdinstall-installscript-aa
+. $TMPDIR/bsdinstall-installscript-preamble
: ${DISTRIBUTIONS="kernel.txz base.txz"}; export DISTRIBUTIONS
export BSDINSTALL_DISTDIR
@@ -158,8 +163,9 @@
fi
# Run post-install script
-if [ -f $TMPDIR/bsdinstall-installscript-ab ]; then
- cp $TMPDIR/bsdinstall-installscript-ab $BSDINSTALL_CHROOT/tmp/installscript
+if [ -f $TMPDIR/bsdinstall-installscript-setup ]; then
+ cp $TMPDIR/bsdinstall-installscript-setup \
+ $BSDINSTALL_CHROOT/tmp/installscript
chmod a+x $BSDINSTALL_CHROOT/tmp/installscript
chroot $BSDINSTALL_CHROOT /tmp/installscript $@ 2>&1
rm $BSDINSTALL_CHROOT/tmp/installscript
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 9, 11:51 AM (21 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14559615
Default Alt Text
D43350.diff (2 KB)
Attached To
Mode
D43350: bsdinstall: Split installation script not more than once
Attached
Detach File
Event Timeline
Log In to Comment