>Synopsis: error extracting base is not detected
>Category: installer
>Description:
During an install or an upgrade, if extraction of base fails, the
error is not handled correctly, because the specific handling of
etc-within-base is performed before checking $? (i.e. the result of the
extraction) for failure, as in:
Installing bsd 100% |**************************| 8626 KB 00:08
Installing bsd.rd 100% |**************************| 2668 KB 00:02
Installing base61.tgz 99% |************************* | 97667 KB 07:02
gzip: stdin: Input/output error
tar: End of archive volume 1 reached
Installing comp61.tgz 100% |**************************| 49443 KB 04:24
>How-To-Repeat:
Try and install or upgrade and have I/O errors or whatever causes base
not to be extracted correctly.
>Fix:
This ought to work: (untested)
Index: install.sub
===================================================================
RCS file: /OpenBSD/src/distrib/miniroot/install.sub,v
retrieving revision 1.1032
diff -u -p -r1.1032 install.sub
--- install.sub 8 Aug 2017 07:14:05 -0000 1.1032
+++ install.sub 20 Aug 2017 21:38:12 -0000
@@ -1570,11 +1570,6 @@ install_files() {
case $_fsrc in
*.tgz) $_unpriv ftp -D Installing -Vmo - "$_fsrc" |
tar -zxphf - -C /mnt
- if [[ $_f == ?(x)base*.tgz && $MODE == install ]]; then
- ftp -D Extracting -Vmo - \
- file:///mnt/var/sysmerge/${_f%%base*}etc.tgz |
- tar -zxphf - -C /mnt
- fi
;;
*) $_unpriv ftp -D Installing -Vmo - "$_fsrc" >"/mnt/$_f"
;;
@@ -1586,6 +1581,11 @@ install_files() {
return
fi
else
+ if [[ $_f == ?(x)base*.tgz && $MODE == install ]]; then
+ ftp -D Extracting -Vmo - \
+ file:///mnt/var/sysmerge/${_f%%base*}etc.tgz |
+ tar -zxphf - -C /mnt
+ fi
DEFAULTSETS=$(rmel $_f $DEFAULTSETS)
fi
[[ -d $_tmpsrc ]] && rm -f "$_tmpsrc/$_f"