Page MenuHomeFreeBSD

D58959.id184599.diff
No OneTemporary

D58959.id184599.diff

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
@@ -527,6 +527,7 @@
# 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
#
+<<<<<<< HEAD
tgt_pkg_update_file_path_etc_local() {
tgt_pkg shell <<-EOF
UPDATE files
@@ -577,6 +578,8 @@
}
# Run pkg(8) with the configured ABI, repo, and cache settings
+=======
+>>>>>>> 023e4881b1a (nanobsd: Disable pkg repositories on target image)
pkg_cmd() {
pkg --repo-conf-dir "$(nano_pkg_repos_dir)" \
-o ABI="$NANO_ABI" \
@@ -667,6 +670,26 @@
pkg_cmd repo "$(nano_pkg_cachedir)"
}
+nano_pkg_disable_repos() {
+ (
+ cd "$NANO_WORLDDIR"
+
+ # XXX: 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
@@ -1219,7 +1242,10 @@
fi
if $do_precompiled && [ -z "$NANO_NOPKGBASE" ]; then
+<<<<<<< HEAD
tgt_pkg_time_timestamp
+=======
+>>>>>>> 023e4881b1a (nanobsd: Disable pkg repositories on target image)
fi
}
@@ -1261,6 +1287,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.

File Metadata

Mime Type
text/plain
Expires
Wed, Aug 26, 5:20 AM (9 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37047202
Default Alt Text
D58959.id184599.diff (2 KB)

Event Timeline