summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-filesystems/recipes-utils/aufs-util/aufs-util/aufs-util-add-tool-concept-to-Makefile-for-cross-com.patch29
-rw-r--r--meta-filesystems/recipes-utils/aufs-util/aufs-util/aufs-util-don-t-strip-executables.patch37
-rw-r--r--meta-filesystems/recipes-utils/aufs-util/aufs-util/aufs_type.h210
-rw-r--r--meta-filesystems/recipes-utils/aufs-util/aufs-util_git.bb53
4 files changed, 329 insertions, 0 deletions
diff --git a/meta-filesystems/recipes-utils/aufs-util/aufs-util/aufs-util-add-tool-concept-to-Makefile-for-cross-com.patch b/meta-filesystems/recipes-utils/aufs-util/aufs-util/aufs-util-add-tool-concept-to-Makefile-for-cross-com.patch
new file mode 100644
index 0000000000..5c35586899
--- /dev/null
+++ b/meta-filesystems/recipes-utils/aufs-util/aufs-util/aufs-util-add-tool-concept-to-Makefile-for-cross-com.patch
@@ -0,0 +1,29 @@
1Subject: [PATCH] aufs-util: add tool concept to Makefile for cross compiling
2 purpose
3
4In a cross compilation environment, c2sh, c2tmac and ver need to be created first.
5Add a tools target to Makefile to allow for this.
6
7Upstream-Status: Pending
8
9Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
10---
11 Makefile | 2 +-
12 1 file changed, 1 insertion(+), 1 deletion(-)
13
14diff --git a/Makefile b/Makefile
15index 2f905ad..49c3cd5 100644
16--- a/Makefile
17+++ b/Makefile
18@@ -85,7 +85,7 @@ aufs.5: aufs.in.5 c2tmac
19 chmod a-w $@
20
21 c2sh c2tmac ver: CC = ${HOSTCC}
22-.INTERMEDIATE: c2sh c2tmac ver
23+tools: c2sh c2tmac ver
24
25 Install = install -o root -g root -p
26 install_sbin: File = auibusy auplink mount.aufs umount.aufs
27--
281.7.9.5
29
diff --git a/meta-filesystems/recipes-utils/aufs-util/aufs-util/aufs-util-don-t-strip-executables.patch b/meta-filesystems/recipes-utils/aufs-util/aufs-util/aufs-util-don-t-strip-executables.patch
new file mode 100644
index 0000000000..48727e6e22
--- /dev/null
+++ b/meta-filesystems/recipes-utils/aufs-util/aufs-util/aufs-util-don-t-strip-executables.patch
@@ -0,0 +1,37 @@
1From 244863eca77fcaa1187884836c3e28d6b6d1504a Mon Sep 17 00:00:00 2001
2From: Bruce Ashfield <bruce.ashfield@windriver.com>
3Date: Tue, 9 Apr 2013 18:50:34 -0700
4Subject: [PATCH] aufs-util: don't strip executables
5
6By default, aufs-util strips its binaries. This produces QA warnings
7as follows:
8
9 WARNING: File '/sbin/mount.aufs' from aufs-util was already stripped, this will prevent future debugging!
10 WARNING: File '/sbin/auplink' from aufs-util was already stripped, this will prevent future debugging!
11 WARNING: File '/sbin/umount.aufs' from aufs-util was already stripped, this will prevent future debugging!
12 WARNING: File '/sbin/auibusy' from aufs-util was already stripped, this will prevent future debugging!
13 WARNING: File '/usr/lib/libau.so.2.6' from aufs-util was already stripped, this will prevent future debugging!
14
15To prevent this, we remove -s from LDFLAGS.
16
17Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
18---
19 Makefile | 2 +-
20 1 file changed, 1 insertion(+), 1 deletion(-)
21
22diff --git a/Makefile b/Makefile
23index 2f905ad..e0c6dcd 100644
24--- a/Makefile
25+++ b/Makefile
26@@ -56,7 +56,7 @@ all: ver_test ${Man} ${Bin} ${Etc}
27 ver_test: ver
28 ./ver
29
30-${Bin}: LDFLAGS += -static -s
31+${Bin}: LDFLAGS += -static
32 ${Bin}: LDLIBS = -L. -lautil
33 ${BinObj}: %.o: %.c ${LibUtilHdr} ${LibUtil}
34
35--
361.7.10.4
37
diff --git a/meta-filesystems/recipes-utils/aufs-util/aufs-util/aufs_type.h b/meta-filesystems/recipes-utils/aufs-util/aufs-util/aufs_type.h
new file mode 100644
index 0000000000..cb439baa4c
--- /dev/null
+++ b/meta-filesystems/recipes-utils/aufs-util/aufs-util/aufs_type.h
@@ -0,0 +1,210 @@
1/*
2 * Copyright (C) 2005-2013 Junjiro R. Okajima
3 *
4 * This program, aufs is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19#ifndef __AUFS_TYPE_H__
20#define __AUFS_TYPE_H__
21
22#define AUFS_NAME "aufs"
23
24#include <stdint.h>
25#include <sys/types.h>
26
27#include <linux/limits.h>
28
29#define AUFS_VERSION "3.8-20130325"
30
31/* todo? move this to linux-2.6.19/include/magic.h */
32#define AUFS_SUPER_MAGIC ('a' << 24 | 'u' << 16 | 'f' << 8 | 's')
33
34/* ---------------------------------------------------------------------- */
35
36#ifdef CONFIG_AUFS_BRANCH_MAX_127
37typedef int8_t aufs_bindex_t;
38#define AUFS_BRANCH_MAX 127
39#else
40typedef int16_t aufs_bindex_t;
41#ifdef CONFIG_AUFS_BRANCH_MAX_511
42#define AUFS_BRANCH_MAX 511
43#elif defined(CONFIG_AUFS_BRANCH_MAX_1023)
44#define AUFS_BRANCH_MAX 1023
45#elif defined(CONFIG_AUFS_BRANCH_MAX_32767)
46#define AUFS_BRANCH_MAX 32767
47#endif
48#endif
49
50
51/* ---------------------------------------------------------------------- */
52
53#define AUFS_FSTYPE AUFS_NAME
54
55#define AUFS_ROOT_INO 2
56#define AUFS_FIRST_INO 11
57
58#define AUFS_WH_PFX ".wh."
59#define AUFS_WH_PFX_LEN ((int)sizeof(AUFS_WH_PFX) - 1)
60#define AUFS_WH_TMP_LEN 4
61/* a limit for rmdir/rename a dir */
62#define AUFS_MAX_NAMELEN (NAME_MAX \
63 - AUFS_WH_PFX_LEN * 2 /* doubly whiteouted */\
64 - 1 /* dot */\
65 - AUFS_WH_TMP_LEN) /* hex */
66#define AUFS_XINO_FNAME "." AUFS_NAME ".xino"
67#define AUFS_XINO_DEFPATH "/tmp/" AUFS_XINO_FNAME
68#define AUFS_XINO_TRUNC_INIT 64 /* blocks */
69#define AUFS_XINO_TRUNC_STEP 4 /* blocks */
70#define AUFS_DIRWH_DEF 3
71#define AUFS_RDCACHE_DEF 10 /* seconds */
72#define AUFS_RDCACHE_MAX 3600 /* seconds */
73#define AUFS_RDBLK_DEF 512 /* bytes */
74#define AUFS_RDHASH_DEF 32
75#define AUFS_WKQ_NAME AUFS_NAME "d"
76#define AUFS_MFS_DEF_SEC 30 /* seconds */
77#define AUFS_MFS_MAX_SEC 3600 /* seconds */
78#define AUFS_PLINK_WARN 100 /* number of plinks */
79
80/* pseudo-link maintenace under /proc */
81#define AUFS_PLINK_MAINT_NAME "plink_maint"
82#define AUFS_PLINK_MAINT_DIR "fs/" AUFS_NAME
83#define AUFS_PLINK_MAINT_PATH AUFS_PLINK_MAINT_DIR "/" AUFS_PLINK_MAINT_NAME
84
85#define AUFS_DIROPQ_NAME AUFS_WH_PFX ".opq" /* whiteouted doubly */
86#define AUFS_WH_DIROPQ AUFS_WH_PFX AUFS_DIROPQ_NAME
87
88#define AUFS_BASE_NAME AUFS_WH_PFX AUFS_NAME
89#define AUFS_PLINKDIR_NAME AUFS_WH_PFX "plnk"
90#define AUFS_ORPHDIR_NAME AUFS_WH_PFX "orph"
91
92/* doubly whiteouted */
93#define AUFS_WH_BASE AUFS_WH_PFX AUFS_BASE_NAME
94#define AUFS_WH_PLINKDIR AUFS_WH_PFX AUFS_PLINKDIR_NAME
95#define AUFS_WH_ORPHDIR AUFS_WH_PFX AUFS_ORPHDIR_NAME
96
97/* branch permissions and attributes */
98#define AUFS_BRPERM_RW "rw"
99#define AUFS_BRPERM_RO "ro"
100#define AUFS_BRPERM_RR "rr"
101#define AUFS_BRRATTR_WH "wh"
102#define AUFS_BRWATTR_NLWH "nolwh"
103
104/* ---------------------------------------------------------------------- */
105
106/* ioctl */
107enum {
108 /* readdir in userspace */
109 AuCtl_RDU,
110 AuCtl_RDU_INO,
111
112 /* pathconf wrapper */
113 AuCtl_WBR_FD,
114
115 /* busy inode */
116 AuCtl_IBUSY
117};
118
119/* borrowed from linux/include/linux/kernel.h */
120#ifndef ALIGN
121#define ALIGN(x, a) __ALIGN_MASK(x, (typeof(x))(a)-1)
122#define __ALIGN_MASK(x, mask) (((x)+(mask))&~(mask))
123#endif
124
125/* borrowed from linux/include/linux/compiler-gcc3.h */
126#ifndef __aligned
127#define __aligned(x) __attribute__((aligned(x)))
128#endif
129
130
131struct au_rdu_cookie {
132 uint64_t h_pos;
133 int16_t bindex;
134 uint8_t flags;
135 uint8_t pad;
136 uint32_t generation;
137} __aligned(8);
138
139struct au_rdu_ent {
140 uint64_t ino;
141 int16_t bindex;
142 uint8_t type;
143 uint8_t nlen;
144 uint8_t wh;
145 char name[0];
146} __aligned(8);
147
148static __inline__ int au_rdu_len(int nlen)
149{
150 /* include the terminating NULL */
151 return ALIGN(sizeof(struct au_rdu_ent) + nlen + 1,
152 sizeof(uint64_t));
153}
154
155union au_rdu_ent_ul {
156 struct au_rdu_ent *e;
157 uint64_t ul;
158};
159
160enum {
161 AufsCtlRduV_SZ,
162 AufsCtlRduV_End
163};
164
165struct aufs_rdu {
166 /* input */
167 union {
168 uint64_t sz; /* AuCtl_RDU */
169 uint64_t nent; /* AuCtl_RDU_INO */
170 };
171 union au_rdu_ent_ul ent;
172 uint16_t verify[AufsCtlRduV_End];
173
174 /* input/output */
175 uint32_t blk;
176
177 /* output */
178 union au_rdu_ent_ul tail;
179 /* number of entries which were added in a single call */
180 uint64_t rent;
181 uint8_t full;
182 uint8_t shwh;
183
184 struct au_rdu_cookie cookie;
185} __aligned(8);
186
187/* ---------------------------------------------------------------------- */
188
189struct aufs_wbr_fd {
190 uint32_t oflags;
191 int16_t brid;
192} __aligned(8);
193
194/* ---------------------------------------------------------------------- */
195
196struct aufs_ibusy {
197 uint64_t ino, h_ino;
198 int16_t bindex;
199} __aligned(8);
200
201/* ---------------------------------------------------------------------- */
202
203#define AuCtlType 'A'
204#define AUFS_CTL_RDU _IOWR(AuCtlType, AuCtl_RDU, struct aufs_rdu)
205#define AUFS_CTL_RDU_INO _IOWR(AuCtlType, AuCtl_RDU_INO, struct aufs_rdu)
206#define AUFS_CTL_WBR_FD _IOW(AuCtlType, AuCtl_WBR_FD, \
207 struct aufs_wbr_fd)
208#define AUFS_CTL_IBUSY _IOWR(AuCtlType, AuCtl_IBUSY, struct aufs_ibusy)
209
210#endif /* __AUFS_TYPE_H__ */
diff --git a/meta-filesystems/recipes-utils/aufs-util/aufs-util_git.bb b/meta-filesystems/recipes-utils/aufs-util/aufs-util_git.bb
new file mode 100644
index 0000000000..48c545660d
--- /dev/null
+++ b/meta-filesystems/recipes-utils/aufs-util/aufs-util_git.bb
@@ -0,0 +1,53 @@
1SUMMARY = "Tools for managing AUFS mounts"
2SECTION = "base"
3HOMEPAGE = "http://aufs.sourceforge.net/"
4LICENSE = "GPLv2"
5LIC_FILES_CHKSUM = "file://COPYING;md5=892f569a555ba9c07a568a7c0c4fa63a"
6
7DEPENDS = "aufs-util-native"
8DEPENDS_class-native = ""
9
10SRCREV = "f29056fe396d56fc2a06a96312feabaebbe14c59"
11SRC_URI = "git://git.code.sf.net/p/aufs/aufs-util;protocol=git;branch=aufs3.9 \
12 file://aufs-util-don-t-strip-executables.patch \
13 file://aufs-util-add-tool-concept-to-Makefile-for-cross-com.patch \
14 file://aufs_type.h \
15"
16
17PV = "3.9+git${SRCPV}"
18
19S = "${WORKDIR}/git"
20
21do_configure_append () {
22 install -d ${S}/include/linux/
23 cp ${WORKDIR}/aufs_type.h ${S}/include/linux/
24}
25
26do_configure_append_class-target () {
27 for i in ver c2sh c2tmac; do
28 cp ${STAGING_BINDIR_NATIVE}/aufs-util-${PV}/$i ./
29 done
30}
31
32do_compile () {
33 oe_runmake CPPFLAGS="-I${S}/include -I${S}/libau"
34}
35
36do_compile_class-native () {
37 oe_runmake tools CPPFLAGS="-I${S}/include -I${S}/libau"
38}
39
40do_install () {
41 oe_runmake 'DESTDIR=${D}' install_sbin install_ubin install_etc
42}
43
44do_install_class-native () {
45 install -d ${D}${bindir}/aufs-util-${PV}
46 for i in ver c2sh c2tmac; do
47 install -m 755 $i ${D}${bindir}/aufs-util-${PV}/$i
48 done
49}
50
51RRECOMMENDS_${PN} += "kernel-module-aufs"
52
53BBCLASSEXTEND = "native"