Skip to content

Commit 5c3f1c0

Browse files
authored
new: gptfdisk (#49913)
GPT fdisk provides partitioning tools for GPT block devices; used by ceph via the sgdisk binary which is great for script usage. Includes a patch from Alpine for include paths and a linking issue seen in Wolfi; package lacks any configure command and the upstream Makefile is primitive. ### Pre-review Checklist <!-- This checklist is mostly useful as a reminder of small things that can easily be forgotten – it is meant as a helpful tool rather than hoops to jump through. At the moment of this PR you have the most information on what all the change will affect, so please take the time to jot it down. Put an `x` in all the items that apply, make notes next to any that haven't been addressed, and remove any items that are not relevant to this PR. --> #### For new package PRs only <!-- remove if unrelated --> - [ ] This PR is marked as fixing a pre-existing package request bug - [x] Alternatively, the PR is marked as related to a pre-existing package request bug, such as a dependency - [x] REQUIRED - The package is available under an OSI-approved or FSF-approved license - [x] REQUIRED - The version of the package is still receiving security updates - [ ] This PR links to the upstream project's support policy (e.g. `endoflife.date`) #### For new version streams <!-- remove if unrelated --> - [ ] The upstream project actually supports multiple concurrent versions. - [ ] Any subpackages include the version string in their package name (e.g. `name: ${{package.name}}-compat`) - [ ] The package (and subpackages) `provides:` logical unversioned forms of the package (e.g. `nodejs`, `nodejs-lts`) - [ ] If non-streamed package names no longer built, open PR to withdraw them (see [WITHDRAWING PACKAGES](https://github.com/wolfi-dev/os/blob/main/WITHDRAWING_PACKAGES.md)) #### For package updates (renames) in the base images <!-- remove if unrelated --> When updating packages part of base images (i.e. cgr.dev/chainguard/wolfi-base or ghcr.io/wolfi-dev/sdk) - [ ] REQUIRED cgr.dev/chainguard/wolfi-base and ghcr.io/wolfi-dev/sdk images successfully build - [ ] REQUIRED cgr.dev/chainguard/wolfi-base and ghcr.io/wolfi-dev/sdk contain no obsolete (no longer built) packages - [ ] Upon launch, does `apk upgrade --latest` successfully upgrades packages or performs no actions #### For security-related PRs <!-- remove if unrelated --> - [ ] The security fix is recorded in the [advisories](https://github.com/wolfi-dev/advisories) repo #### For version bump PRs <!-- remove if unrelated --> - [ ] The `epoch` field is reset to 0 #### For PRs that add patches <!-- remove if unrelated --> - [x] Patch source is documented --------- Signed-off-by: James Page <[email protected]>
1 parent bbaabe4 commit 5c3f1c0

File tree

3 files changed

+118
-0
lines changed

3 files changed

+118
-0
lines changed

gptfdisk.yaml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
package:
2+
name: gptfdisk
3+
version: 1.0.10
4+
epoch: 0
5+
description: Text-mode partitioning tool that works on Globally Unique Identifier (GUID) Partition Table (GPT) disks
6+
copyright:
7+
- license: LGPL-2.0-or-later
8+
dependencies:
9+
runtime:
10+
- sgdisk
11+
12+
environment:
13+
contents:
14+
packages:
15+
- build-base
16+
- busybox
17+
- ca-certificates-bundle
18+
- e2fsprogs-dev
19+
- ncurses-dev
20+
- popt-dev
21+
22+
pipeline:
23+
- uses: fetch
24+
with:
25+
expected-sha256: 2abed61bc6d2b9ec498973c0440b8b804b7a72d7144069b5a9209b2ad693a282
26+
uri: https://downloads.sourceforge.net/project/gptfdisk/gptfdisk/${{package.version}}/gptfdisk-${{package.version}}.tar.gz
27+
28+
- uses: patch
29+
with:
30+
patches: fix-wrong-include.patch fix-cgdisk-linking.patch
31+
32+
- uses: autoconf/make
33+
34+
- runs: |
35+
env
36+
# Makefile has no install target so install manually
37+
set -x
38+
for bin in gdisk sgdisk cgdisk fixparts; do
39+
install -Dm755 $bin ${{targets.destdir}}/usr/bin/$bin
40+
done
41+
42+
- uses: strip
43+
44+
subpackages:
45+
- name: sgdisk
46+
description: Script friendly partitioning tool for Globally Unique Identifier (GUID) Partition Table (GPT) disks
47+
pipeline:
48+
- runs: |
49+
install -Dm755 ${{targets.destdir}}/usr/bin/sgdisk ${{targets.contextdir}}/usr/bin/sgdisk
50+
rm -f ${{targets.destdir}}/usr/bin/sgdisk
51+
test:
52+
pipeline:
53+
- name: Check sgdisk binary
54+
runs: |
55+
sgdisk --version | grep ${{package.version}}
56+
- uses: test/tw/ldd-check
57+
58+
test:
59+
environment:
60+
contents:
61+
packages:
62+
- bash-binsh
63+
pipeline:
64+
- uses: fetch
65+
with:
66+
expected-sha256: 2abed61bc6d2b9ec498973c0440b8b804b7a72d7144069b5a9209b2ad693a282
67+
uri: https://downloads.sourceforge.net/project/gptfdisk/gptfdisk/${{package.version}}/gptfdisk-${{package.version}}.tar.gz
68+
- name: Execute gdisk test script
69+
runs: |
70+
# Massage test script to use installed binaries.
71+
sed -i "s/BIN=\./BIN=\/usr\/bin\//g" gdisk_test.sh
72+
./gdisk_test.sh
73+
- name: Verify gptfdisk installation basic - binary check only (all interactive).
74+
runs: |
75+
for bin in gdisk cgdisk fixparts; do
76+
[ -x /usr/bin/$bin ] || exit 1
77+
done
78+
- uses: test/tw/ldd-check
79+
80+
update:
81+
enabled: true
82+
release-monitor:
83+
identifier: 885

gptfdisk/fix-cgdisk-linking.patch

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Description: Add tinfo to LDLIB for cgdisk command
2+
Author: James Page <[email protected]>
3+
4+
diff --git a/Makefile b/Makefile
5+
index af9701c..87021cd 100644
6+
--- a/Makefile
7+
+++ b/Makefile
8+
@@ -72,7 +72,7 @@ LDLIBS+=-luuid #-licuio -licuuc
9+
FATBINFLAGS=
10+
THINBINFLAGS=
11+
SGDISK_LDLIBS=-lpopt
12+
-CGDISK_LDLIBS=-lncursesw
13+
+CGDISK_LDLIBS=-lncursesw -ltinfo
14+
LIB_NAMES=crc32 support guid gptpart mbrpart basicmbr mbr gpt bsd parttypes attributes diskio diskio-unix
15+
MBR_LIBS=support diskio diskio-unix basicmbr mbrpart
16+
ALL=gdisk cgdisk sgdisk fixparts

gptfdisk/fix-wrong-include.patch

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Description: Correct include path for ncurses.h
2+
Origin: https://git.alpinelinux.org/aports/plain/main/gptfdisk/
3+
4+
diff --git a/gptcurses.cc b/gptcurses.cc
5+
index 1b18cf2..4ebfde1 100644
6+
--- a/gptcurses.cc
7+
+++ b/gptcurses.cc
8+
@@ -23,11 +23,7 @@
9+
#include <iostream>
10+
#include <string>
11+
#include <sstream>
12+
-#if defined (__APPLE__) || (__FreeBSD__)
13+
#include <ncurses.h>
14+
-#else
15+
-#include <ncursesw/ncurses.h>
16+
-#endif
17+
#include "gptcurses.h"
18+
#include "support.h"
19+

0 commit comments

Comments
 (0)