]> Frank Brehm's Git Trees - my-stuff/grml-patch.git/commitdiff
Letzte Ă„nderungen wegen rc.local master
authorFrank Brehm <frank.brehm@pixelpark.com>
Thu, 8 Jun 2017 16:18:08 +0000 (18:18 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Thu, 8 Jun 2017 16:18:08 +0000 (18:18 +0200)
bin/create-grml-image.sh
files/rc.local

index faa28af768d6291367e0eff258a1335460e2a390..7dea4c01b9057063ec3b139a46384e2350b351df 100755 (executable)
@@ -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
index c8b17a78778ceae366f3d24f3cb573260b2f9a73..327a0c9778be5bd842e95546e8592c4bdef26a64 100755 (executable)
 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