mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-12-25 17:27:01 +00:00
Updated chroot utils
- Set up /run properly - copy in /etc/onl files for self-update
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user