Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F168387209
D58959.id184324.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
D58959.id184324.diff
View Options
diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh
--- a/tools/tools/nanobsd/defaults.sh
+++ b/tools/tools/nanobsd/defaults.sh
@@ -523,7 +523,10 @@
fi
}
-# Run pkg(8) with the configured ABI, repo, and cache settings
+#
+# Update the path the files table of the target pkg database from
+# /usr/local/etc to /etc/local. All paths are relative to NANO_WORLDDIR
+#
pkg_cmd() {
pkg --repo-conf-dir "$(nano_pkg_repos_dir)" \
-o ABI="$NANO_ABI" \
@@ -614,6 +617,26 @@
pkg_cmd repo "$(nano_pkg_cachedir)"
}
+nano_pkg_disable_repos() {
+ (
+ cd "$NANO_WORLDDIR"
+
+ # XXXJL is it better to just rewrite the entire file?
+ sed -i "" -E \
+ -e "s/([[:space:]]*enabled[[:space:]]*:[[:space:]]*)(yes|true|on)/\1no/" \
+ -e "s/To disable a repository/To enable a repository/" \
+ -e "s/FreeBSD-ports: \{ enabled: no \}/FreeBSD-ports: { enabled: yes }/" \
+ -e "s/FreeBSD-ports-kmods: \{ enabled: no \}/FreeBSD-ports-kmods: { enabled: yes }/" \
+ -e "s/Note that the FreeBSD-base repository is disabled by default\./Note that all repositories are disabled by default./" \
+ etc/pkg/FreeBSD.conf
+
+ if $do_precompiled; then
+ tgt_pkg_update_file_sha256 etc/pkg/FreeBSD.conf
+ tgt_pkg_update_config_files_content etc/pkg/FreeBSD.conf
+ fi
+ )
+}
+
#
# Validate NANO_PKGBASE_LIST requirements, optionally clean the package cache,
# write the pkg repo config, and fetch pkgbase packages
@@ -729,18 +752,6 @@
done
)
-#
-# Update the path the files table of the target pkg database from
-# /usr/local/etc to /etc/local. All paths are relative to NANO_WORLDDIR
-#
-tgt_pkg_update_file_path_etc_local() {
- tgt_pkg shell <<-EOF
- UPDATE files
- SET path = '/etc/local' || SUBSTR(path, 15)
- WHERE path LIKE '/usr/local/etc%';
- EOF
-}
-
#
# Convert a directory into a symlink. Takes three arguments, the current
# directory, what it should become a symlink to, and optionally, the mode.
@@ -1164,6 +1175,9 @@
cat ${NANO_METALOG}.pre | ${NANO_TOOLS}/mtree-dedup.awk | \
sort -u | mtree -C -K uname,gname,tags -R size,time >> ${NANO_METALOG}
fi
+
+ if $do_precompiled && [ -z "$NANO_NOPKGBASE" ]; then
+ fi
}
#
@@ -1204,6 +1218,11 @@
# to have the symlink in error though
tgt_dir2symlink usr/local/etc ../../etc/local 0755
+ # Disable all package repositories
+ if [ -z "$NANO_NOPKGBASE" ]; then
+ nano_pkg_disable_repos
+ fi
+
for d in var etc; do
# Link /$d under /conf
# we use hard links so we have them both places.
@@ -1241,6 +1260,8 @@
sed -i "" "\=^\./tmp =d" "$NANO_METALOG"
fi
tgt_dir2symlink tmp var/tmp 1777
+ if [ -z "$NANO_NOPKGBASE" ]; then
+ fi
) > ${NANO_LOG}/_.dl 2>&1
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Aug 28, 10:41 PM (6 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36989272
Default Alt Text
D58959.id184324.diff (2 KB)
Attached To
Mode
D58959: nanobsd: Disable pkg repositories on target image
Attached
Detach File
Event Timeline
Log In to Comment