summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/eject
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2015-10-08 22:51:41 +0200
committerTudor Florea <tudor.florea@enea.com>2015-10-08 22:51:41 +0200
commit1219bf8a90a7bf8cd3a5363551ef635d51e8fc8e (patch)
treea21a5fc103bb3bd65ecd85ed22be5228fc54e447 /meta-oe/recipes-support/eject
downloadmeta-openembedded-1219bf8a90a7bf8cd3a5363551ef635d51e8fc8e.tar.gz
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta-oe/recipes-support/eject')
-rw-r--r--meta-oe/recipes-support/eject/eject/eject-2.1.1-verbose.patch19
-rw-r--r--meta-oe/recipes-support/eject/eject/eject-2.1.5-error-return.patch12
-rw-r--r--meta-oe/recipes-support/eject/eject/eject-2.1.5-spaces.patch66
-rw-r--r--meta-oe/recipes-support/eject/eject/eject-timeout.patch17
-rw-r--r--meta-oe/recipes-support/eject/eject_2.1.5.bb35
5 files changed, 149 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/eject/eject/eject-2.1.1-verbose.patch b/meta-oe/recipes-support/eject/eject/eject-2.1.1-verbose.patch
new file mode 100644
index 000000000..740360606
--- /dev/null
+++ b/meta-oe/recipes-support/eject/eject/eject-2.1.1-verbose.patch
@@ -0,0 +1,19 @@
1Kept to help with debugging
2
3Upstream-Status: Pending
4
5Signed-off-by: Morgan Little <morgan.little@windriver.com>
6
7--- eject-2.1.1/eject.c.tn 2005-08-24 11:27:42.000000000 +0200
8+++ eject-2.1.1/eject.c 2005-08-24 11:33:05.000000000 +0200
9@@ -638,7 +638,9 @@
10 unsigned char sense_buffer[32];
11
12 if ((ioctl(fd, SG_GET_VERSION_NUM, &k) < 0) || (k < 30000)) {
13- printf("not an sg device, or old sg driver\n");
14+ if (v_option) {
15+ printf(_("not an sg device, or old sg driver\n"));
16+ }
17 return 0;
18 }
19
diff --git a/meta-oe/recipes-support/eject/eject/eject-2.1.5-error-return.patch b/meta-oe/recipes-support/eject/eject/eject-2.1.5-error-return.patch
new file mode 100644
index 000000000..5e13036c5
--- /dev/null
+++ b/meta-oe/recipes-support/eject/eject/eject-2.1.5-error-return.patch
@@ -0,0 +1,12 @@
1Upstream-Status: Inappropriate [the upstream is no longer active]
2
3--- eject/eject.c.orig 2013-09-11 18:08:36.000000000 +0800
4+++ eject/eject.c 2013-09-11 18:09:05.000000000 +0800
5@@ -207,7 +207,6 @@
6 "If omitted, name defaults to `%s'.\n"
7 "By default tries -r, -s, -f, and -q in order until success.\n"),
8 DEFAULTDEVICE);
9- exit(1);
10 }
11
12
diff --git a/meta-oe/recipes-support/eject/eject/eject-2.1.5-spaces.patch b/meta-oe/recipes-support/eject/eject/eject-2.1.5-spaces.patch
new file mode 100644
index 000000000..a16c4b1ce
--- /dev/null
+++ b/meta-oe/recipes-support/eject/eject/eject-2.1.5-spaces.patch
@@ -0,0 +1,66 @@
1Kept to help with spaces in the mount path
2
3Upstream-Status: Backport
4
5Linux mangles spaces in mount points by changing them to an octal string
6of '\040'. So lets scan the mount point and fix it up by replacing all
7occurrences off '\0##' with the ASCII value of 0##. Requires a writable
8string as input as we mangle in place. Some of this was taken from the
9util-linux package.
10
11Signed-off-by: Morgan Little <morgan.little@windriver.com>
12--- eject/eject.c.ori 2007-06-24 00:08:44 -0700
13+++ eject/eject.c 2007-06-24 00:12:44 -0700
14@@ -370,6 +370,30 @@
15
16
17 /*
18+ * Linux mangles spaces in mount points by changing them to an octal string
19+ * of '\040'. So lets scan the mount point and fix it up by replacing all
20+ * occurrences off '\0##' with the ASCII value of 0##. Requires a writable
21+ * string as input as we mangle in place. Some of this was taken from the
22+ * util-linux package.
23+ */
24+#define octalify(a) ((a) & 7)
25+#define tooctal(s) (64*octalify(s[1]) + 8*octalify(s[2]) + octalify(s[3]))
26+#define isoctal(a) (((a) & ~7) == '0')
27+static char *DeMangleMount(char *s)
28+{
29+ char *tmp = s;
30+ while ((tmp = strchr(tmp, '\\')) != NULL) {
31+ if (isoctal(tmp[1]) && isoctal(tmp[2]) && isoctal(tmp[3])) {
32+ tmp[0] = tooctal(tmp);
33+ memmove(tmp+1, tmp+4, strlen(tmp)-3);
34+ }
35+ ++tmp;
36+ }
37+ return s;
38+}
39+
40+
41+/*
42 * Given name, such as foo, see if any of the following exist:
43 *
44 * foo (if foo starts with '.' or '/')
45@@ -884,8 +908,8 @@
46 if (((strcmp(s1, name) == 0) || (strcmp(s2, name) == 0)) ||
47 ((maj != -1) && (maj == mtabmaj) && (min == mtabmin))) {
48 FCLOSE(fp);
49- *deviceName = strdup(s1);
50- *mountName = strdup(s2);
51+ *deviceName = DeMangleMount(strdup(s1));
52+ *mountName = DeMangleMount(strdup(s2));
53 return 1;
54 }
55 }
56@@ -928,8 +952,8 @@
57 rc = sscanf(line, "%1023s %1023s", s1, s2);
58 if (rc >= 2 && s1[0] != '#' && strcmp(s2, name) == 0) {
59 FCLOSE(fp);
60- *deviceName = strdup(s1);
61- *mountName = strdup(s2);
62+ *deviceName = DeMangleMount(strdup(s1));
63+ *mountName = DeMangleMount(strdup(s2));
64 return 1;
65 }
66 }
diff --git a/meta-oe/recipes-support/eject/eject/eject-timeout.patch b/meta-oe/recipes-support/eject/eject/eject-timeout.patch
new file mode 100644
index 000000000..de8146f32
--- /dev/null
+++ b/meta-oe/recipes-support/eject/eject/eject-timeout.patch
@@ -0,0 +1,17 @@
1allow a longer timeout
2
3Upstream-Status: Backport
4
5Signed-off-by: Morgan Little <morgan.little@windriver.com>
6
7--- eject/eject.c.orig 2006-08-07 16:35:15.000000000 +0200
8+++ eject/eject.c 2006-08-07 16:35:54.000000000 +0200
9@@ -723,7 +723,7 @@
10 io_hdr.dxfer_len = 0;
11 io_hdr.dxferp = inqBuff;
12 io_hdr.sbp = sense_buffer;
13- io_hdr.timeout = 2000;
14+ io_hdr.timeout = 10000;
15
16 io_hdr.cmdp = allowRmBlk;
17 status = ioctl(fd, SG_IO, (void *)&io_hdr);
diff --git a/meta-oe/recipes-support/eject/eject_2.1.5.bb b/meta-oe/recipes-support/eject/eject_2.1.5.bb
new file mode 100644
index 000000000..0440f0c37
--- /dev/null
+++ b/meta-oe/recipes-support/eject/eject_2.1.5.bb
@@ -0,0 +1,35 @@
1DESCRIPTION = "Eject allows removable media (typically a CD-ROM, floppy disk, tape, or JAZ or ZIP disk) to be ejected under software control."
2HOMEPAGE = "http://eject.sourceforge.net/"
3LICENSE = "GPLv2"
4LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
5
6inherit autotools gettext update-alternatives
7
8SRC_URI = "http://sources.openembedded.org/${BP}.tar.gz \
9 file://eject-2.1.5-error-return.patch \
10 file://eject-2.1.1-verbose.patch \
11 file://eject-2.1.5-spaces.patch \
12 file://eject-timeout.patch \
13"
14
15SRC_URI[md5sum] = "b96a6d4263122f1711db12701d79f738"
16SRC_URI[sha256sum] = "ef9f7906484cfde4ba223b2682a37058f9a3c7d3bb1adda7a34a67402e2ffe55"
17
18S = "${WORKDIR}/${BPN}"
19
20PR = "r1"
21
22do_compile_prepend() {
23 # PO subdir must be in build directory
24 if [ ! ${S} = ${B} ]; then
25 mkdir -p ${B}/po
26 cp -r ${S}/po/* ${B}/po/
27 fi
28}
29
30ALTERNATIVE_${PN} = "volname eject"
31ALTERNATIVE_LINK_NAME[volname] = "${bindir}/volname"
32ALTERNATIVE_LINK_NAME[eject] = "${bindir}/eject"
33ALTERNATIVE_PRIORITY[volname] = "100"
34ALTERNATIVE_PRIORITY[eject] = "100"
35