diff options
author | imp <imp@FreeBSD.org> | 2010-08-19 06:01:25 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2010-08-19 06:01:25 +0000 |
commit | bc2b00ae354e3bf5e5d2bd85ca560e795b337a4f (patch) | |
tree | 4e215640a4befc7ecd6afd497df17fffe1dbc76c /usr.sbin/pc-sysinstall/backend/functions-extractimage.sh | |
parent | 23d9b9fddd80cb970290ccdde4452d75102c2ce0 (diff) | |
download | FreeBSD-src-bc2b00ae354e3bf5e5d2bd85ca560e795b337a4f.zip FreeBSD-src-bc2b00ae354e3bf5e5d2bd85ca560e795b337a4f.tar.gz |
Updates to pc-sysinstall that allow FTP installation of FreeBSD.
PR: 148661
Submitted by: John Hixson
Diffstat (limited to 'usr.sbin/pc-sysinstall/backend/functions-extractimage.sh')
-rwxr-xr-x | usr.sbin/pc-sysinstall/backend/functions-extractimage.sh | 76 |
1 files changed, 74 insertions, 2 deletions
diff --git a/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh b/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh index e4fccce..de86711 100755 --- a/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh +++ b/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh @@ -203,6 +203,69 @@ fetch_install_file() }; +# Function which will download freebsd install files +fetch_split_files() +{ + get_value_from_cfg ftpHost + if [ -z "$VAL" ] + then + exit_err "ERROR: Install medium was set to ftp, but no ftpHost was provided!" + fi + FTPHOST="${VAL}" + + get_value_from_cfg ftpDir + if [ -z "$VAL" ] + then + exit_err "ERROR: Install medium was set to ftp, but no ftpDir was provided!" + fi + FTPDIR="${VAL}" + + # Check if we have a /usr partition to save the download + if [ -d "${FSMNT}/usr" ] + then + OUTFILE="${FSMNT}/usr/.fetch-${INSFILE}" + else + OUTFILE="${FSMNT}/.fetch-${INSFILE}" + fi + + NETRC="${OUTFILE}/.netrc" + cat<<EOF>"${NETRC}" +machine ${FTPHOST} +login anonymous +password anonymous +macdef INSTALL +bin +prompt +EOF + + DIRS="base catpages dict doc games info manpages proflibs kernels src" + if [ "${FBSD_ARCH}" = "amd64" ] + then + DIRS="${DIRS} lib32" + fi + + for d in ${DIRS} + do + cat<<EOF>>"${NETRC}" +cd ${FTPDIR}/${d} +lcd ${OUTFILE}/${d} +mreget * +EOF + done + + cat<<EOF>>"${NETRC}" +bye + + +EOF + + # Fetch the files via ftp + echo "$ INSTALL" | ftp -N "${NETRC}" "${FTPHOST}" + + # Done fetching, now reset the INSFILE to our downloaded archived + INSFILE="${OUTFILE}" ; export INSFILE +} + # Function which does the rsync download from the server specifed in cfg start_rsync_copy() { @@ -304,8 +367,17 @@ init_extraction() start_extract_uzip_tar fi ;; - ftp) fetch_install_file - start_extract_uzip_tar + ftp) + if [ "$PACKAGETYPE" = "split" ] + then + fetch_split_files + + INSDIR="${INSFILE}" ; export INSDIR + start_extract_split + else + fetch_install_file + start_extract_uzip_tar + fi ;; rsync) start_rsync_copy ;; |