diff --git a/elements/fedora/install.d/01-rc-local b/elements/fedora/install.d/01-rc-local new file mode 100755 index 00000000..5d35b220 --- /dev/null +++ b/elements/fedora/install.d/01-rc-local @@ -0,0 +1,4 @@ +#!/bin/bash + +ln -s /etc/rc.local /etc/rc.d/rc.local +systemctl enable rc-local.service diff --git a/lib/img-functions b/lib/img-functions index 0edf4177..51444171 100644 --- a/lib/img-functions +++ b/lib/img-functions @@ -129,7 +129,9 @@ function prepare_first_boot () { check_break before-first-boot run_in_target bash if [ -d ${TMP_HOOKS_PATH}/first-boot.d ] ; then sudo cp -t $TMP_MOUNT_PATH/etc/ -a $TMP_HOOKS_PATH/first-boot.d - run_in_target mv /etc/rc.local /etc/rc.local.REAL + if [ -f $TMP_MOUNT_PATH/etc/rc.local ] ; then + run_in_target mv /etc/rc.local /etc/rc.local.REAL + fi sudo dd of=$TMP_MOUNT_PATH/etc/rc.local <> /var/log/first-boot.d.log 2>&1 rm -fr /etc/first-boot.d -mv /etc/rc.local.REAL /etc/rc.local +rm -f /etc/rc.local +if [ -f /etc/rc.local.REAL ] ; then + mv /etc/rc.local.REAL /etc/rc.local +fi exit 0 EOF run_in_target chmod 755 /etc/rc.local