aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-distro/recipes-devtools/dpkg
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-distro/recipes-devtools/dpkg')
-rw-r--r--meta-amd-distro/recipes-devtools/dpkg/dpkg_%.bbappend22
-rw-r--r--meta-amd-distro/recipes-devtools/dpkg/files/dpkg-configure-pending14
-rw-r--r--meta-amd-distro/recipes-devtools/dpkg/files/dpkg-configure-pending.service16
3 files changed, 52 insertions, 0 deletions
diff --git a/meta-amd-distro/recipes-devtools/dpkg/dpkg_%.bbappend b/meta-amd-distro/recipes-devtools/dpkg/dpkg_%.bbappend
new file mode 100644
index 00000000..099292ab
--- /dev/null
+++ b/meta-amd-distro/recipes-devtools/dpkg/dpkg_%.bbappend
@@ -0,0 +1,22 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+inherit systemd
+
+SYSTEMD_SERVICE_${PN} = "dpkg-configure-pending.service"
+SYSTEMD_AUTO_ENABLE = "enable"
+
+SRC_URI += " \
+ file://dpkg-configure-pending.service \
+ file://dpkg-configure-pending \
+"
+
+do_install_append () {
+ install -d ${D}${systemd_unitdir}/system
+ install -m 644 ${WORKDIR}/dpkg-configure-pending.service ${D}${systemd_unitdir}/system/
+ install -m 755 ${WORKDIR}/dpkg-configure-pending ${D}${sbindir}/dpkg-configure-pending
+}
+
+FILES_${PN} += " \
+ ${systemd_unitdir}/system/dpkg-configure-pending.service \
+ ${sbindir}/dpkg-configure-pending \
+"
diff --git a/meta-amd-distro/recipes-devtools/dpkg/files/dpkg-configure-pending b/meta-amd-distro/recipes-devtools/dpkg/files/dpkg-configure-pending
new file mode 100644
index 00000000..ba3bf025
--- /dev/null
+++ b/meta-amd-distro/recipes-devtools/dpkg/files/dpkg-configure-pending
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+[ -e /etc/default/postinst ] && . /etc/default/postinst
+if [ "$POSTINST_LOGGING" = "1" ]; then
+ append_log="| tee -a $LOGFILE"
+fi
+
+[ "$POSTINST_LOGGING" = "1" ] && eval echo "Attempting to reconfigure packages on first boot that had failed postinsts..." ${append_log}
+
+dpkg --configure --pending | tee -a $LOGFILE
+
+if [ -n "`which update-rc.d`" ]; then
+ update-rc.d -f dpkg-configure-pending remove | tee -a $LOGFILE
+fi
diff --git a/meta-amd-distro/recipes-devtools/dpkg/files/dpkg-configure-pending.service b/meta-amd-distro/recipes-devtools/dpkg/files/dpkg-configure-pending.service
new file mode 100644
index 00000000..57d582f5
--- /dev/null
+++ b/meta-amd-distro/recipes-devtools/dpkg/files/dpkg-configure-pending.service
@@ -0,0 +1,16 @@
+[Unit]
+Description="Configure pkgs with failed postinsts that Sato GUI depends on."
+DefaultDependencies=no
+After=sysinit.target
+Before=multi-user.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/sbin/dpkg-configure-pending
+ExecStartPost=/bin/systemctl --no-reload disable dpkg-configure-pending.service
+RemainAfterExit=No
+TimeoutSec=0
+User=root
+
+[Install]
+WantedBy=graphical.target