diff --git a/release/Makefile b/release/Makefile --- a/release/Makefile +++ b/release/Makefile @@ -128,7 +128,7 @@ .if defined(WITH_DVD) && !empty(WITH_DVD) CLEANFILES+= pkg-stage .endif -CLEANDIRS= dist pkgbase-repo pkgbase-repo-conf ftp disc1 disc1-disc1 disc1-memstick bootonly bootonly-bootonly bootonly-memstick dvd +CLEANDIRS= dist pkgbase-repo pkgbase-repo-dir ftp disc1 disc1-disc1 disc1-memstick bootonly bootonly-bootonly bootonly-memstick dvd beforeclean: chflags -R noschg . .include @@ -187,15 +187,22 @@ .endif .if defined(PKGBASE) -PKGBASE_REPO= pkgbase-repo -PKG_ABI= $$(${PKG_CMD} -o ABI_FILE=${.TARGET}/usr/bin/uname config ABI) +PKGBASE_REPO_DIR= pkgbase-repo-dir +PKG_ABI_FILE= ${OBJTOP}/worldstage/usr/bin/uname +PKG_ABI= $$(${PKG_CMD} -o ABI_FILE=${PKG_ABI_FILE} config ABI) .endif pkgbase-repo: mkdir -p pkgbase-repo ( ${IMAKE} -C ${WORLDDIR} packages REPODIR=${.OBJDIR}/pkgbase-repo ) -disc1: ${PKGBASE_REPO} +pkgbase-repo-dir: pkgbase-repo + mkdir -p pkgbase-repo-dir + printf "FreeBSD-base: { url: "file://%s", enabled: yes }" \ + ${.OBJDIR}/pkgbase-repo/${PKG_ABI}/latest \ + > pkgbase-repo-dir/FreeBSD-base.conf + +disc1: ${PKGBASE_REPO_DIR} # Install system mkdir -p ${.TARGET} ( cd ${WORLDDIR} && ${IMAKE} installworld installkernel distribution \ @@ -209,7 +216,7 @@ # Create offline pkgbase repo on release media mkdir -p ${.TARGET}/usr/freebsd-packages/repos/ ${.CURDIR}/scripts/pkgbase-stage.lua disc \ - ${.OBJDIR}/pkgbase-repo/${PKG_ABI}/latest \ + ${.OBJDIR}/pkgbase-repo-dir \ ${.TARGET}/usr/freebsd-packages/offline \ "${_ALL_libcompats}" cp ${.CURDIR}/scripts/FreeBSD-base-offline.conf \ @@ -294,7 +301,7 @@ echo "./boot/loader.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG echo "./etc/rc.local type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG -dvd: ${PKGBASE_REPO} +dvd: ${PKGBASE_REPO_DIR} # Install system mkdir -p ${.TARGET} ( cd ${WORLDDIR} && ${IMAKE} installworld installkernel distribution \ @@ -304,7 +311,7 @@ # Create offline pkgbase repo on release media mkdir -p ${.TARGET}/usr/freebsd-packages/repos/ ${.CURDIR}/scripts/pkgbase-stage.lua dvd \ - ${.OBJDIR}/pkgbase-repo/${PKG_ABI}/latest \ + ${.OBJDIR}/pkgbase-repo-dir \ ${.TARGET}/usr/freebsd-packages/offline \ "${_ALL_libcompats}" cp ${.CURDIR}/scripts/FreeBSD-base-offline.conf \ diff --git a/release/scripts/pkgbase-stage.lua b/release/scripts/pkgbase-stage.lua --- a/release/scripts/pkgbase-stage.lua +++ b/release/scripts/pkgbase-stage.lua @@ -107,25 +107,15 @@ -- Determines package subset selected local media = assert(arg[1]) assert(media == "disc" or media == "dvd") - -- Local repository to fetch from - local source = assert(arg[2]) + -- Directory containing FreeBSD-base repository config + local repo_dir = assert(arg[2]) -- Directory to create new repository local target = assert(arg[3]) - -- =hitespace separated list of all libcompat names (e.g. "32") + -- Whitespace separated list of all libcompat names (e.g. "32") local all_libcompats = assert(arg[4]) - assert(os.execute("mkdir -p pkgbase-repo-conf")) - local f = assert(io.open("pkgbase-repo-conf/FreeBSD-base.conf", "w")) - assert(f:write(string.format([[ - FreeBSD-base: { - url: "file://%s", - enabled: yes - } - ]], source))) - assert(f:close()) - local pkg = "pkg -o ASSUME_ALWAYS_YES=yes -o IGNORE_OSVERSION=yes " .. - "-o INSTALL_AS_USER=1 -o PKG_DBDIR=./pkgdb -R ./pkgbase-repo-conf " + "-o INSTALL_AS_USER=1 -o PKG_DBDIR=./pkgdb -R " .. repo_dir .. " " assert(os.execute(pkg .. "update"))