diff options
| author | Adrian Bunk <bunk@stusta.de> | 2019-05-16 10:27:18 +0300 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2019-05-18 12:42:47 -0700 |
| commit | 18a5897143b80ce207a8ed6634ee5650472f8c6a (patch) | |
| tree | 995c9a9b0c0d8d4b4c0e7b88c5cadb3f4ba9309b | |
| parent | 590663da5daa11095b036de634e068e25ea94009 (diff) | |
| download | meta-openembedded-18a5897143b80ce207a8ed6634ee5650472f8c6a.tar.gz | |
Add irda-utils
Removed from oe-core since IrDA support was removed in kernel 4.17,
added here in case there are users left on older kernels.
RRECOMMENDS are the former RRECOMMENDS_packagegroup-base-irda.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
4 files changed, 258 insertions, 0 deletions
diff --git a/meta-oe/recipes-bsp/irda-utils/irda-utils-0.9.18/init b/meta-oe/recipes-bsp/irda-utils/irda-utils-0.9.18/init new file mode 100755 index 0000000000..6f29e9c6ed --- /dev/null +++ b/meta-oe/recipes-bsp/irda-utils/irda-utils-0.9.18/init | |||
| @@ -0,0 +1,78 @@ | |||
| 1 | #! /bin/sh | ||
| 2 | ### BEGIN INIT INFO | ||
| 3 | # Provides: irda | ||
| 4 | # Required-Start: $network $remote_fs | ||
| 5 | # Required-Stop: $network $remote_fs | ||
| 6 | # Default-Start: 2 3 4 5 | ||
| 7 | # Default-Stop: 0 1 6 | ||
| 8 | # Short-Description: Infrared port support | ||
| 9 | ### END INIT INFO | ||
| 10 | |||
| 11 | NAME="irattach" | ||
| 12 | test -x "$IRDA_DAEMON" || IRDA_DAEMON=/usr/sbin/irattach | ||
| 13 | test -z "$IRATTACH_PID" && IRATTACH_PID=/var/run/irattach.pid | ||
| 14 | |||
| 15 | # Source function library. | ||
| 16 | . /etc/init.d/functions | ||
| 17 | |||
| 18 | module_id() { | ||
| 19 | awk 'BEGIN { FS=": " } /Hardware/ { print $2 } ' </proc/cpuinfo | ||
| 20 | } | ||
| 21 | |||
| 22 | if [ ! -f /etc/sysconfig/irda ]; then | ||
| 23 | case `module_id` in | ||
| 24 | "HP iPAQ H2200" | "HP iPAQ HX4700" | "HTC Universal") | ||
| 25 | IRDA=yes | ||
| 26 | DEVICE=/dev/ttyS2 | ||
| 27 | DONGLE= | ||
| 28 | DISCOVERY= | ||
| 29 | ;; | ||
| 30 | *) | ||
| 31 | IRDA=yes | ||
| 32 | DEVICE=/dev/ttyS1 | ||
| 33 | DONGLE= | ||
| 34 | DISCOVERY= | ||
| 35 | ;; | ||
| 36 | esac | ||
| 37 | else | ||
| 38 | . /etc/sysconfig/irda | ||
| 39 | fi | ||
| 40 | |||
| 41 | # Check that irda is up. | ||
| 42 | [ ${IRDA} = "no" ] && exit 0 | ||
| 43 | |||
| 44 | [ -f /usr/sbin/irattach ] || exit 0 | ||
| 45 | |||
| 46 | ARGS= | ||
| 47 | if [ $DONGLE ]; then | ||
| 48 | ARGS="$ARGS -d $DONGLE" | ||
| 49 | fi | ||
| 50 | if [ "$DISCOVERY" = "yes" ];then | ||
| 51 | ARGS="$ARGS -s" | ||
| 52 | fi | ||
| 53 | |||
| 54 | case "$1" in | ||
| 55 | start) | ||
| 56 | echo -n "Starting IrDA: $NAME" | ||
| 57 | start-stop-daemon --start --quiet --exec "$IRDA_DAEMON" ${DEVICE} ${ARGS} --pidfile "$IRATTACH_PID" | ||
| 58 | sleep 1 | ||
| 59 | [ -f /var/run/irattach.pid ] && echo " done" || echo " fail" | ||
| 60 | ;; | ||
| 61 | stop) | ||
| 62 | echo "Stopping IrDA: $NAME" | ||
| 63 | start-stop-daemon --stop --quiet --exec "$IRDA_DAEMON" --pidfile "$IRATTACH_PID" | ||
| 64 | ;; | ||
| 65 | restart|force-reload) | ||
| 66 | $0 stop | ||
| 67 | $0 start | ||
| 68 | ;; | ||
| 69 | status) | ||
| 70 | status irattach | ||
| 71 | exit $? | ||
| 72 | ;; | ||
| 73 | *) | ||
| 74 | N=/etc/init.d/$NAME | ||
| 75 | echo "Usage: $N {start|stop|restart|force-reload|status}" >&2 | ||
| 76 | exit 1 | ||
| 77 | ;; | ||
| 78 | esac | ||
diff --git a/meta-oe/recipes-bsp/irda-utils/irda-utils-0.9.18/ldflags.patch b/meta-oe/recipes-bsp/irda-utils/irda-utils-0.9.18/ldflags.patch new file mode 100644 index 0000000000..b246de8f5f --- /dev/null +++ b/meta-oe/recipes-bsp/irda-utils/irda-utils-0.9.18/ldflags.patch | |||
| @@ -0,0 +1,87 @@ | |||
| 1 | Obey LDFLAGS | ||
| 2 | |||
| 3 | Signed-off-by: Christopher Larson <chris_larson@mentor.com> | ||
| 4 | Upstream-Status: Pending | ||
| 5 | |||
| 6 | Index: irda-utils-0.9.18/findchip/Makefile | ||
| 7 | =================================================================== | ||
| 8 | --- irda-utils-0.9.18.orig/findchip/Makefile | ||
| 9 | +++ irda-utils-0.9.18/findchip/Makefile | ||
| 10 | @@ -65,5 +65,5 @@ install: findchip | ||
| 11 | |||
| 12 | gfindchip: gfindchip.c | ||
| 13 | $(prn_cc) | ||
| 14 | - $(ECMD))$(CC) $(CFLAGS) `gtk-config --cflags` $< -o $@ `gtk-config --libs` | ||
| 15 | + $(ECMD)$(CC) $(CFLAGS) $(LDFLAGS) `gtk-config --cflags` $< -o $@ `gtk-config --libs` | ||
| 16 | |||
| 17 | Index: irda-utils-0.9.18/irattach/Makefile | ||
| 18 | =================================================================== | ||
| 19 | --- irda-utils-0.9.18.orig/irattach/Makefile | ||
| 20 | +++ irda-utils-0.9.18/irattach/Makefile | ||
| 21 | @@ -49,13 +49,13 @@ all: $(TARGETS) | ||
| 22 | |||
| 23 | irattach: irattach.o util.o | ||
| 24 | $(prn_cc_o) | ||
| 25 | - $(ECMD)$(CC) $(CFLAGS) irattach.o util.o -o $@ | ||
| 26 | + $(ECMD)$(CC) $(CFLAGS) $(LDFLAGS) irattach.o util.o -o $@ | ||
| 27 | |||
| 28 | |||
| 29 | |||
| 30 | dongle_attach: dongle_attach.o | ||
| 31 | $(prn_cc_o) | ||
| 32 | - $(ECMD)$(CC) $(CFLAGS) dongle_attach.o -o $@ | ||
| 33 | + $(ECMD)$(CC) $(CFLAGS) $(LDFLAGS) dongle_attach.o -o $@ | ||
| 34 | |||
| 35 | |||
| 36 | install: $(TARGETS) | ||
| 37 | Index: irda-utils-0.9.18/irdadump/Makefile | ||
| 38 | =================================================================== | ||
| 39 | --- irda-utils-0.9.18.orig/irdadump/Makefile | ||
| 40 | +++ irda-utils-0.9.18/irdadump/Makefile | ||
| 41 | @@ -40,7 +40,7 @@ lib_irdadump.a: $(LIBIRDADUMP_OBJS) | ||
| 42 | |||
| 43 | irdadump: $(IRDADUMP_OBJS) $(LIBIRDADUMP_TARGET) | ||
| 44 | $(prn_cc_o) | ||
| 45 | - $(ECMD)$(CC) $(CFLAGS) `pkg-config --libs glib-2.0` -o $(IRDADUMP_TARGET) $< $(LIBIRDADUMP_TARGET) | ||
| 46 | + $(ECMD)$(CC) $(CFLAGS) $(LDFLAGS) `pkg-config --libs glib-2.0` -o $(IRDADUMP_TARGET) $< $(LIBIRDADUMP_TARGET) | ||
| 47 | |||
| 48 | |||
| 49 | .c.o: | ||
| 50 | Index: irda-utils-0.9.18/irdaping/Makefile | ||
| 51 | =================================================================== | ||
| 52 | --- irda-utils-0.9.18.orig/irdaping/Makefile | ||
| 53 | +++ irda-utils-0.9.18/irdaping/Makefile | ||
| 54 | @@ -56,7 +56,7 @@ all: $(TARGETS) | ||
| 55 | |||
| 56 | irdaping: $(OBJS) | ||
| 57 | $(prn_cc_o) | ||
| 58 | - $(ECMD)$(CC) $(CFLAGS) $(OBJS) -o $@ | ||
| 59 | + $(ECMD)$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@ | ||
| 60 | |||
| 61 | |||
| 62 | .c.o: | ||
| 63 | Index: irda-utils-0.9.18/irnetd/Makefile | ||
| 64 | =================================================================== | ||
| 65 | --- irda-utils-0.9.18.orig/irnetd/Makefile | ||
| 66 | +++ irda-utils-0.9.18/irnetd/Makefile | ||
| 67 | @@ -50,7 +50,7 @@ all: $(TARGETS) | ||
| 68 | |||
| 69 | irnetd: $(OBJS) | ||
| 70 | $(prn_cc_o) | ||
| 71 | - $(ECMD)$(CC) $(CFLAGS) $(OBJS) -o $@ | ||
| 72 | + $(ECMD)$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@ | ||
| 73 | |||
| 74 | |||
| 75 | install: irnetd | ||
| 76 | Index: irda-utils-0.9.18/psion/Makefile | ||
| 77 | =================================================================== | ||
| 78 | --- irda-utils-0.9.18.orig/psion/Makefile | ||
| 79 | +++ irda-utils-0.9.18/psion/Makefile | ||
| 80 | @@ -25,4 +25,4 @@ install: $(PSION_TARGETS) | ||
| 81 | CFLAGS += -g -I../include -Wall -Wstrict-prototypes $(RPM_OPT_FLAGS) | ||
| 82 | irpsion5: | ||
| 83 | $(prn_cc_o) | ||
| 84 | - $(ECMD)$(CC) $(CFLAGS) $(PSION_SRC) -o $@ | ||
| 85 | \ No newline at end of file | ||
| 86 | + $(ECMD)$(CC) $(CFLAGS) $(LDFLAGS) $(PSION_SRC) -o $@ | ||
| 87 | \ No newline at end of file | ||
diff --git a/meta-oe/recipes-bsp/irda-utils/irda-utils-0.9.18/musl.patch b/meta-oe/recipes-bsp/irda-utils/irda-utils-0.9.18/musl.patch new file mode 100644 index 0000000000..97eb975023 --- /dev/null +++ b/meta-oe/recipes-bsp/irda-utils/irda-utils-0.9.18/musl.patch | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | Replace use of <net/if_packet.h> with <linux/if_packet.h>. | ||
| 2 | |||
| 3 | kernel headers <linux/if_packet.h> already provides the | ||
| 4 | needed definitions, moreover not all libc implementations | ||
| 5 | provide if_packet.h e.g. musl | ||
| 6 | |||
| 7 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 8 | Upstream-Status: Pending | ||
| 9 | |||
| 10 | Index: irda-utils-0.9.18/irdaping/irdaping.c | ||
| 11 | =================================================================== | ||
| 12 | --- irda-utils-0.9.18.orig/irdaping/irdaping.c | ||
| 13 | +++ irda-utils-0.9.18/irdaping/irdaping.c | ||
| 14 | @@ -33,7 +33,6 @@ | ||
| 15 | #include <sys/socket.h> | ||
| 16 | #include <sys/ioctl.h> | ||
| 17 | #include <net/if.h> /* For struct ifreq */ | ||
| 18 | -#include <net/if_packet.h> /* For struct sockaddr_pkt */ | ||
| 19 | #include <net/if_arp.h> /* For ARPHRD_IRDA */ | ||
| 20 | #include <netinet/if_ether.h> /* For ETH_P_ALL */ | ||
| 21 | #include <netinet/in.h> /* For htons */ | ||
| 22 | @@ -46,6 +45,7 @@ | ||
| 23 | #include <asm/byteorder.h> /* __cpu_to_le32 and co. */ | ||
| 24 | |||
| 25 | #include <linux/types.h> /* For __u8 and co. */ | ||
| 26 | +#include <linux/if_packet.h> /* For struct sockaddr_pkt */ | ||
| 27 | #include <irda.h> | ||
| 28 | |||
| 29 | #ifndef AF_IRDA | ||
diff --git a/meta-oe/recipes-bsp/irda-utils/irda-utils_0.9.18.bb b/meta-oe/recipes-bsp/irda-utils/irda-utils_0.9.18.bb new file mode 100644 index 0000000000..caffcb6966 --- /dev/null +++ b/meta-oe/recipes-bsp/irda-utils/irda-utils_0.9.18.bb | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | SUMMARY = "Common files for IrDA" | ||
| 2 | DESCRIPTION = "Provides common files needed to use IrDA. \ | ||
| 3 | IrDA allows communication over Infrared with other devices \ | ||
| 4 | such as phones and laptops." | ||
| 5 | HOMEPAGE = "http://irda.sourceforge.net/" | ||
| 6 | BUGTRACKER = "http://sourceforge.net/p/irda/bugs/" | ||
| 7 | SECTION = "base" | ||
| 8 | LICENSE = "GPLv2+" | ||
| 9 | LIC_FILES_CHKSUM = "file://irdadump/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ | ||
| 10 | file://smcinit/COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \ | ||
| 11 | file://man/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ | ||
| 12 | file://irdadump/irdadump.c;beginline=1;endline=24;md5=d78b9dce3cd78c2220250c9c7a2be178" | ||
| 13 | |||
| 14 | SRC_URI = "${SOURCEFORGE_MIRROR}/irda/irda-utils-${PV}.tar.gz \ | ||
| 15 | file://ldflags.patch \ | ||
| 16 | file://musl.patch \ | ||
| 17 | file://init" | ||
| 18 | |||
| 19 | SRC_URI[md5sum] = "84dc12aa4c3f61fccb8d8919bf4079bb" | ||
| 20 | SRC_URI[sha256sum] = "61980551e46b2eaa9e17ad31cbc1a638074611fc33bff34163d10c7a67a9fdc6" | ||
| 21 | |||
| 22 | inherit update-rc.d | ||
| 23 | |||
| 24 | RRECOMMENDS_${PN} = "\ | ||
| 25 | kernel-module-pxaficp-ir \ | ||
| 26 | kernel-module-irda \ | ||
| 27 | kernel-module-ircomm \ | ||
| 28 | kernel-module-ircomm-tty \ | ||
| 29 | kernel-module-irlan \ | ||
| 30 | ${@bb.utils.contains('DISTRO_FEATURES', 'ppp', 'kernel-module-irnet', '',d)} \ | ||
| 31 | kernel-module-irport \ | ||
| 32 | kernel-module-irtty \ | ||
| 33 | kernel-module-irtty-sir \ | ||
| 34 | kernel-module-sir-dev \ | ||
| 35 | ${@bb.utils.contains('COMBINED_FEATURES', 'usbhost', 'kernel-module-ir-usb', '',d)} " | ||
| 36 | |||
| 37 | EXTRA_OEMAKE = "\ | ||
| 38 | 'CC=${CC}' \ | ||
| 39 | 'LD=${LD}' \ | ||
| 40 | 'CFLAGS=${CFLAGS}' \ | ||
| 41 | 'LDFLAGS=${LDFLAGS}' \ | ||
| 42 | 'SYS_INCLUDES=' \ | ||
| 43 | 'V=1' \ | ||
| 44 | " | ||
| 45 | |||
| 46 | INITSCRIPT_NAME = "irattach" | ||
| 47 | INITSCRIPT_PARAMS = "defaults 20" | ||
| 48 | |||
| 49 | TARGETS ??= "irattach irdaping" | ||
| 50 | do_compile () { | ||
| 51 | for t in ${TARGETS}; do | ||
| 52 | oe_runmake -C $t | ||
| 53 | done | ||
| 54 | } | ||
| 55 | |||
| 56 | do_install () { | ||
| 57 | install -d ${D}${sbindir} | ||
| 58 | for t in ${TARGETS}; do | ||
| 59 | oe_runmake -C $t ROOT="${D}" install | ||
| 60 | done | ||
| 61 | |||
| 62 | install -d ${D}${sysconfdir}/init.d | ||
| 63 | install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME} | ||
| 64 | } | ||
