diff options
| author | Matías Fonzo <[email protected]> | 2023-04-04 19:32:39 -0300 |
|---|---|---|
| committer | Matías Fonzo <[email protected]> | 2023-04-04 19:32:39 -0300 |
| commit | bd34976226541771c198613e94568aa90b17615f (patch) | |
| tree | 94fb3b18d353e1a3eb6180def23ea25ca2d6c554 | |
| parent | 28cb7ce1709bd1db2d9c6c4e1b69453158153aa7 (diff) | |
| download | dragora-extras-master.tar.gz | |
Signed-off-by: Matías Fonzo <[email protected]>
| -rw-r--r-- | patches/gptfdisk/Makefile-ICU.diff | 11 | ||||
| -rw-r--r-- | patches/gptfdisk/gptfdisk-1.0.9-convenience-1.patch | 27 | ||||
| -rw-r--r-- | patches/gptfdisk/popt-1.19-follow-up.patch | 37 | ||||
| -rw-r--r-- | patches/gptfdisk/popt-1.19.patch | 37 | ||||
| -rw-r--r-- | patches/gptfdisk/util-linux-2.38.patch | 25 | ||||
| -rw-r--r-- | recipes/tools/gptfdisk/depends.order | 3 | ||||
| -rw-r--r-- | recipes/tools/gptfdisk/recipe | 101 |
7 files changed, 241 insertions, 0 deletions
diff --git a/patches/gptfdisk/Makefile-ICU.diff b/patches/gptfdisk/Makefile-ICU.diff new file mode 100644 index 0000000..4f42917 --- /dev/null +++ b/patches/gptfdisk/Makefile-ICU.diff @@ -0,0 +1,11 @@ +--- gptfdisk-1.0.9/Makefile.orig 2022-05-04 20:20:23.101863901 +0000 ++++ gptfdisk-1.0.9/Makefile 2022-05-04 20:20:53.010045295 +0000 +@@ -68,7 +68,7 @@ + #CXXFLAGS+=-O2 -Wall -D_FILE_OFFSET_BITS=64 -D USE_UTF16 + CXXFLAGS+=-O2 -Wall -D_FILE_OFFSET_BITS=64 + LDFLAGS+= +-LDLIBS+=-luuid #-licuio -licuuc ++LDLIBS+=-luuid -licuio -licuuc + FATBINFLAGS= + THINBINFLAGS= + SGDISK_LDLIBS=-lpopt diff --git a/patches/gptfdisk/gptfdisk-1.0.9-convenience-1.patch b/patches/gptfdisk/gptfdisk-1.0.9-convenience-1.patch new file mode 100644 index 0000000..3d78b87 --- /dev/null +++ b/patches/gptfdisk/gptfdisk-1.0.9-convenience-1.patch @@ -0,0 +1,27 @@ +Submitted By: Bruce Dubbs <bdubbs_at_linuxfromscratch_dot_org> +Date: 2015-10-19 +Initial Package Version: 1.0.1 +Upstream Status: None. BLFS specific. +Origin: BLFS +Description: Updates Makefile enabling parameter passing. + Rediffed for version 1.0.1 +Updates: Rediffed for version 1.0.3 (P. Labastie) + Patch version 2 for version 1.0.3: Removed ICU + and POPT switches, keeping only the + install target (P. Labastie) + +diff -Naur gptfdisk-1.0.3.old/Makefile gptfdisk-1.0.3.new/Makefile +--- gptfdisk-1.0.3.old/Makefile 2017-07-28 03:41:20.000000000 +0200 ++++ gptfdisk-1.0.3.new/Makefile 2018-04-20 10:04:18.896802047 +0200 +@@ -37,6 +37,11 @@ + clean: #no pre-reqs + rm -f core *.o *~ gdisk sgdisk cgdisk fixparts + ++install: gdisk cgdisk sgdisk fixparts ++ install -dm 755 $(DESTDIR)/sbin $(DESTDIR)/usr/share/man/man8 ++ install -m755 gdisk cgdisk sgdisk fixparts $(DESTDIR)/sbin ++ install -m644 *.8 $(DESTDIR)/usr/share/man/man8 ++ + # what are the source dependencies + depend: $(SRCS) + $(DEPEND) $(SRCS) diff --git a/patches/gptfdisk/popt-1.19-follow-up.patch b/patches/gptfdisk/popt-1.19-follow-up.patch new file mode 100644 index 0000000..3cee7cc --- /dev/null +++ b/patches/gptfdisk/popt-1.19-follow-up.patch @@ -0,0 +1,37 @@ +From f5de3401b974ce103ffd93af8f9d43505a04aaf9 Mon Sep 17 00:00:00 2001 +From: Damian Kurek <[email protected]> +Date: Thu, 7 Jul 2022 03:39:16 +0000 +Subject: [PATCH] Fix NULL dereference when duplicating string argument + +poptGetArg can return NULL if there are no additional arguments, which +makes strdup dereference NULL on strlen +--- + gptcl.cc | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/gptcl.cc b/gptcl.cc +index 0d578eb..ab95239 100644 +--- a/gptcl.cc ++++ b/gptcl.cc +@@ -155,10 +155,11 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) { + } // while + + // Assume first non-option argument is the device filename.... +- device = strdup((char*) poptGetArg(poptCon)); +- poptResetContext(poptCon); ++ device = (char*) poptGetArg(poptCon); + + if (device != NULL) { ++ device = strdup(device); ++ poptResetContext(poptCon); + JustLooking(); // reset as necessary + BeQuiet(); // Tell called functions to be less verbose & interactive + if (LoadPartitions((string) device)) { +@@ -498,6 +499,7 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) { + cerr << "Error encountered; not saving changes.\n"; + retval = 4; + } // if ++ free(device); + } // if (device != NULL) + poptFreeContext(poptCon); + return retval; diff --git a/patches/gptfdisk/popt-1.19.patch b/patches/gptfdisk/popt-1.19.patch new file mode 100644 index 0000000..39468d3 --- /dev/null +++ b/patches/gptfdisk/popt-1.19.patch @@ -0,0 +1,37 @@ +From 5d5e76d369a412bfb3d2cebb5fc0a7509cef878d Mon Sep 17 00:00:00 2001 +From: Rod Smith <[email protected]> +Date: Fri, 15 Apr 2022 18:10:14 -0400 +Subject: [PATCH] Fix failure & crash of sgdisk when compiled with latest popt + (commit 740; presumably eventually release 1.19) + +--- + gptcl.cc | 2 +- + support.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gptcl.cc b/gptcl.cc +index 34c9421..0d578eb 100644 +--- a/gptcl.cc ++++ b/gptcl.cc +@@ -155,7 +155,7 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) { + } // while + + // Assume first non-option argument is the device filename.... +- device = (char*) poptGetArg(poptCon); ++ device = strdup((char*) poptGetArg(poptCon)); + poptResetContext(poptCon); + + if (device != NULL) { +diff --git a/support.h b/support.h +index 8ba9ad1..f91f1bc 100644 +--- a/support.h ++++ b/support.h +@@ -8,7 +8,7 @@ + #include <stdlib.h> + #include <string> + +-#define GPTFDISK_VERSION "1.0.9" ++#define GPTFDISK_VERSION "1.0.9.1" + + #if defined (__FreeBSD__) || defined (__FreeBSD_kernel__) || defined (__APPLE__) + // Darwin (Mac OS) & FreeBSD: disk IOCTLs are different, and there is no lseek64 diff --git a/patches/gptfdisk/util-linux-2.38.patch b/patches/gptfdisk/util-linux-2.38.patch new file mode 100644 index 0000000..7b258aa --- /dev/null +++ b/patches/gptfdisk/util-linux-2.38.patch @@ -0,0 +1,25 @@ +From 127e40dcc2d62ad693cb4e03e1182d0a227d85e1 Mon Sep 17 00:00:00 2001 +From: Evangelos Foutras <[email protected]> +Date: Sat, 16 Apr 2022 08:24:58 +0300 +Subject: [PATCH] Fix uuid/uuid.h detection with util-linux 2.38 + +util-linux commit 10f5f79485964ab52272ebe79c3b0047b1f84d82 changed the +header guard in uuid/uuid.h from _UUID_UUID_H to _UL_LIBUUID_UUID_H as +the former was too generic; fix guid.cc to also look for the new name. +--- + guid.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/guid.cc b/guid.cc +index 1e73ab7..d3e4fd5 100644 +--- a/guid.cc ++++ b/guid.cc +@@ -141,7 +141,7 @@ void GUIDData::Zero(void) { + void GUIDData::Randomize(void) { + int i, uuidGenerated = 0; + +-#ifdef _UUID_UUID_H ++#if defined (_UUID_UUID_H) || defined (_UL_LIBUUID_UUID_H) + uuid_generate(uuidData); + ReverseBytes(&uuidData[0], 4); + ReverseBytes(&uuidData[4], 2); diff --git a/recipes/tools/gptfdisk/depends.order b/recipes/tools/gptfdisk/depends.order new file mode 100644 index 0000000..5c4c2dc --- /dev/null +++ b/recipes/tools/gptfdisk/depends.order @@ -0,0 +1,3 @@ +tools/util-linux +libs/popt +libs/icu diff --git a/recipes/tools/gptfdisk/recipe b/recipes/tools/gptfdisk/recipe new file mode 100644 index 0000000..d6a3af9 --- /dev/null +++ b/recipes/tools/gptfdisk/recipe @@ -0,0 +1,101 @@ +# Build recipe for gptfdisk. +# +# Copyright (c) 2022-2023 Matias Fonzo, <[email protected]>. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Exit immediately on any error +set -e + +program=gptfdisk +version=1.0.9 +release=4 + +# Define a category for the output of the package name +pkgcategory=tools + +tarname=${program}-${version}.tar.gz + +# Remote source(s) +fetch=https://sourceforge.net/projects/gptfdisk/files/gptfdisk/${version}/$tarname + +description=" +GPT partitioning and MBR repair software. + +GPT fdisk is a disk partitioning tool loosely modeled on Linux fdisk, +but used for modifying GUID Partition Table (GPT) disks. The related +FixParts utility fixes some common problems on Master Boot Record (MBR) +disks. +" + +homepage=https://www.rodsbooks.com/gdisk/ +license=GPLv2+ + +# Source documentation +docs="COPYING NEWS README" +docsdir="${docdir}/${program}-${version}" + +# Limit parallel jobs for the compiler +jobs=1 + +build() +{ + unpack "${tardir}/$tarname" + + cd "$srcdir" + + # Update in order to build against latest popt package + patch -Np1 -i "${worktree}/patches/gptfdisk/popt-1.19.patch" + patch -Np1 -i "${worktree}/patches/gptfdisk/popt-1.19-follow-up.patch" + + # Update in order to build against util-linux 2.38 + patch -Np1 -i "${worktree}/patches/gptfdisk/util-linux-2.38.patch" + + # This patch modifies the Makefile file + # so that it provides an install target. + # Thanks to "Beyond Linux From Scratch" + patch -Np1 -i "${worktree}/patches/gptfdisk/gptfdisk-1.0.9-convenience-1.patch" + + # Build with ICU support + patch -Np1 -i "${worktree}/patches/gptfdisk/Makefile-ICU.diff" + + # To accommodate paths + sed -i 's|ncursesw/||' gptcurses.cc + sed -i 's|sbin|usr/sbin|' Makefile + + # Set sane permissions + chmod -R u+w,go-w,a+rX-s . + + make -j${jobs} V=1 CPPFLAGS="$QICPPFLAGS" \ + CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" + make -j${jobs} DESTDIR="$destdir" install + + # Compress and link man pages (if needed) + if test -d "${destdir}/$mandir" + then + ( + cd "${destdir}/$mandir" + find . -type f -exec lzip -9 {} + + find . -type l | while read -r file + do + ln -sf "$(readlink -- "$file").lz" "${file}.lz" + rm -- "$file" + done + ) + fi + + # Copy documentation + mkdir -p "${destdir}/$docsdir" + cp -p $docs "${destdir}/$docsdir" +} + |
