From 7166dce5c6b9279bfeb19a8c04c861f35e6cfb7e Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Tue, 10 May 2016 18:25:20 -0700 Subject: [PATCH] Updated chroot utils - Set up /run properly - copy in /etc/onl files for self-update --- .../vendor-config-onl/src/lib/install/lib.sh | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/packages/base/all/vendor-config-onl/src/lib/install/lib.sh b/packages/base/all/vendor-config-onl/src/lib/install/lib.sh index 5537de43..78a5033b 100644 --- a/packages/base/all/vendor-config-onl/src/lib/install/lib.sh +++ b/packages/base/all/vendor-config-onl/src/lib/install/lib.sh @@ -74,6 +74,28 @@ installer_mkchroot() { done mkdir -p "${rootdir}/dev/pts" + installer_say "Setting up /run" + rm -fr "${rootdir}/run"/* + mkdir -p "${rootdir}/run" + d1=$(stat -c "%D" /run) + for rdir in /run/*; do + if test -d "$rdir"; then + mkdir "${rootdir}${rdir}" + d2=$(stat -c "%D" $rdir) + t2=$(stat -f -c "%T" $rdir) + case "$t2" in + tmpfs|ramfs) + # skip tmpfs, we'll just inherit the initrd ramfs + ;; + *) + if test "$d1" != "$d2"; then + mount -o bind $rdir "${rootdir}${rdir}" + fi + ;; + esac + fi + done + installer_say "Setting up mounts" mount -t proc proc "${rootdir}/proc" mount -t sysfs sysfs "${rootdir}/sys" @@ -89,6 +111,12 @@ installer_mkchroot() { cp /etc/machine.conf "${rootdir}/etc/machine.conf" fi + # export ONL defines to the installer + mkdir -p "${rootdir}/etc/onl" + if test -d /etc/onl; then + cp -a /etc/onl/. "${rootdir}/etc/onl/." + fi + # export firmware config if test -r /etc/fw_env.config; then cp /etc/fw_env.config "${rootdir}/etc/fw_env.config"