From 0f558761aa2dee1017b4751e4017205e015a9560 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 29 Jun 2022 12:04:12 +0100 Subject: gentoo resync : 29.12.2022 --- sys-fs/mac-fdisk/Manifest | 3 + sys-fs/mac-fdisk/files/mac-fdisk-0.1_p18-2tb.patch | 164 +++++++++++++++++++++ .../mac-fdisk/files/mac-fdisk-0.1_p18-musl.patch | 68 +++++++++ sys-fs/mac-fdisk/mac-fdisk-0.1_p18-r1.ebuild | 53 +++++++ 4 files changed, 288 insertions(+) create mode 100644 sys-fs/mac-fdisk/files/mac-fdisk-0.1_p18-2tb.patch create mode 100644 sys-fs/mac-fdisk/files/mac-fdisk-0.1_p18-musl.patch create mode 100644 sys-fs/mac-fdisk/mac-fdisk-0.1_p18-r1.ebuild (limited to 'sys-fs/mac-fdisk') diff --git a/sys-fs/mac-fdisk/Manifest b/sys-fs/mac-fdisk/Manifest index bc3b3b93e7ea..7f6ad9460155 100644 --- a/sys-fs/mac-fdisk/Manifest +++ b/sys-fs/mac-fdisk/Manifest @@ -3,9 +3,12 @@ AUX largerthan2gb.patch 272 BLAKE2B 7bbd9b0fd817430d956d96d89c12b996d8ceec8f0665 AUX mac-fdisk-0.1-headers.patch 2050 BLAKE2B d375f6e4eb9ec940957771047413de4e8b3a99340630804926a24fc0104acde175c6332d06eab6f709d96974c81a3e834408fe8e42be4a1d917e136caca87a00 SHA512 7d16300c02b293de87101e3ef83a8b7778d15123c261d562f0129704b74d0c3d7ca18730c52d37b599ff57c0b70dacd41aeefe99cf235aea4abd4b569e3d601e AUX mac-fdisk-0.1_p16-ppc-inline.patch 863 BLAKE2B 3af665308ee82c2854047a5a80749122e02a3ab75370ff03e1f0322f54977ac9722f81a1a53cf918e0400bf9bc9bd03e9f31732574a22533e9f956eecbe54420 SHA512 40e213b1f0234195eb14450fe9fb326de2401552747af15eb743c0fbedd5f94aebe41245ad6f892a0aa34b6041cad2728530b7c6290731375b4dfe06c0e0102c AUX mac-fdisk-0.1_p16-ppc64.patch 12912 BLAKE2B 39b808d7e69e1ce705e6b8e231a1f0db559863fb2f80cd15bf9a3971c87e4a6c0a06e85dc3726489a4f82493aa7e85da1597c101ea1eed174bd58d3615167d9d SHA512 e521009d628934fe3925085c941d2bb3fba9c3322ccaaa6dd650ecbc6b990056f9bf186adb3a645dc8593efdb44611b69a7b6bf4e87d262870bbb515581e0ef3 +AUX mac-fdisk-0.1_p18-2tb.patch 4865 BLAKE2B 30c4b074c5069cca5e2d9bca1206b728d309b47aec17f5a0b35c7aca8fddbc4417bcce26de2a6e5b3d0baebee0d13ac024ed310eec849a502abe951de51b61b9 SHA512 fd81420d5cd1a6f0ee66735917ce379c256d411b4abd7653815324f581fe5b87ea3426816382fb1f0527c2f954202ccbed906d0f7cf4bacae99123f9e5170781 AUX mac-fdisk-0.1_p18-lseek64.patch 754 BLAKE2B b78d43edba6cf7c1f08eae6e55749c5abe0aedd35dfe8a445e3400235801d0e7d383e954dd3596b3eacfc5672227e7e76e6c1d527019b0c9b1b5a052a7b0e040 SHA512 15eccaa1fe60e7478c6636cdac8bc9f064847b52536c9bb38a9417ef1f1bdedd617f6f9f67bbb9377429c24797595f610da7128ae7dade216936786374e098ec +AUX mac-fdisk-0.1_p18-musl.patch 1473 BLAKE2B 8864b23821de7f270e4d04d0fa256d9a155b104382fa6122c856932b459b957fc367d01ef83a91fe73d053ee3b8162f82be4879d28d8c4d84dca03701e99f036 SHA512 cd68c8759e33077e6688198b0a93d0b265b1cec7fc506bab0e578b932519314e91a981e4c31b7d634984c4bd9d7ae27eb4aa0431359961cc320cdb32a49ee7c8 AUX mac-fdisk-amd64.patch 5154 BLAKE2B c8bbc117df448bc4c1181d9c172bc78dd5b1fd021184be73ecdc41568fcaf73e1daec8183d43f355b4bba876a0399f3dfd2c05173d7c9fee6d8d95068f141633 SHA512 241576f64dd334f98e8c9cb9e0b17b6366e208f2d0af47ddb4659cf2d8e25ca8f44a84d1f7fa2e5f6215f4be42668f43f034074ac981a0d87ca8483505a3623c DIST mac-fdisk_0.1-18.diff.gz 20267 BLAKE2B 111e5b18c1485b33cfb2f653846e901a528e65207d705f024bb4ba1e181881913fc79cc2bf94c536e0bd2f88f9169d25f2a64c0d1464844a2ebb8e24f1554a61 SHA512 5774e86e1770873cbccb80a79941c6bf917ac1df62f722805b1c4eae0a76b318b3df36ed39ac16d8b051e771603cc42a13feeaadd451343f6a21703e07e58c11 DIST mac-fdisk_0.1.orig.tar.gz 55817 BLAKE2B d193be6b06be562bcb3297300dc009ac28adba41ea5d7c1a5bc0d16b8f9ec8275e1ad015c9bc529c3aafd12cbd9012e1af7baef7259ce0c8cef4d6dc62986dec SHA512 1263e60a18111162f5ef439b5f9615cef9de94e7836cb998782a6e6d3bcf92a69e49566b33c7330bdea05de5e6ca83f7920c6707f342ce515440160695f07120 +EBUILD mac-fdisk-0.1_p18-r1.ebuild 1466 BLAKE2B 1cafcda86243a27c53354da03cb6c7555ec187d7f3796f5bc02645d24f1598ffbc005c0e537cc5411e5cf2c385a43cbbaa5a7fd008437bf4bcee68b968e86d3e SHA512 43cb42079e940fb8e34afc1c65770568da27640e662a2a6509237528d2d8000c335bd9dc68ae52d715ff8ef4a8bdaa23641d4d50a6fac1e98bef8eb1c7bf6e70 EBUILD mac-fdisk-0.1_p18.ebuild 1340 BLAKE2B cec0a9246a4d687a6efe2f1c2b0a631f408ca6cc36ad4efd478e6eb823f81c8fb693dc05c0d47c344aef350f95661929d80009e2725e90ce97cc9a9358fa44ce SHA512 a202db684bda096c32fec303e65b0055dd04921f462c4f55e77b6ee04e343b606a2769fb717f40ef615a369e929077f918ab1b9864c44f7288e13c25dfdf2e5a MISC metadata.xml 249 BLAKE2B 7e06a350422c31f33f36aaf66be928966e03869a64dd89e2cc5ce5eb2ab0700e1a66ab439005ad6a15411db138deb0fdab2dbcbce326cebb4a11bee5e2f78fba SHA512 1f490b62c59b89a97c79ca55dc8fb9af4449788b759ca070099d147f66821f1ecd8956f125800122f5be3ada277e4fd9eb6fdcb30acc41f0f16289ed6df19c49 diff --git a/sys-fs/mac-fdisk/files/mac-fdisk-0.1_p18-2tb.patch b/sys-fs/mac-fdisk/files/mac-fdisk-0.1_p18-2tb.patch new file mode 100644 index 000000000000..bb7c4222a4df --- /dev/null +++ b/sys-fs/mac-fdisk/files/mac-fdisk-0.1_p18-2tb.patch @@ -0,0 +1,164 @@ +grobian@gentoo.org + +not sure what big_pt.patch was tested on, but partitioning a 2TB disk +(Blocks=3907029168) won't work, with a daft warning, and no joy + +upgrade size storage to unsigned long long, so we can store these sizes +tested on a PowerMac G5 with a 2TB SATA drive + + +--- mac-fdisk-0.1.orig/io.c 2022-06-01 19:37:08.000000000 +0200 ++++ mac-fdisk-0.1.orig/io.c 2022-06-01 20:32:12.000000000 +0200 +@@ -85,7 +85,7 @@ + // + // Forward declarations + // +-long get_number(int first_char); ++long long get_number(int first_char); + char* get_string(int eos); + #ifndef __linux__ + int DoTestUnitReady(UInt8 targetID); +@@ -201,9 +205,8 @@ + return 0; + } + +- + int +-get_number_argument(char *prompt, long *number, long default_value) ++get_number_argument_long(char *prompt, long long *number, long long default_value) + { + int c; + int result = 0; +@@ -237,14 +241,22 @@ + return result; + } + ++int ++get_number_argument(char *prompt, long *number, long default_value) ++{ ++ long long retval = (long long)default_value; ++ int ret = get_number_argument_long(prompt, &retval, retval); ++ *number = (long)retval; ++ return ret; ++} + +-long ++long long + get_number(int first_char) + { + register int c; + int base; + int digit; +- int ret_value; ++ long long ret_value; + + if (first_char != '0') { + c = first_char; +--- mac-fdisk-0.1.orig/io.h 1997-01-09 23:31:31.000000000 +0100 ++++ mac-fdisk-0.1.orig/io.h 2022-06-01 20:10:20.000000000 +0200 +@@ -57,6 +57,7 @@ + int get_command(char *prompt, int promptBeforeGet, int *command); + long get_multiplier(long divisor); + int get_number_argument(char *prompt, long *number, long default_value); ++int get_number_argument_long(char *prompt, long long *number, long long default_value); + int get_okay(char *prompt, int default_value); + int get_string_argument(char *prompt, char **string, int reprompt); + int getch(); +--- mac-fdisk-0.1.orig/partition_map.c 2022-06-01 19:37:08.000000000 +0200 ++++ mac-fdisk-0.1.orig/partition_map.c 2022-06-01 20:16:26.000000000 +0200 +@@ -90,7 +90,7 @@ + void coerce_block0(partition_map_header *map); + int contains_driver(partition_map *entry); + void combine_entry(partition_map *entry); +-long compute_device_size(int fd); ++unsigned long long compute_device_size(int fd); + DPME* create_data(const char *name, const char *dptype, u32 base, u32 length); + partition_map_header* create_partition_map(char *name); + void delete_entry(partition_map *entry); +@@ -407,7 +407,7 @@ + int fd; + partition_map_header * map; + DPME *data; +- unsigned long number; ++ unsigned long long number; + #ifdef __linux__ + struct stat info; + #endif +@@ -435,13 +435,14 @@ + map->maximum_in_map = -1; + + number = compute_device_size(fd); +- printf("size of 'device' is %u blocks: ", (unsigned int)number); ++ printf("size of 'device' is %llu blocks: ", number); ++ fflush(NULL); + flush_to_newline(0); +- get_number_argument("what should be the size? ", (long *)&number, number); ++ get_number_argument_long("what should be the size? ", (long long *)&number, (long long)number); + if (number < 4) { + number = 4; + } +- printf("new size of 'device' is %u blocks\n", (unsigned int)number); ++ printf("new size of 'device' is %llu blocks\n", number); + map->media_size = number; + + #ifdef __linux__ +@@ -468,7 +469,7 @@ + data->dpme_signature = DPME_SIGNATURE; + data->dpme_map_entries = 1; + data->dpme_pblock_start = 1; +- data->dpme_pblocks = map->media_size - 1; ++ data->dpme_pblocks = (u32)(map->media_size - 1); + strncpy(data->dpme_name, kFreeName, DPISTRLEN); + strncpy(data->dpme_type, kFreeType, DPISTRLEN); + data->dpme_lblock_start = 0; +@@ -506,7 +507,7 @@ + if (p->sbSig != BLOCK0_SIGNATURE) { + p->sbSig = BLOCK0_SIGNATURE; + p->sbBlkSize = 512; +- p->sbBlkCount = map->media_size; ++ p->sbBlkCount = (u32)map->media_size; + p->sbDevType = 0; + p->sbDevId = 0; + p->sbData = 0; +@@ -573,7 +574,7 @@ + } + // if the map will overflow then punt + if (map->maximum_in_map < 0) { +- limit = map->media_size; ++ limit = (int)map->media_size; + } else { + limit = map->maximum_in_map; + } +@@ -661,7 +662,7 @@ + } + + +-long ++unsigned long long + compute_device_size(int fd) + { + #ifdef TEST_COMPUTE +@@ -753,11 +754,7 @@ + free(data); + } + +- // Add a warning just in case... +- if(x > 0x80000000) +- printf("Warning: Large disks may not work with this tool!\n"); +- +- return (unsigned long) x; ++ return x; + } + + +--- mac-fdisk-0.1.orig/partition_map.h 2022-06-01 19:37:08.000000000 +0200 ++++ mac-fdisk-0.1.orig/partition_map.h 2022-06-01 19:37:49.000000000 +0200 +@@ -47,7 +47,7 @@ + int regular_file; + int blocks_in_map; + int maximum_in_map; +- unsigned long media_size; ++ unsigned long long media_size; + }; + typedef struct partition_map_header partition_map_header; + diff --git a/sys-fs/mac-fdisk/files/mac-fdisk-0.1_p18-musl.patch b/sys-fs/mac-fdisk/files/mac-fdisk-0.1_p18-musl.patch new file mode 100644 index 000000000000..e99d6f5941d6 --- /dev/null +++ b/sys-fs/mac-fdisk/files/mac-fdisk-0.1_p18-musl.patch @@ -0,0 +1,68 @@ +grobian@gentoo.org + +auto-flush on stdio is really a glibc feature AFAICT, so in order for +musl to get prompts (and make the tool more bearable) just flush right +after writing half a line + +--- mac-fdisk-0.1.orig/io.c 2022-06-01 19:37:08.000000000 +0200 ++++ mac-fdisk-0.1.orig/io.c 2022-06-01 20:32:12.000000000 +0200 +@@ -151,7 +151,8 @@ + int c; + + flush_to_newline(0); +- printf(prompt); ++ printf("%s", prompt); ++ fflush(NULL); + + for (;;) { + c = getch(); +@@ -169,7 +170,8 @@ + return 0; + } else { + flush_to_newline(0); +- printf(prompt); ++ printf("%s", prompt); ++ fflush(NULL); + } + } + return -1; +@@ -182,7 +184,8 @@ + int c; + + if (promptBeforeGet) { +- printf(prompt); ++ printf("%s", prompt); ++ fflush(NULL); + } + for (;;) { + c = getch(); +@@ -192,7 +195,8 @@ + } else if (c == ' ' || c == '\t') { + // skip blanks and tabs + } else if (c == '\n') { +- printf(prompt); ++ printf("%s", prompt); ++ fflush(NULL); + } else { + *command = c; + return 1; +@@ -217,7 +220,8 @@ + // skip blanks and tabs + } else if (c == '\n') { + if (default_value < 0) { +- printf(prompt); ++ printf("%s", prompt); ++ fflush(NULL); + } else { + ungetch(c); + *number = default_value; +@@ -295,7 +307,8 @@ + // skip blanks and tabs + } else if (c == '\n') { + if (reprompt) { +- printf(prompt); ++ printf("%s", prompt); ++ fflush(NULL); + } else { + ungetch(c); + *string = NULL; diff --git a/sys-fs/mac-fdisk/mac-fdisk-0.1_p18-r1.ebuild b/sys-fs/mac-fdisk/mac-fdisk-0.1_p18-r1.ebuild new file mode 100644 index 000000000000..dad62e50d2ac --- /dev/null +++ b/sys-fs/mac-fdisk/mac-fdisk-0.1_p18-r1.ebuild @@ -0,0 +1,53 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +inherit toolchain-funcs flag-o-matic + +DESCRIPTION="Mac/PowerMac disk partitioning utility" +HOMEPAGE="ftp://ftp.mklinux.apple.com/pub/Other_Tools/" +SRC_URI=" + mirror://debian/pool/main/m/mac-fdisk/${PN}_${PV/_p*}.orig.tar.gz + mirror://debian/pool/main/m/mac-fdisk/${PN}_${PV/_p*}-${PV/*_p}.diff.gz +" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~ppc64 -riscv ~x86" + +S=${WORKDIR}/${P/_p*}.orig +PATCHES=( + "${WORKDIR}"/${PN}_${PV/_p*}-${PV/*_p}.diff + "${FILESDIR}"/largerthan2gb.patch + "${FILESDIR}"/${PN}-0.1-headers.patch + # Patch for bug #142737 + "${FILESDIR}"/${PN}-0.1_p16-ppc64.patch + ### Patch for building on amd64 + "${FILESDIR}"/${PN}-amd64.patch + # Patch for large (>550GB disks) + # Note that >=2TB disks may not work due to limitations of the Mac + # Partition Table structure, this needs to be investigated + "${FILESDIR}"/big_pt.patch + "${FILESDIR}"/${PN}-0.1_p16-ppc-inline.patch + "${FILESDIR}"/${PN}-0.1_p18-lseek64.patch + # add support for partitioning 2TB drives + "${FILESDIR}"/${PN}-0.1_p18-2tb.patch + "${FILESDIR}"/${PN}-0.1_p18-musl.patch +) + +src_compile() { + use elibc_musl && append-cppflags -Dloff_t=off_t + emake CC="$(tc-getCC)" +} + +src_install() { + into / + newsbin pdisk mac-fdisk + newsbin fdisk pmac-fdisk + + into /usr + newman mac-fdisk.8.in mac-fdisk.8 + newman pmac-fdisk.8.in pmac-fdisk.8 + + dodoc debian/changelog README HISTORY +} -- cgit v1.2.3