Page MenuHomeFreeBSD

D58954.id184454.diff
No OneTemporary

D58954.id184454.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
@@ -493,6 +493,25 @@
fi
}
+#
+# Update the content value in the config_files table of the target pkg database.
+# All paths are relative to NANO_WORLDDIR
+#
+tgt_pkg_update_config_files_content() {
+ local escaped_file file
+
+ file="${NANO_WORLDDIR}/${1}"
+ # We need to escape single quotes and avoid $(...) from removing newlines at EOF
+ escaped_file=$(sed "s/'/''/g" "$file"; printf 'EOF')
+ escaped_file=${escaped_file%EOF}
+
+ if [ -f "$file" ]; then
+ tgt_pkg shell "UPDATE config_files SET content = '$escaped_file' WHERE path = '/${1}';"
+ else
+ err "File ${file} not found"
+ fi
+}
+
# Run pkg(8) with the configured ABI, repo, and cache settings
pkg_cmd() {
pkg --repo-conf-dir "$(nano_pkg_repos_dir)" \
@@ -1232,6 +1251,8 @@
err "Regular expression pattern not found"
fi
[ -n "${NANO_NOPRIV_BUILD}" ] && chmod 444 etc/defaults/rc.conf
+ if $do_precompiled && [ -z "$NANO_NOPKGBASE" ]; then
+ fi
# Save config file for scripts
echo "NANO_DRIVE=${NANO_DRIVE}" > etc/nanobsd.conf
@@ -1505,6 +1526,9 @@
# Tell loader to use serial console early.
echo "${NANO_BOOT2CFG}" > ${NANO_WORLDDIR}/boot.config
tgt_touch boot.config
+
+ if $do_precompiled && [ -z "$NANO_NOPKGBASE" ]; then
+ fi
}
#######################################################################
@@ -1514,6 +1538,9 @@
cust_allow_ssh_root() {
sed -i "" -E 's/^#?PermitRootLogin.*/PermitRootLogin yes/' \
${NANO_WORLDDIR}/etc/ssh/sshd_config
+
+ if $do_precompiled && [ -z "$NANO_NOPKGBASE" ]; then
+ fi
}
#######################################################################

File Metadata

Mime Type
text/plain
Expires
Tue, Sep 1, 1:08 PM (1 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37028244
Default Alt Text
D58954.id184454.diff (1 KB)

Event Timeline