]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
New Addon: gptfdisk 1.0.8
authorsmooky@v16.de <smooky@v16.de>
Sun, 9 Jan 2022 12:09:20 +0000 (13:09 +0100)
committerPeter Müller <peter.mueller@ipfire.org>
Wed, 16 Feb 2022 17:11:25 +0000 (17:11 +0000)
>>> https://www.rodsbooks.com/gdisk/ <<<

source = https://sourceforge.net/projects/gptfdisk/files/gptfdisk/1.0.8/gptfdisk-1.0.8.tar.gz/download

Hi @ all

I have a new add-on here which I use e.g. to bring partitions from mbr to gpt without data loss.
It is also well suited for rescuing broken partitions.

GPT fdisk (consisting of the gdisk, cgdisk, sgdisk, and fixparts programs) is a set of text-mode partitioning tools for Linux,
FreeBSD, Mac OS X, and Windows.
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.
The fixparts program repairs certain types of damage to MBR disks and enables changing partition types from
primary to logical and vice-versa.

Signed-off-by: Marcel Follert (Smooky) <smooky@v16.de>
Reviewed-by: Adolf Belka <adolf.belka@ipfire.org>
config/rootfiles/packages/gptfdisk [new file with mode: 0644]
lfs/gptfdisk [new file with mode: 0644]
make.sh

diff --git a/config/rootfiles/packages/gptfdisk b/config/rootfiles/packages/gptfdisk
new file mode 100644 (file)
index 0000000..a1a8540
--- /dev/null
@@ -0,0 +1,4 @@
+usr/sbin/cgdisk
+usr/sbin/fixparts
+usr/sbin/gdisk
+usr/sbin/sgdisk
diff --git a/lfs/gptfdisk b/lfs/gptfdisk
new file mode 100644 (file)
index 0000000..073d57c
--- /dev/null
@@ -0,0 +1,85 @@
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2007-2022  IPFire Team  <info@ipfire.org>                     #
+#                                                                             #
+# This program is free software: you can redistribute it and/or modify        #
+# it under the terms of the GNU General Public License as published by        #
+# the Free Software Foundation, either version 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program is distributed in the hope that it will be useful,             #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
+# GNU General Public License for more details.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include Config
+
+VER        = 1.0.8
+
+THISAPP    = gptfdisk-$(VER)
+DL_FILE    = $(THISAPP).tar.gz
+DL_FROM    = $(URL_IPFIRE)
+DIR_APP    = $(DIR_SRC)/$(THISAPP)
+TARGET     = $(DIR_INFO)/$(THISAPP)
+PROG       = gptfdisk
+PAK_VER    = 1
+
+DEPS       = 
+
+###############################################################################
+# Top-level Rules
+###############################################################################
+
+objects = $(DL_FILE)
+
+$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
+
+$(DL_FILE)_MD5 = 74684c4eb0e6d5a1839e4bb0bba36fa2
+
+install : $(TARGET)
+
+check : $(patsubst %,$(DIR_CHK)/%,$(objects))
+
+download :$(patsubst %,$(DIR_DL)/%,$(objects))
+
+md5 : $(subst %,%_MD5,$(objects))
+
+dist: 
+       @$(PAK)
+
+###############################################################################
+# Downloading, checking, md5sum
+###############################################################################
+
+$(patsubst %,$(DIR_CHK)/%,$(objects)) :
+       @$(CHECK)
+
+$(patsubst %,$(DIR_DL)/%,$(objects)) :
+       @$(LOAD)
+
+$(subst %,%_MD5,$(objects)) :
+       @$(MD5)
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
+       @$(PREBUILD)
+       @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar xvfz $(DIR_DL)/$(DL_FILE)
+       cd $(DIR_APP) && sed -i '29s#<ncursesw/ncurses.h>#<ncurses.h>#g' gptcurses.cc
+       cd $(DIR_APP) && make
+       cd $(DIR_APP) && cp cgdisk fixparts gdisk sgdisk /usr/sbin
+       @rm -rf $(DIR_APP)
+       @$(POSTBUILD)
diff --git a/make.sh b/make.sh
index 4dd068e4bbbfa99dfe92f2ee8cbc7c490df30a9b..cc80fcf6014e6e01ea29225d09545a634330c921 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -1702,6 +1702,7 @@ buildipfire() {
   lfsmake2 pmacct
   lfsmake2 squid-asnbl
   lfsmake2 qemu-ga
+       lfsmake2 gptfdisk
 }
 
 buildinstaller() {
@@ -1719,7 +1720,7 @@ buildpackages() {
   export LOGFILE
   echo "... see detailed log in _build.*.log files" >> $LOGFILE
 
-  
+
   # Generating list of packages used
   print_line "Generating packages list from logs"
   rm -f $BASEDIR/doc/packages-list
@@ -1734,7 +1735,7 @@ buildpackages() {
   rm -f $BASEDIR/doc/packages-list
   # packages-list.txt is ready to be displayed for wiki page
   print_status DONE
-  
+
   # Update changelog
   cd $BASEDIR
   [ -z $GIT_TAG ]  || LAST_TAG=$GIT_TAG
@@ -1806,7 +1807,7 @@ while [ $# -gt 0 ]; do
 done
 
 # See what we're supposed to do
-case "$1" in 
+case "$1" in
 build)
        START_TIME=$(now)
 
@@ -1845,7 +1846,7 @@ build)
 
        print_build_stage "Building packages"
        buildpackages
-       
+
        print_build_stage "Checking Logfiles for new Files"
 
        cd $BASEDIR
@@ -1910,7 +1911,7 @@ downloadsrc)
        FINISHED=0
        cd $BASEDIR/lfs
        for c in `seq $MAX_RETRIES`; do
-               if (( FINISHED==1 )); then 
+               if (( FINISHED==1 )); then
                        break
                fi
                FINISHED=1
@@ -2051,7 +2052,7 @@ find-dependencies)
        ;;
 check-manualpages)
        echo "Checking the manual pages for broken links..."
-       
+
        chmod 755 $BASEDIR/tools/check_manualpages.pl
        if $BASEDIR/tools/check_manualpages.pl; then
                print_status DONE
@@ -2064,4 +2065,3 @@ check-manualpages)
        cat doc/make.sh-usage
        ;;
 esac
-