From cab8c29a873bfa4126218d6bdc16158e2d2043b1 2016-09-19 14:05:36 From: root Date: 2016-09-19 14:05:36 Subject: [PATCH] Restart systemd.resolv only if not resolv.conf exists --- diff --git a/bootstrap.d/13-kernel.sh b/bootstrap.d/13-kernel.sh index a63129d..1de8b7b 100644 --- a/bootstrap.d/13-kernel.sh +++ b/bootstrap.d/13-kernel.sh @@ -71,6 +71,10 @@ if [ "$BUILD_KERNEL" = true ] ; then # Load default raspberry kernel configuration make -C "${KERNEL_DIR}" ARCH="${KERNEL_ARCH}" CROSS_COMPILE="${CROSS_COMPILE}" "${KERNEL_DEFCONFIG}" + if [ ! -z "$KERNELUSR_CONFIG" ] ; then + cp $KERNELUSR_CONFIG ${KERNEL_DIR}/.config + fi + # Start menu-driven kernel configuration (interactive) if [ "$KERNEL_MENUCONFIG" = true ] ; then make -C "${KERNEL_DIR}" ARCH="${KERNEL_ARCH}" CROSS_COMPILE="${CROSS_COMPILE}" menuconfig diff --git a/files/etc/rc.local b/files/etc/rc.local index 65634df..afd7d41 100755 --- a/files/etc/rc.local +++ b/files/etc/rc.local @@ -11,4 +11,13 @@ # # By default this script does nothing. +if [ ! -e /var/cfengine/policy_server.dat ] ; then + while ! ping -c 1 -q zcu.cz; do sleep 2s; done + rm -f /var/cfengine/ppkeys/* + /var/cfengine/bin/cf-key + /var/cfengine/bin/cf-agent --bootstrap cf.civ.zcu.cz + /var/cfengine/bin/cf-agent -Kf update.cf -D FORCE_update + /var/cfengine/bin/cf-agent -Kf update.cf -D FORCE_update +fi + exit 0 diff --git a/files/firstboot/25-create-resolv-symlink.sh b/files/firstboot/25-create-resolv-symlink.sh index 8a3f00b..e243475 100644 --- a/files/firstboot/25-create-resolv-symlink.sh +++ b/files/firstboot/25-create-resolv-symlink.sh @@ -1,7 +1,7 @@ logger -t "rc.firstboot" "Creating /etc/resolv.conf symlink" # Check if systemd resolve directory exists -if [ ! -d "/run/systemd/resolve" ] ; then +if [ ! -d "/run/systemd/resolve" -a ! -e "/etc/resolv.conf" ] ; then systemctl enable systemd-resolved.service systemctl restart systemd-resolved.service fi @@ -11,5 +11,8 @@ if [ ! -f "/run/systemd/resolve/resolv.conf" ] ; then touch /run/systemd/resolve/resolv.conf fi -# Create symlink to /etc/reolv.conf -ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf +# Create symlink to /etc/reolv.conf if not exists yet +if [ ! -e "/etc/resolv.conf" ] ; then + ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf +fi +