Add busybox configuration for stm32mp machine
Signed-off-by: Christophe Priouzeau <christophe.priouzeau@st.com>
This commit is contained in:
parent
6ab1f8c68f
commit
3e1571bb6d
|
|
@ -0,0 +1,38 @@
|
||||||
|
From 08d9bcdef21f117511e109d28507c9f76045914f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Yannick Fertre <yannick.fertre@st.com>
|
||||||
|
Date: Fri, 16 Sep 2016 16:59:37 +0200
|
||||||
|
Subject: [PATCH] miscutils: watchdog: Add gettimeleft
|
||||||
|
|
||||||
|
For purpose debug only, call of ioctl GETTIMELEFT
|
||||||
|
|
||||||
|
Signed-off-by: Yannick Fertre <yannick.fertre@st.com>
|
||||||
|
---
|
||||||
|
/miscutils/watchdog.c | 5 +++++
|
||||||
|
1 file changed, 5 insertions(+)
|
||||||
|
|
||||||
|
diff --git a//miscutils/watchdog.c b//miscutils/watchdog.c
|
||||||
|
index d3a76ed..d8e1c0e 100644
|
||||||
|
--- a//miscutils/watchdog.c
|
||||||
|
+++ b//miscutils/watchdog.c
|
||||||
|
@@ -50,6 +50,7 @@ int watchdog_main(int argc, char **argv)
|
||||||
|
unsigned opts;
|
||||||
|
unsigned stimer_duration; /* how often to restart */
|
||||||
|
unsigned htimer_duration = 60000; /* reboots after N ms if not restarted */
|
||||||
|
+ unsigned time_left;
|
||||||
|
char *st_arg;
|
||||||
|
char *ht_arg;
|
||||||
|
|
||||||
|
@@ -105,6 +106,10 @@ int watchdog_main(int argc, char **argv)
|
||||||
|
*/
|
||||||
|
write(3, "", 1); /* write zero byte */
|
||||||
|
usleep(stimer_duration * 1000L);
|
||||||
|
+
|
||||||
|
+#ifdef WDIOC_GETTIMELEFT
|
||||||
|
+ ioctl_or_warn(3, WDIOC_GETTIMELEFT, &time_left);
|
||||||
|
+#endif
|
||||||
|
}
|
||||||
|
return EXIT_SUCCESS; /* - not reached, but gcc 4.2.1 is too dumb! */
|
||||||
|
}
|
||||||
|
--
|
||||||
|
1.9.1
|
||||||
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
# Enable MDEV feature for initramfs
|
||||||
|
CONFIG_MDEV=y
|
||||||
|
CONFIG_FEATURE_MDEV_CONF=y
|
||||||
|
CONFIG_FEATURE_MDEV_RENAME=y
|
||||||
|
CONFIG_FEATURE_MDEV_RENAME_REGEXP=y
|
||||||
|
CONFIG_FEATURE_MDEV_EXEC=y
|
||||||
|
CONFIG_FEATURE_MDEV_LOAD_FIRMWARE=y
|
||||||
|
CONFIG_WATCHDOG=y
|
||||||
|
CONFIG_SETSID=y
|
||||||
|
CONFIG_CTTYHACK=y
|
||||||
|
CONFIG_UDPSVD=y
|
||||||
|
CONFIG_TFTPD=y
|
||||||
|
CONFIG_IFPLUGD=y
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
set -e
|
||||||
|
|
||||||
|
#Ensure the correct values are received by the script
|
||||||
|
if [ -z "$1" ] || [ -z "$2" ] ; then
|
||||||
|
echo "Wrong arguments for ifplugd" > /dev/stderr
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$2" = "up" ]
|
||||||
|
then
|
||||||
|
echo "ifplugd up"
|
||||||
|
ifup $1
|
||||||
|
/sbin/udhcpc -D -s /usr/share/udhcpc/default.script
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$2" = "down" ]
|
||||||
|
then
|
||||||
|
echo "ifplugd down"
|
||||||
|
ifdown $1
|
||||||
|
#/sbin/ifconfig $1 down
|
||||||
|
fi
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
INTERFACES= "eth0"
|
||||||
|
ARGS="-fwI -u0 -d10"
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ -e /usr/sbin/ifplugd ]; then
|
||||||
|
/usr/sbin/ifplugd
|
||||||
|
fi
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
FILESEXTRAPATHS_prepend_stm32mpcommon := "${THISDIR}/${PN}:"
|
||||||
|
|
||||||
|
SRC_URI_append_stm32mpcommon = " \
|
||||||
|
file://${BUSYBOX_CONFIG_FRAGMENT} \
|
||||||
|
file://0001-miscutils-watchdog-Add-gettimeleft.patch \
|
||||||
|
file://ifplugd.conf \
|
||||||
|
file://ifplugd.action \
|
||||||
|
file://ifplugd.sh \
|
||||||
|
"
|
||||||
|
|
||||||
|
BUSYBOX_CONFIG_FRAGMENT_stm32mpcommon = "busybox-stm32mp.cfg"
|
||||||
|
|
||||||
|
#inherit update-rc.d
|
||||||
|
DEPENDS_append_stm32mpcommon = " ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'update-rc.d-native', d)}"
|
||||||
|
|
||||||
|
do_configure_append_stm32mpcommon () {
|
||||||
|
# merge specific configuration to newly generated .config
|
||||||
|
merge_config.sh -m -r -O ${B} ${B}/.config ${WORKDIR}/${BUSYBOX_CONFIG_FRAGMENT} 1>&2
|
||||||
|
# make sure to generate proper config file for busybox
|
||||||
|
cml1_do_configure
|
||||||
|
}
|
||||||
|
|
||||||
|
do_install_append_stm32mpcommon () {
|
||||||
|
if [ "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '1', '0', d)}" = "0" ]; then
|
||||||
|
if grep -q "CONFIG_IFPLUGD=y" ${B}/.config; then
|
||||||
|
install -d ${D}${sysconfdir}/ifplugd
|
||||||
|
install -m 755 ${WORKDIR}/ifplugd.sh ${D}${sysconfdir}/init.d/ifplugd.sh
|
||||||
|
update-rc.d -r ${D} ifplugd.sh start 99 2 3 4 5 .
|
||||||
|
install -m 755 ${WORKDIR}/ifplugd.conf ${D}${sysconfdir}/ifplugd/ifplugd.conf
|
||||||
|
install -m 755 ${WORKDIR}/ifplugd.action ${D}${sysconfdir}/ifplugd/ifplugd.action
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue