mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Jonas Rebmann <jre@pengutronix.de>
Subject: Re: [ptxdist] [APPLIED] gptfdisk: add new package
Date: Fri, 14 Feb 2025 10:02:11 +0100	[thread overview]
Message-ID: <20250214090211.2797789-1-m.olbrich@pengutronix.de> (raw)
In-Reply-To: <20250131-gptfdisk-v2-1-c6de969b69bb@pengutronix.de>

Thanks, applied as aaafe2aa5c115e810f0f0bd055547cb74e67bd00.

Michael

[sent from post-receive hook]

On Fri, 14 Feb 2025 10:02:11 +0100, Jonas Rebmann <jre@pengutronix.de> wrote:
> GPT fdisk is a set of tools to work with GUID partition tables: gdisk,
> cgdisk, sgdisk and fixparts
> 
> Of particular interest to embedded devices is sgdisk, the noninteractive
> tool, which, amongst other functionality, allows relocating the backup
> (alternative) GPT header to the end of the disk. This may be needed
> after flashing a GPT disk image created for a smaller disk size e.g. to
> account for fluctuation in disk size amongst hardware revisions.
> 
> The curses based cgdisk makes use of the wide char ncurses variant. As
> ptxdist currently, unlike some linux distributions, does not set up
> ncursesw/ncurses.h as a symlink to ncurses.h, gptfdisk is patched to
> include ncurses from the standard path.
> 
> Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
> Message-Id: <20250131-gptfdisk-v2-1-c6de969b69bb@pengutronix.de>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> 
> diff --git a/patches/gptfdisk-1.0.10/0001-gptcurses-never-include-ncurses-from-ncursesw.patch b/patches/gptfdisk-1.0.10/0001-gptcurses-never-include-ncurses-from-ncursesw.patch
> new file mode 100644
> index 000000000000..f320e8eb1802
> --- /dev/null
> +++ b/patches/gptfdisk-1.0.10/0001-gptcurses-never-include-ncurses-from-ncursesw.patch
> @@ -0,0 +1,24 @@
> +From: Jonas Rebmann <jre@pengutronix.de>
> +Date: Fri, 24 Jan 2025 15:21:29 +0100
> +Subject: [PATCH] gptcurses: never include ncurses from ncursesw
> +
> +---
> + gptcurses.cc | 4 ----
> + 1 file changed, 4 deletions(-)
> +
> +diff --git a/gptcurses.cc b/gptcurses.cc
> +index b47670094d73..476fc43d6cdb 100644
> +--- a/gptcurses.cc
> ++++ b/gptcurses.cc
> +@@ -23,11 +23,7 @@
> + #include <iostream>
> + #include <string>
> + #include <sstream>
> +-#if defined (__APPLE__) || (__FreeBSD__)
> + #include <ncurses.h>
> +-#else
> +-#include <ncursesw/ncurses.h>
> +-#endif
> + #include "gptcurses.h"
> + #include "support.h"
> + 
> diff --git a/patches/gptfdisk-1.0.10/series b/patches/gptfdisk-1.0.10/series
> new file mode 100644
> index 000000000000..d8006ace5377
> --- /dev/null
> +++ b/patches/gptfdisk-1.0.10/series
> @@ -0,0 +1,4 @@
> +# generated by git-ptx-patches
> +#tag:base --start-number 1
> +0001-gptcurses-never-include-ncurses-from-ncursesw.patch
> +# f271468e860c32391bf01fdd0d73b3ac  - git-ptx-patches magic
> diff --git a/rules/gptfdisk.in b/rules/gptfdisk.in
> new file mode 100644
> index 000000000000..e02cf359c10d
> --- /dev/null
> +++ b/rules/gptfdisk.in
> @@ -0,0 +1,49 @@
> +## SECTION=disk_and_file
> +
> +menuconfig GPTFDISK
> +	tristate
> +	prompt "gptfdisk                      "
> +	select LIBUUID
> +	select LIBPOPT			if GPTFDISK_SGDISK
> +	select NCURSES			if GPTFDISK_CGDISK
> +	select NCURSES_WIDE_CHAR	if GPTFDISK_CGDISK
> +	help
> +	  GPT fdisk is a set of text-mode partitioning tools. The gdisk,
> +	  cgdisk, and sgdisk programs work on Globally Unique Identifier (GUID)
> +	  Partition Table (GPT) disks, rather than on the older (and once more
> +	  common) Master Boot Record (MBR) partition tables.
> +
> +if GPTFDISK
> +
> +comment "At least one GPTFDISK_* option must be enabled!"
> +	depends on \
> +		!GPTFDISK_GDISK    && \
> +		!GPTFDISK_CGDISK   && \
> +		!GPTFDISK_SGDISK   && \
> +		!GPTFDISK_FIXPARTS
> +
> +config GPTFDISK_GDISK
> +	bool
> +	prompt "gdisk"
> +	help
> +	  Interactive GUID partition table (GPT) manipulator
> +
> +config GPTFDISK_CGDISK
> +	bool
> +	prompt "cgdisk"
> +	help
> +	  Curses-based GUID partition table (GPT) manipulator
> +
> +config GPTFDISK_SGDISK
> +	bool
> +	prompt "sgdisk"
> +	help
> +	  Command-line GUID partition table (GPT) manipulator for Linux and Unix
> +
> +config GPTFDISK_FIXPARTS
> +	bool
> +	prompt "fixparts"
> +	help
> +	  MBR partition table repair utility
> +
> +endif
> diff --git a/rules/gptfdisk.make b/rules/gptfdisk.make
> new file mode 100644
> index 000000000000..6bafcccaa02d
> --- /dev/null
> +++ b/rules/gptfdisk.make
> @@ -0,0 +1,84 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2025 by Jonas Rebmann <jre@pengutronix.de>
> +#
> +# For further information about the PTXdist project and license conditions
> +# see the README file.
> +#
> +
> +#
> +# We provide this package
> +#
> +PACKAGES-$(PTXCONF_GPTFDISK) += gptfdisk
> +
> +#
> +# Paths and names
> +#
> +GPTFDISK_VERSION	:= 1.0.10
> +GPTFDISK_MD5		:= 1970269eb7a97560e238611524b7797a
> +GPTFDISK		:= gptfdisk-$(GPTFDISK_VERSION)
> +GPTFDISK_SUFFIX		:= tar.gz
> +GPTFDISK_URL		:= https://downloads.sourceforge.net/project/gptfdisk/gptfdisk/$(GPTFDISK_VERSION)/$(GPTFDISK).$(GPTFDISK_SUFFIX)
> +GPTFDISK_SOURCE		:= $(SRCDIR)/$(GPTFDISK).$(GPTFDISK_SUFFIX)
> +GPTFDISK_DIR		:= $(BUILDDIR)/$(GPTFDISK)
> +GPTFDISK_LICENSE	:= GPL-2.0-only
> +GPTFDISK_LICENSE_FILES	:= file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552
> +
> +# ----------------------------------------------------------------------------
> +# Prepare
> +# ----------------------------------------------------------------------------
> +
> +GPTFDISK_TOOLS-$(PTXCONF_GPTFDISK_GDISK)	+= gdisk
> +GPTFDISK_TOOLS-$(PTXCONF_GPTFDISK_CGDISK)	+= cgdisk
> +GPTFDISK_TOOLS-$(PTXCONF_GPTFDISK_SGDISK)	+= sgdisk
> +GPTFDISK_TOOLS-$(PTXCONF_GPTFDISK_FIXPARTS)	+= fixparts
> +
> +ifdef PTXCONF_GPTFDISK
> +ifeq ($(strip $(GPTFDISK_TOOLS-y)),)
> +$(error At least one PTXCONF_GPTFDISK_* option must be enabled)
> +endif
> +endif
> +
> +GPTFDISK_CONF_TOOL	:= NO
> +
> +GPTFDISK_MAKE_ENV	:= \
> +	$(CROSS_ENV) \
> +	PREFIX=/usr
> +
> +GPTFDISK_MAKE_OPT	:= \
> +	TARGET=linux \
> +	$(GPTFDISK_TOOLS-y)
> +
> +# ----------------------------------------------------------------------------
> +# Install
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/gptfdisk.install:
> +	@$(call targetinfo)
> +	@$(call world/execute, GPTFDISK, \
> +		install -m755 -v \
> +		$(addprefix $(GPTFDISK_DIR)/,$(GPTFDISK_TOOLS-y)) \
> +		$(GPTFDISK_PKGDIR)/usr/bin/)
> +	@$(call touch)
> +
> +# ----------------------------------------------------------------------------
> +# Target-Install
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/gptfdisk.targetinstall:
> +	@$(call targetinfo)
> +
> +	@$(call install_init, gptfdisk)
> +	@$(call install_fixup, gptfdisk,PRIORITY,optional)
> +	@$(call install_fixup, gptfdisk,SECTION,base)
> +	@$(call install_fixup, gptfdisk,AUTHOR,"Jonas Rebmann <jre@pengutronix.de>")
> +	@$(call install_fixup, gptfdisk,DESCRIPTION,"GPT disk partitioning tools")
> +
> +	@$(foreach tool,$(GPTFDISK_TOOLS-y), \
> +		$(call install_copy, gptfdisk, 0, 0, 0755, -, /usr/bin/$(tool))$(ptx/nl))
> +
> +	@$(call install_finish, gptfdisk)
> +
> +	@$(call touch)
> +
> +# vim: syntax=make



      reply	other threads:[~2025-02-14  9:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-31  9:46 [ptxdist] [PATCH v2] " Jonas Rebmann
2025-02-14  9:02 ` Michael Olbrich [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250214090211.2797789-1-m.olbrich@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=jre@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox