View | Details | Raw Unified | Return to bug 256754 | Differences between
and this patch

Collapse All | Expand All

(-)b/net/remarkable-devd/Makefile (+27 lines)
Added Link Here
1
# Created by: Trenton Schulz <trueos@norwegianrockcat.com>
2
3
PORTNAME=	remarkable-devd
4
PORTVERSION=	1.0
5
CATEGORIES=	net
6
MASTER_SITES=	#
7
DISTFILES=      #
8
9
MAINTAINER=	trueos@norwegianrockcat.com
10
COMMENT=	Devd hotplug rules for Remarkable Tablet
11
12
LICENSE=	BSD2CLAUSE
13
14
NO_BUILD=	yes
15
16
USE_RC_SUBR=	remarkable
17
18
SUB_FILES=	pkg-message \
19
		remarkable.conf
20
21
PLIST_FILES=	etc/devd/remarkable.conf \
22
		etc/rc.d/remarkable
23
do-install:
24
	${INSTALL_DATA} ${WRKDIR}/remarkable.conf ${STAGEDIR}${PREFIX}/etc/devd/remarkable.conf
25
	${INSTALL_SCRIPT} ${WRKDIR}/remarkable ${STAGEDIR}${PREFIX}/etc/rc.d/remarkable
26
27
.include <bsd.port.mk>
(-)b/net/remarkable-devd/files/pkg-message.in (+14 lines)
Added Link Here
1
[
2
{ type: install
3
  message: <<EOM
4
A devd rule and rc script has been added to get an address from the
5
remarkable tablet when it is connected. This is disabled by default.
6
Set remarkable_enable=YES if you want this to happen automatically. Devd must also be restarted.
7
8
# sysrc remarkable_enable=YES
9
# service devd restart
10
11
For details, see %%PREFIX%%/etc/devd/remarkable.conf and %%PREFIX%%/etc/rc.d/remarkable
12
EOM
13
}
14
]
(-)b/net/remarkable-devd/files/remarkable.conf.in (+7 lines)
Added Link Here
1
# Connect the Remarkable 1 device and get the IP address
2
attach 100 {
3
       device-name "urndis.+";
4
       match "vendor"	"0x04b3";
5
       match "product"	"0x4010";
6
       action "%%PREFIX%%/etc/rc.d/remarkable start $device-name";
7
};
(-)b/net/remarkable-devd/files/remarkable.in (+45 lines)
Added Link Here
1
#!/bin/sh
2
#
3
# PROVIDE: webcamd
4
# REQUIRE: FILESYSTEMS netif dbus
5
# BEFORE: devd
6
# KEYWORD: shutdown
7
8
. /etc/rc.subr
9
10
name=remarkable
11
rcvar=remarkable_enable
12
load_rc_config $name
13
14
devd_device=${2}
15
start_cmd="${name}_start"
16
17
remarkable_start_devd()
18
{
19
    # Find the USB Ethernet for the device
20
    # We first grab the total number of interfaces in
21
    # the case when all the interfaces are USB Ethernet
22
    local total_ifs=`sysctl -n net.link.generic.system.ifcount`
23
    local i=0
24
    for i in $(seq 0 $total_ifs)
25
    do
26
	ueparent=`sysctl -n net.ue.$i.%parent`
27
	if [ $? -eq 0 ] && [ $ueparent = $devd_device ]; then
28
	    /sbin/dhclient ue$i
29
	    return
30
	fi
31
    done
32
    echo "Couldn't find a remarkable tablet."
33
}
34
35
remarkable_start()
36
{
37
    if [ "$devd_device" ]; then
38
	remarkable_start_devd
39
    else
40
	echo "Plug in your Remarkable to connect to it" 
41
    fi
42
}
43
44
run_rc_command "$1"
45
(-)b/net/remarkable-devd/pkg-descr (+3 lines)
Added Link Here
1
Automatic IP address when connecting a Remarkable Tablet to USB. This
2
makes it possible to access your Remarkable tablet via ssh or its USB
3
web interface when its enabled.

Return to bug 256754