Permalink
Browse files

Improve pc-sysinstall for pkgng 1.2.x, when doing installations from

local media, we can avoid doing a "pkg install", since it does unnecessary
steps of copying the media from DVD -> DISK -> INSTALL. Instead we will
do a 'pkg rquery' to get the filename of the requested package, and
install it with 'pkg add' which will stream from the DVD/USB directly.
  • Loading branch information...
1 parent 48087a0 commit bdf4cac226140796d2a590ef97da3a539d1a1a82 @kmoore134 kmoore134 committed Dec 10, 2013
Showing with 21 additions and 1 deletion.
  1. +21 −1 src-sh/pc-sysinstall/backend/functions-installpackages.sh
View
22 src-sh/pc-sysinstall/backend/functions-installpackages.sh
@@ -61,6 +61,13 @@ install_packages()
# Install PKGNG into the chroot
bootstrap_pkgng
+ # Update the repo database
+ echo "Updating pkgng database"
+ case "${INSTALLMEDIUM}" in
+ usb|dvd|local) run_chroot_cmd "pkg -R /mnt/repo-installer update -f" ;;
+ *) run_chroot_cmd "pkg update -f" ;;
+ esac
+
# Lets start by cleaning up the string and getting it ready to parse
get_value_from_cfg_with_spaces installPackages
PACKAGES="${VAL}"
@@ -71,7 +78,20 @@ install_packages()
# When doing a pkg install, if on local media, use a pkg.conf from /dist/
if [ "${INSTALLMEDIUM}" != "ftp" ] ; then
- PKGADD="pkg -R /mnt/repo-installer install -y ${PKGNAME}"
+ # Get the package file-name
+ PKGFILENAME=""
+ PKGFILENAME=`chroot ${FSMNT} pkg -R /mnt/repo-installer rquery '%n-%v' ${PKGNAME}`
+ if [ -z "$PKGFILENAME" ] ; then
+ echo_log "Warning: No such package in repo: ${PKGNAME}"
+ sleep 2
+ continue
+ fi
+ if [ ! -e "${FSMNT}/mnt/All/${PKGFILENAME}.txz" ] ; then
+ echo_log "Warning: No such package file in repo: ${PKGFILENAME}"
+ sleep 2
+ continue
+ fi
+ PKGADD="pkg add /mnt/All/${PKGFILENAME}.txz"
else
# Doing a network install, use the default pkg.conf
PKGADD="pkg install -y ${PKGNAME}"

0 comments on commit bdf4cac

Please sign in to comment.