From: Frank Brehm Date: Thu, 8 Jun 2017 16:18:08 +0000 (+0200) Subject: Letzte Ă„nderungen wegen rc.local X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=HEAD;p=my-stuff%2Fgrml-patch.git Letzte Ă„nderungen wegen rc.local --- diff --git a/bin/create-grml-image.sh b/bin/create-grml-image.sh index faa28af..7dea4c0 100755 --- a/bin/create-grml-image.sh +++ b/bin/create-grml-image.sh @@ -552,8 +552,22 @@ copy_files() { CHOWN root:root ${TGT_DIR}/etc/rc.local CHMOD 0744 ${TGT_DIR}/etc/rc.local - info "Enabling ${GREEN}rc.local${NORMAL} in runlevel ..." - CHROOT systemctl enable rc.local.service + if [[ ! -d "${TGT_DIR}/etc/systemd/system" ]] ; then + MKDIR -p "${TGT_DIR}/etc/systemd/system" + fi + if [[ -f "${TGT_DIR}/lib/systemd/system/rc-local.service" ]] ; then + CP "${TGT_DIR}/lib/systemd/system/rc-local.service" "${TGT_DIR}/etc/systemd/system" + cat >> "${TGT_DIR}/etc/systemd/system/rc-local.service" <<-EOF + + [Install] + WantedBy=multi-user.target + + EOF + + info "Enabling ${GREEN}rc-local.service${NORMAL} in runlevel ..." + CHROOT systemctl enable rc-local.service + + fi # info "Disabling ${YELLOW}avahi-daemon${NORMAL} in all runlevels ..." # CHROOT update-rc.d avahi-daemon remove || true diff --git a/files/rc.local b/files/rc.local index c8b17a7..327a0c9 100755 --- a/files/rc.local +++ b/files/rc.local @@ -16,9 +16,12 @@ set -e do_start() { - for i in $(cat /etc/modules | grep -v "#"); do - modprobe $i + printf "Loading mudules: " + for module in $(cat /etc/modules | grep -v "#"); do + printf "%s " "$module" + modprobe $module || true done + echo wget http://repo.uhu-banane.de/grml.sh -O /tmp/grml.sh || true if [[ -f /tmp/grml.sh && -s /tmp/grml.sh ]] ; then