echo "Action $FAI_ACTION of FAI (hooks/instsoft.GRMLBASE) via grml-live running"
if [ -r /etc/resolv.conf ] ; then
- if [ -d $target/etc/resolvconf/run ] ; then # resolvconf
+ if [ -d $target/etc/resolvconf/run ] ; then # resolvconf without /run
# sanity check to avoid "input file is output file",
# see http://bts.grml.org/grml/issue984
if ! [ -L $target/etc/resolvconf/run/resolv.conf ] ; then
echo " Looks like something is wrong, please fix manually." >&2
exit 1
fi
+ elif [ -L $target/etc/resolvconf/run ] ; then # resolvconf with /run
+ # /etc/resolvconf/run symlinks to /run/resolvconf
+ mkdir -p $target/run/resolvconf
+ cat /etc/resolv.conf >> $target/run/resolvconf/resolv.conf
else # no resolvconf installed in chroot
if ! [ -L $target/etc/resolv.conf ] ; then
cat /etc/resolv.conf >> $target/etc/resolv.conf
fi
## END OF FILE #################################################################
-# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3
+# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2
[ -n "$HOSTNAME" ] || HOSTNAME=grml
if [ -r /etc/resolv.conf ] ; then
- if [ -d $target/etc/resolvconf/run ] ; then # resolvconf
+ if [ -d $target/etc/resolvconf/run ] ; then # resolvconf without /run
# sanity check to avoid "input file is output file",
# see http://bts.grml.org/grml/issue984
if ! [ -L $target/etc/resolvconf/run/resolv.conf ] ; then
- cat /etc/resolv.conf >> $target/etc/resolvconf/run/resolv.conf
+ cat /etc/resolv.conf >> $target/etc/resolvconf/run/resolv.conf
else
- echo "Error: /etc/resolvconf/run/resolv.conf in chroot should not be a symlink." >&2
- echo " Looks like something is wrong, please fix manually." >&2
- exit 1
+ echo "Error: /etc/resolvconf/run/resolv.conf in chroot should not be a symlink." >&2
+ echo " Looks like something is wrong, please fix manually." >&2
+ exit 1
fi
+ elif [ -L $target/etc/resolvconf/run ] ; then # resolvconf with /run
+ # /etc/resolvconf/run symlinks to /run/resolvconf
+ mkdir -p $target/run/resolvconf
+ cat /etc/resolv.conf >> $target/run/resolvconf/resolv.conf
else # no resolvconf installed in chroot
if ! [ -L $target/etc/resolv.conf ] ; then
- cat /etc/resolv.conf >> $target/etc/resolv.conf
+ cat /etc/resolv.conf >> $target/etc/resolv.conf
else
- echo "Error: /etc/resolv.conf in chroot should not be a symlink (resolvconf not installed)." >&2
- exit 1
+ echo "Error: /etc/resolv.conf in chroot should not be a symlink (resolvconf not installed)." >&2
+ exit 1
fi
fi
fi
# installation of resolvconf in chroot *with* /proc
# is different from an installation without /proc,
-# so make sure it is OK in any case; don't use /dev/shm
+# so make sure it is OK in any case
if [ -d /etc/resolvconf ] ; then
- rm -rf /etc/resolvconf/run
- mkdir /etc/resolvconf/run
+ if [ -L /etc/resolvconf/run ] ; then # resolvconf with /run
+ # /etc/resolvconf/run symlinks to /run/resolvconf
+ rm -rf /run/resolvconf
+ mkdir -p /run/resolvconf
+ else # no /run present
+ rm -rf /etc/resolvconf/run
+ mkdir /etc/resolvconf/run
+ fi
+
touch /etc/resolvconf/run/enable-updates
mkdir /etc/resolvconf/run/interface
cat > /etc/resolvconf/run/resolv.conf << EOF