Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F167539234
D59043.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
D59043.diff
View Options
diff --git a/tools/tools/nanobsd/_xxx_includes.subr b/tools/tools/nanobsd/_xxx_includes.subr
--- a/tools/tools/nanobsd/_xxx_includes.subr
+++ b/tools/tools/nanobsd/_xxx_includes.subr
@@ -95,6 +95,71 @@
fi
}
+#
+# Build NANO_METALOG from pkgbase package manifests,
+# regenerate system databases (passwd, caps, services),
+# and add missing entries
+#
+_xxx_pkg_metalog() {
+ local files directories path
+
+ # Add the root entry
+ metalog_add_data "."
+
+ _xxx_add_missing_boot_dtb
+
+ # https://github.com/freebsd/pkg/issues/2672
+ metalog_add_data "./etc/local/periodic"
+ metalog_add_data "./etc/local/periodic/daily"
+ metalog_add_data "./etc/local/periodic/security"
+ metalog_add_data "./etc/local/periodic/weekly"
+ # /conf/base counterparts
+ metalog_add_data "./conf/base/etc/local/periodic"
+ metalog_add_data "./conf/base/etc/local/periodic/daily"
+ metalog_add_data "./conf/base/etc/local/periodic/security"
+ metalog_add_data "./conf/base/etc/local/periodic/weekly"
+
+ # Paths missing from the package manifest will default to
+ # root:wheel with 0755 permissions.
+ # Take care not to add them twice to the METALOG; otherwise,
+ # the wrong entry may appear first when sorting
+ tmp_metalog=$(mktemp -t nano_tmp_metalog)
+ trap 'rm -f "$tmp_metalog"' 1 2 15 EXIT
+ directories=$(tgt_pkg query "%Sp")
+ for path in $directories; do
+ path="${path#/}"
+ mtree_walk "$path" "$tmp_metalog"
+ done
+ files=$(tgt_pkg query "%Fp")
+ for file in $files; do
+ file="${file#/}"
+ if [ "$file" != "${file%/*}" ]; then
+ path="${file%/*}"
+ mtree_walk "$path" "$tmp_metalog"
+ else
+ continue
+ fi
+ done
+ cat "$NANO_METALOG" "$tmp_metalog" |
+ awk '/^#/ { print; next } !seen[$1]++' > "${NANO_METALOG}.pre"
+ mv "${NANO_METALOG}.pre" "$NANO_METALOG"
+ trap - 1 2 15 EXIT
+ rm -f "$tmp_metalog"
+
+ # Remove the directory entries for the symlinked paths
+ sed -i "" "\=^\./usr/local/etc = { / type=dir / d; }" "$NANO_METALOG"
+
+ # These directories may end up being generated many times
+ # by pkg -o METALOG and the first one may not have the right permissions
+ # in the database:
+ # https://github.com/freebsd/pkg/issues/2658
+ # FreeBSD-bootloader-dev-16.snap20251026024203: /usr/share/man/man3/libsa.3.gz [perm] --------- -> r--r--r--
+ # FreeBSD-runtime-16.snap20260601092744: /root [perm] rwxr-x--- -> rwxr-xr-x
+ # FreeBSD-utilities-16.snap20260531173731: /root [perm] rwxr-x--- -> rwxr-xr-x
+ sed -i "" "\=^\./etc/ntp =s/mode=0\{0,1\}755/mode=0700/g" "$NANO_METALOG"
+ sed -i "" "\=^\./root =s/mode=0\{0,1\}755/mode=0750/g" "$NANO_METALOG"
+}
+
#
# Manually run triggers and package scripts
# XXXJL do we need to manually run the scripts or just the triggers?
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Aug 23, 2:03 PM (7 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37031041
Default Alt Text
D59043.diff (2 KB)
Attached To
Mode
D59043: nanobsd: Add _xxx_pkg_metalog
Attached
Detach File
Event Timeline
Log In to Comment