Complete Yocto mirror with license table for TQMa6UL (2038-compliance)
- 264 license table entries with exact download URLs (224/264 resolved) - Complete sources/ directory with all BitBake recipes - Build configuration: tqma6ul-multi-mba6ulx, spaetzle (musl) - Full traceability for Softwarefreigabeantrag - GCC 13.4.0, Linux 6.6.102, U-Boot 2023.04, musl 1.2.4 - License distribution: GPL-2.0 (24), MIT (23), GPL-2.0+ (18), BSD-3 (16)
This commit is contained in:
105
sources/poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
Executable file
105
sources/poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
Executable file
@@ -0,0 +1,105 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright 2007 Openedhand Ltd.
|
||||
#
|
||||
# Author: Richard Purdie <rpurdie@openedhand.com>
|
||||
#
|
||||
|
||||
# The following script will run all the scriptlets found in #SYSCONFDIR#/deb-postinsts,
|
||||
# #SYSCONFDIR#/ipk-postinsts or #SYSCONFDIR#/rpm-postinsts or the package manager in
|
||||
# case available.
|
||||
|
||||
# the order of this list is important, do not change!
|
||||
backend_list="rpm deb ipk"
|
||||
|
||||
pm_installed=false
|
||||
|
||||
for pm in $backend_list; do
|
||||
# found the package manager, it has postinsts
|
||||
case $pm in
|
||||
"deb")
|
||||
if [ -s "#LOCALSTATEDIR#/lib/dpkg/status" ]; then
|
||||
pm_installed=true
|
||||
break
|
||||
fi
|
||||
;;
|
||||
|
||||
"ipk")
|
||||
if [ -s "#LOCALSTATEDIR#/lib/opkg/status" ]; then
|
||||
pm_installed=true
|
||||
break
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
pi_dir="#SYSCONFDIR#/$pm-postinsts"
|
||||
|
||||
# found postinsts directory
|
||||
if [ -d $pi_dir ]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
remove_rcsd_link () {
|
||||
if [ -n "`which update-rc.d`" ]; then
|
||||
update-rc.d -f run-postinsts remove
|
||||
fi
|
||||
}
|
||||
|
||||
if ! [ -d $pi_dir ] && ! $pm_installed; then
|
||||
remove_rcsd_link
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Configuring packages on first boot...."
|
||||
echo " (This may take several minutes. Please do not power off the machine.)"
|
||||
|
||||
[ -e #SYSCONFDIR#/default/postinst ] && . #SYSCONFDIR#/default/postinst
|
||||
|
||||
if [ "$POSTINST_LOGGING" = "1" ]; then
|
||||
rm -f $LOGFILE
|
||||
append_log=">>$LOGFILE 2>&1"
|
||||
fi
|
||||
|
||||
exec_postinst_scriptlets() {
|
||||
for i in `ls $pi_dir`; do
|
||||
i=$pi_dir/$i
|
||||
echo "Running postinst $i..."
|
||||
[ "$POSTINST_LOGGING" = "1" ] && eval echo "Running postinst $i..." $append_log
|
||||
if [ -x $i ]; then
|
||||
(sh -c $i $append_log)
|
||||
rm $i
|
||||
else
|
||||
echo "ERROR: postinst $i failed."
|
||||
[ "$POSTINST_LOGGING" = "1" ] && eval echo "ERROR: postinst $i failed." $append_log
|
||||
remove_rcsd_link=0
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
remove_rcsd_link=1
|
||||
if $pm_installed; then
|
||||
case $pm in
|
||||
"ipk")
|
||||
if ! `fcntl-lock --wait 30 /run/opkg.lock true`; then
|
||||
eval echo "Unable to obtain the opkg lock, deadlock?" $append_log
|
||||
fi
|
||||
if ! eval "opkg configure $append_log"; then
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
"deb")
|
||||
if ! eval "eval dpkg --configure -a $append_log"; then
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
else
|
||||
exec_postinst_scriptlets
|
||||
fi
|
||||
|
||||
# since all postinstalls executed successfully, remove the rcS.d link
|
||||
if [ $remove_rcsd_link = 1 ]; then
|
||||
remove_rcsd_link
|
||||
fi
|
||||
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
run-postinsts
|
||||
@@ -0,0 +1,15 @@
|
||||
[Unit]
|
||||
Description=Run pending postinsts
|
||||
DefaultDependencies=no
|
||||
After=systemd-remount-fs.service systemd-tmpfiles-setup.service tmp.mount ldconfig.service
|
||||
Before=sysinit.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=#SBINDIR#/run-postinsts
|
||||
ExecStartPost=#BASE_BINDIR#/systemctl disable run-postinsts.service
|
||||
RemainAfterExit=yes
|
||||
TimeoutSec=0
|
||||
|
||||
[Install]
|
||||
WantedBy=sysinit.target
|
||||
@@ -0,0 +1,46 @@
|
||||
SUMMARY = "Runs postinstall scripts on first boot of the target device"
|
||||
DESCRIPTION = "${SUMMARY}"
|
||||
SECTION = "devel"
|
||||
LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
|
||||
|
||||
SRC_URI = "file://run-postinsts \
|
||||
file://run-postinsts.init \
|
||||
file://run-postinsts.service"
|
||||
|
||||
S = "${WORKDIR}"
|
||||
|
||||
inherit allarch systemd update-rc.d
|
||||
|
||||
RDEPENDS:${PN} = "util-linux-fcntl-lock"
|
||||
|
||||
INITSCRIPT_NAME = "run-postinsts"
|
||||
INITSCRIPT_PARAMS = "start 99 S ."
|
||||
|
||||
SYSTEMD_SERVICE:${PN} = "run-postinsts.service"
|
||||
|
||||
do_configure() {
|
||||
:
|
||||
}
|
||||
|
||||
do_compile () {
|
||||
:
|
||||
}
|
||||
|
||||
do_install() {
|
||||
install -d ${D}${sbindir}
|
||||
install -m 0755 ${WORKDIR}/run-postinsts ${D}${sbindir}/
|
||||
|
||||
install -d ${D}${sysconfdir}/init.d/
|
||||
install -m 0755 ${WORKDIR}/run-postinsts.init ${D}${sysconfdir}/init.d/run-postinsts
|
||||
|
||||
install -d ${D}${systemd_system_unitdir}/
|
||||
install -m 0644 ${WORKDIR}/run-postinsts.service ${D}${systemd_system_unitdir}/
|
||||
|
||||
sed -i -e 's:#SYSCONFDIR#:${sysconfdir}:g' \
|
||||
-e 's:#SBINDIR#:${sbindir}:g' \
|
||||
-e 's:#BASE_BINDIR#:${base_bindir}:g' \
|
||||
-e 's:#LOCALSTATEDIR#:${localstatedir}:g' \
|
||||
${D}${sbindir}/run-postinsts \
|
||||
${D}${systemd_system_unitdir}/run-postinsts.service
|
||||
}
|
||||
Reference in New Issue
Block a user