1 |
commit: 0eb6f9313c116798bffaea22adc49e44806fd3e7 |
2 |
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Oct 3 00:20:20 2014 +0000 |
4 |
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Oct 3 00:20:20 2014 +0000 |
6 |
URL: http://sources.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=0eb6f931 |
7 |
|
8 |
sys-fs/e2fsprogs: in tree builds fine against musl |
9 |
|
10 |
--- |
11 |
sys-fs/e2fsprogs/e2fsprogs-1.42.7-r99.ebuild | 151 -- |
12 |
sys-fs/e2fsprogs/e2fsprogs-1.42.9-r99.ebuild | 150 -- |
13 |
sys-fs/e2fsprogs/files/e2fsck.conf | 6 - |
14 |
sys-fs/e2fsprogs/files/e2fsprogs-1.40-fbsd.patch | 11 - |
15 |
sys-fs/e2fsprogs/files/e2fsprogs-1.41-mint.patch | 1947 -------------------- |
16 |
.../files/e2fsprogs-1.41.12-darwin-makefile.patch | 113 -- |
17 |
.../files/e2fsprogs-1.41.12-mint-blkid.patch | 43 - |
18 |
.../files/e2fsprogs-1.41.8-makefile.patch | 10 - |
19 |
...fsprogs-1.42.7-libext2fs-fix-return-value.patch | 32 - |
20 |
.../files/e2fsprogs-1.42.7-use-uint64_t.patch | 17 - |
21 |
sys-fs/e2fsprogs/files/fsck_ext2fs.8 | 96 - |
22 |
sys-fs/e2fsprogs/files/fsck_ext2fs.c | 147 -- |
23 |
sys-fs/e2fsprogs/metadata.xml | 8 - |
24 |
13 files changed, 2731 deletions(-) |
25 |
|
26 |
diff --git a/sys-fs/e2fsprogs/e2fsprogs-1.42.7-r99.ebuild b/sys-fs/e2fsprogs/e2fsprogs-1.42.7-r99.ebuild |
27 |
deleted file mode 100644 |
28 |
index 4b9b86f..0000000 |
29 |
--- a/sys-fs/e2fsprogs/e2fsprogs-1.42.7-r99.ebuild |
30 |
+++ /dev/null |
31 |
@@ -1,151 +0,0 @@ |
32 |
-# Copyright 1999-2014 Gentoo Foundation |
33 |
-# Distributed under the terms of the GNU General Public License v2 |
34 |
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/e2fsprogs/e2fsprogs-1.42.7.ebuild,v 1.15 2014/01/18 05:15:33 vapier Exp $ |
35 |
- |
36 |
-EAPI=3 |
37 |
- |
38 |
-case ${PV} in |
39 |
-*_pre*) UP_PV="${PV%_pre*}-WIP-${PV#*_pre}" ;; |
40 |
-*) UP_PV=${PV} ;; |
41 |
-esac |
42 |
- |
43 |
-inherit eutils flag-o-matic multilib toolchain-funcs |
44 |
- |
45 |
-DESCRIPTION="Standard EXT2/EXT3/EXT4 filesystem utilities" |
46 |
-HOMEPAGE="http://e2fsprogs.sourceforge.net/" |
47 |
-SRC_URI="mirror://sourceforge/e2fsprogs/${PN}-${UP_PV}.tar.gz" |
48 |
- |
49 |
-LICENSE="GPL-2 BSD" |
50 |
-SLOT="0" |
51 |
-KEYWORDS="amd64 arm ~mips x86" |
52 |
-IUSE="nls static-libs elibc_FreeBSD" |
53 |
- |
54 |
-RDEPEND="~sys-libs/${PN}-libs-${PV} |
55 |
- >=sys-apps/util-linux-2.16 |
56 |
- nls? ( virtual/libintl )" |
57 |
-DEPEND="${RDEPEND} |
58 |
- nls? ( sys-devel/gettext ) |
59 |
- virtual/pkgconfig |
60 |
- sys-apps/texinfo" |
61 |
- |
62 |
-S=${WORKDIR}/${P%_pre*} |
63 |
- |
64 |
-pkg_setup() { |
65 |
- if [[ ! -e ${EROOT}/etc/mtab ]] ; then |
66 |
- # add some crap to deal with missing /etc/mtab #217719 |
67 |
- ewarn "No /etc/mtab file, creating one temporarily" |
68 |
- echo "${PN} crap for src_test" > "${EROOT}"/etc/mtab |
69 |
- fi |
70 |
-} |
71 |
- |
72 |
-src_prepare() { |
73 |
- epatch "${FILESDIR}"/${PN}-1.41.8-makefile.patch |
74 |
- epatch "${FILESDIR}"/${PN}-1.40-fbsd.patch |
75 |
- epatch "${FILESDIR}"/${PN}-1.41.12-darwin-makefile.patch |
76 |
- epatch "${FILESDIR}"/${PN}-1.42.7-libext2fs-fix-return-value.patch #467986 |
77 |
- epatch "${FILESDIR}"/${PN}-1.42.7-use-uint64_t.patch |
78 |
- if [[ ${CHOST} == *-mint* ]] ; then |
79 |
- epatch "${FILESDIR}"/${PN}-1.41-mint.patch |
80 |
- epatch "${FILESDIR}"/${PN}-1.41.12-mint-blkid.patch |
81 |
- fi |
82 |
- # blargh ... trick e2fsprogs into using e2fsprogs-libs |
83 |
- rm -rf doc |
84 |
- sed -i -r \ |
85 |
- -e 's:@LIBINTL@:@LTLIBINTL@:' \ |
86 |
- -e '/^LIB(COM_ERR|SS)/s:[$][(]LIB[)]/lib([^@]*)@LIB_EXT@:-l\1:' \ |
87 |
- -e '/^DEPLIB(COM_ERR|SS)/s:=.*:=:' \ |
88 |
- MCONFIG.in || die "muck libs" #122368 |
89 |
- sed -i -r \ |
90 |
- -e '/^LIB_SUBDIRS/s:lib/(et|ss)::g' \ |
91 |
- Makefile.in || die "remove subdirs" |
92 |
- |
93 |
- # Avoid rebuild |
94 |
- touch lib/ss/ss_err.h |
95 |
-} |
96 |
- |
97 |
-src_configure() { |
98 |
- # Keep the package from doing silly things #261411 |
99 |
- export VARTEXFONTS=${T}/fonts |
100 |
- |
101 |
- # needs open64() prototypes and friends |
102 |
- append-cppflags -D_GNU_SOURCE |
103 |
- |
104 |
- # We want to use the "bsd" libraries while building on Darwin, but while |
105 |
- # building on other Gentoo/*BSD we prefer elf-naming scheme. |
106 |
- local libtype |
107 |
- case ${CHOST} in |
108 |
- *-darwin*) libtype=--enable-bsd-shlibs ;; |
109 |
- *-mint*) libtype= ;; |
110 |
- *) libtype=--enable-elf-shlibs ;; |
111 |
- esac |
112 |
- |
113 |
- ac_cv_path_LDCONFIG=: \ |
114 |
- econf \ |
115 |
- --with-root-prefix="${EPREFIX}/" \ |
116 |
- --enable-symlink-install \ |
117 |
- ${libtype} \ |
118 |
- $(tc-has-tls || echo --disable-tls) \ |
119 |
- --without-included-gettext \ |
120 |
- $(use_enable nls) \ |
121 |
- --disable-libblkid \ |
122 |
- --disable-libuuid \ |
123 |
- --disable-quota \ |
124 |
- --disable-fsck \ |
125 |
- --disable-uuidd |
126 |
- if [[ ${CHOST} != *-uclibc ]] && grep -qs 'USE_INCLUDED_LIBINTL.*yes' config.{log,status} ; then |
127 |
- eerror "INTL sanity check failed, aborting build." |
128 |
- eerror "Please post your ${S}/config.log file as an" |
129 |
- eerror "attachment to http://bugs.gentoo.org/show_bug.cgi?id=81096" |
130 |
- die "Preventing included intl cruft from building" |
131 |
- fi |
132 |
-} |
133 |
- |
134 |
-src_compile() { |
135 |
- emake COMPILE_ET=compile_et MK_CMDS=mk_cmds || die |
136 |
- |
137 |
- # Build the FreeBSD helper |
138 |
- if use elibc_FreeBSD ; then |
139 |
- cp "${FILESDIR}"/fsck_ext2fs.c . |
140 |
- emake fsck_ext2fs || die |
141 |
- fi |
142 |
-} |
143 |
- |
144 |
-pkg_preinst() { |
145 |
- if [[ -r ${EROOT}/etc/mtab ]] ; then |
146 |
- if [[ $(<"${EROOT}"/etc/mtab) == "${PN} crap for src_test" ]] ; then |
147 |
- rm -f "${EROOT}"/etc/mtab |
148 |
- fi |
149 |
- fi |
150 |
-} |
151 |
- |
152 |
-src_install() { |
153 |
- # need to set root_libdir= manually as any --libdir options in the |
154 |
- # econf above (i.e. multilib) will screw up the default #276465 |
155 |
- emake \ |
156 |
- STRIP=: \ |
157 |
- root_libdir="${EPREFIX}/usr/$(get_libdir)" \ |
158 |
- DESTDIR="${D}" \ |
159 |
- install install-libs || die |
160 |
- dodoc README RELEASE-NOTES |
161 |
- |
162 |
- insinto /etc |
163 |
- doins "${FILESDIR}"/e2fsck.conf || die |
164 |
- |
165 |
- # Move shared libraries to /lib/, install static libraries to |
166 |
- # /usr/lib/, and install linker scripts to /usr/lib/. |
167 |
- gen_usr_ldscript -a e2p ext2fs |
168 |
- # configure doesn't have an option to disable static libs :/ |
169 |
- use static-libs || find "${D}" -name '*.a' -delete |
170 |
- |
171 |
- if use elibc_FreeBSD ; then |
172 |
- # Install helpers for us |
173 |
- into / |
174 |
- dosbin "${S}"/fsck_ext2fs || die |
175 |
- doman "${FILESDIR}"/fsck_ext2fs.8 || die |
176 |
- |
177 |
- # filefrag is linux only |
178 |
- rm \ |
179 |
- "${ED}"/usr/sbin/filefrag \ |
180 |
- "${ED}"/usr/share/man/man8/filefrag.8 || die |
181 |
- fi |
182 |
-} |
183 |
|
184 |
diff --git a/sys-fs/e2fsprogs/e2fsprogs-1.42.9-r99.ebuild b/sys-fs/e2fsprogs/e2fsprogs-1.42.9-r99.ebuild |
185 |
deleted file mode 100644 |
186 |
index c2993f0..0000000 |
187 |
--- a/sys-fs/e2fsprogs/e2fsprogs-1.42.9-r99.ebuild |
188 |
+++ /dev/null |
189 |
@@ -1,150 +0,0 @@ |
190 |
-# Copyright 1999-2014 Gentoo Foundation |
191 |
-# Distributed under the terms of the GNU General Public License v2 |
192 |
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/e2fsprogs/e2fsprogs-1.42.9.ebuild,v 1.2 2014/01/18 05:15:33 vapier Exp $ |
193 |
- |
194 |
-EAPI=3 |
195 |
- |
196 |
-case ${PV} in |
197 |
-*_pre*) UP_PV="${PV%_pre*}-WIP-${PV#*_pre}" ;; |
198 |
-*) UP_PV=${PV} ;; |
199 |
-esac |
200 |
- |
201 |
-inherit eutils flag-o-matic multilib toolchain-funcs |
202 |
- |
203 |
-DESCRIPTION="Standard EXT2/EXT3/EXT4 filesystem utilities" |
204 |
-HOMEPAGE="http://e2fsprogs.sourceforge.net/" |
205 |
-SRC_URI="mirror://sourceforge/e2fsprogs/${PN}-${UP_PV}.tar.gz" |
206 |
- |
207 |
-LICENSE="GPL-2 BSD" |
208 |
-SLOT="0" |
209 |
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 -x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x86-macos ~m68k-mint" |
210 |
-IUSE="nls static-libs elibc_FreeBSD" |
211 |
- |
212 |
-RDEPEND="~sys-libs/${PN}-libs-${PV} |
213 |
- >=sys-apps/util-linux-2.16 |
214 |
- nls? ( virtual/libintl )" |
215 |
-DEPEND="${RDEPEND} |
216 |
- nls? ( sys-devel/gettext ) |
217 |
- virtual/pkgconfig |
218 |
- sys-apps/texinfo" |
219 |
- |
220 |
-S=${WORKDIR}/${P%_pre*} |
221 |
- |
222 |
-pkg_setup() { |
223 |
- if [[ ! -e ${EROOT}/etc/mtab ]] ; then |
224 |
- # add some crap to deal with missing /etc/mtab #217719 |
225 |
- ewarn "No /etc/mtab file, creating one temporarily" |
226 |
- echo "${PN} crap for src_test" > "${EROOT}"/etc/mtab |
227 |
- fi |
228 |
-} |
229 |
- |
230 |
-src_prepare() { |
231 |
- epatch "${FILESDIR}"/${PN}-1.41.8-makefile.patch |
232 |
- epatch "${FILESDIR}"/${PN}-1.40-fbsd.patch |
233 |
- epatch "${FILESDIR}"/${PN}-1.41.12-darwin-makefile.patch |
234 |
- epatch "${FILESDIR}"/${PN}-1.42.7-use-uint64_t.patch |
235 |
- if [[ ${CHOST} == *-mint* ]] ; then |
236 |
- epatch "${FILESDIR}"/${PN}-1.41-mint.patch |
237 |
- epatch "${FILESDIR}"/${PN}-1.41.12-mint-blkid.patch |
238 |
- fi |
239 |
- # blargh ... trick e2fsprogs into using e2fsprogs-libs |
240 |
- rm -rf doc |
241 |
- sed -i -r \ |
242 |
- -e 's:@LIBINTL@:@LTLIBINTL@:' \ |
243 |
- -e '/^LIB(COM_ERR|SS)/s:[$][(]LIB[)]/lib([^@]*)@LIB_EXT@:-l\1:' \ |
244 |
- -e '/^DEPLIB(COM_ERR|SS)/s:=.*:=:' \ |
245 |
- MCONFIG.in || die "muck libs" #122368 |
246 |
- sed -i -r \ |
247 |
- -e '/^LIB_SUBDIRS/s:lib/(et|ss)::g' \ |
248 |
- Makefile.in || die "remove subdirs" |
249 |
- |
250 |
- # Avoid rebuild |
251 |
- touch lib/ss/ss_err.h |
252 |
-} |
253 |
- |
254 |
-src_configure() { |
255 |
- # Keep the package from doing silly things #261411 |
256 |
- export VARTEXFONTS=${T}/fonts |
257 |
- |
258 |
- # needs open64() prototypes and friends |
259 |
- append-cppflags -D_GNU_SOURCE |
260 |
- |
261 |
- # We want to use the "bsd" libraries while building on Darwin, but while |
262 |
- # building on other Gentoo/*BSD we prefer elf-naming scheme. |
263 |
- local libtype |
264 |
- case ${CHOST} in |
265 |
- *-darwin*) libtype=--enable-bsd-shlibs ;; |
266 |
- *-mint*) libtype= ;; |
267 |
- *) libtype=--enable-elf-shlibs ;; |
268 |
- esac |
269 |
- |
270 |
- ac_cv_path_LDCONFIG=: \ |
271 |
- econf \ |
272 |
- --with-root-prefix="${EPREFIX}/" \ |
273 |
- --enable-symlink-install \ |
274 |
- ${libtype} \ |
275 |
- $(tc-has-tls || echo --disable-tls) \ |
276 |
- --without-included-gettext \ |
277 |
- $(use_enable nls) \ |
278 |
- --disable-libblkid \ |
279 |
- --disable-libuuid \ |
280 |
- --disable-quota \ |
281 |
- --disable-fsck \ |
282 |
- --disable-uuidd |
283 |
- if [[ ${CHOST} != *-uclibc ]] && grep -qs 'USE_INCLUDED_LIBINTL.*yes' config.{log,status} ; then |
284 |
- eerror "INTL sanity check failed, aborting build." |
285 |
- eerror "Please post your ${S}/config.log file as an" |
286 |
- eerror "attachment to http://bugs.gentoo.org/show_bug.cgi?id=81096" |
287 |
- die "Preventing included intl cruft from building" |
288 |
- fi |
289 |
-} |
290 |
- |
291 |
-src_compile() { |
292 |
- emake COMPILE_ET=compile_et MK_CMDS=mk_cmds || die |
293 |
- |
294 |
- # Build the FreeBSD helper |
295 |
- if use elibc_FreeBSD ; then |
296 |
- cp "${FILESDIR}"/fsck_ext2fs.c . |
297 |
- emake fsck_ext2fs || die |
298 |
- fi |
299 |
-} |
300 |
- |
301 |
-pkg_preinst() { |
302 |
- if [[ -r ${EROOT}/etc/mtab ]] ; then |
303 |
- if [[ $(<"${EROOT}"/etc/mtab) == "${PN} crap for src_test" ]] ; then |
304 |
- rm -f "${EROOT}"/etc/mtab |
305 |
- fi |
306 |
- fi |
307 |
-} |
308 |
- |
309 |
-src_install() { |
310 |
- # need to set root_libdir= manually as any --libdir options in the |
311 |
- # econf above (i.e. multilib) will screw up the default #276465 |
312 |
- emake \ |
313 |
- STRIP=: \ |
314 |
- root_libdir="${EPREFIX}/usr/$(get_libdir)" \ |
315 |
- DESTDIR="${D}" \ |
316 |
- install install-libs || die |
317 |
- dodoc README RELEASE-NOTES |
318 |
- |
319 |
- insinto /etc |
320 |
- doins "${FILESDIR}"/e2fsck.conf || die |
321 |
- |
322 |
- # Move shared libraries to /lib/, install static libraries to |
323 |
- # /usr/lib/, and install linker scripts to /usr/lib/. |
324 |
- gen_usr_ldscript -a e2p ext2fs |
325 |
- # configure doesn't have an option to disable static libs :/ |
326 |
- use static-libs || find "${D}" -name '*.a' -delete |
327 |
- |
328 |
- if use elibc_FreeBSD ; then |
329 |
- # Install helpers for us |
330 |
- into / |
331 |
- dosbin "${S}"/fsck_ext2fs || die |
332 |
- doman "${FILESDIR}"/fsck_ext2fs.8 || die |
333 |
- |
334 |
- # filefrag is linux only |
335 |
- rm \ |
336 |
- "${ED}"/usr/sbin/filefrag \ |
337 |
- "${ED}"/usr/share/man/man8/filefrag.8 || die |
338 |
- fi |
339 |
-} |
340 |
|
341 |
diff --git a/sys-fs/e2fsprogs/files/e2fsck.conf b/sys-fs/e2fsprogs/files/e2fsck.conf |
342 |
deleted file mode 100644 |
343 |
index 401cec4..0000000 |
344 |
--- a/sys-fs/e2fsprogs/files/e2fsck.conf |
345 |
+++ /dev/null |
346 |
@@ -1,6 +0,0 @@ |
347 |
-# See the e2fsck.conf man page for more info |
348 |
- |
349 |
-[options] |
350 |
- |
351 |
-# allow fsck to run sanely at any point in time #142850 |
352 |
-buggy_init_scripts = yes |
353 |
|
354 |
diff --git a/sys-fs/e2fsprogs/files/e2fsprogs-1.40-fbsd.patch b/sys-fs/e2fsprogs/files/e2fsprogs-1.40-fbsd.patch |
355 |
deleted file mode 100644 |
356 |
index 7d09196..0000000 |
357 |
--- a/sys-fs/e2fsprogs/files/e2fsprogs-1.40-fbsd.patch |
358 |
+++ /dev/null |
359 |
@@ -1,11 +0,0 @@ |
360 |
---- a/lib/ext2fs/ext2_fs.h |
361 |
-+++ b/lib/ext2fs/ext2_fs.h |
362 |
-@@ -414,7 +414,7 @@ |
363 |
- |
364 |
- #define i_size_high i_dir_acl |
365 |
- |
366 |
--#if defined(__KERNEL__) || defined(__linux__) |
367 |
-+#if defined(__KERNEL__) || defined(__linux__) || defined(__FreeBSD__) |
368 |
- #define i_reserved1 osd1.linux1.l_i_reserved1 |
369 |
- #define i_frag osd2.linux2.l_i_frag |
370 |
- #define i_fsize osd2.linux2.l_i_fsize |
371 |
|
372 |
diff --git a/sys-fs/e2fsprogs/files/e2fsprogs-1.41-mint.patch b/sys-fs/e2fsprogs/files/e2fsprogs-1.41-mint.patch |
373 |
deleted file mode 100644 |
374 |
index 43ed92d..0000000 |
375 |
--- a/sys-fs/e2fsprogs/files/e2fsprogs-1.41-mint.patch |
376 |
+++ /dev/null |
377 |
@@ -1,1947 +0,0 @@ |
378 |
-http://bugs.gentoo.org/show_bug.cgi?id=256234 |
379 |
-http://sourceforge.net/tracker/?func=detail&aid=2550325&group_id=2406&atid=302406 |
380 |
- |
381 |
-diff -ur --new-file e2fsprogs-1.41.3/lib/ext2fs/Makefile.in e2fsprogs-1.41.3-mint/lib/ext2fs/Makefile.in |
382 |
---- e2fsprogs-1.41.3/lib/ext2fs/Makefile.in 2008-10-07 14:22:39.000000000 +0000 |
383 |
-+++ e2fsprogs-1.41.3-mint/lib/ext2fs/Makefile.in 2009-01-23 10:48:50.000000000 +0000 |
384 |
-@@ -74,7 +74,9 @@ |
385 |
- unix_io.o \ |
386 |
- unlink.o \ |
387 |
- valid_blk.o \ |
388 |
-- version.o |
389 |
-+ version.o \ |
390 |
-+ mint_io.o \ |
391 |
-+ xhdi.o |
392 |
- |
393 |
- SRCS= ext2_err.c \ |
394 |
- $(srcdir)/alloc.c \ |
395 |
-@@ -146,6 +148,8 @@ |
396 |
- $(srcdir)/unlink.c \ |
397 |
- $(srcdir)/valid_blk.c \ |
398 |
- $(srcdir)/version.c \ |
399 |
-+ $(srcdir)/mint_io.c \ |
400 |
-+ $(srcdir)/xhdi.c \ |
401 |
- $(srcdir)/write_bb_file.c |
402 |
- |
403 |
- HFILES= bitops.h ext2fs.h ext2_io.h ext2_fs.h ext2_ext_attr.h ext3_extents.h \ |
404 |
-diff -ur --new-file e2fsprogs-1.41.3/lib/ext2fs/bitops.h e2fsprogs-1.41.3-mint/lib/ext2fs/bitops.h |
405 |
---- e2fsprogs-1.41.3/lib/ext2fs/bitops.h 2008-10-07 14:22:39.000000000 +0000 |
406 |
-+++ e2fsprogs-1.41.3-mint/lib/ext2fs/bitops.h 2009-01-23 10:47:35.000000000 +0000 |
407 |
-@@ -125,7 +125,7 @@ |
408 |
- */ |
409 |
- #ifdef NO_INLINE_FUNCS |
410 |
- #if (defined(__GNUC__) && (defined(__i386__) || defined(__i486__) || \ |
411 |
-- defined(__i586__) || defined(__mc68000__))) |
412 |
-+ defined(__i586__) || defined(__mc68020__))) |
413 |
- /* This prevents bitops.c from trying to include the C */ |
414 |
- /* function version of these functions */ |
415 |
- #define _EXT2_HAVE_ASM_BITOPS_ |
416 |
-@@ -246,7 +246,7 @@ |
417 |
- #endif /* i386 */ |
418 |
- |
419 |
- #if ((defined __GNUC__) && !defined(_EXT2_USE_C_VERSIONS_) && \ |
420 |
-- (defined(__mc68000__))) |
421 |
-+ (defined(__mc68020__))) |
422 |
- |
423 |
- #define _EXT2_HAVE_ASM_BITOPS_ |
424 |
- |
425 |
-@@ -280,6 +280,50 @@ |
426 |
- return retval; |
427 |
- } |
428 |
- |
429 |
-+#elif defined(__mc68000__) |
430 |
-+ |
431 |
-+#define _EXT2_HAVE_ASM_BITOPS_ |
432 |
-+ |
433 |
-+_INLINE_ int |
434 |
-+ext2fs_set_bit (unsigned int nr, void *addr) |
435 |
-+{ |
436 |
-+ int mask, retval; |
437 |
-+ unsigned char *ADDR = (unsigned char *) addr; |
438 |
-+ |
439 |
-+ ADDR += nr >> 3; |
440 |
-+ mask = 1UL << (nr & 0x07); |
441 |
-+ retval = (mask & *ADDR) != 0; |
442 |
-+ *ADDR |= mask; |
443 |
-+ |
444 |
-+ return retval; |
445 |
-+} |
446 |
-+ |
447 |
-+_INLINE_ int |
448 |
-+ext2fs_clear_bit (unsigned int nr, void *addr) |
449 |
-+{ |
450 |
-+ int mask, retval; |
451 |
-+ unsigned char *ADDR = (unsigned char *) addr; |
452 |
-+ |
453 |
-+ ADDR += nr >> 3; |
454 |
-+ mask = 1UL << (nr & 0x07); |
455 |
-+ retval = (mask & *ADDR) != 0; |
456 |
-+ *ADDR &= ~mask; |
457 |
-+ |
458 |
-+ return retval; |
459 |
-+} |
460 |
-+ |
461 |
-+_INLINE_ int |
462 |
-+ext2fs_test_bit (unsigned int nr, const void *addr) |
463 |
-+{ |
464 |
-+ int mask; |
465 |
-+ const unsigned char *ADDR = (const unsigned char *) addr; |
466 |
-+ |
467 |
-+ ADDR += nr >> 3; |
468 |
-+ mask = 1UL << (nr & 0x07); |
469 |
-+ |
470 |
-+ return ((mask & *ADDR) != 0); |
471 |
-+} |
472 |
-+ |
473 |
- #endif /* __mc68000__ */ |
474 |
- |
475 |
- |
476 |
-diff -ur --new-file e2fsprogs-1.41.3/lib/ext2fs/ext2_fs.h e2fsprogs-1.41.3-mint/lib/ext2fs/ext2_fs.h |
477 |
---- e2fsprogs-1.41.3/lib/ext2fs/ext2_fs.h 2009-01-23 10:01:34.000000000 +0000 |
478 |
-+++ e2fsprogs-1.41.3-mint/lib/ext2fs/ext2_fs.h 2009-01-23 10:49:44.000000000 +0000 |
479 |
-@@ -307,6 +307,7 @@ |
480 |
- #define _IOT_ext2_new_group_input _IOT (_IOTS(__u32), 5, _IOTS(__u16), 2, 0, 0) |
481 |
- #endif |
482 |
- |
483 |
-+#ifndef __MINT__ |
484 |
- #define EXT2_IOC_GETFLAGS _IOR('f', 1, long) |
485 |
- #define EXT2_IOC_SETFLAGS _IOW('f', 2, long) |
486 |
- #define EXT2_IOC_GETVERSION _IOR('v', 1, long) |
487 |
-@@ -316,6 +317,9 @@ |
488 |
- #define EXT2_IOC_GROUP_EXTEND _IOW('f', 7, unsigned long) |
489 |
- #define EXT2_IOC_GROUP_ADD _IOW('f', 8,struct ext2_new_group_input) |
490 |
- #define EXT4_IOC_GROUP_ADD _IOW('f', 8,struct ext4_new_group_input) |
491 |
-+#else |
492 |
-+#include <mint/dcntl.h> |
493 |
-+#endif |
494 |
- |
495 |
- /* |
496 |
- * Structure of an inode on the disk |
497 |
-diff -ur --new-file e2fsprogs-1.41.3/lib/ext2fs/getsize.c e2fsprogs-1.41.3-mint/lib/ext2fs/getsize.c |
498 |
---- e2fsprogs-1.41.3/lib/ext2fs/getsize.c 2008-10-07 14:22:39.000000000 +0000 |
499 |
-+++ e2fsprogs-1.41.3-mint/lib/ext2fs/getsize.c 2009-01-23 10:47:35.000000000 +0000 |
500 |
-@@ -58,6 +58,11 @@ |
501 |
- #define BLKGETSIZE DKIOCGETBLOCKCOUNT32 |
502 |
- #endif /* APPLE_DARWIN */ |
503 |
- |
504 |
-+#ifdef __MINT__ |
505 |
-+#include <sys/ioctl.h> |
506 |
-+#include "mint_io.h" |
507 |
-+#endif |
508 |
-+ |
509 |
- #include "ext2_fs.h" |
510 |
- #include "ext2fs.h" |
511 |
- |
512 |
-diff -ur --new-file e2fsprogs-1.41.3/lib/ext2fs/llseek.c e2fsprogs-1.41.3-mint/lib/ext2fs/llseek.c |
513 |
---- e2fsprogs-1.41.3/lib/ext2fs/llseek.c 2008-10-07 14:22:39.000000000 +0000 |
514 |
-+++ e2fsprogs-1.41.3-mint/lib/ext2fs/llseek.c 2009-01-23 10:47:35.000000000 +0000 |
515 |
-@@ -115,6 +115,8 @@ |
516 |
- |
517 |
- #else /* !linux */ |
518 |
- |
519 |
-+#ifndef __MINT__ |
520 |
-+ |
521 |
- #ifndef EINVAL |
522 |
- #define EINVAL EXT2_ET_INVALID_ARGUMENT |
523 |
- #endif |
524 |
-@@ -133,6 +135,8 @@ |
525 |
- #endif |
526 |
- } |
527 |
- |
528 |
-+#endif /* __MINT__ */ |
529 |
-+ |
530 |
- #endif /* linux */ |
531 |
- |
532 |
- |
533 |
-diff -ur --new-file e2fsprogs-1.41.3/lib/ext2fs/mint_io.c e2fsprogs-1.41.3-mint/lib/ext2fs/mint_io.c |
534 |
---- e2fsprogs-1.41.3/lib/ext2fs/mint_io.c 1970-01-01 00:00:00.000000000 +0000 |
535 |
-+++ e2fsprogs-1.41.3-mint/lib/ext2fs/mint_io.c 2009-01-23 10:49:51.000000000 +0000 |
536 |
-@@ -0,0 +1,858 @@ |
537 |
-+/* |
538 |
-+ * $Id: e2fsprogs-1.41-mint.patch,v 1.1 2010/11/19 18:49:02 jlec Exp $ |
539 |
-+ * |
540 |
-+ * This file belongs to FreeMiNT. It's not in the original MiNT 1.12 |
541 |
-+ * distribution. See the file CHANGES for a detailed log of changes. |
542 |
-+ * |
543 |
-+ * |
544 |
-+ * Copyright 2000 Frank Naumann <fnaumann@××××××××.de> |
545 |
-+ * All rights reserved. |
546 |
-+ * |
547 |
-+ * This program is free software; you can redistribute it and/or modify |
548 |
-+ * it under the terms of the GNU General Public License as published by |
549 |
-+ * the Free Software Foundation; either version 2, or (at your option) |
550 |
-+ * any later version. |
551 |
-+ * |
552 |
-+ * This file is distributed in the hope that it will be useful, |
553 |
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
554 |
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
555 |
-+ * GNU General Public License for more details. |
556 |
-+ * |
557 |
-+ * You should have received a copy of the GNU General Public License |
558 |
-+ * along with this program; if not, write to the Free Software |
559 |
-+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
560 |
-+ * |
561 |
-+ * |
562 |
-+ * Author: Frank Naumann <fnaumann@××××××××.de> |
563 |
-+ * Started: 200-06-14 |
564 |
-+ * |
565 |
-+ * Please send suggestions, patches or bug reports to me or |
566 |
-+ * the MiNT mailing list. |
567 |
-+ * |
568 |
-+ */ |
569 |
-+ |
570 |
-+# ifdef __MINT__ |
571 |
-+ |
572 |
-+# include <assert.h> |
573 |
-+# include <ctype.h> |
574 |
-+# include <errno.h> |
575 |
-+# include <fcntl.h> |
576 |
-+# include <limits.h> |
577 |
-+# include <stdarg.h> |
578 |
-+# include <stdlib.h> |
579 |
-+# include <stdio.h> |
580 |
-+# include <string.h> |
581 |
-+# include <time.h> |
582 |
-+# include <unistd.h> |
583 |
-+ |
584 |
-+# include "et/com_err.h" |
585 |
-+# include "ext2fs/ext2_io.h" |
586 |
-+# include <sys/ioctl.h> |
587 |
-+# include <sys/stat.h> |
588 |
-+# define loff_t ext2_loff_t |
589 |
-+# define llseek ext2fs_llseek |
590 |
-+ |
591 |
-+# include <mintbind.h> |
592 |
-+# include "mint_io.h" |
593 |
-+# include "xhdi.h" |
594 |
-+ |
595 |
-+ |
596 |
-+# if 0 |
597 |
-+# define DEBUG(x) printf x |
598 |
-+# else |
599 |
-+# define DEBUG(x) |
600 |
-+# endif |
601 |
-+ |
602 |
-+ |
603 |
-+/* prototypes */ |
604 |
-+ |
605 |
-+int __open_v(const char *_filename, int iomode, va_list argp); |
606 |
-+ |
607 |
-+int open(__const char *__file, int __oflag, ...) __THROW; |
608 |
-+int __open(__const char *__file, int __oflag, ...) __THROW; |
609 |
-+ |
610 |
-+int ioctl(int fd, int cmd, void *arg); |
611 |
-+int __ioctl(int fd, int cmd, void *arg); |
612 |
-+ |
613 |
-+int fsync(int __fd) __THROW; |
614 |
-+int __fsync(int __fd) __THROW; |
615 |
-+ |
616 |
-+__off_t lseek(int __fd, __off_t __offset, int __whence) __THROW; |
617 |
-+__off_t __lseek(int __fd, __off_t __offset, int __whence) __THROW; |
618 |
-+ |
619 |
-+int close(int __fd) __THROW; |
620 |
-+int __close(int __fd) __THROW; |
621 |
-+ |
622 |
-+ssize_t read(int __fd, void *__buf, size_t __nbytes) __THROW; |
623 |
-+ssize_t __read(int __fd, void *__buf, size_t __nbytes) __THROW; |
624 |
-+ |
625 |
-+ssize_t write(int __fd, __const void *__buf, size_t __n) __THROW; |
626 |
-+ssize_t __write(int __fd, __const void *__buf, size_t __n) __THROW; |
627 |
-+ |
628 |
-+int fstat(int __fd, struct stat *__buf) __THROW; |
629 |
-+int __fstat(int __fd, struct stat *__buf) __THROW; |
630 |
-+ |
631 |
-+int stat(const char *filename, struct stat *st) __THROW; |
632 |
-+ |
633 |
-+ |
634 |
-+struct device |
635 |
-+{ |
636 |
-+ int used; |
637 |
-+ |
638 |
-+ int drv; |
639 |
-+ int open_flags; |
640 |
-+ |
641 |
-+ ushort xhdi_maj; |
642 |
-+ ushort xhdi_min; |
643 |
-+ ulong xhdi_start; |
644 |
-+ ulong xhdi_blocks; |
645 |
-+ ulong xhdi_blocksize; |
646 |
-+ char xhdi_id[4]; |
647 |
-+ |
648 |
-+ loff_t pos; |
649 |
-+}; |
650 |
-+ |
651 |
-+# define DEVS 16 |
652 |
-+static struct device devs[DEVS]; |
653 |
-+ |
654 |
-+static void |
655 |
-+init_device(struct device *dev) |
656 |
-+{ |
657 |
-+ dev->used = 0; |
658 |
-+ |
659 |
-+ dev->drv = -1; |
660 |
-+ dev->open_flags = 0; |
661 |
-+ dev->xhdi_maj = 0; |
662 |
-+ dev->xhdi_min = 0; |
663 |
-+ dev->xhdi_start = 0; |
664 |
-+ dev->xhdi_blocks = 0; |
665 |
-+ dev->xhdi_blocksize = 0; |
666 |
-+ |
667 |
-+ dev->pos = 0; |
668 |
-+} |
669 |
-+ |
670 |
-+static inline void |
671 |
-+init(void) |
672 |
-+{ |
673 |
-+ static int done = 0; |
674 |
-+ int i; |
675 |
-+ |
676 |
-+ if (done) |
677 |
-+ return; |
678 |
-+ |
679 |
-+ assert(sizeof(loff_t) == sizeof(long long)); |
680 |
-+ |
681 |
-+ for (i = 0; i < DEVS; i++) |
682 |
-+ init_device (&devs[i]); |
683 |
-+ |
684 |
-+ init_XHDI(); |
685 |
-+ |
686 |
-+ /* we are now initialized */ |
687 |
-+ done = 1; |
688 |
-+} |
689 |
-+ |
690 |
-+static struct device * |
691 |
-+get_device(int fd) |
692 |
-+{ |
693 |
-+ struct device *dev; |
694 |
-+ |
695 |
-+ if ((fd < 1024) || (fd >= (1024 + DEVS))) |
696 |
-+ return NULL; |
697 |
-+ |
698 |
-+ fd -= 1024; |
699 |
-+ dev = &devs[fd]; |
700 |
-+ |
701 |
-+ assert(dev->used); |
702 |
-+ |
703 |
-+ return dev; |
704 |
-+} |
705 |
-+ |
706 |
-+static int |
707 |
-+alloc_device(void) |
708 |
-+{ |
709 |
-+ int i; |
710 |
-+ |
711 |
-+ for (i = 0; i < DEVS; i++) |
712 |
-+ { |
713 |
-+ struct device *dev = &devs[i]; |
714 |
-+ |
715 |
-+ if (!dev->used) |
716 |
-+ { |
717 |
-+ dev->used = 1; |
718 |
-+ return (i + 1024); |
719 |
-+ } |
720 |
-+ } |
721 |
-+ |
722 |
-+ __set_errno(ENOMEM); |
723 |
-+ return -1; |
724 |
-+} |
725 |
-+ |
726 |
-+static void |
727 |
-+free_device(struct device *dev) |
728 |
-+{ |
729 |
-+ assert(dev->used); |
730 |
-+ |
731 |
-+ init_device (dev); |
732 |
-+} |
733 |
-+ |
734 |
-+ |
735 |
-+int |
736 |
-+open(const char *filename, int iomode, ...) |
737 |
-+{ |
738 |
-+ const char *f = filename; |
739 |
-+ struct device *mydev = NULL; |
740 |
-+ int dev = -1; |
741 |
-+ long ret; |
742 |
-+ |
743 |
-+ init(); |
744 |
-+ |
745 |
-+ if (!filename) |
746 |
-+ { |
747 |
-+ __set_errno(EINVAL); |
748 |
-+ return -1; |
749 |
-+ } |
750 |
-+ |
751 |
-+ if ((f[1] == ':') && (f[2] == '\0')) |
752 |
-+ { |
753 |
-+ int c = tolower(f[0]); |
754 |
-+ |
755 |
-+ if (c >= 'a' && c <= 'z') |
756 |
-+ c = c - 'a'; |
757 |
-+ else if (c >= '1' && c <= '6') |
758 |
-+ c = 26 + (c - '1'); |
759 |
-+ |
760 |
-+ if ((c >= 0) && (c < 32)) |
761 |
-+ { |
762 |
-+ dev = alloc_device(); |
763 |
-+ if (dev != -1) |
764 |
-+ { |
765 |
-+ mydev = get_device(dev); |
766 |
-+ assert(mydev); |
767 |
-+ |
768 |
-+ mydev->drv = c; |
769 |
-+ mydev->open_flags = iomode; |
770 |
-+ } |
771 |
-+ } |
772 |
-+ } |
773 |
-+ |
774 |
-+ if (dev == -1) |
775 |
-+ { |
776 |
-+ /* fall through */ |
777 |
-+ |
778 |
-+ va_list args; |
779 |
-+ int retval; |
780 |
-+ |
781 |
-+ va_start(args, iomode); |
782 |
-+ retval = __open_v(filename, iomode, args); |
783 |
-+ va_end(args); |
784 |
-+ |
785 |
-+ return retval; |
786 |
-+ } |
787 |
-+ |
788 |
-+ if (mydev->open_flags == O_RDONLY) |
789 |
-+ { |
790 |
-+ DEBUG(("readonly mode!\n")); |
791 |
-+ sync(); |
792 |
-+ } |
793 |
-+ else if (Dlock(1, mydev->drv)) |
794 |
-+ { |
795 |
-+ printf("Can't lock partition %c:!\n", mydev->drv+'A'); |
796 |
-+ |
797 |
-+ if (mydev) |
798 |
-+ free_device(mydev); |
799 |
-+ |
800 |
-+ __set_errno(EACCES); |
801 |
-+ return -1; |
802 |
-+ } |
803 |
-+ |
804 |
-+ __set_errno(EERROR); |
805 |
-+ |
806 |
-+ ret = XHGetVersion (); |
807 |
-+ DEBUG(("XHDI version: %lx\n", ret)); |
808 |
-+ |
809 |
-+ ret = XHInqDev2(mydev->drv, |
810 |
-+ &mydev->xhdi_maj, &mydev->xhdi_min, |
811 |
-+ &mydev->xhdi_start, NULL, |
812 |
-+ &mydev->xhdi_blocks, mydev->xhdi_id); |
813 |
-+ if (ret) |
814 |
-+ { |
815 |
-+ printf("XHInqDev2 [%c] fail (ret = %li, errno = %i)\n", |
816 |
-+ mydev->drv+'A', ret, errno); |
817 |
-+ ret = -1; |
818 |
-+ } |
819 |
-+ else |
820 |
-+ { |
821 |
-+ ret = XHInqTarget(mydev->xhdi_maj, mydev->xhdi_min, |
822 |
-+ &mydev->xhdi_blocksize, NULL, NULL); |
823 |
-+ if (ret) |
824 |
-+ { |
825 |
-+ printf("XHInqTarget [%i:%i] fail (ret = %li, errno = %i)\n", |
826 |
-+ mydev->xhdi_maj, mydev->xhdi_min, ret, errno); |
827 |
-+ ret = -1; |
828 |
-+ } |
829 |
-+ else |
830 |
-+ { |
831 |
-+ char *xhdi_id = mydev->xhdi_id; |
832 |
-+ |
833 |
-+ if ( 0 |
834 |
-+ || ((xhdi_id[0] == 'G') && (xhdi_id[1] == 'E') && (xhdi_id[2] == 'M')) /* GEM */ |
835 |
-+ || ((xhdi_id[0] == 'B') && (xhdi_id[1] == 'G') && (xhdi_id[2] == 'M')) /* BGM */ |
836 |
-+ || ((xhdi_id[0] == 'F') && (xhdi_id[1] == '3') && (xhdi_id[2] == '2')) /* F32 */ |
837 |
-+ || ((xhdi_id[0] == 'M') && (xhdi_id[1] == 'I') && (xhdi_id[2] == 'X')) /* MIX */ |
838 |
-+ || ((xhdi_id[0] == 'R') && (xhdi_id[1] == 'A') && (xhdi_id[2] == 'W')) /* RAW */ |
839 |
-+ || ((xhdi_id[0] == 'L') && (xhdi_id[1] == 'N') && (xhdi_id[2] == 'X')) /* LNX */ |
840 |
-+ || ((xhdi_id[0] == '\0') && (xhdi_id[1] == 'D'))) /* any DOS */ |
841 |
-+ { |
842 |
-+ DEBUG(("Partition ok and accepted!\n")); |
843 |
-+ DEBUG(("start = %lu, blocks = %lu, blocksize = %lu\n", |
844 |
-+ mydev->xhdi_start, mydev->xhdi_blocks, |
845 |
-+ mydev->xhdi_blocksize)); |
846 |
-+ } |
847 |
-+ else |
848 |
-+ { |
849 |
-+ xhdi_id [3] = '\0'; |
850 |
-+ printf("Wrong partition ID [%s]!\n", xhdi_id); |
851 |
-+ printf("Only 'RAW', 'LNX' and DOS partitions are supported.\n"); |
852 |
-+ |
853 |
-+ __set_errno(EPERM); |
854 |
-+ ret = -1; |
855 |
-+ } |
856 |
-+ } |
857 |
-+ } |
858 |
-+ |
859 |
-+ if (ret) |
860 |
-+ { |
861 |
-+ if (mydev) |
862 |
-+ free_device(mydev); |
863 |
-+ |
864 |
-+ dev = -1; |
865 |
-+ } |
866 |
-+ |
867 |
-+ return dev; |
868 |
-+} |
869 |
-+ |
870 |
-+int |
871 |
-+close(int fd) |
872 |
-+{ |
873 |
-+ struct device *mydev = get_device(fd); |
874 |
-+ int ret = 0; |
875 |
-+ |
876 |
-+ if (!mydev) |
877 |
-+ /* fall through */ |
878 |
-+ return __close(fd); |
879 |
-+ |
880 |
-+ if (mydev->open_flags == O_RDONLY) |
881 |
-+ { |
882 |
-+ ; |
883 |
-+ } |
884 |
-+ else if (Dlock(0, mydev->drv)) |
885 |
-+ { |
886 |
-+ printf("Can't unlock partition %c:!\n", 'A'+mydev->drv); |
887 |
-+ |
888 |
-+ __set_errno(EACCES); |
889 |
-+ ret = -1; |
890 |
-+ } |
891 |
-+ |
892 |
-+ free_device(mydev); |
893 |
-+ return ret; |
894 |
-+} |
895 |
-+ |
896 |
-+/* simple buffer */ |
897 |
-+static char buffer[1024L * 128]; |
898 |
-+static ulong buf_recno = 0; |
899 |
-+static long buf_n = 0; |
900 |
-+ |
901 |
-+static long |
902 |
-+rwabs_xhdi(struct device *mydev, ushort rw, void *buf, ulong size, ulong recno) |
903 |
-+{ |
904 |
-+ ulong n = size / mydev->xhdi_blocksize; |
905 |
-+ long r; |
906 |
-+ |
907 |
-+ assert((size % mydev->xhdi_blocksize) == 0); |
908 |
-+ |
909 |
-+ if (!n || (recno + n) > mydev->xhdi_blocks) |
910 |
-+ { |
911 |
-+ printf("rwabs_xhdi: access outside partition (drv = %c:)\n", 'A'+mydev->drv); |
912 |
-+ exit(2); |
913 |
-+ } |
914 |
-+ |
915 |
-+ if (n > 65535UL) |
916 |
-+ { |
917 |
-+ printf("rwabs_xhdi: n to large (drv = %c)\n", 'A'+mydev->drv); |
918 |
-+ exit(2); |
919 |
-+ } |
920 |
-+ |
921 |
-+ if (!rw && (buf_recno == recno) && (buf_n == n)) |
922 |
-+ { |
923 |
-+ bcopy(buffer, buf, buf_n * mydev->xhdi_blocksize); |
924 |
-+ return 0; |
925 |
-+ } |
926 |
-+ |
927 |
-+ r = XHReadWrite (mydev->xhdi_maj, mydev->xhdi_min, rw, mydev->xhdi_start + recno, n, buf); |
928 |
-+ |
929 |
-+ if (!r && (n * mydev->xhdi_blocksize) <= sizeof(buffer)) |
930 |
-+ { |
931 |
-+ bcopy(buf, buffer, n * mydev->xhdi_blocksize); |
932 |
-+ |
933 |
-+ buf_recno = recno; |
934 |
-+ buf_n = n; |
935 |
-+ } |
936 |
-+ else |
937 |
-+ buf_n = 0; |
938 |
-+ |
939 |
-+ return r; |
940 |
-+} |
941 |
-+ |
942 |
-+# define max(a,b) (a > b ? a : b) |
943 |
-+# define min(a,b) (a > b ? b : a) |
944 |
-+ |
945 |
-+int |
946 |
-+read(int fd, void *_buf, size_t size) |
947 |
-+{ |
948 |
-+ struct device *mydev = get_device(fd); |
949 |
-+ |
950 |
-+ if (!mydev) |
951 |
-+ /* fall through */ |
952 |
-+ return __read(fd, _buf, size); |
953 |
-+ |
954 |
-+{ |
955 |
-+ char *buf = _buf; |
956 |
-+ long todo; /* characters remaining */ |
957 |
-+ long done; /* characters processed */ |
958 |
-+ |
959 |
-+ todo = size; |
960 |
-+ done = 0; |
961 |
-+ |
962 |
-+ if (todo == 0) |
963 |
-+ return 0; |
964 |
-+ |
965 |
-+ /* partial block copy |
966 |
-+ */ |
967 |
-+ if (mydev->pos % mydev->xhdi_blocksize) |
968 |
-+ { |
969 |
-+ char tmp[mydev->xhdi_blocksize]; |
970 |
-+ |
971 |
-+ ulong recno = mydev->pos / mydev->xhdi_blocksize; |
972 |
-+ ulong offset = mydev->pos % mydev->xhdi_blocksize; |
973 |
-+ ulong data; |
974 |
-+ long ret; |
975 |
-+ |
976 |
-+ ret = rwabs_xhdi(mydev, 0, tmp, mydev->xhdi_blocksize, recno); |
977 |
-+ if (ret) |
978 |
-+ { |
979 |
-+ DEBUG(("read: partial part: read failure (r = %li, errno = %i)\n", ret, errno)); |
980 |
-+ goto out; |
981 |
-+ } |
982 |
-+ |
983 |
-+ data = mydev->xhdi_blocksize - offset; |
984 |
-+ data = min (todo, data); |
985 |
-+ |
986 |
-+ memcpy(buf, tmp + offset, data); |
987 |
-+ |
988 |
-+ buf += data; |
989 |
-+ todo -= data; |
990 |
-+ done += data; |
991 |
-+ mydev->pos += data; |
992 |
-+ } |
993 |
-+ |
994 |
-+ if (todo) |
995 |
-+ { |
996 |
-+ assert((todo > 0)); |
997 |
-+ assert((mydev->pos % mydev->xhdi_blocksize) == 0); |
998 |
-+ } |
999 |
-+ |
1000 |
-+ |
1001 |
-+ /* full blocks |
1002 |
-+ */ |
1003 |
-+ if (todo / mydev->xhdi_blocksize) |
1004 |
-+ { |
1005 |
-+ ulong recno = mydev->pos / mydev->xhdi_blocksize; |
1006 |
-+ ulong data = (todo / mydev->xhdi_blocksize) * mydev->xhdi_blocksize; |
1007 |
-+ long ret; |
1008 |
-+ |
1009 |
-+ ret = rwabs_xhdi (mydev, 0, buf, data, recno); |
1010 |
-+ if (ret) |
1011 |
-+ { |
1012 |
-+ DEBUG(("read: full blocks: read failure (r = %li, errno = %i)\n", ret, errno)); |
1013 |
-+ goto out; |
1014 |
-+ } |
1015 |
-+ |
1016 |
-+ buf += data; |
1017 |
-+ todo -= data; |
1018 |
-+ done += data; |
1019 |
-+ mydev->pos += data; |
1020 |
-+ } |
1021 |
-+ |
1022 |
-+ if (todo) |
1023 |
-+ { |
1024 |
-+ assert((todo > 0) && (todo < mydev->xhdi_blocksize)); |
1025 |
-+ assert((mydev->pos % mydev->xhdi_blocksize) == 0); |
1026 |
-+ } |
1027 |
-+ |
1028 |
-+ /* anything left? |
1029 |
-+ */ |
1030 |
-+ if (todo) |
1031 |
-+ { |
1032 |
-+ char tmp[mydev->xhdi_blocksize]; |
1033 |
-+ |
1034 |
-+ ulong recno = mydev->pos / mydev->xhdi_blocksize; |
1035 |
-+ long ret; |
1036 |
-+ |
1037 |
-+ ret = rwabs_xhdi (mydev, 0, tmp, mydev->xhdi_blocksize, recno); |
1038 |
-+ if (ret) |
1039 |
-+ { |
1040 |
-+ DEBUG(("read: left part: read failure (r = %li, errno = %i)]\n", ret, errno)); |
1041 |
-+ goto out; |
1042 |
-+ } |
1043 |
-+ |
1044 |
-+ memcpy(buf, tmp, todo); |
1045 |
-+ |
1046 |
-+ done += todo; |
1047 |
-+ mydev->pos += todo; |
1048 |
-+ } |
1049 |
-+ |
1050 |
-+ assert(done == size); |
1051 |
-+ |
1052 |
-+out: |
1053 |
-+ return done; |
1054 |
-+} |
1055 |
-+} |
1056 |
-+ |
1057 |
-+int |
1058 |
-+write(int fd, const void *_buf, size_t size) |
1059 |
-+{ |
1060 |
-+ struct device *mydev = get_device(fd); |
1061 |
-+ |
1062 |
-+ if (!mydev) |
1063 |
-+ /* fall through */ |
1064 |
-+ return __write(fd, _buf, size); |
1065 |
-+ |
1066 |
-+ if (mydev->open_flags == O_RDONLY) |
1067 |
-+ { |
1068 |
-+ __set_errno(EPERM); |
1069 |
-+ return -1; |
1070 |
-+ } |
1071 |
-+{ |
1072 |
-+ const char *buf = _buf; |
1073 |
-+ long todo; /* characters remaining */ |
1074 |
-+ long done; /* characters processed */ |
1075 |
-+ |
1076 |
-+ todo = size; |
1077 |
-+ done = 0; |
1078 |
-+ |
1079 |
-+ if (todo == 0) |
1080 |
-+ return 0; |
1081 |
-+ |
1082 |
-+ /* partial block copy |
1083 |
-+ */ |
1084 |
-+ if (mydev->pos % mydev->xhdi_blocksize) |
1085 |
-+ { |
1086 |
-+ char tmp[mydev->xhdi_blocksize]; |
1087 |
-+ |
1088 |
-+ ulong recno = mydev->pos / mydev->xhdi_blocksize; |
1089 |
-+ ulong offset = mydev->pos % mydev->xhdi_blocksize; |
1090 |
-+ ulong data; |
1091 |
-+ long ret; |
1092 |
-+ |
1093 |
-+ ret = rwabs_xhdi(mydev, 0, tmp, mydev->xhdi_blocksize, recno); |
1094 |
-+ if (ret) |
1095 |
-+ { |
1096 |
-+ DEBUG(("write: partial part: read failure (r = %li, errno = %i)\n", ret, errno)); |
1097 |
-+ goto out; |
1098 |
-+ } |
1099 |
-+ |
1100 |
-+ data = mydev->xhdi_blocksize - offset; |
1101 |
-+ data = min (todo, data); |
1102 |
-+ |
1103 |
-+ memcpy(tmp + offset, buf, data); |
1104 |
-+ |
1105 |
-+ ret = rwabs_xhdi(mydev, 1, tmp, mydev->xhdi_blocksize, recno); |
1106 |
-+ if (ret) |
1107 |
-+ { |
1108 |
-+ DEBUG(("write: partial part: write failure (r = %li, errno = %i)\n", ret, errno)); |
1109 |
-+ goto out; |
1110 |
-+ } |
1111 |
-+ |
1112 |
-+ buf += data; |
1113 |
-+ todo -= data; |
1114 |
-+ done += data; |
1115 |
-+ mydev->pos += data; |
1116 |
-+ } |
1117 |
-+ |
1118 |
-+ if (todo) |
1119 |
-+ { |
1120 |
-+ assert((todo > 0)); |
1121 |
-+ assert((mydev->pos % mydev->xhdi_blocksize) == 0); |
1122 |
-+ } |
1123 |
-+ |
1124 |
-+ /* full blocks |
1125 |
-+ */ |
1126 |
-+ if (todo / mydev->xhdi_blocksize) |
1127 |
-+ { |
1128 |
-+ ulong recno = mydev->pos / mydev->xhdi_blocksize; |
1129 |
-+ ulong data = (todo / mydev->xhdi_blocksize) * mydev->xhdi_blocksize; |
1130 |
-+ long ret; |
1131 |
-+ |
1132 |
-+ ret = rwabs_xhdi(mydev, 1, (void *)buf, data, recno); |
1133 |
-+ if (ret) |
1134 |
-+ { |
1135 |
-+ DEBUG(("write: full blocks: write failure (r = %li, errno = %i)\n", ret, errno)); |
1136 |
-+ goto out; |
1137 |
-+ } |
1138 |
-+ |
1139 |
-+ buf += data; |
1140 |
-+ todo -= data; |
1141 |
-+ done += data; |
1142 |
-+ mydev->pos += data; |
1143 |
-+ } |
1144 |
-+ |
1145 |
-+ if (todo) |
1146 |
-+ { |
1147 |
-+ assert((todo > 0) && (todo < mydev->xhdi_blocksize)); |
1148 |
-+ assert((mydev->pos % mydev->xhdi_blocksize) == 0); |
1149 |
-+ } |
1150 |
-+ |
1151 |
-+ /* anything left? |
1152 |
-+ */ |
1153 |
-+ if (todo) |
1154 |
-+ { |
1155 |
-+ char tmp[mydev->xhdi_blocksize]; |
1156 |
-+ |
1157 |
-+ ulong recno = mydev->pos / mydev->xhdi_blocksize; |
1158 |
-+ long ret; |
1159 |
-+ |
1160 |
-+ ret = rwabs_xhdi(mydev, 0, tmp, mydev->xhdi_blocksize, recno); |
1161 |
-+ if (ret) |
1162 |
-+ { |
1163 |
-+ DEBUG(("write: left part: read failure (r = %li, errno = %i)]\n", ret, errno)); |
1164 |
-+ goto out; |
1165 |
-+ } |
1166 |
-+ |
1167 |
-+ memcpy(tmp, buf, todo); |
1168 |
-+ |
1169 |
-+ ret = rwabs_xhdi(mydev, 1, tmp, mydev->xhdi_blocksize, recno); |
1170 |
-+ if (ret) |
1171 |
-+ { |
1172 |
-+ DEBUG(("write: partial part: write failure (r = %li, errno = %i)\n", ret, errno)); |
1173 |
-+ goto out; |
1174 |
-+ } |
1175 |
-+ |
1176 |
-+ done += todo; |
1177 |
-+ mydev->pos += todo; |
1178 |
-+ } |
1179 |
-+ |
1180 |
-+ assert(done == size); |
1181 |
-+ |
1182 |
-+out: |
1183 |
-+ return done; |
1184 |
-+} |
1185 |
-+} |
1186 |
-+ |
1187 |
-+int |
1188 |
-+ioctl(int fd, int cmd, void *arg) |
1189 |
-+{ |
1190 |
-+ struct device *mydev = get_device(fd); |
1191 |
-+ |
1192 |
-+ if (!mydev) |
1193 |
-+ /* fall through */ |
1194 |
-+ return __ioctl(fd, cmd, arg); |
1195 |
-+ |
1196 |
-+ DEBUG(("ioctl: cmd = %i\n", cmd)); |
1197 |
-+ |
1198 |
-+ switch (cmd) |
1199 |
-+ { |
1200 |
-+ case BLKGETSIZE: |
1201 |
-+ { |
1202 |
-+ ulong *size = arg; |
1203 |
-+ *size = mydev->xhdi_blocks * (mydev->xhdi_blocksize / 512); |
1204 |
-+ break; |
1205 |
-+ } |
1206 |
-+ case BLOCKSIZE: |
1207 |
-+ { |
1208 |
-+ ulong *block_size = arg; |
1209 |
-+ *block_size = mydev->xhdi_blocksize; |
1210 |
-+ break; |
1211 |
-+ } |
1212 |
-+ default: |
1213 |
-+ __set_errno(EINVAL); |
1214 |
-+ return -1; |
1215 |
-+ } |
1216 |
-+ |
1217 |
-+ return 0; |
1218 |
-+} |
1219 |
-+ |
1220 |
-+int |
1221 |
-+fstat(int fd, struct stat *st) |
1222 |
-+{ |
1223 |
-+ struct device *mydev = get_device(fd); |
1224 |
-+ |
1225 |
-+ if (!mydev) |
1226 |
-+ /* fall through */ |
1227 |
-+ return __fstat(fd, st); |
1228 |
-+ |
1229 |
-+ bzero(st, sizeof(*st)); |
1230 |
-+ |
1231 |
-+ st->st_dev = mydev->xhdi_maj; |
1232 |
-+ st->st_ino = mydev->drv; |
1233 |
-+ st->st_mode = S_IFBLK | S_IRUSR | S_IWUSR; |
1234 |
-+ st->st_nlink = 1; |
1235 |
-+ st->st_uid = 0; |
1236 |
-+ st->st_gid = 0; |
1237 |
-+ st->st_rdev = mydev->xhdi_min; |
1238 |
-+ st->st_atime = time (NULL); |
1239 |
-+ st->st_mtime = time (NULL); |
1240 |
-+ st->st_ctime = time (NULL); |
1241 |
-+ st->st_size = (int64_t) mydev->xhdi_blocks * mydev->xhdi_blocksize; |
1242 |
-+ st->st_blocks = (int64_t) mydev->xhdi_blocks * mydev->xhdi_blocksize / 512; |
1243 |
-+ st->st_blksize = mydev->xhdi_blocksize; |
1244 |
-+ st->st_flags = 0; |
1245 |
-+ st->st_gen = 0; |
1246 |
-+ |
1247 |
-+ return 0; |
1248 |
-+} |
1249 |
-+ |
1250 |
-+int |
1251 |
-+stat(const char *filename, struct stat *st) |
1252 |
-+{ |
1253 |
-+ struct device *mydev; |
1254 |
-+ int fd, res; |
1255 |
-+ |
1256 |
-+ fd = open(filename, O_RDONLY); |
1257 |
-+ if (fd == -1) |
1258 |
-+ return -1; |
1259 |
-+ |
1260 |
-+ mydev = get_device(fd); |
1261 |
-+ if (!mydev) |
1262 |
-+ { |
1263 |
-+ close(fd); |
1264 |
-+ |
1265 |
-+ /* fall through */ |
1266 |
-+ return __stat(filename, st); |
1267 |
-+ } |
1268 |
-+ |
1269 |
-+ res = fstat(fd, st); |
1270 |
-+ close(fd); |
1271 |
-+ |
1272 |
-+ return res; |
1273 |
-+} |
1274 |
-+ |
1275 |
-+int |
1276 |
-+fsync(int fd) |
1277 |
-+{ |
1278 |
-+ struct device *mydev = get_device(fd); |
1279 |
-+ |
1280 |
-+ if (!mydev) |
1281 |
-+ /* fall through */ |
1282 |
-+ return __fsync(fd); |
1283 |
-+ |
1284 |
-+ /* nothing todo */ |
1285 |
-+ return 0; |
1286 |
-+} |
1287 |
-+ |
1288 |
-+loff_t llseek(int fd, loff_t offset, int origin); |
1289 |
-+ |
1290 |
-+loff_t |
1291 |
-+llseek(int fd, loff_t offset, int origin) |
1292 |
-+{ |
1293 |
-+ struct device *mydev = get_device(fd); |
1294 |
-+ |
1295 |
-+ if (!mydev) |
1296 |
-+ /* fall through */ |
1297 |
-+ return __lseek(fd, (off_t) offset, origin); |
1298 |
-+ |
1299 |
-+ |
1300 |
-+ switch (origin) |
1301 |
-+ { |
1302 |
-+ case SEEK_SET: |
1303 |
-+ break; |
1304 |
-+ case SEEK_CUR: |
1305 |
-+ offset += mydev->pos; |
1306 |
-+ break; |
1307 |
-+ case SEEK_END: |
1308 |
-+ offset += (int64_t) mydev->xhdi_blocks * mydev->xhdi_blocksize; |
1309 |
-+ break; |
1310 |
-+ default: |
1311 |
-+ return -1; |
1312 |
-+ } |
1313 |
-+ |
1314 |
-+ if (offset > (loff_t) mydev->xhdi_blocks * mydev->xhdi_blocksize) |
1315 |
-+ { |
1316 |
-+ __set_errno(EINVAL); |
1317 |
-+ return -1; |
1318 |
-+ } |
1319 |
-+ |
1320 |
-+ mydev->pos = offset; |
1321 |
-+ return mydev->pos; |
1322 |
-+} |
1323 |
-+ |
1324 |
-+loff_t lseek64(int fd, loff_t offset, int origin); |
1325 |
-+ |
1326 |
-+loff_t |
1327 |
-+lseek64(int fd, loff_t offset, int origin) |
1328 |
-+{ |
1329 |
-+ return llseek(fd, offset, origin); |
1330 |
-+} |
1331 |
-+ |
1332 |
-+__off_t |
1333 |
-+lseek(int fd, __off_t offset, int mode) |
1334 |
-+{ |
1335 |
-+ struct device *mydev = get_device(fd); |
1336 |
-+ |
1337 |
-+ if (!mydev) |
1338 |
-+ /* fall through */ |
1339 |
-+ return __lseek(fd, offset, mode); |
1340 |
-+ |
1341 |
-+{ |
1342 |
-+ loff_t _offset = offset; |
1343 |
-+ |
1344 |
-+ switch (mode) |
1345 |
-+ { |
1346 |
-+ case SEEK_SET: |
1347 |
-+ break; |
1348 |
-+ case SEEK_CUR: |
1349 |
-+ _offset += mydev->pos; |
1350 |
-+ break; |
1351 |
-+ case SEEK_END: |
1352 |
-+ _offset += (loff_t) mydev->xhdi_blocks * mydev->xhdi_blocksize; |
1353 |
-+ break; |
1354 |
-+ default: |
1355 |
-+ return -1; |
1356 |
-+ } |
1357 |
-+ |
1358 |
-+ if (_offset > LONG_MAX) |
1359 |
-+ { |
1360 |
-+ __set_errno(EINVAL); |
1361 |
-+ return -1; |
1362 |
-+ } |
1363 |
-+ |
1364 |
-+ if (_offset > (loff_t) mydev->xhdi_blocks * mydev->xhdi_blocksize) |
1365 |
-+ { |
1366 |
-+ __set_errno(EINVAL); |
1367 |
-+ return -1; |
1368 |
-+ } |
1369 |
-+ |
1370 |
-+ mydev->pos = _offset; |
1371 |
-+ return (off_t) mydev->pos; |
1372 |
-+} |
1373 |
-+} |
1374 |
-+ |
1375 |
-+int gettype(int fd); |
1376 |
-+ |
1377 |
-+int |
1378 |
-+gettype(int fd) |
1379 |
-+{ |
1380 |
-+ struct device *mydev = get_device(fd); |
1381 |
-+ char *xhdi_id; |
1382 |
-+ |
1383 |
-+ if (!mydev) |
1384 |
-+ return -1; |
1385 |
-+ |
1386 |
-+ /* Get filesystem type by XHDI ID */ |
1387 |
-+ xhdi_id = mydev->xhdi_id; |
1388 |
-+ if ((xhdi_id[0] == '\0') && (xhdi_id[1] == 'D')) |
1389 |
-+ return 0; /* DOS (\0D*) */ |
1390 |
-+ else |
1391 |
-+ return 1; /* Atari (GEM/GBM) */ |
1392 |
-+} |
1393 |
-+ |
1394 |
-+# endif /* __MINT__ */ |
1395 |
-diff -ur --new-file e2fsprogs-1.41.3/lib/ext2fs/mint_io.h e2fsprogs-1.41.3-mint/lib/ext2fs/mint_io.h |
1396 |
---- e2fsprogs-1.41.3/lib/ext2fs/mint_io.h 1970-01-01 00:00:00.000000000 +0000 |
1397 |
-+++ e2fsprogs-1.41.3-mint/lib/ext2fs/mint_io.h 2009-01-23 10:49:53.000000000 +0000 |
1398 |
-@@ -0,0 +1,22 @@ |
1399 |
-+/* |
1400 |
-+ * mint_io.h |
1401 |
-+ * |
1402 |
-+ * Copyright (C) 2000 Frank Naumann <fnaumann@××××××××.de>. |
1403 |
-+ * |
1404 |
-+ * %Begin-Header% |
1405 |
-+ * This file may be redistributed under the terms of the GNU Public |
1406 |
-+ * License. |
1407 |
-+ * %End-Header% |
1408 |
-+ */ |
1409 |
-+ |
1410 |
-+# ifdef __MINT__ |
1411 |
-+ |
1412 |
-+# ifndef _mint_io_h |
1413 |
-+# define _mint_io_h |
1414 |
-+ |
1415 |
-+# define BLKGETSIZE (('b'<< 8) | 1) |
1416 |
-+# define BLOCKSIZE (('b'<< 8) | 2) |
1417 |
-+ |
1418 |
-+# endif /* _mint_io_h */ |
1419 |
-+ |
1420 |
-+# endif /* __MINT__ */ |
1421 |
-diff -ur --new-file e2fsprogs-1.41.3/lib/ext2fs/unix_io.c e2fsprogs-1.41.3-mint/lib/ext2fs/unix_io.c |
1422 |
---- e2fsprogs-1.41.3/lib/ext2fs/unix_io.c 2008-10-13 03:12:22.000000000 +0000 |
1423 |
-+++ e2fsprogs-1.41.3-mint/lib/ext2fs/unix_io.c 2009-01-23 10:47:35.000000000 +0000 |
1424 |
-@@ -51,9 +51,15 @@ |
1425 |
- #define BLKROGET _IO(0x12, 94) /* Get read-only status (0 = read_write). */ |
1426 |
- #endif |
1427 |
- |
1428 |
-+#ifdef __MINT__ |
1429 |
-+#include <sys/ioctl.h> |
1430 |
-+#include "mint_io.h" |
1431 |
-+#endif |
1432 |
-+ |
1433 |
- #include "ext2_fs.h" |
1434 |
- #include "ext2fs.h" |
1435 |
- |
1436 |
-+ |
1437 |
- /* |
1438 |
- * For checking structure magic numbers... |
1439 |
- */ |
1440 |
-@@ -512,6 +518,16 @@ |
1441 |
- } |
1442 |
- } |
1443 |
- #endif |
1444 |
-+ |
1445 |
-+#ifdef __MINT__ |
1446 |
-+ { |
1447 |
-+ unsigned long block_size; |
1448 |
-+ retval = ioctl(data->dev, BLOCKSIZE, &block_size); |
1449 |
-+ if (retval == 0) |
1450 |
-+ io->block_size = block_size; |
1451 |
-+ } |
1452 |
-+#endif |
1453 |
-+ |
1454 |
- *channel = io; |
1455 |
- return 0; |
1456 |
- |
1457 |
-diff -ur --new-file e2fsprogs-1.41.3/lib/ext2fs/xhdi.c e2fsprogs-1.41.3-mint/lib/ext2fs/xhdi.c |
1458 |
---- e2fsprogs-1.41.3/lib/ext2fs/xhdi.c 1970-01-01 00:00:00.000000000 +0000 |
1459 |
-+++ e2fsprogs-1.41.3-mint/lib/ext2fs/xhdi.c 2009-01-23 10:49:55.000000000 +0000 |
1460 |
-@@ -0,0 +1,577 @@ |
1461 |
-+/* |
1462 |
-+ * Copyright 2000 Frank Naumann <fnaumann@××××××××.de> |
1463 |
-+ * All rights reserved. |
1464 |
-+ * |
1465 |
-+ * This program is free software; you can redistribute it and/or modify |
1466 |
-+ * it under the terms of the GNU General Public License as published by |
1467 |
-+ * the Free Software Foundation; either version 2, or (at your option) |
1468 |
-+ * any later version. |
1469 |
-+ * |
1470 |
-+ * This file is distributed in the hope that it will be useful, |
1471 |
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1472 |
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1473 |
-+ * GNU General Public License for more details. |
1474 |
-+ * |
1475 |
-+ * You should have received a copy of the GNU General Public License |
1476 |
-+ * along with this program; if not, write to the Free Software |
1477 |
-+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
1478 |
-+ * |
1479 |
-+ * |
1480 |
-+ * Started: 2000-05-02 |
1481 |
-+ * |
1482 |
-+ * Changes: |
1483 |
-+ * |
1484 |
-+ * 0.1: |
1485 |
-+ * |
1486 |
-+ * fix: Cookie handling stuff; use Getcookie from MiNT-Lib now |
1487 |
-+ * requires an actual MiNT-Lib (>= PL49) |
1488 |
-+ * |
1489 |
-+ * 0.0: |
1490 |
-+ * |
1491 |
-+ * - inital version |
1492 |
-+ * |
1493 |
-+ */ |
1494 |
-+ |
1495 |
-+# include "xhdi.h" |
1496 |
-+ |
1497 |
-+# include <stdio.h> |
1498 |
-+# include <stdlib.h> |
1499 |
-+# include <errno.h> |
1500 |
-+# include <mintbind.h> |
1501 |
-+# include <mint/cookie.h> |
1502 |
-+ |
1503 |
-+ |
1504 |
-+/* |
1505 |
-+ * internal usage |
1506 |
-+ */ |
1507 |
-+ |
1508 |
-+/* dummy routine */ |
1509 |
-+static long |
1510 |
-+XHDIfail (void) |
1511 |
-+{ |
1512 |
-+ return -ENOSYS; |
1513 |
-+} |
1514 |
-+ |
1515 |
-+/* XHDI handler function */ |
1516 |
-+static long (*XHDI)() = XHDIfail; |
1517 |
-+ |
1518 |
-+ushort XHDI_installed = 0; |
1519 |
-+ |
1520 |
-+ |
1521 |
-+# define C_XHDI 0x58484449L |
1522 |
-+# define XHDIMAGIC 0x27011992L |
1523 |
-+ |
1524 |
-+/* initalize flag */ |
1525 |
-+static ushort init = 1; |
1526 |
-+ |
1527 |
-+long |
1528 |
-+init_XHDI (void) |
1529 |
-+{ |
1530 |
-+ long *val; |
1531 |
-+ long r; |
1532 |
-+ |
1533 |
-+ init = 0; |
1534 |
-+ |
1535 |
-+ r = Getcookie (C_XHDI, (long *) &val); |
1536 |
-+ if (r == C_FOUND) |
1537 |
-+ { |
1538 |
-+ long *magic_test = val; |
1539 |
-+ |
1540 |
-+ /* check magic */ |
1541 |
-+ if (magic_test) |
1542 |
-+ { |
1543 |
-+ magic_test--; |
1544 |
-+ if (*magic_test == XHDIMAGIC) |
1545 |
-+ { |
1546 |
-+ XHDI = val; |
1547 |
-+ } |
1548 |
-+ } |
1549 |
-+ } |
1550 |
-+ |
1551 |
-+ r = XHGetVersion (); |
1552 |
-+ if (r < 0) |
1553 |
-+ { |
1554 |
-+ perror ("XHGetVersion"); |
1555 |
-+ |
1556 |
-+ XHDI = XHDIfail; |
1557 |
-+ return r; |
1558 |
-+ } |
1559 |
-+ |
1560 |
-+ /* we need at least XHDI 1.10 */ |
1561 |
-+ if (r >= 0x110) |
1562 |
-+ { |
1563 |
-+ XHDI_installed = r; |
1564 |
-+ return 0; |
1565 |
-+ } |
1566 |
-+ |
1567 |
-+ XHDI = XHDIfail; |
1568 |
-+ return -1; |
1569 |
-+} |
1570 |
-+ |
1571 |
-+ |
1572 |
-+/* |
1573 |
-+ * XHDI wrapper routines |
1574 |
-+ */ |
1575 |
-+ |
1576 |
-+# define CALL \ |
1577 |
-+ long oldstack = 0; \ |
1578 |
-+ long r; \ |
1579 |
-+ \ |
1580 |
-+ if (init) init_XHDI (); \ |
1581 |
-+ \ |
1582 |
-+ if (!Super (1L)) \ |
1583 |
-+ oldstack = Super (0L); \ |
1584 |
-+ \ |
1585 |
-+ r = XHDI (args); \ |
1586 |
-+ if (r < 0) \ |
1587 |
-+ { \ |
1588 |
-+ __set_errno (-r); \ |
1589 |
-+ r = -1; \ |
1590 |
-+ } \ |
1591 |
-+ \ |
1592 |
-+ if (oldstack) \ |
1593 |
-+ Super (oldstack); \ |
1594 |
-+ \ |
1595 |
-+ return r |
1596 |
-+ |
1597 |
-+long |
1598 |
-+XHGetVersion (void) |
1599 |
-+{ |
1600 |
-+ struct args_XHGetVersion |
1601 |
-+ { |
1602 |
-+ ushort opcode; |
1603 |
-+ } |
1604 |
-+ args = |
1605 |
-+ { |
1606 |
-+ 0 |
1607 |
-+ }; |
1608 |
-+ |
1609 |
-+ CALL; |
1610 |
-+} |
1611 |
-+ |
1612 |
-+long |
1613 |
-+XHInqTarget (ushort major, ushort minor, ulong *block_size, ulong *device_flags, char *product_name) |
1614 |
-+{ |
1615 |
-+ struct args_XHInqTarget |
1616 |
-+ { |
1617 |
-+ ushort opcode; |
1618 |
-+ ushort major; |
1619 |
-+ ushort minor; |
1620 |
-+ ulong *block_size; |
1621 |
-+ ulong *device_flags; |
1622 |
-+ char *product_name; |
1623 |
-+ } |
1624 |
-+ args = |
1625 |
-+ { |
1626 |
-+ 1, |
1627 |
-+ major, |
1628 |
-+ minor, |
1629 |
-+ block_size, |
1630 |
-+ device_flags, |
1631 |
-+ product_name |
1632 |
-+ }; |
1633 |
-+ |
1634 |
-+ CALL; |
1635 |
-+} |
1636 |
-+ |
1637 |
-+long |
1638 |
-+XHReserve (ushort major, ushort minor, ushort do_reserve, ushort key) |
1639 |
-+{ |
1640 |
-+ struct args_XHReserve |
1641 |
-+ { |
1642 |
-+ ushort opcode; |
1643 |
-+ ushort major; |
1644 |
-+ ushort minor; |
1645 |
-+ ushort do_reserve; |
1646 |
-+ ushort key; |
1647 |
-+ } |
1648 |
-+ args = |
1649 |
-+ { |
1650 |
-+ 2, |
1651 |
-+ major, |
1652 |
-+ minor, |
1653 |
-+ do_reserve, |
1654 |
-+ key |
1655 |
-+ }; |
1656 |
-+ |
1657 |
-+ CALL; |
1658 |
-+} |
1659 |
-+ |
1660 |
-+long |
1661 |
-+XHLock (ushort major, ushort minor, ushort do_lock, ushort key) |
1662 |
-+{ |
1663 |
-+ struct args_XHLock |
1664 |
-+ { |
1665 |
-+ ushort opcode; |
1666 |
-+ ushort major; |
1667 |
-+ ushort minor; |
1668 |
-+ ushort do_lock; |
1669 |
-+ ushort key; |
1670 |
-+ } |
1671 |
-+ args = |
1672 |
-+ { |
1673 |
-+ 3, |
1674 |
-+ major, |
1675 |
-+ minor, |
1676 |
-+ do_lock, |
1677 |
-+ key |
1678 |
-+ }; |
1679 |
-+ |
1680 |
-+ CALL; |
1681 |
-+} |
1682 |
-+ |
1683 |
-+long |
1684 |
-+XHStop (ushort major, ushort minor, ushort do_stop, ushort key) |
1685 |
-+{ |
1686 |
-+ struct args_XHStop |
1687 |
-+ { |
1688 |
-+ ushort opcode; |
1689 |
-+ ushort major; |
1690 |
-+ ushort minor; |
1691 |
-+ ushort do_stop; |
1692 |
-+ ushort key; |
1693 |
-+ } |
1694 |
-+ args = |
1695 |
-+ { |
1696 |
-+ 4, |
1697 |
-+ major, |
1698 |
-+ minor, |
1699 |
-+ do_stop, |
1700 |
-+ key |
1701 |
-+ }; |
1702 |
-+ |
1703 |
-+ CALL; |
1704 |
-+} |
1705 |
-+ |
1706 |
-+long |
1707 |
-+XHEject (ushort major, ushort minor, ushort do_eject, ushort key) |
1708 |
-+{ |
1709 |
-+ struct args_XHEject |
1710 |
-+ { |
1711 |
-+ ushort opcode; |
1712 |
-+ ushort major; |
1713 |
-+ ushort minor; |
1714 |
-+ ushort do_eject; |
1715 |
-+ ushort key; |
1716 |
-+ } |
1717 |
-+ args = |
1718 |
-+ { |
1719 |
-+ 5, |
1720 |
-+ major, |
1721 |
-+ minor, |
1722 |
-+ do_eject, |
1723 |
-+ key |
1724 |
-+ }; |
1725 |
-+ |
1726 |
-+ CALL; |
1727 |
-+} |
1728 |
-+ |
1729 |
-+long |
1730 |
-+XHDrvMap (void) |
1731 |
-+{ |
1732 |
-+ struct args_XHDrvMap |
1733 |
-+ { |
1734 |
-+ ushort opcode; |
1735 |
-+ } |
1736 |
-+ args = |
1737 |
-+ { |
1738 |
-+ 6 |
1739 |
-+ }; |
1740 |
-+ |
1741 |
-+ CALL; |
1742 |
-+} |
1743 |
-+ |
1744 |
-+long |
1745 |
-+XHInqDev (ushort bios, ushort *major, ushort *minor, ulong *start, __BPB *bpb) |
1746 |
-+{ |
1747 |
-+ struct args_XHInqDev |
1748 |
-+ { |
1749 |
-+ ushort opcode; |
1750 |
-+ ushort bios; |
1751 |
-+ ushort *major; |
1752 |
-+ ushort *minor; |
1753 |
-+ ulong *start; |
1754 |
-+ __BPB *bpb; |
1755 |
-+ } |
1756 |
-+ args = |
1757 |
-+ { |
1758 |
-+ 7, |
1759 |
-+ bios, |
1760 |
-+ major, |
1761 |
-+ minor, |
1762 |
-+ start, |
1763 |
-+ bpb |
1764 |
-+ }; |
1765 |
-+ |
1766 |
-+ CALL; |
1767 |
-+} |
1768 |
-+ |
1769 |
-+long |
1770 |
-+XHInqDriver (ushort bios, char *name, char *version, char *company, ushort *ahdi_version, ushort *maxIPL) |
1771 |
-+{ |
1772 |
-+ struct args_XHInqDriver |
1773 |
-+ { |
1774 |
-+ ushort opcode; |
1775 |
-+ ushort bios; |
1776 |
-+ char *name; |
1777 |
-+ char *version; |
1778 |
-+ char *company; |
1779 |
-+ ushort *ahdi_version; |
1780 |
-+ ushort *maxIPL; |
1781 |
-+ } |
1782 |
-+ args = |
1783 |
-+ { |
1784 |
-+ 8, |
1785 |
-+ bios, |
1786 |
-+ name, |
1787 |
-+ version, |
1788 |
-+ company, |
1789 |
-+ ahdi_version, |
1790 |
-+ maxIPL |
1791 |
-+ }; |
1792 |
-+ |
1793 |
-+ CALL; |
1794 |
-+} |
1795 |
-+ |
1796 |
-+long |
1797 |
-+XHNewCookie (void *newcookie) |
1798 |
-+{ |
1799 |
-+ struct args_XHNewCookie |
1800 |
-+ { |
1801 |
-+ ushort opcode; |
1802 |
-+ void *newcookie; |
1803 |
-+ } |
1804 |
-+ args = |
1805 |
-+ { |
1806 |
-+ 9, |
1807 |
-+ newcookie |
1808 |
-+ }; |
1809 |
-+ |
1810 |
-+ CALL; |
1811 |
-+} |
1812 |
-+ |
1813 |
-+long |
1814 |
-+XHReadWrite (ushort major, ushort minor, ushort rwflag, ulong recno, ushort count, void *buf) |
1815 |
-+{ |
1816 |
-+ struct args_XHReadWrite |
1817 |
-+ { |
1818 |
-+ ushort opcode; |
1819 |
-+ ushort major; |
1820 |
-+ ushort minor; |
1821 |
-+ ushort rwflag; |
1822 |
-+ ulong recno; |
1823 |
-+ ushort count; |
1824 |
-+ void *buf; |
1825 |
-+ } |
1826 |
-+ args = |
1827 |
-+ { |
1828 |
-+ 10, |
1829 |
-+ major, |
1830 |
-+ minor, |
1831 |
-+ rwflag, |
1832 |
-+ recno, |
1833 |
-+ count, |
1834 |
-+ buf |
1835 |
-+ }; |
1836 |
-+ |
1837 |
-+ CALL; |
1838 |
-+} |
1839 |
-+ |
1840 |
-+long |
1841 |
-+XHInqTarget2 (ushort major, ushort minor, ulong *block_size, ulong *device_flags, char *product_name, ushort stringlen) |
1842 |
-+{ |
1843 |
-+ struct args_XHInqTarget2 |
1844 |
-+ { |
1845 |
-+ ushort opcode; |
1846 |
-+ ushort major; |
1847 |
-+ ushort minor; |
1848 |
-+ ulong *block_size; |
1849 |
-+ ulong *device_flags; |
1850 |
-+ char *product_name; |
1851 |
-+ ushort stringlen; |
1852 |
-+ } |
1853 |
-+ args = |
1854 |
-+ { |
1855 |
-+ 11, |
1856 |
-+ major, |
1857 |
-+ minor, |
1858 |
-+ block_size, |
1859 |
-+ device_flags, |
1860 |
-+ product_name, |
1861 |
-+ stringlen |
1862 |
-+ }; |
1863 |
-+ |
1864 |
-+ CALL; |
1865 |
-+} |
1866 |
-+ |
1867 |
-+long |
1868 |
-+XHInqDev2 (ushort bios, ushort *major, ushort *minor, ulong *start, __BPB *bpb, ulong *blocks, char *partid) |
1869 |
-+{ |
1870 |
-+ struct args_XHInqDev2 |
1871 |
-+ { |
1872 |
-+ ushort opcode; |
1873 |
-+ ushort bios; |
1874 |
-+ ushort *major; |
1875 |
-+ ushort *minor; |
1876 |
-+ ulong *start; |
1877 |
-+ __BPB *bpb; |
1878 |
-+ ulong *blocks; |
1879 |
-+ char *partid; |
1880 |
-+ } |
1881 |
-+ args = |
1882 |
-+ { |
1883 |
-+ 12, |
1884 |
-+ bios, |
1885 |
-+ major, |
1886 |
-+ minor, |
1887 |
-+ start, |
1888 |
-+ bpb, |
1889 |
-+ blocks, |
1890 |
-+ partid |
1891 |
-+ }; |
1892 |
-+ |
1893 |
-+ CALL; |
1894 |
-+} |
1895 |
-+ |
1896 |
-+long |
1897 |
-+XHDriverSpecial (ulong key1, ulong key2, ushort subopcode, void *data) |
1898 |
-+{ |
1899 |
-+ struct args_XHDriverSpecial |
1900 |
-+ { |
1901 |
-+ ushort opcode; |
1902 |
-+ ulong key1; |
1903 |
-+ ulong key2; |
1904 |
-+ ushort subopcode; |
1905 |
-+ void *data; |
1906 |
-+ } |
1907 |
-+ args = |
1908 |
-+ { |
1909 |
-+ 13, |
1910 |
-+ key1, |
1911 |
-+ key2, |
1912 |
-+ subopcode, |
1913 |
-+ data |
1914 |
-+ }; |
1915 |
-+ |
1916 |
-+ CALL; |
1917 |
-+} |
1918 |
-+ |
1919 |
-+long |
1920 |
-+XHGetCapacity (ushort major, ushort minor, ulong *blocks, ulong *bs) |
1921 |
-+{ |
1922 |
-+ struct args_XHGetCapacity |
1923 |
-+ { |
1924 |
-+ ushort opcode; |
1925 |
-+ ushort major; |
1926 |
-+ ushort minor; |
1927 |
-+ ulong *blocks; |
1928 |
-+ ulong *bs; |
1929 |
-+ } |
1930 |
-+ args = |
1931 |
-+ { |
1932 |
-+ 14, |
1933 |
-+ major, |
1934 |
-+ minor, |
1935 |
-+ blocks, |
1936 |
-+ bs |
1937 |
-+ }; |
1938 |
-+ |
1939 |
-+ CALL; |
1940 |
-+} |
1941 |
-+ |
1942 |
-+long |
1943 |
-+XHMediumChanged (ushort major, ushort minor) |
1944 |
-+{ |
1945 |
-+ struct args_XHMediumChanged |
1946 |
-+ { |
1947 |
-+ ushort opcode; |
1948 |
-+ ushort major; |
1949 |
-+ ushort minor; |
1950 |
-+ } |
1951 |
-+ args = |
1952 |
-+ { |
1953 |
-+ 15, |
1954 |
-+ major, |
1955 |
-+ minor |
1956 |
-+ }; |
1957 |
-+ |
1958 |
-+ CALL; |
1959 |
-+} |
1960 |
-+ |
1961 |
-+long |
1962 |
-+XHMiNTInfo (ushort op, void *data) |
1963 |
-+{ |
1964 |
-+ struct args_XHMiNTInfo |
1965 |
-+ { |
1966 |
-+ ushort opcode; |
1967 |
-+ ushort op; |
1968 |
-+ void *data; |
1969 |
-+ } |
1970 |
-+ args = |
1971 |
-+ { |
1972 |
-+ 16, |
1973 |
-+ op, |
1974 |
-+ data |
1975 |
-+ }; |
1976 |
-+ |
1977 |
-+ CALL; |
1978 |
-+} |
1979 |
-+ |
1980 |
-+long |
1981 |
-+XHDOSLimits (ushort which, ulong limit) |
1982 |
-+{ |
1983 |
-+ struct args_XHDOSLimits |
1984 |
-+ { |
1985 |
-+ ushort opcode; |
1986 |
-+ ushort which; |
1987 |
-+ ulong limit; |
1988 |
-+ } |
1989 |
-+ args = |
1990 |
-+ { |
1991 |
-+ 17, |
1992 |
-+ which, |
1993 |
-+ limit |
1994 |
-+ }; |
1995 |
-+ |
1996 |
-+ CALL; |
1997 |
-+} |
1998 |
-+ |
1999 |
-+long |
2000 |
-+XHLastAccess (ushort major, ushort minor, ulong *ms) |
2001 |
-+{ |
2002 |
-+ struct args_XHLastAccess |
2003 |
-+ { |
2004 |
-+ ushort opcode; |
2005 |
-+ ushort major; |
2006 |
-+ ushort minor; |
2007 |
-+ ulong *ms; |
2008 |
-+ } |
2009 |
-+ args = |
2010 |
-+ { |
2011 |
-+ 18, |
2012 |
-+ major, |
2013 |
-+ minor, |
2014 |
-+ ms |
2015 |
-+ }; |
2016 |
-+ |
2017 |
-+ CALL; |
2018 |
-+} |
2019 |
-+ |
2020 |
-+long |
2021 |
-+XHReaccess (ushort major, ushort minor) |
2022 |
-+{ |
2023 |
-+ struct args_XHReaccess |
2024 |
-+ { |
2025 |
-+ ushort opcode; |
2026 |
-+ ushort major; |
2027 |
-+ ushort minor; |
2028 |
-+ } |
2029 |
-+ args = |
2030 |
-+ { |
2031 |
-+ 19, |
2032 |
-+ major, |
2033 |
-+ minor |
2034 |
-+ }; |
2035 |
-+ |
2036 |
-+ CALL; |
2037 |
-+} |
2038 |
-diff -ur --new-file e2fsprogs-1.41.3/lib/ext2fs/xhdi.h e2fsprogs-1.41.3-mint/lib/ext2fs/xhdi.h |
2039 |
---- e2fsprogs-1.41.3/lib/ext2fs/xhdi.h 1970-01-01 00:00:00.000000000 +0000 |
2040 |
-+++ e2fsprogs-1.41.3-mint/lib/ext2fs/xhdi.h 2009-01-23 10:49:56.000000000 +0000 |
2041 |
-@@ -0,0 +1,144 @@ |
2042 |
-+/* |
2043 |
-+ * Copyright 2000 Frank Naumann <fnaumann@××××××××.de> |
2044 |
-+ * All rights reserved. |
2045 |
-+ * |
2046 |
-+ * This program is free software; you can redistribute it and/or modify |
2047 |
-+ * it under the terms of the GNU General Public License as published by |
2048 |
-+ * the Free Software Foundation; either version 2, or (at your option) |
2049 |
-+ * any later version. |
2050 |
-+ * |
2051 |
-+ * This file is distributed in the hope that it will be useful, |
2052 |
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2053 |
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2054 |
-+ * GNU General Public License for more details. |
2055 |
-+ * |
2056 |
-+ * You should have received a copy of the GNU General Public License |
2057 |
-+ * along with this program; if not, write to the Free Software |
2058 |
-+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
2059 |
-+ * |
2060 |
-+ */ |
2061 |
-+ |
2062 |
-+# ifndef _xhdi_h |
2063 |
-+# define _xhdi_h |
2064 |
-+ |
2065 |
-+# include <sys/types.h> |
2066 |
-+ |
2067 |
-+typedef unsigned char uchar; |
2068 |
-+ |
2069 |
-+ |
2070 |
-+/* |
2071 |
-+ * BIOS parameter block (osbind.h is buggy) |
2072 |
-+ */ |
2073 |
-+ |
2074 |
-+typedef struct |
2075 |
-+{ |
2076 |
-+ ushort recsiz; /* bytes per sector */ |
2077 |
-+ short clsiz; /* sectors per cluster */ |
2078 |
-+ ushort clsizb; /* bytes per cluster */ |
2079 |
-+ short rdlen; /* root directory size */ |
2080 |
-+ short fsiz; /* size of FAT */ |
2081 |
-+ short fatrec; /* startsector of second FAT */ |
2082 |
-+ short datrec; /* first data sector */ |
2083 |
-+ ushort numcl; /* total number of clusters */ |
2084 |
-+ short bflags; /* some flags */ |
2085 |
-+ |
2086 |
-+} __BPB; |
2087 |
-+ |
2088 |
-+ |
2089 |
-+/* |
2090 |
-+ * Extended BIOS Parameter Block (XHDI) |
2091 |
-+ */ |
2092 |
-+ |
2093 |
-+typedef struct |
2094 |
-+{ |
2095 |
-+ ushort recsiz; /* bytes per sector */ |
2096 |
-+ short clsiz; /* sectors per cluster */ |
2097 |
-+ ushort clsizb; /* bytes per cluster */ |
2098 |
-+ short rdlen; /* root directory size or 0 if FAT32 */ |
2099 |
-+ short fsiz; /* size of FAT or 0 if FAT32 */ |
2100 |
-+ short fatrec; /* startsector of second FAT or 0 if FAT32 */ |
2101 |
-+ short datrec; /* first data sector or 0 if FAT32 */ |
2102 |
-+ ushort numcl; /* total number of clusters or 0 if FAT32 */ |
2103 |
-+ short bflags; /* bit 0: 0 = FAT12, 1 = FAT16 |
2104 |
-+ * bit 1: 0 = 2 FATs, 1 = 1 FAT |
2105 |
-+ * bit 2: 0 = BPB, 1 = EXTENDED_BPB |
2106 |
-+ */ |
2107 |
-+ |
2108 |
-+ /* Ab hier undokumentiert, nur A: und B:! */ |
2109 |
-+ short ntracks; /* Anzahl Spuren */ |
2110 |
-+ short nsides; /* Anzahl Seiten */ |
2111 |
-+ short spc; /* Sektoren pro Zylinder */ |
2112 |
-+ short spt; /* Sektoren pro Spur */ |
2113 |
-+ ushort nhid; /* Anzahl versteckte Sektoren */ |
2114 |
-+ uchar ser[3]; /* Seriennummer */ |
2115 |
-+ uchar serms[4]; /* ab TOS 2.06: MS-DOS-4.0-Seriennummer */ |
2116 |
-+ char unused; |
2117 |
-+ |
2118 |
-+ /* if bit 2 of bflags are set */ |
2119 |
-+ long l_recsiz; /* bytes per sector */ |
2120 |
-+ long l_clsiz; /* sectors per cluster */ |
2121 |
-+ long l_clsizb; /* bytes per cluster */ |
2122 |
-+ long l_rdlen; /* root directory size */ |
2123 |
-+ long l_fsiz; /* size of FAT */ |
2124 |
-+ long l_fatrec; /* startsector of second FAT */ |
2125 |
-+ long l_datrec; /* first data sector */ |
2126 |
-+ long l_numcl; /* total number of clusters */ |
2127 |
-+ long l_rdstcl; /* if FAT32: startcluster of root directory |
2128 |
-+ * otherwise 0 |
2129 |
-+ */ |
2130 |
-+} __xhdi_BPB; |
2131 |
-+ |
2132 |
-+ |
2133 |
-+# define XH_TARGET_STOPPABLE 0x00000001L |
2134 |
-+# define XH_TARGET_REMOVABLE 0x00000002L |
2135 |
-+# define XH_TARGET_LOCKABLE 0x00000004L |
2136 |
-+# define XH_TARGET_EJECTABLE 0x00000008L |
2137 |
-+# define XH_TARGET_LOCKED 0x20000000L |
2138 |
-+# define XH_TARGET_STOPPED 0x40000000L |
2139 |
-+# define XH_TARGET_RESERVED 0x80000000L |
2140 |
-+ |
2141 |
-+# define XH_MI_SETKERINFO 0 |
2142 |
-+# define XH_MI_GETKERINFO 1 |
2143 |
-+ |
2144 |
-+# define XH_DL_SECSIZ 0 |
2145 |
-+# define XH_DL_MINFAT 1 |
2146 |
-+# define XH_DL_MAXFAT 2 |
2147 |
-+# define XH_DL_MINSPC 3 |
2148 |
-+# define XH_DL_MAXSPC 4 |
2149 |
-+# define XH_DL_CLUSTS 5 |
2150 |
-+# define XH_DL_MAXSEC 6 |
2151 |
-+# define XH_DL_DRIVES 7 |
2152 |
-+# define XH_DL_CLSIZB 8 |
2153 |
-+# define XH_DL_RDLEN 9 |
2154 |
-+# define XH_DL_CLUSTS12 12 |
2155 |
-+# define XH_DL_CLUSTS32 13 |
2156 |
-+# define XH_DL_BFLAGS 14 |
2157 |
-+ |
2158 |
-+ |
2159 |
-+extern ushort XHDI_installed; |
2160 |
-+ |
2161 |
-+long init_XHDI (void); |
2162 |
-+ |
2163 |
-+long XHGetVersion (void); |
2164 |
-+long XHInqTarget (ushort major, ushort minor, ulong *block_size, ulong *device_flags, char *product_name); |
2165 |
-+long XHReserve (ushort major, ushort minor, ushort do_reserve, ushort key); |
2166 |
-+long XHLock (ushort major, ushort minor, ushort do_lock, ushort key); |
2167 |
-+long XHStop (ushort major, ushort minor, ushort do_stop, ushort key); |
2168 |
-+long XHEject (ushort major, ushort minor, ushort do_eject, ushort key); |
2169 |
-+long XHDrvMap (void); |
2170 |
-+long XHInqDev (ushort bios, ushort *major, ushort *minor, ulong *start, __BPB *bpb); |
2171 |
-+long XHInqDriver (ushort bios, char *name, char *version, char *company, ushort *ahdi_version, ushort *maxIPL); |
2172 |
-+long XHNewCookie (void *newcookie); |
2173 |
-+long XHReadWrite (ushort major, ushort minor, ushort rwflag, ulong recno, ushort count, void *buf); |
2174 |
-+long XHInqTarget2 (ushort major, ushort minor, ulong *block_size, ulong *device_flags, char *product_name, ushort stringlen); |
2175 |
-+long XHInqDev2 (ushort bios, ushort *major, ushort *minor, ulong *start, __BPB *bpb, ulong *blocks, char *partid); |
2176 |
-+long XHDriverSpecial (ulong key1, ulong key2, ushort subopcode, void *data); |
2177 |
-+long XHGetCapacity (ushort major, ushort minor, ulong *blocks, ulong *bs); |
2178 |
-+long XHMediumChanged (ushort major, ushort minor); |
2179 |
-+long XHMiNTInfo (ushort op, void *data); |
2180 |
-+long XHDOSLimits (ushort which, ulong limit); |
2181 |
-+long XHLastAccess (ushort major, ushort minor, ulong *ms); |
2182 |
-+long XHReaccess (ushort major, ushort minor); |
2183 |
-+ |
2184 |
-+ |
2185 |
-+# endif /* _xhdi_h */ |
2186 |
-diff -ur --new-file e2fsprogs-1.41.3/misc/e2undo.c e2fsprogs-1.41.3-mint/misc/e2undo.c |
2187 |
---- e2fsprogs-1.41.3/misc/e2undo.c 2009-01-23 12:59:44.000000000 +0000 |
2188 |
-+++ e2fsprogs-1.41.3-mint/misc/e2undo.c 2009-01-23 12:56:40.000000000 +0000 |
2189 |
-@@ -19,6 +19,7 @@ |
2190 |
- #if HAVE_ERRNO_H |
2191 |
- #include <errno.h> |
2192 |
- #endif |
2193 |
-+#include <sys/types.h> |
2194 |
- #include "ext2fs/tdb.h" |
2195 |
- #include "ext2fs/ext2fs.h" |
2196 |
- #include "nls-enable.h" |
2197 |
-diff -ur --new-file e2fsprogs-1.41.3/misc/e2initrd_helper.c e2fsprogs-1.41.3-mint/misc/e2initrd_helper.c |
2198 |
---- e2fsprogs-1.41.3/misc/e2initrd_helper.c 2009-01-23 12:58:29.000000000 +0000 |
2199 |
-+++ e2fsprogs-1.41.3-mint/misc/e2initrd_helper.c 2009-01-23 12:59:11.000000000 +0000 |
2200 |
-@@ -50,7 +50,7 @@ |
2201 |
- int ptr; |
2202 |
- }; |
2203 |
- |
2204 |
--struct fs_info { |
2205 |
-+struct _fs_info { |
2206 |
- char *device; |
2207 |
- char *mountpt; |
2208 |
- char *type; |
2209 |
-@@ -58,7 +58,7 @@ |
2210 |
- int freq; |
2211 |
- int passno; |
2212 |
- int flags; |
2213 |
-- struct fs_info *next; |
2214 |
-+ struct _fs_info *next; |
2215 |
- }; |
2216 |
- |
2217 |
- static void usage(void) |
2218 |
-@@ -230,7 +230,7 @@ |
2219 |
- *q = 0; |
2220 |
- } |
2221 |
- |
2222 |
--static int parse_fstab_line(char *line, struct fs_info *fs) |
2223 |
-+static int parse_fstab_line(char *line, struct _fs_info *fs) |
2224 |
- { |
2225 |
- char *dev, *device, *mntpnt, *type, *opts, *freq, *passno, *cp; |
2226 |
- |
2227 |
-@@ -280,7 +280,7 @@ |
2228 |
- return 0; |
2229 |
- } |
2230 |
- |
2231 |
--static void free_fstab_line(struct fs_info *fs) |
2232 |
-+static void free_fstab_line(struct _fs_info *fs) |
2233 |
- { |
2234 |
- if (fs->device) |
2235 |
- fs->device = 0; |
2236 |
-@@ -290,7 +290,7 @@ |
2237 |
- fs->type = 0; |
2238 |
- if (fs->opts) |
2239 |
- fs->opts = 0; |
2240 |
-- memset(fs, 0, sizeof(struct fs_info)); |
2241 |
-+ memset(fs, 0, sizeof(struct _fs_info)); |
2242 |
- } |
2243 |
- |
2244 |
- |
2245 |
-@@ -334,7 +334,7 @@ |
2246 |
- errcode_t retval; |
2247 |
- struct mem_file file; |
2248 |
- char *buf; |
2249 |
-- struct fs_info fs_info; |
2250 |
-+ struct _fs_info _fs_info; |
2251 |
- int ret; |
2252 |
- |
2253 |
- retval = get_file(fs, "/etc/fstab", &file); |
2254 |
-@@ -344,14 +344,14 @@ |
2255 |
- if (!buf) |
2256 |
- continue; |
2257 |
- |
2258 |
-- ret = parse_fstab_line(buf, &fs_info); |
2259 |
-+ ret = parse_fstab_line(buf, &_fs_info); |
2260 |
- if (ret < 0) |
2261 |
- goto next_line; |
2262 |
- |
2263 |
-- if (!strcmp(fs_info.mountpt, "/")) |
2264 |
-- printf("%s\n", fs_info.type); |
2265 |
-+ if (!strcmp(_fs_info.mountpt, "/")) |
2266 |
-+ printf("%s\n", _fs_info.type); |
2267 |
- |
2268 |
-- free_fstab_line(&fs_info); |
2269 |
-+ free_fstab_line(&_fs_info); |
2270 |
- |
2271 |
- next_line: |
2272 |
- free(buf); |
2273 |
-diff -ur --new-file e2fsprogs-1.41.3/misc/mke2fs.c e2fsprogs-1.41.3-mint/misc/mke2fs.c |
2274 |
---- e2fsprogs-1.41.3/misc/mke2fs.c 2008-10-07 14:22:39.000000000 +0000 |
2275 |
-+++ e2fsprogs-1.41.3-mint/misc/mke2fs.c 2009-01-23 10:47:35.000000000 +0000 |
2276 |
-@@ -1819,6 +1819,36 @@ |
2277 |
- return retval; |
2278 |
- } |
2279 |
- |
2280 |
-+#ifdef __MINT__ |
2281 |
-+void |
2282 |
-+warn (const char *drv) |
2283 |
-+{ |
2284 |
-+ char c; |
2285 |
-+ int check; |
2286 |
-+ |
2287 |
-+ check = open (drv, O_RDONLY); |
2288 |
-+ if (check == -1) |
2289 |
-+ return; |
2290 |
-+ |
2291 |
-+ close (check); |
2292 |
-+ |
2293 |
-+ if (check < 1024) |
2294 |
-+ return; |
2295 |
-+ |
2296 |
-+ fprintf (stderr, "\n"); |
2297 |
-+ fprintf (stderr, "WARNING: THIS WILL TOTALLY DESTROY ANY DATA ON %s:\n", drv); |
2298 |
-+ fprintf (stderr, "Are you ABSOLUTELY SURE you want to do this? (y/n) "); |
2299 |
-+ scanf ("%c", &c); |
2300 |
-+ fprintf (stderr, "\n"); |
2301 |
-+ |
2302 |
-+ if (c == 'y' || c == 'Y') |
2303 |
-+ return; |
2304 |
-+ |
2305 |
-+ fprintf (stderr, "Aborted\n"); |
2306 |
-+ exit (1); |
2307 |
-+} |
2308 |
-+#endif |
2309 |
-+ |
2310 |
- int main (int argc, char *argv[]) |
2311 |
- { |
2312 |
- errcode_t retval = 0; |
2313 |
-@@ -1839,6 +1869,11 @@ |
2314 |
- #endif |
2315 |
- PRS(argc, argv); |
2316 |
- |
2317 |
-+#ifdef __MINT__ |
2318 |
-+ if (!quiet) |
2319 |
-+ warn (device_name); |
2320 |
-+#endif |
2321 |
-+ |
2322 |
- #ifdef CONFIG_TESTIO_DEBUG |
2323 |
- if (getenv("TEST_IO_FLAGS") || getenv("TEST_IO_BLOCK")) { |
2324 |
- io_ptr = test_io_manager; |
2325 |
|
2326 |
diff --git a/sys-fs/e2fsprogs/files/e2fsprogs-1.41.12-darwin-makefile.patch b/sys-fs/e2fsprogs/files/e2fsprogs-1.41.12-darwin-makefile.patch |
2327 |
deleted file mode 100644 |
2328 |
index 8444067..0000000 |
2329 |
--- a/sys-fs/e2fsprogs/files/e2fsprogs-1.41.12-darwin-makefile.patch |
2330 |
+++ /dev/null |
2331 |
@@ -1,113 +0,0 @@ |
2332 |
-On Darwin, create dylibs with a versioning scheme like Linux/ELF, not |
2333 |
-like BSD/ELF. |
2334 |
-This patch uses intentionally ELF_* vars to make it easier to diff |
2335 |
-against the ELF Makefile. |
2336 |
- |
2337 |
-http://sourceforge.net/tracker/index.php?func=detail&aid=2555389&group_id=2406&atid=302406 |
2338 |
- |
2339 |
---- lib/Makefile.darwin-lib |
2340 |
-+++ lib/Makefile.darwin-lib |
2341 |
-@@ -1,14 +1,15 @@ |
2342 |
- # |
2343 |
--# This is a Makefile stub which handles the creation of Darwin BSD shared |
2344 |
--# libraries. |
2345 |
-+# This is a Makefile stub which handles the creation of Darwin shared |
2346 |
-+# libraries based on the ELF scheme. |
2347 |
- # |
2348 |
- # In order to use this stub, the following makefile variables must be defined. |
2349 |
--# |
2350 |
--# BSDLIB_VERSION = 1.0 |
2351 |
--# BSDLIB_IMAGE = libce |
2352 |
--# BSDLIB_MYDIR = et |
2353 |
--# BSDLIB_INSTALL_DIR = $(SHLIBDIR) |
2354 |
--# |
2355 |
-+# |
2356 |
-+# ELF_VERSION = 1.0 |
2357 |
-+# ELF_SO_VERSION = 1 |
2358 |
-+# ELF_IMAGE = libce |
2359 |
-+# ELF_MYDIR = et |
2360 |
-+# ELF_INSTALL_DIR = $(SHLIBDIR) |
2361 |
-+# ELF_OTHER_LIBS = -lc |
2362 |
- |
2363 |
- all:: image |
2364 |
- |
2365 |
-@@ -16,36 +17,58 @@ |
2366 |
- $(E) " MKDIR pic" |
2367 |
- $(Q) mkdir -p pic |
2368 |
- |
2369 |
--BSD_LIB = $(BSDLIB_IMAGE).$(BSDLIB_VERSION).dylib |
2370 |
--BSDLIB_PIC_FLAG = -fPIC |
2371 |
-+ELF_LIB = $(ELF_IMAGE).$(ELF_VERSION).dylib |
2372 |
-+ELF_SONAME = $(ELF_IMAGE).$(ELF_SO_VERSION).dylib |
2373 |
- |
2374 |
--image: $(BSD_LIB) |
2375 |
-+image: $(ELF_LIB) |
2376 |
- |
2377 |
--$(BSD_LIB): $(OBJS) |
2378 |
-- $(E) " GEN_BSD_SOLIB $(BSD_LIB)" |
2379 |
-- $(Q) (cd pic; $(CC) -dynamiclib -compatibility_version 1.0 -current_version $(BSDLIB_VERSION) \ |
2380 |
-- -flat_namespace -undefined warning -o $(BSD_LIB) $(OBJS)) |
2381 |
-- $(Q) $(MV) pic/$(BSD_LIB) . |
2382 |
-- $(Q) $(RM) -f ../$(BSD_LIB) |
2383 |
-+$(ELF_LIB): $(OBJS) |
2384 |
-+ $(E) " GEN_ELF_SOLIB $(ELF_LIB)" |
2385 |
-+ $(Q) (cd pic; $(CC) -dynamiclib -o $(ELF_LIB) $(LDFLAGS) \ |
2386 |
-+ -Wl,-install_name,$(libdir)/$(ELF_SONAME) $(OBJS) $(ELF_OTHER_LIBS)) |
2387 |
-+ $(Q) $(MV) pic/$(ELF_LIB) . |
2388 |
-+ $(Q) $(RM) -f ../$(ELF_LIB) ../$(ELF_IMAGE).dylib ../$(ELF_SONAME) |
2389 |
- $(Q) (cd ..; $(LN) $(LINK_BUILD_FLAGS) \ |
2390 |
-- `echo $(my_dir) | sed -e 's;lib/;;'`/$(BSD_LIB) $(BSD_LIB)) |
2391 |
-- $(Q) (cd ..; $(LN) $(LINK_BUILD_FLAGS) $(BSD_LIB) $(BSDLIB_IMAGE).dylib) |
2392 |
-- |
2393 |
--install-shlibs install:: $(BSD_LIB) |
2394 |
-- $(E) " INSTALL_PROGRAM $(BSDLIB_INSTALL_DIR)/$(BSD_LIB)" |
2395 |
-- $(Q) $(INSTALL_PROGRAM) $(BSD_LIB) \ |
2396 |
-- $(DESTDIR)$(BSDLIB_INSTALL_DIR)/$(BSD_LIB) |
2397 |
-- -$(Q) $(LDCONFIG) |
2398 |
-+ `echo $(my_dir) | sed -e 's;lib/;;'`/$(ELF_LIB) $(ELF_LIB)) |
2399 |
-+ $(Q) (cd ..; $(LN) $(LINK_BUILD_FLAGS) $(ELF_LIB) $(ELF_IMAGE).dylib) |
2400 |
-+ $(Q) (cd ..; $(LN) $(LINK_BUILD_FLAGS) $(ELF_LIB) $(ELF_SONAME)) |
2401 |
-+ |
2402 |
-+installdirs-elf-lib:: |
2403 |
-+ $(E) " MKINSTALLDIRS $(ELF_INSTALL_DIR) $(libdir)" |
2404 |
-+ $(Q) $(MKINSTALLDIRS) $(DESTDIR)$(ELF_INSTALL_DIR) \ |
2405 |
-+ $(DESTDIR)$(libdir) |
2406 |
-+ |
2407 |
-+installdirs:: installdirs-elf-lib |
2408 |
-+ |
2409 |
-+install-shlibs install:: $(ELF_LIB) installdirs-elf-lib |
2410 |
-+ $(E) " INSTALL-ELF-LIB $(ELF_INSTALL_DIR)/$(ELF_LIB)" |
2411 |
-+ $(Q) $(INSTALL_PROGRAM) $(ELF_LIB) $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB) |
2412 |
-+ $(E) " SYMLINK $(ELF_INSTALL_DIR)/$(ELF_SONAME)" |
2413 |
-+ $(Q) $(LN_S) -f $(ELF_LIB) $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_SONAME) |
2414 |
-+ $(E) " SYMLINK $(libdir)/$(ELF_IMAGE).dylib" |
2415 |
-+ $(Q) if test "$(ELF_INSTALL_DIR)" = "$(libdir)"; then \ |
2416 |
-+ $(LN_S) -f $(ELF_SONAME) $(DESTDIR)$(libdir)/$(ELF_IMAGE).dylib ; \ |
2417 |
-+ else \ |
2418 |
-+ $(LN_S) -f $(ELF_INSTALL_DIR)/$(ELF_SONAME) \ |
2419 |
-+ $(DESTDIR)$(libdir)/$(ELF_IMAGE).dylib; \ |
2420 |
-+ fi |
2421 |
- |
2422 |
- install-strip: install |
2423 |
-+ $(E) " STRIP-LIB $(ELF_INSTALL_DIR)/$(ELF_LIB)" |
2424 |
-+ $(Q) $(STRIP) --strip-unneeded --remove-section=.comment \ |
2425 |
-+ --remove-section=.note $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB) |
2426 |
- |
2427 |
- install-shlibs-strip: install-shlibs |
2428 |
-+ $(E) " STRIP-LIB $(ELF_INSTALL_DIR)/$(ELF_LIB)" |
2429 |
-+ $(Q) $(STRIP) --strip-unneeded --remove-section=.comment \ |
2430 |
-+ --remove-section=.note $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB) |
2431 |
- |
2432 |
- uninstall-shlibs uninstall:: |
2433 |
-- $(RM) -f $(DESTDIR)$(BSDLIB_INSTALL_DIR)/$(BSD_LIB) |
2434 |
-+ $(RM) -f $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB) \ |
2435 |
-+ $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_SONAME) \ |
2436 |
-+ $(DESTDIR)$(libdir)/$(ELF_IMAGE).dylib |
2437 |
- |
2438 |
- clean:: |
2439 |
- $(RM) -rf pic |
2440 |
-- $(RM) -f $(BSD_LIB) |
2441 |
-- $(RM) -f ../$(BSD_LIB) |
2442 |
-- $(RM) -f ../$(BSDLIB_IMAGE).dylib |
2443 |
-+ $(RM) -f $(ELF_LIB) |
2444 |
-+ $(RM) -f ../$(ELF_LIB) ../$(ELF_IMAGE).dylib ../$(ELF_SONAME) |
2445 |
|
2446 |
diff --git a/sys-fs/e2fsprogs/files/e2fsprogs-1.41.12-mint-blkid.patch b/sys-fs/e2fsprogs/files/e2fsprogs-1.41.12-mint-blkid.patch |
2447 |
deleted file mode 100644 |
2448 |
index 886ece5..0000000 |
2449 |
--- a/sys-fs/e2fsprogs/files/e2fsprogs-1.41.12-mint-blkid.patch |
2450 |
+++ /dev/null |
2451 |
@@ -1,43 +0,0 @@ |
2452 |
-http://bugs.gentoo.org/276055 |
2453 |
- |
2454 |
-<alanh@×××××××××××.uk>: |
2455 |
-The configure test program links against libblkid to test. This works |
2456 |
-fine on shared library systems as libblkid automatically depends on |
2457 |
-libuuid. But on static systems it needs explicit linking. |
2458 |
- |
2459 |
- |
2460 |
---- configure.in |
2461 |
-+++ configure.in |
2462 |
-@@ -398,8 +398,8 @@ |
2463 |
- fi |
2464 |
- |
2465 |
- AC_CHECK_LIB(blkid, blkid_get_cache, |
2466 |
-- [LIBBLKID=`$PKG_CONFIG --libs blkid`; |
2467 |
-- STATIC_LIBBLKID=`$PKG_CONFIG --static --libs blkid`], |
2468 |
-+ [LIBBLKID=`$PKG_CONFIG --libs blkid --libs uuid`; |
2469 |
-+ STATIC_LIBBLKID=`$PKG_CONFIG --static --libs blkid --libs uuid`], |
2470 |
- [AC_MSG_ERROR([external blkid library not found])], |
2471 |
- [$LIBBLKID]) |
2472 |
- BLKID_CMT=# |
2473 |
---- configure.old 2011-01-01 14:20:07.000000000 +0000 |
2474 |
-+++ configure 2011-01-01 14:22:01.000000000 +0000 |
2475 |
-@@ -5228,7 +5228,7 @@ |
2476 |
- $as_echo_n "(cached) " >&6 |
2477 |
- else |
2478 |
- ac_check_lib_save_LIBS=$LIBS |
2479 |
--LIBS="-lblkid $LIBBLKID $LIBS" |
2480 |
-+LIBS="-lblkid -luuid $LIBBLKID $LIBS" |
2481 |
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
2482 |
- /* end confdefs.h. */ |
2483 |
- |
2484 |
-@@ -5259,8 +5259,8 @@ |
2485 |
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_blkid_blkid_get_cache" >&5 |
2486 |
- $as_echo "$ac_cv_lib_blkid_blkid_get_cache" >&6; } |
2487 |
- if test "x$ac_cv_lib_blkid_blkid_get_cache" = x""yes; then : |
2488 |
-- LIBBLKID=`$PKG_CONFIG --libs blkid`; |
2489 |
-- STATIC_LIBBLKID=`$PKG_CONFIG --static --libs blkid` |
2490 |
-+ LIBBLKID=`$PKG_CONFIG --libs blkid --libs uuid`; |
2491 |
-+ STATIC_LIBBLKID=`$PKG_CONFIG --static --libs blkid --libs uuid` |
2492 |
- else |
2493 |
- as_fn_error "external blkid library not found" "$LINENO" 5 |
2494 |
- fi |
2495 |
|
2496 |
diff --git a/sys-fs/e2fsprogs/files/e2fsprogs-1.41.8-makefile.patch b/sys-fs/e2fsprogs/files/e2fsprogs-1.41.8-makefile.patch |
2497 |
deleted file mode 100644 |
2498 |
index b7d3d96..0000000 |
2499 |
--- a/sys-fs/e2fsprogs/files/e2fsprogs-1.41.8-makefile.patch |
2500 |
+++ /dev/null |
2501 |
@@ -1,10 +0,0 @@ |
2502 |
---- e2fsprogs-1.41.5/Makefile.in |
2503 |
-+++ e2fsprogs-1.41.5/Makefile.in |
2504 |
-@@ -281,6 +66,7 @@ |
2505 |
- uninstall: uninstall-progs-recursive uninstall-shlibs-libs-recursive uninstall-doc-libs |
2506 |
- |
2507 |
- install-libs: install-libs-recursive |
2508 |
-+install-libs-recursive: | install-shlibs-libs-recursive |
2509 |
- |
2510 |
- uninstall-libs: uninstall-libs-recursive |
2511 |
- |
2512 |
|
2513 |
diff --git a/sys-fs/e2fsprogs/files/e2fsprogs-1.42.7-libext2fs-fix-return-value.patch b/sys-fs/e2fsprogs/files/e2fsprogs-1.42.7-libext2fs-fix-return-value.patch |
2514 |
deleted file mode 100644 |
2515 |
index 2d48fdf..0000000 |
2516 |
--- a/sys-fs/e2fsprogs/files/e2fsprogs-1.42.7-libext2fs-fix-return-value.patch |
2517 |
+++ /dev/null |
2518 |
@@ -1,32 +0,0 @@ |
2519 |
-From 266eb87990025e82a8884e30993ce93c00d19db3 Mon Sep 17 00:00:00 2001 |
2520 |
-From: Mike Frysinger <vapier@g.o> |
2521 |
-Date: Sat, 4 May 2013 01:00:58 -0400 |
2522 |
-Subject: [PATCH] libext2fs: fix return value |
2523 |
- |
2524 |
-The ext2fs_test_block_bitmap_range2 func is not a void, so make sure we |
2525 |
-return a value. I picked EINVAL as it looks like what other things in |
2526 |
-this func use. |
2527 |
- |
2528 |
-URL: http://bugs.gentoo.org/467986 |
2529 |
-Reported-by: Vicente Olivert Riera <vincent@g.o> |
2530 |
-Signed-off-by: Mike Frysinger <vapier@g.o> |
2531 |
---- |
2532 |
- lib/ext2fs/gen_bitmap64.c | 2 +- |
2533 |
- 1 file changed, 1 insertion(+), 1 deletion(-) |
2534 |
- |
2535 |
-diff --git a/lib/ext2fs/gen_bitmap64.c b/lib/ext2fs/gen_bitmap64.c |
2536 |
-index 42a97d4..44ac499 100644 |
2537 |
---- a/lib/ext2fs/gen_bitmap64.c |
2538 |
-+++ b/lib/ext2fs/gen_bitmap64.c |
2539 |
-@@ -658,7 +658,7 @@ int ext2fs_test_block_bitmap_range2(ext2fs_block_bitmap bmap, |
2540 |
- if ((block < bmap->start) || (block+num-1 > bmap->end)) { |
2541 |
- ext2fs_warn_bitmap(EXT2_ET_BAD_BLOCK_TEST, block, |
2542 |
- bmap->description); |
2543 |
-- return; |
2544 |
-+ return EINVAL; |
2545 |
- } |
2546 |
- |
2547 |
- return bmap->bitmap_ops->test_clear_bmap_extent(bmap, block, num); |
2548 |
--- |
2549 |
-1.8.2.1 |
2550 |
- |
2551 |
|
2552 |
diff --git a/sys-fs/e2fsprogs/files/e2fsprogs-1.42.7-use-uint64_t.patch b/sys-fs/e2fsprogs/files/e2fsprogs-1.42.7-use-uint64_t.patch |
2553 |
deleted file mode 100644 |
2554 |
index 5171936..0000000 |
2555 |
--- a/sys-fs/e2fsprogs/files/e2fsprogs-1.42.7-use-uint64_t.patch |
2556 |
+++ /dev/null |
2557 |
@@ -1,17 +0,0 @@ |
2558 |
-diff -Naur e2fsprogs-1.42.7.orig/lib/ext2fs/unix_io.c e2fsprogs-1.42.7/lib/ext2fs/unix_io.c |
2559 |
---- e2fsprogs-1.42.7.orig/lib/ext2fs/unix_io.c 2013-01-02 00:47:20.000000000 +0000 |
2560 |
-+++ e2fsprogs-1.42.7/lib/ext2fs/unix_io.c 2014-01-23 19:33:52.851912147 +0000 |
2561 |
-@@ -931,10 +931,10 @@ |
2562 |
- |
2563 |
- if (channel->flags & CHANNEL_FLAGS_BLOCK_DEVICE) { |
2564 |
- #ifdef BLKDISCARD |
2565 |
-- __uint64_t range[2]; |
2566 |
-+ uint64_t range[2]; |
2567 |
- |
2568 |
-- range[0] = (__uint64_t)(block) * channel->block_size; |
2569 |
-- range[1] = (__uint64_t)(count) * channel->block_size; |
2570 |
-+ range[0] = (uint64_t)(block) * channel->block_size; |
2571 |
-+ range[1] = (uint64_t)(count) * channel->block_size; |
2572 |
- |
2573 |
- ret = ioctl(data->dev, BLKDISCARD, &range); |
2574 |
- #else |
2575 |
|
2576 |
diff --git a/sys-fs/e2fsprogs/files/fsck_ext2fs.8 b/sys-fs/e2fsprogs/files/fsck_ext2fs.8 |
2577 |
deleted file mode 100644 |
2578 |
index ee40b26..0000000 |
2579 |
--- a/sys-fs/e2fsprogs/files/fsck_ext2fs.8 |
2580 |
+++ /dev/null |
2581 |
@@ -1,96 +0,0 @@ |
2582 |
-.TH fsck_ext2fs 8 2006-07-02 "Matthias Andree" "FreeBSD Ports" |
2583 |
-.\" |
2584 |
-.\" fsck_ext2fs.8 - manual page for fsck_ext2fs wrapper |
2585 |
-.\" |
2586 |
-.\" (C) Copyright 2006 by Matthias Andree <matthias.andree@×××.de> |
2587 |
-.\" |
2588 |
-.\" License: This file may be redistributed in accordance with the terms |
2589 |
-.\" of the GNU General Public License v2. |
2590 |
-.\" |
2591 |
-.\" Upstream $Id: fsck_ext2fs.8,v 1.1 2007/09/15 08:54:26 uberlord Exp $ |
2592 |
-.\" $FreeBSD: ports/sysutils/e2fsprogs/files/fsck_ext2fs.8,v 1.1 2006/07/04 15:47:51 leeym Exp $ |
2593 |
-.\" |
2594 |
-.SH NAME |
2595 |
-.B fsck_ext2fs |
2596 |
-\- compatibility wrapper for e2fsck |
2597 |
-.SH SYNOPSIS |
2598 |
-.P |
2599 |
-.B fsck_ext2fs |
2600 |
-[\fB\-Fpfnyv\fR] [\fB\-b\fR \fIblock\fR] |
2601 |
-.SH DESCRIPTION |
2602 |
-.P |
2603 |
-\fBfsck_ext2fs\fR maps the traditional FreeBSD \fBfsck_ffs\fR options to |
2604 |
-options with the same functionality for \fBe2fsck,\fR runs \fBe2fsck\fR |
2605 |
-and then maps its exit status to values that FreeBSD understands. |
2606 |
-\fBe2fsck\fR is a utility to check and repair ext2 and ext3 file |
2607 |
-systems. |
2608 |
- |
2609 |
-.SH OPTIONS |
2610 |
-.IP \fB\-F\fR |
2611 |
-(check foreground mode required) Immediately exits with status 1 to tell |
2612 |
-\fBfsck\fR that ext2fs cannot be checked in the background. \fBfsck\fR |
2613 |
-usually runs \fBfsck_*\fR programs twice, first with \fB\-F\fR to find |
2614 |
-out if they can do background checking, then either immediately without |
2615 |
-\fB\-F\fR for foreground checking or deferred in the background with |
2616 |
-\fB\-B\fR. |
2617 |
-.IP \fB\-p\fR |
2618 |
-(preen mode) This option suppresses adding the \fB\-f\fR option (unless |
2619 |
-\fB\-f\fR is also given) and adds the \fB\-p\fR option to the |
2620 |
-\fBe2fsck\fR command line. This causes \fBe2fsck\fR to automatically fix |
2621 |
-any filesystem problems that can safely be fixed without operator |
2622 |
-intervention. Without this option given, \fBe2fsck\fR will be run with |
2623 |
-the \fB\-f\fR option to force a check, since interactive scan and repair |
2624 |
-mode is the default on FreeBSD, but not on Linux where \fBe2fsck\fR |
2625 |
-comes from. |
2626 |
-.IP \fB\-f\fR |
2627 |
-(force check) This option forces the check of a clean file system while |
2628 |
-preening and is passed to \fBe2fsck\fR verbatim. |
2629 |
-.IP \fB\-n\fR |
2630 |
-("no" mode) This option causes the file system to be opened in read-only |
2631 |
-mode and assume "no" as answer to all questions. This is the only way to |
2632 |
-safely run \fBfsck\fR on a mounted ext2 or ext3 file system. This option |
2633 |
-is passed to \fBe2fsck\fR verbatim. |
2634 |
-.IP \fB\-y\fR |
2635 |
-("yes" mode) This option is passed verbatim to \fBe2fsck\fR and causes |
2636 |
-it to assume "yes" as answer to all questions. This allows the |
2637 |
-non-interactive use of e2fsck but is rather aggressive. Use with care. |
2638 |
-.IP \fB\-v\fR |
2639 |
-(verbose output) This option is passed verbatim to \fBe2fsck\fR and |
2640 |
-causes it to verbosely report its progress. |
2641 |
-.IP "\fB\-b\fR \fIblock\fR" |
2642 |
-(use alternate super block) This option is passed verbatim to |
2643 |
-\fBe2fsck\fR and selects an alternate super block, for use when the |
2644 |
-primary super block has been damaged. Please see the \fBe2fsck\fR(8) |
2645 |
-manual page for details. |
2646 |
- |
2647 |
-.SH EXIT STATUS |
2648 |
-If errors remain after \fBe2fsck\fR, an invalid option or too many |
2649 |
-options have been specified, \fBe2fsck\fR was killed with a signal or |
2650 |
-the \fIfork\fB system call failed, \fBfsck_ext2fs\fR exits with status |
2651 |
-EXIT_FAILURE (usually 1). If \fBe2fsck\fR cannot be started, exits with |
2652 |
-status 127. If the file system is clean after \fBe2fsck\fR operation, |
2653 |
-exits with status EXIT_SUCCESS (0). |
2654 |
- |
2655 |
-.SH NOTES |
2656 |
-.P |
2657 |
-This utility is merely meant as an adaptor so that \fBe2fsck\fR can be |
2658 |
-run during the boot process, it does not support all options that |
2659 |
-\fBe2fsck\fR offers. If you need one of its advanced options, please run |
2660 |
-\fBe2fsck\fR directly. |
2661 |
- |
2662 |
-.SH FILES |
2663 |
-.TP |
2664 |
-.I /sbin/e2fsck |
2665 |
-is the location of the \fBe2fsck\fR program to run. |
2666 |
- |
2667 |
-.SH AUTHOR |
2668 |
-.P |
2669 |
-Matthias Andree <matthias.andree@×××.de> wrote the program and this |
2670 |
-manual page. |
2671 |
-.SH CONFORMING TO |
2672 |
-The FreeBSD 6.1 command line interface for \fBfsck_ufs\fR(8). |
2673 |
-.SH SEE ALSO |
2674 |
-.BR fsck (8), |
2675 |
-.BR e2fsck (8) |
2676 |
-and |
2677 |
-.BR fsck_ufs (8). |
2678 |
|
2679 |
diff --git a/sys-fs/e2fsprogs/files/fsck_ext2fs.c b/sys-fs/e2fsprogs/files/fsck_ext2fs.c |
2680 |
deleted file mode 100644 |
2681 |
index 0b6a74e..0000000 |
2682 |
--- a/sys-fs/e2fsprogs/files/fsck_ext2fs.c |
2683 |
+++ /dev/null |
2684 |
@@ -1,147 +0,0 @@ |
2685 |
-/* |
2686 |
- * fsck_ext2fs - wrapper for e2fsck on FreeBSD |
2687 |
- * Copyright (C) 2004,2006 Matthias Andree <matthias.andree@×××.de> |
2688 |
- * redistributable in accordance with the |
2689 |
- * GNU General Public License v2 |
2690 |
- * |
2691 |
- * $FreeBSD: ports/sysutils/e2fsprogs/files/fsck_ext2fs.c,v 1.5 2006/07/04 15:47:51 leeym Exp $ |
2692 |
- * |
2693 |
- * Upstream: $Id: fsck_ext2fs.c,v 1.1 2007/09/15 08:54:26 uberlord Exp $ |
2694 |
- * |
2695 |
- * format: gindent -kr |
2696 |
- */ |
2697 |
- |
2698 |
-#include <sys/types.h> |
2699 |
-#include <unistd.h> |
2700 |
-#include <stdlib.h> |
2701 |
-#include <stdio.h> |
2702 |
-#include <string.h> |
2703 |
-#include <sys/wait.h> |
2704 |
-#include <sys/time.h> |
2705 |
-#include <sys/resource.h> |
2706 |
-#include <errno.h> |
2707 |
- |
2708 |
-__attribute__ ((noreturn)) |
2709 |
-static int die(const char *tag) |
2710 |
-{ |
2711 |
- perror(tag); |
2712 |
- exit(EXIT_FAILURE); |
2713 |
-} |
2714 |
- |
2715 |
-int main(int argc, char **argv) |
2716 |
-{ |
2717 |
- int ch, i = 1, force = 0, status, verbose = 0, t; |
2718 |
- long block = 0; |
2719 |
- enum { normal, preen, yes, no } mode = normal; |
2720 |
- char *cmd[256]; |
2721 |
- pid_t pid; |
2722 |
- |
2723 |
- cmd[0] = "/sbin/e2fsck"; |
2724 |
- while ((ch = getopt(argc, argv, "BFpfnyb:v")) != -1) { |
2725 |
- switch (ch) { |
2726 |
- case 'p': |
2727 |
- mode = preen; |
2728 |
- break; |
2729 |
- case 'f': |
2730 |
- force = 1; |
2731 |
- break; |
2732 |
- case 'n': |
2733 |
- mode = no; |
2734 |
- break; |
2735 |
- case 'y': |
2736 |
- mode = yes; |
2737 |
- break; |
2738 |
- case 'b': |
2739 |
- block = atol(optarg); |
2740 |
- break; |
2741 |
- case 'v': |
2742 |
- verbose++; |
2743 |
- break; |
2744 |
- case 'F': |
2745 |
- /* e2fsck does not support background checking, |
2746 |
- * hence exit with nonzero status to force |
2747 |
- * the foreground check. */ |
2748 |
- exit(1); |
2749 |
- case 'B': |
2750 |
- default: |
2751 |
- fprintf(stderr, "%s: unknown option -%c\n", |
2752 |
- argv[0], optopt); |
2753 |
- exit(EXIT_FAILURE); |
2754 |
- } |
2755 |
- } |
2756 |
- |
2757 |
- if (force) |
2758 |
- cmd[i++] = "-f"; |
2759 |
- |
2760 |
- switch (mode) { |
2761 |
- case normal: |
2762 |
- /* FreeBSD needs -f to force a check only in context |
2763 |
- * with -p -- so map normal to force to match |
2764 |
- * expectations */ |
2765 |
- if (!force) |
2766 |
- cmd[i++] = "-f"; |
2767 |
- break; |
2768 |
- case yes: |
2769 |
- cmd[i++] = "-y"; |
2770 |
- break; |
2771 |
- case no: |
2772 |
- cmd[i++] = "-n"; |
2773 |
- break; |
2774 |
- case preen: |
2775 |
- cmd[i++] = "-p"; |
2776 |
- break; |
2777 |
- } |
2778 |
- |
2779 |
- if (block) { |
2780 |
- static char b[30]; |
2781 |
- |
2782 |
- sprintf(b, "-b %ld", block); |
2783 |
- cmd[i++] = b; |
2784 |
- } |
2785 |
- |
2786 |
- /* silently limit verbose to 15 so we don't overflow the cmd array */ |
2787 |
- if (verbose > 15) |
2788 |
- verbose = 15; |
2789 |
- |
2790 |
- for (t = verbose; t > 1; t--) |
2791 |
- cmd[i++] = "-v"; |
2792 |
- |
2793 |
- while (optind < argc) { |
2794 |
- cmd[i++] = argv[optind++]; |
2795 |
- /* sanity check so we don't overflow the cmd buffer */ |
2796 |
- if (i+1 == sizeof(cmd)/sizeof(cmd[0])) { |
2797 |
- errno = E2BIG; |
2798 |
- die(argv[0]); |
2799 |
- } |
2800 |
- } |
2801 |
- |
2802 |
- cmd[i++] = 0; |
2803 |
- |
2804 |
- if (verbose) { |
2805 |
- for (i=0; cmd[i]; i++) |
2806 |
- fputs(cmd[i], stderr), |
2807 |
- fputc(' ', stderr); |
2808 |
- fputc('\n', stderr); |
2809 |
- } |
2810 |
- |
2811 |
- pid = fork(); |
2812 |
- switch (pid) { |
2813 |
- case -1: |
2814 |
- /* error */ |
2815 |
- die("fork"); |
2816 |
- break; |
2817 |
- case 0: |
2818 |
- /* child */ |
2819 |
- (void) execv(cmd[0], cmd); |
2820 |
- perror("execve"); |
2821 |
- _exit(127); |
2822 |
- default: |
2823 |
- /* parent */ |
2824 |
- if (pid != waitpid(pid, &status, 0)) |
2825 |
- die("waitpid"); |
2826 |
- if (WIFSIGNALED(status) |
2827 |
- || (WIFEXITED(status) && WEXITSTATUS(status) >= 4)) |
2828 |
- exit(EXIT_FAILURE); |
2829 |
- } |
2830 |
- exit(EXIT_SUCCESS); |
2831 |
-} |
2832 |
|
2833 |
diff --git a/sys-fs/e2fsprogs/metadata.xml b/sys-fs/e2fsprogs/metadata.xml |
2834 |
deleted file mode 100644 |
2835 |
index 0abb95a..0000000 |
2836 |
--- a/sys-fs/e2fsprogs/metadata.xml |
2837 |
+++ /dev/null |
2838 |
@@ -1,8 +0,0 @@ |
2839 |
-<?xml version="1.0" encoding="UTF-8"?> |
2840 |
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
2841 |
-<pkgmetadata> |
2842 |
-<herd>base-system</herd> |
2843 |
-<upstream> |
2844 |
- <remote-id type="cpe">cpe:/a:ext2_filesystems_utilities:e2fsprogs</remote-id> |
2845 |
-</upstream> |
2846 |
-</pkgmetadata> |