Initial commit
This commit is contained in:
19
.SRCINFO
Normal file
19
.SRCINFO
Normal file
@@ -0,0 +1,19 @@
|
||||
pkgbase = pdisk
|
||||
pkgdesc = A low-level Apple partition table editor for Linux.
|
||||
pkgver = 0.9
|
||||
pkgrel = 1
|
||||
arch = x86_64
|
||||
license = custom
|
||||
source = https://opensource.apple.com/tarballs/pdisk/pdisk-9.tar.gz
|
||||
source = LICENSE
|
||||
source = makefile.patch
|
||||
source = file_media.c.patch
|
||||
source = cvt_pt.c.patch
|
||||
sha256sums = 5d080d8ff80744b9740b18030c59d7cea216f718c2bc2878434338b1d090a4ba
|
||||
sha256sums = 54ae88ac1448451ebe3c7298bc000a19ef35a562107fed48ce2c41b9b22d9bab
|
||||
sha256sums = a1cdfa2d3d3d4a74f75d4906de5d411eef8a7b9d9f4300b4722277e25290ab9a
|
||||
sha256sums = e455106da2572150b5178d564814c33ee29bf39ec31f7f787e2d6fcc3a32fa68
|
||||
sha256sums = 2dca3b77f193563299f5ba3388521712f9ad0da5d4aad6334025e1eadb191a0e
|
||||
|
||||
pkgname = pdisk
|
||||
|
||||
20
LICENSE
Normal file
20
LICENSE
Normal file
@@ -0,0 +1,20 @@
|
||||
Modifications copyright 2000 by Eryk Vershen
|
||||
|
||||
Copyright 1996,1997,1998 by Apple Computer, Inc.
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify, and distribute this software and
|
||||
its documentation for any purpose and without fee is hereby granted,
|
||||
provided that the above copyright notice appears in all copies and
|
||||
that both the copyright notice and this permission notice appear in
|
||||
supporting documentation.
|
||||
|
||||
APPLE COMPUTER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
|
||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
FOR A PARTICULAR PURPOSE.
|
||||
|
||||
IN NO EVENT SHALL APPLE COMPUTER BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
|
||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
|
||||
NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
||||
WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
47
PKGBUILD
Normal file
47
PKGBUILD
Normal file
@@ -0,0 +1,47 @@
|
||||
# Maintainer: Kevin Cotugno <kevin@kevincotugno.com>
|
||||
|
||||
pkgname=pdisk
|
||||
pkgver=0.9
|
||||
pkgrel=1
|
||||
pkgdesc="A low-level Apple partition table editor for Linux."
|
||||
arch=(x86_64)
|
||||
license=(custom)
|
||||
source=(
|
||||
"https://opensource.apple.com/tarballs/pdisk/pdisk-${pkgver//0./}.tar.gz"
|
||||
'LICENSE'
|
||||
'makefile.patch'
|
||||
'file_media.c.patch'
|
||||
'cvt_pt.c.patch'
|
||||
)
|
||||
sha256sums=(
|
||||
'5d080d8ff80744b9740b18030c59d7cea216f718c2bc2878434338b1d090a4ba'
|
||||
'54ae88ac1448451ebe3c7298bc000a19ef35a562107fed48ce2c41b9b22d9bab'
|
||||
'a1cdfa2d3d3d4a74f75d4906de5d411eef8a7b9d9f4300b4722277e25290ab9a'
|
||||
'e455106da2572150b5178d564814c33ee29bf39ec31f7f787e2d6fcc3a32fa68'
|
||||
'2dca3b77f193563299f5ba3388521712f9ad0da5d4aad6334025e1eadb191a0e'
|
||||
)
|
||||
|
||||
prepare() {
|
||||
cd "pdisk-${pkgver//0./}"
|
||||
|
||||
patch -p1 -i "${srcdir}/makefile.patch"
|
||||
patch -p1 -i "${srcdir}/file_media.c.patch"
|
||||
patch -p1 -i "${srcdir}/cvt_pt.c.patch"
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "pdisk-${pkgver//0./}"
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
install -Dm 644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
|
||||
|
||||
cd "pdisk-${pkgver//0./}"
|
||||
install -Dm 755 pdisk "${pkgdir}/usr/bin/pdisk"
|
||||
install -Dm 755 cvt_pt "${pkgdir}/usr/bin/cvt_pt"
|
||||
|
||||
gzip pdisk.8
|
||||
install -Dm 644 pdisk.8.gz "${pkgdir}/usr/share/man/man8/pdisk.8.gz"
|
||||
install -Dm 644 pdisk.html "${pkgdir}/usr/share/doc/${pkgname}/pdisk.html"
|
||||
}
|
||||
19
cvt_pt.c.patch
Normal file
19
cvt_pt.c.patch
Normal file
@@ -0,0 +1,19 @@
|
||||
--- a/cvt_pt.c 2010-03-05 16:09:50.000000000 -0700
|
||||
+++ b/cvt_pt.c 2020-04-17 07:16:18.472198301 -0700
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <stdarg.h>
|
||||
#include <errno.h>
|
||||
#include <ctype.h>
|
||||
+#include <fcntl.h>
|
||||
|
||||
#include "partition_map.h"
|
||||
#include "errors.h"
|
||||
@@ -173,7 +174,7 @@ process(char *filename)
|
||||
}
|
||||
|
||||
// 2) open prefix of filename as partition map
|
||||
- map = open_partition_map(s, &valid_file, 0);
|
||||
+ map = open_partition_map(s, &valid_file, 0, O_RDWR);
|
||||
if (!valid_file) {
|
||||
fatal(-1, "%s does not have a partition map", s);
|
||||
return;
|
||||
47
file_media.c.patch
Normal file
47
file_media.c.patch
Normal file
@@ -0,0 +1,47 @@
|
||||
--- pdisk/pdisk-9/file_media.c 2010-03-05 16:09:50.000000000 -0700
|
||||
+++ pdisk-9/file_media.c 2020-04-13 07:15:59.940941095 -0700
|
||||
@@ -59,7 +59,7 @@
|
||||
*/
|
||||
#ifdef __linux__
|
||||
#define LOFF_MAX 9223372036854775807LL
|
||||
-extern __loff_t llseek __P ((int __fd, __loff_t __offset, int __whence));
|
||||
+/* extern __loff_t llseek __P ((int __fd, __loff_t __offset, int __whence)); */
|
||||
#else
|
||||
#ifdef __unix__
|
||||
#define loff_t off_t
|
||||
@@ -186,7 +186,7 @@ compute_block_size(int fd)
|
||||
if (size == 0) {
|
||||
break;
|
||||
}
|
||||
- if ((x = llseek(fd, (loff_t)0, 0)) < 0) {
|
||||
+ if ((x = lseek(fd, (loff_t)0, 0)) < 0) {
|
||||
error(errno, "Can't seek on file");
|
||||
break;
|
||||
}
|
||||
@@ -221,7 +221,7 @@ open_file_as_media(char *file, int oflag
|
||||
if (a != 0) {
|
||||
a->m.kind = file_info.kind;
|
||||
a->m.grain = compute_block_size(fd);
|
||||
- off = llseek(fd, (loff_t)0, 2); /* seek to end of media */
|
||||
+ off = lseek(fd, (loff_t)0, 2); /* seek to end of media */
|
||||
#if !defined(__linux__) && !defined(__unix__)
|
||||
if (off <= 0) {
|
||||
off = 1; /* XXX not right? */
|
||||
@@ -281,7 +281,7 @@ read_file_media(MEDIA m, long long offse
|
||||
} else {
|
||||
/* do the read */
|
||||
off = offset;
|
||||
- if ((off = llseek(a->fd, off, 0)) >= 0) {
|
||||
+ if ((off = lseek(a->fd, off, 0)) >= 0) {
|
||||
if ((t = read(a->fd, address, count)) == (ssize_t)count) {
|
||||
rtn_value = 1;
|
||||
} else {
|
||||
@@ -318,7 +318,7 @@ write_file_media(MEDIA m, long long offs
|
||||
} else {
|
||||
/* do the write */
|
||||
off = offset;
|
||||
- if ((off = llseek(a->fd, off, 0)) >= 0) {
|
||||
+ if ((off = lseek(a->fd, off, 0)) >= 0) {
|
||||
if ((t = write(a->fd, address, count)) == (ssize_t)count) {
|
||||
if (off + count > a->m.size_in_bytes) {
|
||||
a->m.size_in_bytes = off + count;
|
||||
61
makefile.patch
Normal file
61
makefile.patch
Normal file
@@ -0,0 +1,61 @@
|
||||
--- pdisk/pdisk-9/makefile 2003-11-10 13:52:05.000000000 -0700
|
||||
+++ pdisk-9/makefile 2020-04-17 07:08:33.740037215 -0700
|
||||
@@ -48,6 +48,8 @@ MAC_SOURCE= \
|
||||
UNIX_SOURCE= \
|
||||
bitfield.c \
|
||||
bitfield.h \
|
||||
+ cmdline.c \
|
||||
+ cmdline.h \
|
||||
convert.c \
|
||||
convert.h \
|
||||
cvt_pt.c \
|
||||
@@ -84,6 +86,7 @@ UNIX_SOURCE= \
|
||||
COMMON_OBJECTS = \
|
||||
partition_map.o \
|
||||
bitfield.o \
|
||||
+ cmdline.o \
|
||||
convert.o \
|
||||
deblock_media.o \
|
||||
file_media.o \
|
||||
@@ -102,6 +105,7 @@ UNIX_OBJECTS = \
|
||||
|
||||
CVT_OBJECTS = \
|
||||
cvt_pt.o \
|
||||
+ dump.o \
|
||||
$(COMMON_OBJECTS)
|
||||
|
||||
|
||||
@@ -136,10 +140,10 @@ DIST_TAR_FLAGS = cvf
|
||||
all: $(UNIX_BINARIES)
|
||||
|
||||
pdisk: $(UNIX_OBJECTS)
|
||||
- cc -o pdisk $(UNIX_OBJECTS)
|
||||
+ cc -lbsd -o pdisk $(UNIX_OBJECTS)
|
||||
|
||||
cvt_pt: $(CVT_OBJECTS)
|
||||
- cc -o cvt_pt $(CVT_OBJECTS)
|
||||
+ cc -lbsd -o cvt_pt $(CVT_OBJECTS)
|
||||
|
||||
tags: $(MAC_SOURCE) $(UNIX_SOURCE)
|
||||
ctags $(MAC_SOURCE) $(UNIX_SOURCE)
|
||||
@@ -189,17 +193,18 @@ pathname.h: media.h
|
||||
validate.h: partition_map.h
|
||||
|
||||
bitfield.o: bitfield.c bitfield.h
|
||||
+cmdline.o: cmdline.c cmdline.h io.h
|
||||
convert.o: convert.c convert.h
|
||||
deblock_media.o: deblock_media.c deblock_media.h
|
||||
dump.o: dump.c dump.h pathname.h io.h errors.h
|
||||
-errors.o: errors.c errors.h
|
||||
+errors.o: errors.c errors.h cmdline.c cmdline.h
|
||||
file_media.o: file_media.c file_media.h errors.h
|
||||
io.o: io.c io.h errors.h
|
||||
layout_dump.o: layout_dump.c layout_dump.h
|
||||
media.o: media.c media.h
|
||||
partition_map.o: partition_map.c partition_map.h pathname.h deblock_media.h io.h convert.h util.h errors.h
|
||||
pathname.o: pathname.c pathname.h file_media.h
|
||||
-pdisk.o: pdisk.c pdisk.h io.h partition_map.h pathname.h errors.h dump.h validate.h version.h util.h
|
||||
+pdisk.o: pdisk.c pdisk.h io.h partition_map.h pathname.h errors.h dump.h validate.h version.h util.h cmdline.h
|
||||
util.o: util.c version.h util.h
|
||||
validate.o: validate.c validate.h deblock_media.h pathname.h convert.h io.h errors.h
|
||||
|
||||
Reference in New Issue
Block a user