--- parted-1.4.24.orig/ChangeLog +++ parted-1.4.24/ChangeLog @@ -7,6 +7,14 @@ ----------------------------------------------------------------------------- 1.4.x ----------------------------------------------------------------------------- + +2002-03-19 Richard Hirst +* treat GPT structs as little-endian always, regardless of cpu byte order, + now gets unique GUID byte order correct, and works on big-endian +* treat GUIDs as little-endian blobs except when calling libuuid functions, + avoid triggering gcc ((packed)) bug +* add hp-service partition type support + 2002-01-26 Andrew Cluasen * added new/updated translations: ca, fr, da * backported fixes from 1.6.x: --- parted-1.4.24.orig/debian/.cvsignore +++ parted-1.4.24/debian/.cvsignore @@ -0,0 +1,7 @@ +*~ +*.rej +*.orig +*.bak +libparted[0-9]*.* +control +shlibs.local --- parted-1.4.24.orig/debian/README.Debian +++ parted-1.4.24/debian/README.Debian @@ -0,0 +1,46 @@ +GNU Parted for Debian +---------------------- + +The nature of this software means that any bugs could cause massive data loss. +While there are no known bugs at the moment, they could exist, so please back +up all important files before running it, and do so at your own risk. + +Note that the libparted1.4 package _are_ newer than the libparted2 packages, +I have decided to go with upstream's version numbers for the library +packages, to reduce any confusion. Note that the letter will be bumped +every time the soname changes, so that any programs using an older libparted +when an incompatible version is released will still work with the old +package. + +Parted currently supports DOS, Mac, PC98, BSD, GPT and Sun disklabels / +partition tables, as well as a 'loop' (raw disk) disklabel type which is +useful for RAID/LVM filesystems. + +Filesystems currently supported: +[from the user documentation] + +Filesystem | Supported Operations + |detect |create |resize | copy | check +----------------|-------|-------|-------|-------|-------- +ext2 | * | * | *[1] | *[2] | *[3] +ext3 | * | * | *[1] | *[2] | *[3] +fat16 | * | * | *[4] | *[4] | * +fat32 | * | * | * | * | * +hfs | * | | | | +jfs | * | | | | +linux-swap | * | * | * | * | * +ntfs | * | | | | +reiserfs | * | | | | +ufs | * | | | | +xfs | * | | | | + +[1] Parted can't move the start of ext2 or ext3 partitions (yet). +[2] The size of the partition you copy to must be greater than or equal to + the size of the partition you copy from. +[3] Limited checking is done when the filesystem is opened, this is the + extent of ext2 checking done at the moment. +[4] The size of the new partition, after resizing or copying, is restricted + by the cluster size for fat (mainly affects FAT16). Parted can shrink + cluster sizes, but cannot grow them on FAT16. + + -- Timshel Knoll Thu, 7 Mar 2002 23:02:32 +1100 \ No newline at end of file --- parted-1.4.24.orig/debian/changelog +++ parted-1.4.24/debian/changelog @@ -0,0 +1,634 @@ +parted (1.4.24-4) unstable; urgency=low + + * Applied Richard Hirst's hp-service partition patch + + -- Timshel Knoll Thu, 28 Mar 2002 12:36:48 +1100 + +parted (1.4.24-3) unstable; urgency=high + + * Applied patch from Richard Hirst which fixes a data + corruption bug on ia64 (GPT) disklabels (hence the urgency=high upload). + This problem is caused by a bug with gcc's __attribute__ ((packed)) + "feature". Richard's patch also fixes endianness issues with the on-disk / + in-memory UUID of the GUID Partition Table, and an endianness bug where + 64 bit which were little endian on disk were only being half transferred + to big endian in memory. This latter bug only affects big endian machines. + * Recompile against latest e2fsprogs, this fixes a problem where + incompatible versions of e2fsprogs can be installed + + -- Timshel Knoll Tue, 26 Mar 2002 18:09:12 +1100 + +parted (1.4.24-2) unstable; urgency=low + + * Many packaging changes merged from experimental 1.6.0-pre4-1 packages: + * debian/copyright: cleaned up copyright message and added 2002 to (C) + * debian/control.in: + - Fixed misspelling in parted-bf description (closes: #125216) + - added libparted1.4-i18n package with i18n message catalogs + - updated filesystem and disklabel lists in package descriptions + * debian/rules: + - use DESTDIR rather than prefix to install to debian/tmp + - use $(CURDIR) rather than `pwd` to get the current directory + - misc. small fixes + + -- Timshel Knoll Fri, 8 Mar 2002 00:14:36 +1100 + +parted (1.4.24-1) unstable; urgency=low + + * New upstream release + + -- Timshel Knoll Wed, 30 Jan 2002 10:32:50 +1100 + +parted (1.4.23-1) unstable; urgency=low + + * New upstream release + + -- Timshel Knoll Wed, 16 Jan 2002 00:02:03 +1100 + +parted (1.4.22-1) unstable; urgency=low + + * New upstream release + + -- Timshel Knoll Sun, 30 Dec 2001 00:51:42 +1100 + +parted (1.4.21-1) unstable; urgency=low + + * New upstream release + * Disable -Werror when building on s390 (closes: #121267) + + -- Timshel Knoll Fri, 7 Dec 2001 23:51:02 +1100 + +parted (1.4.20-1) unstable; urgency=low + + * New upstream release + * Upstream now uses C99's PRIx64 for printf'ing __u64's - this fixes + compilation warnings on alpha and ia64 (closes: #115369) + * This should fix all alpha compile warnings, so removed --disable-Werror + configure flag when compiling on alpha (-Werror will help find bugs) + + -- Timshel Knoll Mon, 15 Oct 2001 11:00:29 +1000 + +parted (1.4.19-2) unstable; urgency=low + + * debian/rules: call ./configure with --disable-Werror flag on + alpha as well ... (closes: #114172) + + -- Timshel Knoll Mon, 8 Oct 2001 12:51:47 +1000 + +parted (1.4.19-1) unstable; urgency=low + + * New upstream release + + -- Timshel Knoll Sun, 30 Sep 2001 18:51:41 +1000 + +parted (1.4.18+19pre2-5) unstable; urgency=low + + * Applied Matt Domsch 's GPT (GUID Partition Tables) + support patch (closes: #105555) + + -- Timshel Knoll Sat, 15 Sep 2001 10:46:55 +1000 + +parted (1.4.18+19pre2-4) unstable; urgency=low + + * debian/control: Build-Depend on libtool (closes: #112110) + + -- Timshel Knoll Thu, 13 Sep 2001 11:20:56 +1000 + +parted (1.4.18+19pre2-3) unstable; urgency=low + + * Fixes to *really* fix building on m68k (yes really this time ... grrr): + - configure.in: hacked to add --disable-Werror argument + - debian/control: added Build-Depends on recent autoconf and automake + - debian/rules: + + run aclocal, autoconf and automake before ./configure'ing + + run configure with --disable-Werror argument on m68k + + -- Timshel Knoll Wed, 12 Sep 2001 16:43:59 +1000 + +parted (1.4.18+19pre2-2) unstable; urgency=low + + * debian/control: + + Fixed typo - fixed typo - libparted1.4 package was Priority: extra + instead of parted-bf package for the last 2 releases - fixed this + + Updated the file system support list in package descriptions + + Removed Build-Depends: on autoconf, automake and libtool - these are + only needed if autoconf/automake need to be re-run ... (not the case) + * debian/rules: + + pass the correct libparted library directory to dh_shlibdeps for + correct parted package dependancies (closes: #102359) + * debian/README.Debian: Updated the file system support list + + -- Timshel Knoll Mon, 10 Sep 2001 00:40:49 +0000 + +parted (1.4.18+19pre2-1) unstable; urgency=low + + * New upstream (pre-) release + * Build with -Wno-uninitialized on m68k (really closes: #110264) + + -- Timshel Knoll Mon, 10 Sep 2001 00:28:47 +1000 + +parted (1.4.18+19pre1-1) unstable; urgency=low + + * New upstream (pre-) release (closes: #110264) + * debian/rules, debian/control: + + Build parted-bf package, built with --disable-readline (closes: #109161) + + Now using debhelper v3 + + -- Timshel Knoll Wed, 5 Sep 2001 13:08:56 +1000 + +parted (1.4.18-1) unstable; urgency=low + + * New upstream release (never uploaded) + + -- Timshel Knoll Mon, 20 Aug 2001 20:23:41 +1000 + +parted (1.4.17-1) unstable; urgency=low + + * New upstream release + * debian/rules: build with CFLAGS += -Wno-unused on m68k to work around + compiler bug (closes: #105819) + + -- Timshel Knoll Mon, 23 Jul 2001 09:39:22 +1000 + +parted (1.4.16-1) unstable; urgency=low + + * New upstream release + + -- Timshel Knoll Tue, 17 Jul 2001 14:14:38 +1000 + +parted (1.4.15-2) unstable; urgency=low + + * Fixed ia64 compile errors (thanks to Jeff Licquia) (closes: #105529) + + -- Timshel Knoll Tue, 17 Jul 2001 10:22:56 +1000 + +parted (1.4.15-1) unstable; urgency=low + + * New upstream release + + -- Timshel Knoll Tue, 10 Jul 2001 11:43:26 +1000 + +parted (1.4.14-1) unstable; urgency=low + + * New upstream release + * debian/control: libparted1.4 Conflicts: parted (<< 1.4.13+14pre1), to + make sure that the soname change doesn't break stuff. + + -- Timshel Knoll Wed, 30 May 2001 21:55:26 +1000 + +parted (1.4.13+14pre2-1) unstable; urgency=low + + * New upstream release + * This means I don't need a patched configure.in, so don't need to + Build-Depend: auto{conf,make}, libtool ... (closes: Bug#99015) + Left the Build-Depends there anyway (just in case) + * This upstream release uses libtool 1.4 anyway, so that alone would fix + #99015 as well :-) + * debian/rules: + - explicitly specify --enable-shared to configure in configure target + (bug workaround for this version, shared libs aren't built by default) + - explicitly specify --disable-shared to configure in configure-dbg + target, this should substantially shorten the build time. + + -- Timshel Knoll Tue, 29 May 2001 10:10:09 +1000 + +parted (1.4.13-1) unstable; urgency=low + + * New upstream release + + -- Timshel Knoll Sat, 26 May 2001 22:48:13 +1000 + +parted (1.4.12-2) unstable; urgency=low + + * debian/rules: Lots of updates to get stuff building properly, merged + binary-common and binary-libparted$(LIBPKGVER)-dbg rules. + * debian/control updates: + - added Build-Depends: autoconf (>= 2.50), automake (>= 1.4-p1), libtool + (closes: Bug#98673) + - Added '| libncurses5-dev' to libncurses-dev Build-Depends to provide + non-virtual installation candidate. + - Standards-Version: 3.5.4 + + -- Timshel Knoll Sat, 26 May 2001 14:53:59 +1000 + +parted (1.4.12-1) unstable; urgency=low + + * New upstream release + * debian/rules: made {build{,-dbg},configure{,-dbg}}-stamp stuff depend + directly on $(GENFILES), which stops ./configure from being repeatedly + run unnecessarily during the build procedure. + + -- Timshel Knoll Tue, 22 May 2001 17:26:34 +1000 + +parted (1.4.11-4) unstable; urgency=low + + * debian/control: libparted1.4-dbg Priority: extra + * debian/control: parted & libparted-dev now Suggests: parted-doc + (closes: Bug#97556) + + -- Timshel Knoll Tue, 15 May 2001 23:13:41 +1000 + +parted (1.4.11-3) unstable; urgency=low + + * Some big updates - lots of library versioning stuff automated ... + - debian/control and debian/shlibs.local now being generated from + debian/control.in and debian/shlibs.local.in respectively, with + debian/rules + - debian/libparted2{,-dev}.* moved to debian/libparted{,-dev}.*, + these are now copied to their appropriate places when necessary + - LIBPKGVER variable added to debian/rules, this is the library + package version (part of the library name). Initially set to + 1.4, which is the new version number of libparted (ie. the + libparted package is now named libparted1.4, to keep in line + with upstream). I'll add a letter which will be bumped whenever + upstream's soname changes, if necessary (ie. libparted1.4a) ... + * Added support for DEB_BUILD_OPTIONS=noopt (compiles without -O2). + * debian/control.in debian/rules: Added building of libparted2-dbg + package, unstripped static lib with malloc debugging enabled. + * Fixed problem with ./configure being run twice, once on + 'debian/rules build' and again on 'debian/rules binary-arch' + * Fixed shlibs library version _properly_, I changed the depends: + version but not the soname version :-(. With the versioning automation + stuff I have also added a LIBSONAME substitution, and also check that + parted's soname is what debian/rules (and thus debian/shlibs.local) + think that it is ... + + -- Timshel Knoll Wed, 2 May 2001 15:15:20 +1000 + +parted (1.4.11-2) unstable; urgency=low + + * Apparently 1.4.11 has a new soname, changed shlibs.local and + dh_makeshlibs to use (>= 1.4.11) (closes: Bug#95846) + + -- Timshel Knoll Tue, 1 May 2001 12:03:56 +1000 + +parted (1.4.11-1) unstable; urgency=low + + * New upstream release + + -- Timshel Knoll Thu, 19 Apr 2001 01:49:23 +1000 + +parted (1.4.10-2) unstable; urgency=low + + * debian/rules: Added support for $DEB_BUILD_OPTIONS + * debian/rules: removed call to deprecated dh_suidregister + * debian/rules: added separate configure[-stamp] targets which call configure + * debian/control: updated disklabel list in package descriptions, added + list of supported filesystems. + * debian/control: libparted2: added Conflicts: and Replaces: libparted + * debian/README.Debian: updated disklabel list, added detailed list + of supported filesystem and the amount of support for each + + -- Timshel Knoll Thu, 29 Mar 2001 19:57:58 -0800 + +parted (1.4.10-1) unstable; urgency=low + + * New upstream release + * Converted to cvs-buildpackage. + * debian/rules: removed call to obsolete dh_testversion. + * debian/parted-doc.docs: removed reference to 0 byte file BUGS + (well, no bugs, great) :-) + + -- Timshel Knoll Tue, 20 Mar 2001 00:47:22 +1100 + +parted (1.4.9-1) unstable; urgency=low + + * New upstream release + + -- Timshel Knoll Mon, 19 Feb 2001 18:21:43 +1100 + +parted (1.4.8-1) unstable; urgency=low + + * New upstream release + * debian/control: Made libparted2 Suggest: libparted2-dev + + -- Timshel Knoll Sat, 10 Feb 2001 09:51:10 +1100 + +parted (1.4.7-1) unstable; urgency=low + + * New upstream release + * debian/control, debian/libparted1[-dev]*, debian/rules: + Updated library package names to libparted2 and libparted2-dev, as + this upstream version contains incompatible changes to the library + versioning system + * debian/control: Updated build-depends: on debhelper to version + >= 2.0 (for DH_COMPAT=2), added gettext. + * debian/README.Debian: updated list of supported partition tables + (added BSD disklabels to the list) + + -- Timshel Knoll Sun, 4 Feb 2001 18:30:05 +1100 + +parted (1.4.6-1) unstable; urgency=low + + * New upstream release + + -- Timshel Knoll Sun, 7 Jan 2001 18:57:46 +1100 + +parted (1.4.5-1) unstable; urgency=low + + * New upstream release + * Updated package descriptions and README.Debian with a list of + supported partition tables / disklabels. + * debian/copyright: fixed bad email addresses of upstream authors, changed + copyright to Free Software Foundation, Inc. (it has been signed over + to the FSF). + + -- Timshel Knoll Sun, 7 Jan 2001 18:39:59 +1100 + +parted (1.4.4-1) unstable; urgency=low + + * New upstream release + + -- Timshel Knoll Sun, 3 Dec 2000 18:58:28 +1100 + +parted (1.4.3-1) unstable; urgency=low + + * New upstream release + + -- Timshel Knoll Tue, 28 Nov 2000 11:05:45 +1100 + +parted (1.4.2-1) unstable; urgency=low + + * New upstream release + * Removed empty NEWS file from parted-doc - fixes lintian warning. + * Changed all calls to dh_testversion in debian/rules to version 2. + * Modified debian/rules to not call dh_makeshlibs for arch-independent + parted-doc package. + + -- Timshel Knoll Wed, 22 Nov 2000 01:16:52 +1100 + +parted (1.4.0-1) unstable; urgency=low + + * New upstream release + * Renamed libparted0 to libparted1, and libparted0-dev to libparted1-dev. + * Changed shlibs to depend on 'libparted1 (>= 1.4.0)' rather than + 'libparted1 (= ${Source-Version})'. + * Made libparted1 Conflicts: libparted0 Replaces: libparted0 (since both + have their NLS messages in /usr/share/locale/*/LC_MESSAGES/parted.mo) - + I must find some way to work around this!!! + + -- Timshel Knoll Sun, 19 Nov 2000 22:52:57 +1100 + +parted (1.2.13-1) unstable; urgency=low + + * New upstream release + + -- Timshel Knoll Mon, 13 Nov 2000 09:49:54 +1100 + +parted (1.2.12-1) unstable; urgency=low + + * New upstream release + * Changed build system to use DH_COMPAT=2, so the 'parted' package now + builds in the debian/parted directory. This included moving the 'dirs' + file to 'parted.dirs', and 'docs' to 'parted.docs', amongst other things. + + -- Timshel Knoll Sun, 5 Nov 2000 14:59:25 +1100 + +parted (1.2.11-1) unstable; urgency=low + + * New upstream release + * Moved parted.m4 (in /usr/share/aclocal) from parted to libparted0-dev. + * Moved all locales (from /usr/share/locales) from parted to libparted0. + This is the right behavior since most of the messages are for libparted, + I have asked the author if it is possible to split parted and libparted + locales ... + * Made libparted0 and libparted0-dev Conflict: parted (<< 1.2.11) to + avoid dpkg needing --force-overwrite ... + * Added -D_REENTRANT to CFLAGS in libparted/Makefile.am - to conform + to policy 3.2.1. + * Policy 3.2.1 + + -- Timshel Knoll Wed, 18 Oct 2000 12:59:48 +1100 + +parted (1.2.10-1) unstable; urgency=low + + * New upstream release + + -- Timshel Knoll Sun, 15 Oct 2000 23:24:15 +1100 + +parted (1.2.9-1) unstable; urgency=low + + * New upstream release + + -- Timshel Knoll Tue, 12 Sep 2000 22:41:38 +1100 + +parted (1.2.8-2) unstable; urgency=low + + * debian/docs: debian/libparted0.docs: debian/libparted0-dev.docs: + Removed all documentation from packages other than parted-doc. All + packages have changelog and copyright, however (as per Debian + policy) + + -- Timshel Knoll Wed, 30 Aug 2000 20:01:15 +1100 + +parted (1.2.8-1) unstable; urgency=low + + * New upstream release + * Changed Build-Depends on libuuid-dev to uuid-dev (closes: Bug#69536) + + -- Timshel Knoll Tue, 22 Aug 2000 21:27:59 +1000 + +parted (1.2.7-1) unstable; urgency=low + + * New upstream release + + -- Timshel Knoll Sun, 13 Aug 2000 13:33:42 +1000 + +parted (1.2.6-1) unstable; urgency=low + + * New upstream release + * Shared libs in libparted0 now install to /lib (otherwise it's pointless + having the parted executable in /sbin ...) + * Now building shlibs with `libparted 0 libparted0 (= ${Source-Version})' + rather than >= ... This is because the libparted API is still changing + quite regularly. + + -- Timshel Knoll Wed, 2 Aug 2000 21:13:42 +1000 + +parted (1.2.5-1) unstable; urgency=low + + * New upstream release + + -- Timshel Knoll Thu, 20 Jul 2000 09:49:29 +1000 + +parted (1.2.3-1) unstable; urgency=low + + * New upstream release + + -- Timshel Knoll Wed, 28 Jun 2000 21:04:42 +1000 + +parted (1.2.1-2) unstable; urgency=low + + * Removed parted-doc Recommends: parted, and got rid of versions + from Suggests: parted, libparted0, libparted0-dev + * Changed description of libparted0-dev for consistency + (the word 'disk' was missing) + + -- Timshel Knoll Thu, 15 Jun 2000 13:25:56 +1000 + +parted (1.2.1-1) unstable; urgency=low + + * New upstream release + * The last release (1.2.0) didn't build on systems without libparted-dev + or libparted0-dev already installed, fixed in this version. + * Maintainer email addresses updated to `timshel@debian.org' + * debian/README.Debian updated to remove stuff about why shared libs + won't build (because they can be now) :) + + -- Timshel Knoll Thu, 15 Jun 2000 12:57:29 +1000 + +parted (1.2.0-1) unstable; urgency=low + + * New upstream release + * Merged a whole heap of changes from my locally built series of 1.1.x + packages, listed below: + * Can now build shared libraries. Split off package libparted0 which + contains the shared libraries. + * Renamed libparted-dev to libparted0-dev. This still Provides: libparted-dev + however. + + -- Timshel Knoll Thu, 15 Jun 2000 02:24:05 +1000 + +parted (1.0.17-2) unstable; urgency=low + + * Rebuild to get rid of config.log junk in the .diff.gz (hmmm ... must've + killed ./configure ... dammit) + * Split docs off into new, separate package (parted-doc) + * libparted-dev now Suggests: parted + + -- Timshel Knoll Tue, 13 Jun 2000 01:34:34 +1000 + +parted (1.0.17-1) unstable; urgency=low + + * New upstream release + * parted executable moved from /usr/sbin to /sbin + * "Section: " in debian/control changed for both 'parted' source & + 'parted' binary packages from 'utils' to 'admin' (admin is more suitable) + * "Architecture: any" for both packages, (was 'i386 alpha'), so + packages will now be built for other arches (for resizing old DOS + drives, as parted currently only support DOS partition tables) + + -- Timshel Knoll Mon, 12 Jun 2000 15:41:48 +1000 + +parted (1.0.15-1) unstable; urgency=low + + * New upstream release + + -- Timshel Knoll Fri, 12 May 2000 19:08:52 +1000 + +parted (1.0.14-1) unstable; urgency=low + + * New upstream release + * Updated debian/README.Debian with current parted shared libs status ... + + -- Timshel Knoll Sun, 16 Apr 2000 16:46:47 +1000 + +parted (1.0.13-1) frozen unstable; urgency=low + + * New upstream release + * This needs to go into frozen because it fixes a release critical bug: + * Fixed a severe bug which can cause massive data loss when converting + between FAT16 and FAT32 (closes: #62029). + * dh_testversion (in debian/rules) and Build-depends debhelper version + updated to 1.2.9 for dh_link ... + * Fixed typo in debian/control: Build-Depends: liuuid-dev -> libuuid-dev :) + * Policy 3.1.1 + + -- Timshel Knoll Tue, 11 Apr 2000 17:44:42 +1000 + +parted (1.0.12-1) unstable; urgency=low + + * New upstream release + * libparted-dev.docs updated to reflect movement of API docs to doc/ + * Updated to Standards-Version 3.1.0 (with Build-Depends) + + -- Timshel Knoll Tue, 28 Mar 2000 20:07:51 +1000 + +parted (1.0.10-1) unstable; urgency=low + + * New upstream release + * libparted-dev moved from libs to devel section + + -- Timshel Knoll Fri, 3 Mar 2000 09:59:32 +1100 + +parted (1.0.9-1) frozen unstable; urgency=low + + * New upstream release (closes: Bug#58301) + + -- Timshel Knoll Thu, 17 Feb 2000 21:28:53 +1100 + +parted (1.0.7-1) frozen unstable; urgency=low + + * New upstream release (closes: Bug#55871, parted fails on disks >16Gb) + * Manpage moved to upstream sources + + -- Timshel Knoll Tue, 25 Jan 2000 23:29:56 +1100 + +parted (1.0.5-1) frozen unstable; urgency=low + + * New upstream release (closes: Bug#55613) + * Added Conflicts: fsresize and Replaces: fsresize (closes: Bug#54110) + * Updates to manpage, parted(8) + + -- Timshel Knoll Wed, 19 Jan 2000 13:28:53 +1100 + +parted (1.0.4-1) unstable; urgency=low + + * New upstream release + + -- Timshel Knoll Wed, 5 Jan 2000 17:23:57 +1100 + +parted (1.0.2-1) unstable; urgency=low + + * New upstream release + * Updated debian/copyright with date/time last updated + * Updated package descripion and README.Debian warnings + + -- Timshel Knoll Mon, 3 Jan 2000 13:30:02 +1100 + +parted (1.0pre8-1.1) unstable; urgency=low + + * Sponsor upload. + * Recompiled against libreadline2g as libreadline4 is not yet in + potato. (closes: Bug#52205) + + -- Torsten Landschoff Sun, 19 Dec 1999 12:05:41 +0100 + +parted (1.0pre8-1) unstable; urgency=low + + * New upstream release + + -- Timshel Knoll Mon, 15 Nov 1999 22:40:06 +1100 + +parted (1.0pre7-2) unstable; urgency=low + + * Copyright message and Authors updated + * Updated package description, descriptions are now more consistant + * Added warning about software being unstable to package description + * Changed libparted-dev to Section: devel + * Removed debian/dirs (not required) + * Manpage parted.8 is now only installed in the parted package + + -- Timshel Knoll Sun, 14 Nov 1999 23:29:01 +1100 + +parted (1.0pre7-1) unstable; urgency=low + + * New upstream release + + -- Timshel Knoll Tue, 9 Nov 1999 13:52:14 +1100 + +parted (1.0pre4-2) unstable; urgency=low + + * Package split into parted and libparted-dev + + -- Timshel Knoll Mon, 8 Nov 1999 18:41:28 +1100 + +parted (1.0pre4-1) unstable; urgency=low + + * Initial Release. + + -- Timshel Knoll Fri, 5 Nov 1999 18:11:28 +1100 + +Local variables: +mode: debian-changelog +End: --- parted-1.4.24.orig/debian/control.in +++ parted-1.4.24/debian/control.in @@ -0,0 +1,223 @@ +Source: parted +Section: admin +Priority: optional +Maintainer: Timshel Knoll +Standards-Version: 3.5.4 +Build-Depends: debhelper (>= 3.0.0), libncurses-dev | libncurses5-dev, libreadline-dev, uuid-dev, gettext + +Package: parted +Architecture: any +Section: admin +Depends: ${shlibs:Depends} +Suggests: parted-doc +Conflicts: fsresize +Replaces: fsresize +Description: The GNU Parted disk partition resizing program + GNU Parted is a program that allows you to create, destroy, + resize, move and copy hard disk partitions. This is useful + for creating space for new operating systems, reorganising + disk usage, and copying data to new hard disks. + . + This package contains the Parted binary and manual page. + . + Parted currently supports DOS, Mac, Sun, BSD, GPT and PC98 + disklabels/partition tables, as well as a 'loop' (raw disk) + type which allows use on RAID/LVM. Filesystems supported are + ext2, ext3, FAT (FAT16 and FAT32) and linux-swap. Parted can + also detect HFS (Mac OS), JFS, NTFS, ReiserFS, UFS and XFS + filesystems, but cannot create/remove/resize/check these + filesystems yet. + . + The nature of this software means that any bugs could cause + massive data loss. While there are no known bugs at the moment, + they could exist, so please back up all important files before + running it, and do so at your own risk. + +Package: parted-bf +Architecture: any +Section: admin +Priority: extra +Depends: ${shlibs:Depends} +Suggests: parted-doc +Conflicts: fsresize, parted +Replaces: fsresize +Provides: parted +Description: The GNU Parted disk partition resizing program, small version + GNU Parted is a program that allows you to create, destroy, + resize, move and copy hard disk partitions. This is useful + for creating space for new operating systems, reorganising + disk usage, and copying data to new hard disks. + . + This package is similar to the "big" parted package, but has + less cosmetic features resulting in smaller binary. Intended + to be used on boot floppies. + . + Parted currently supports DOS, Mac, Sun, BSD, GPT and PC98 + disklabels/partition tables, as well as a 'loop' (raw disk) + type which allows use on RAID/LVM. Filesystems supported are + ext2, ext3, fat (FAT16 and FAT32) and linux-swap. Parted can + also detect HFS (Mac OS), JFS, NTFS, ReiserFS, UFS and XFS + filesystems, but cannot create/remove/resize/check these + filesystems yet. + . + The nature of this software means that any bugs could cause + massive data loss. While there are no known bugs at the moment, + they could exist, so please back up all important files before + running it, and do so at your own risk. + +Package: libparted@LIBPKGVER@ +Architecture: any +Section: libs +Depends: ${shlibs:Depends} +Suggests: libparted@LIBPKGVER@-dev +Conflicts: parted (<< 1.4.13+14pre1), libparted0, libparted1, libparted2 +Replaces: libparted0, libparted1, libparted2 +Provides: libparted +Description: The GNU Parted disk partitioning library, shared libraries. + GNU Parted is a program that allows you to create, destroy, + resize, move and copy hard disk partitions. This is useful + for creating space for new operating systems, reorganising + disk usage, and copying data to new hard disks. + . + This package contains libparted, the required shared library + used by Parted. + . + Parted currently supports DOS, Mac, Sun, BSD, GPT and PC98 + disklabels/partition tables, as well as a 'loop' (raw disk) + type which allows use on RAID/LVM. Filesystems supported are + ext2, ext3, fat (FAT16 and FAT32) and linux-swap. Parted can + also detect HFS (Mac OS), JFS, NTFS, ReiserFS, UFS and XFS + filesystems, but cannot create/remove/resize/check these + filesystems yet. + . + Please note that libparted@LIBPKGVER@ packages are actually + newer than the libparted2 packages. I have re-numbered the + packages because of problems with new, incompatible versions + of libparted being released, and also to create more + consistency of version numbers across the package. See + README.Debian for more details. + . + The nature of this software means that any bugs could cause + massive data loss. While there are no known bugs at the moment, + they could exist, so please back up all important files before + running it, and do so at your own risk. + +Package: libparted@LIBPKGVER@-i18n +Architecture: all +Section: libs +Depends: libparted@LIBPKGVER@ +Replaces: libparted0, libparted1, libparted2, libparted1.4 (<< 1.4.24-2), parted (<< 1.4.13+14pre1), +Conflicts: libparted-i18n +Provides: libparted-i18n +Description: The GNU Parted disk partitioning library, i18n support + GNU Parted is a program that allows you to create, destroy, + resize, move and copy hard disk partitions. This is useful + for creating space for new operating systems, reorganising + disk usage, and copying data to new hard disks. + . + This package contains the i18n message catalogs for both + libparted and the parted executable. + . + Parted currently supports DOS, Mac, Sun, BSD, GPT and PC98 + disklabels/partition tables, as well as a 'loop' (raw disk) + type which allows use on RAID/LVM. Filesystems supported are + ext2, ext3, fat (FAT16 and FAT32) and linux-swap. Parted can + also detect HFS (Mac OS), JFS, NTFS, ReiserFS, UFS and XFS + filesystems, but cannot create/remove/resize/check these + filesystems yet. + . + Please note that libparted@LIBPKGVER@ packages are actually + newer than the libparted2 packages. I have re-numbered the + packages because of problems with new, incompatible versions + of libparted being released, and also to create more + consistency of version numbers across the package. See + README.Debian for more details. + . + The nature of this software means that any bugs could cause + massive data loss. While there are no known bugs at the moment, + they could exist, so please back up all important files before + running it, and do so at your own risk. + +Package: libparted@LIBPKGVER@-dev +Architecture: any +Section: devel +Depends: libc6-dev, libparted@LIBPKGVER@ (= ${Source-Version}) +Suggests: parted (= ${Source-Version}), parted-doc +Conflicts: libparted-dev, parted (<< 1.2.11) +Replaces: libparted0-dev, libparted1-dev, libparted2-dev +Provides: libparted-dev +Description: The GNU Parted disk partitioning library, development files + GNU Parted is a program that allows you to create, destroy, + resize, move and copy hard disk partitions. This is useful + for creating space for new operating systems, reorganising + disk usage, and copying data to new hard disks. + . + This package contains the static library and header files + for libparted, which are really only of interest to parted + developers. + . + Parted currently supports DOS, Mac, Sun, BSD, GPT and PC98 + disklabels/partition tables, as well as a 'loop' (raw disk) + type which allows use on RAID/LVM. Filesystems supported are + ext2, ext3, fat (FAT16 and FAT32) and linux-swap. Parted can + also detect HFS (Mac OS), JFS, NTFS, ReiserFS, UFS and XFS + filesystems, but cannot create/remove/resize/check these + filesystems yet. + . + Please note that libparted@LIBPKGVER@ packages are actually + newer than the libparted2 packages. I have re-numbered the + packages because of problems with new, incompatible versions + of libparted being released, and also to create more + consistency of version numbers across the package. See + README.Debian for more details. + . + The nature of this software means that any bugs could cause + massive data loss. While there are no known bugs at the moment, + they could exist, so please back up all important files before + running it, and do so at your own risk. + +Package: libparted@LIBPKGVER@-dbg +Architecture: any +Section: devel +Priority: extra +Depends: libparted@LIBPKGVER@ (= ${Source-Version}), libparted@LIBPKGVER@-dev (= ${Source-Version}) +Conflicts: libparted-dbg +Provides: libparted-dbg +Description: The GNU Parted disk partitioning library, development files + GNU Parted is a program that allows you to create, destroy, + resize, move and copy hard disk partitions. This is useful + for creating space for new operating systems, reorganising + disk usage, and copying data to new hard disks. + . + This package contains the debugging static library for + libparted, which are really only of interest to parted + developers who need to debug their programs. + . + The debugging libraries are installed as /usr/lib/libparted_g.a + Link specifically with them if you want to debug. + . + Parted currently supports DOS, Mac, Sun, BSD, GPT and PC98 + disklabels/partition tables, as well as a 'loop' (raw disk) + type which allows use on RAID/LVM. Filesystems supported are + ext2, ext3, fat (FAT16 and FAT32) and linux-swap. Parted can + also detect HFS (Mac OS), JFS, NTFS, ReiserFS, UFS and XFS + filesystems, but cannot create/remove/resize/check these + filesystems yet. + . + The nature of this software means that any bugs could cause + massive data loss. While there are no known bugs at the moment, + they could exist, so please back up all important files before + running it, and do so at your own risk. + +Package: parted-doc +Architecture: all +Section: doc +Suggests: parted | libparted@LIBPKGVER@-dev +Description: The GNU Parted disk partition resizing program documentation + GNU Parted is a program that allows you to create, destroy, + resize, move and copy hard disk partitions. This is useful + for creating space for new operating systems, reorganising + disk usage, and copying data to new hard disks. This package + contains user documentation for parted (for the 'parted' + package) and API documentation for libparted (for the + 'libparted@LIBPKGVER@' and 'libparted@LIBPKGVER@-dev' packages). --- parted-1.4.24.orig/debian/copyright +++ parted-1.4.24/debian/copyright @@ -0,0 +1,32 @@ +This package was debianized by Timshel Knoll on +Fri, 5 Nov 1999 18:11:28 +1100. + +It was downloaded from ftp://ftp.gnu.org/gnu/parted/ + +Upstream Authors: Andrew Clausen + Lennert Buytanhek + Matthew Wilson + +Copyright: + + Copyright (C) 1998, 1999, 2000, 2001, 2002 + Free Software Foundation, Inc. + + 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 2 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. + + -- Timshel Knoll Wed, 27 Feb 2002 11:40:08 +1100 --- parted-1.4.24.orig/debian/libparted-dev.files +++ parted-1.4.24/debian/libparted-dev.files @@ -0,0 +1,5 @@ +usr/lib/libparted.a +usr/lib/libparted.la +usr/lib/libparted.so +usr/include +usr/share/aclocal/parted.m4 --- parted-1.4.24.orig/debian/libparted-i18n.files +++ parted-1.4.24/debian/libparted-i18n.files @@ -0,0 +1 @@ +usr/share/locale --- parted-1.4.24.orig/debian/libparted.files +++ parted-1.4.24/debian/libparted.files @@ -0,0 +1 @@ +lib/libparted*.so.* --- parted-1.4.24.orig/debian/parted-bf.manpages +++ parted-1.4.24/debian/parted-bf.manpages @@ -0,0 +1 @@ +doc/parted.8 --- parted-1.4.24.orig/debian/parted-doc.docs +++ parted-1.4.24/debian/parted-doc.docs @@ -0,0 +1,8 @@ +AUTHORS +README +TODO +doc/API +doc/FAQ +doc/FAT +doc/USER +doc/USER.jp --- parted-1.4.24.orig/debian/parted.files +++ parted-1.4.24/debian/parted.files @@ -0,0 +1,2 @@ +sbin/parted +usr/share/man/man8/parted.8 --- parted-1.4.24.orig/debian/rules +++ parted-1.4.24/debian/rules @@ -0,0 +1,330 @@ +#!/usr/bin/make -f +# GNU Parted debian/rules +# +# This file is used by dpkg-buildpackage to build the parted packages. +# To build a package, run `dpkg-buildpackage' or `debuild' from the +# parent directory. (You may need to specify `-rfakeroot' to +# dpkg-buildpackage if you are not running it as root ...) +# +# $Id: rules,v 1.57 2002/03/07 13:20:08 timshel Exp $ +# +# Copyright (C) 1999, 2000, 2001 Timshel Knoll +# Licensed under the terms of the GNU General Public License +# +# Based on parted's debian/rules, which in turn is based on +# `Sample debian/rules that uses debhelper', from dh_make, +# GNU Copyright (C) 1997 to 1999 by Joey Hess + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# This is the debhelper compatability version to use. +export DH_COMPAT=3 + +# This has to be exported to make some magic below work. +export DH_OPTIONS + +# The library package version, ie. version 0.2 will build package +# lib$(LIBRARY)0.2, lib$(LIBRARY)0.2-dev etc. +# When incrementing this because of a new library SONAME, add an 'a' to the +# end if there isn't already one, otherwise increment the letter that is +# already there. +# When incrementing this, also set DEPVER to the current package version. +LIBPKGVER = 1.4 + +# The first version of the package to build with the current LIBPKGVER +# This should be changed to the current version when LIBPKGVER is changed ... +DEPVER = 1.4.13+14pre1 + +# This is the library's soname. The build will fail if this is wrong, since +# if the soname has changed we need to update stuff ... +LIBSONAME = 14 + +# The list of sed substitutions we need to do when generating files ... +# if you put `x' in here somewhere, the substitution `s/@x@/$(x)/' +# will be done ... +SUBSTS = LIBPKGVER DEPVER LIBSONAME + +# Files which are generated by this script ... +# You will probably need to change this depending on what files your package +# needs ... +GENFILES = debian/control \ + debian/libparted$(LIBPKGVER).files \ + debian/libparted$(LIBPKGVER)-dev.files \ + debian/libparted$(LIBPKGVER)-i18n.files + + +DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) + +CFLAGS = + +ifeq (, $(findstring noopt, $(DEB_BUILD_OPTIONS))) +OPT_CFLAGS = -O2 +endif + +ifneq (, $(findstring debug, $(DEB_BUILD_OPTIONS))) +DBG_CFLAGS = -g +endif + +CFLAGS = $(OPT_CFLAGS) $(DBG_CFLAGS) + +# This is a workaround for a m68k compiler bug ... +ifeq (m68k, $(DEB_BUILD_ARCH)) + CONFFLAGS += --disable-Werror +else +ifeq (s390, $(DEB_BUILD_ARCH)) + CONFFLAGS += --disable-Werror +endif +endif + +# This builds a substitution list for sed based on the SUBSTS variable +# and the variables whose names SUBSTS contains ... +SUBSTLIST = $(foreach subst, $(SUBSTS), s/@$(subst)@/$($(subst))/g;) + +# Pattern rules: + +# How to generate various files ... +debian/%: debian/%.in debian/rules + sed -e '$(SUBSTLIST)' < $< > $@ + +# This puts the libparted* packaging files in their right places +debian/libparted$(LIBPKGVER)%: debian/libparted% + cp $< $@ + +packaging-files: $(GENFILES) + +# by default, just build ... +default: build + +configure: packaging-files build/configure-stamp +build/configure-stamp: + dh_testdir + [ ! -d build ] && mkdir build || true + +ifneq (, $(findstring debug, $(DEB_BUILD_OPTIONS))) + @echo "warning: option \`debug' in \$$DEB_BUILD_OPTIONS: building with gcc option \`-g'" >&2 +endif + +# Add here commands to configure the package. +# Install the `parted' executable to /sbin ... + cd build && CFLAGS="$(CFLAGS)" ../configure --prefix=/usr \ + --sbindir=/sbin --mandir=\$${prefix}/share/man --enable-shared \ + --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \ + $(CONFFLAGS) + + touch $@ + +configure-bf: build build-bf/configure-stamp +build-bf/configure-stamp: + dh_testdir + [ ! -d build-bf ] && mkdir build-bf || true + +ifneq (, $(findstring debug, $(DEB_BUILD_OPTIONS))) + @echo "warning: option \`debug' in \$$DEB_BUILD_OPTIONS: building with gcc option \`-g'" >&2 +endif + cd build-bf && CFLAGS="$(CFLAGS)" ../configure --prefix=/usr \ + --sbindir=/sbin --mandir=\$${prefix}/share/man --enable-shared \ + --without-readline $(CONFFLAGS) \ + --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) && \ + rm -r libparted && ln -s ../build/libparted . + + touch $@ + +configure-dbg: packaging-files build-dbg/configure-stamp +build-dbg/configure-stamp: + dh_testdir + [ ! -d build-dbg ] && mkdir build-dbg || true + +# Add here commands to configure the package. + cd build-dbg && CFLAGS="-g $(CFLAGS)" ../configure --prefix=/usr \ + --enable-mtrace --disable-shared $(CONFFLAGS) \ + --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) + + touch $@ + +build: packaging-files configure build/build-stamp +build/build-stamp: + dh_testdir + +# Add here commands to compile the package. + $(MAKE) -C build + + touch $@ + +build-bf: packaging-files configure-bf build-bf/build-stamp +build-bf/build-stamp: + dh_testdir + +# Only build binary + $(MAKE) -C build-bf/parted + + touch $@ + +build-dbg: packaging-files configure-dbg build-dbg/build-stamp +build-dbg/build-stamp: + dh_testdir + +# Add here commands to compile the package. +# Don't need to build headers or doco rubbish, just the library ... +# Note: this assumes that the library source code is in the +# libparted directory, change this if it isn't ... + $(MAKE) -C build-dbg/libparted + + touch $@ + +clean: packaging-files + dh_testdir + dh_testroot + +# Add here commands to clean up after the build process + rm -rf build build-bf build-dbg + +# Remove all debian/libparted*.* except for libparted.*, +# libparted-dev.* and libparted$(LIBPKGVER)* + @for file in debian/libparted*; do \ + file="`basename $$file`"; \ + case "$$file" in \ + libparted.*|libparted-dev.*|libparted-i18n.*| \ + libparted$(LIBPKGVER).*|libparted$(LIBPKGVER)-dev.*) \ + ;; \ + *) \ + echo "rm -rf \"debian/$$file\""; \ + rm -rf "debian/$$file" ;; \ + esac; \ + done + + -$(MAKE) distclean + + dh_clean + +install: DH_OPTIONS=-Nparted-bf -Nlibparted$(LIBPKGVER)-dbg +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + $(MAKE) -C build install DESTDIR=$(CURDIR)/debian/tmp + +# We need to do 2 things here: +# 1. Check that $(LIBSONAME) is actually what the library's SONAME is +# 2. Fix the libparted.so symlink to point to /lib/libparted.so.x.x.x +# rather than being relative & pointing to the current directory + @(cd debian/tmp/usr/lib; \ + SONAME=`ls libparted-$(LIBPKGVER).so.*.*.* | \ + sed -e 's/^.*\.so\.\([0-9]\+\)\..*$$/\1/'`; \ + if [ "$(LIBSONAME)" -ne "$$SONAME" ]; then \ + echo " *** error: debian/rules thinks that libparted is" \ + "version $(LIBSONAME)" >&2; \ + echo " *** library is actually version $$SONAME. These should" \ + "be the same." >&2; \ + echo " *** Change the value of LIBSONAME to $$SONAME in" \ + "debian/rules, and" >&2; \ + echo " *** while you're there, bump the value of LIBPKGVER and" \ + "also set"; \ + echo " *** DEPVER to the current version of the package that" \ + "you are building." >&2; \ + exit 1; \ + fi; \ + ln -sf /lib/`ls -l libparted.so | awk '{ print $$11 }'` libparted.so) + +# Make sure the shared libs are in /lib (otherwise there's no point +# installing the executable to /sbin ...) :-) + mkdir -p debian/tmp/lib + mv debian/tmp/usr/lib/*.so.* debian/tmp/lib + + dh_movefiles + +# Remove all empty directories under debian/tmp +# The `sort -r' makes sure that the dir `x/y' is removed before `x' + rmdir --ignore-fail-on-non-empty `find debian/tmp -type d | sort -r` + + @if [ -d debian/tmp ]; then \ + echo " *** WARNING: files exists in debian/tmp after" \ + "dh_movefiles!!!" >&2; \ + echo " *** Maybe the debian/*.files files need updating ..." >&2; \ + fi + +install-bf: DH_OPTIONS=-pparted-bf +install-bf: build-bf + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + $(MAKE) -C build-bf/parted install DESTDIR=$(CURDIR)/debian/parted-bf + +install-dbg: DH_OPTIONS=-plibparted$(LIBPKGVER)-dbg +install-dbg: build-dbg + dh_testdir + dh_testroot + dh_clean -k -plibparted$(LIBPKGVER)-dbg + + install -D -m644 build-dbg/libparted/.libs/libparted.a \ + debian/libparted$(LIBPKGVER)-dbg/usr/lib/libparted_g.a + +# This single target is used to build all the packages, all at once, or +# one at a time. So keep in mind: any options passed to commands here will +# affect _all_ packages. Anything you want to only affect one package +# should be put in another target, such as the install target. +binary-common: + dh_testdir + dh_testroot +# dh_installdebconf + dh_installdocs + dh_installexamples + dh_installmenu +# dh_installemacsen +# dh_installpam +# dh_installinit + dh_installcron + dh_installman + dh_installinfo +# dh_undocumented + dh_installchangelogs ChangeLog + dh_strip + dh_link + dh_compress + dh_fixperms + dh_makeshlibs -V 'libparted$(LIBPKGVER) (>= $(DEPVER))' + dh_installdeb +# dh_perl + dh_shlibdeps -l$(CURDIR)/debian/libparted$(LIBPKGVER)/lib + dh_gencontrol + dh_md5sums + dh_builddeb + +# Build architecture independant packages using the common target. +# Unfortunately, we still need to build since the info file has to be +# re-generated before installation and the locales need to be installed :-( +binary-indep: build install +# (Uncomment this next line if you have such packages.) + $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common + +# Build architecture dependant packages using the common target. +# FIXME: this is an ugly hack :-( Work out a better way to build the +# separate debug package ... +binary-arch: build install + $(MAKE) -f debian/rules DH_OPTIONS="-a -Nlibparted$(LIBPKGVER)-dbg -Nparted-bf" binary-common + $(MAKE) -f debian/rules binary-parted-bf + $(MAKE) -f debian/rules binary-libparted$(LIBPKGVER)-dbg + +# Any other binary targets build just one binary package at a time. +binary-%-dbg: build-dbg install-dbg + $(MAKE) -f debian/rules DH_OPTIONS="-p$*-dbg" binary-common + +binary-%-bf: build-bf install-bf + $(MAKE) -f debian/rules DH_OPTIONS="-p$*-bf" binary-common + +binary-%: build install + $(MAKE) -f debian/rules DH_OPTIONS=-p$* binary-common + +binary: binary-arch binary-indep + +.PHONY: configure configure-bf configure-dbg +.PHONY: build build-bf build-dbg +.PHONY: install install-bf install-dbg +.PHONY: clean binary-indep binary-arch binary +.PHONY: packaging-files --- parted-1.4.24.orig/debian/shlibs.local +++ parted-1.4.24/debian/shlibs.local @@ -0,0 +1 @@ +libparted 14 libparted1.4 (= ${Source-Version}) --- parted-1.4.24.orig/debian/watch +++ parted-1.4.24/debian/watch @@ -0,0 +1,2 @@ +# Site Directory Pattern Version Script +ftp.gnu.org /gnu/parted/ parted-(.*).tar.gz debian uupdate --- parted-1.4.24.orig/debian/control +++ parted-1.4.24/debian/control @@ -0,0 +1,223 @@ +Source: parted +Section: admin +Priority: optional +Maintainer: Timshel Knoll +Standards-Version: 3.5.4 +Build-Depends: debhelper (>= 3.0.0), libncurses-dev | libncurses5-dev, libreadline-dev, uuid-dev, gettext + +Package: parted +Architecture: any +Section: admin +Depends: ${shlibs:Depends} +Suggests: parted-doc +Conflicts: fsresize +Replaces: fsresize +Description: The GNU Parted disk partition resizing program + GNU Parted is a program that allows you to create, destroy, + resize, move and copy hard disk partitions. This is useful + for creating space for new operating systems, reorganising + disk usage, and copying data to new hard disks. + . + This package contains the Parted binary and manual page. + . + Parted currently supports DOS, Mac, Sun, BSD, GPT and PC98 + disklabels/partition tables, as well as a 'loop' (raw disk) + type which allows use on RAID/LVM. Filesystems supported are + ext2, ext3, FAT (FAT16 and FAT32) and linux-swap. Parted can + also detect HFS (Mac OS), JFS, NTFS, ReiserFS, UFS and XFS + filesystems, but cannot create/remove/resize/check these + filesystems yet. + . + The nature of this software means that any bugs could cause + massive data loss. While there are no known bugs at the moment, + they could exist, so please back up all important files before + running it, and do so at your own risk. + +Package: parted-bf +Architecture: any +Section: admin +Priority: extra +Depends: ${shlibs:Depends} +Suggests: parted-doc +Conflicts: fsresize, parted +Replaces: fsresize +Provides: parted +Description: The GNU Parted disk partition resizing program, small version + GNU Parted is a program that allows you to create, destroy, + resize, move and copy hard disk partitions. This is useful + for creating space for new operating systems, reorganising + disk usage, and copying data to new hard disks. + . + This package is similar to the "big" parted package, but has + less cosmetic features resulting in smaller binary. Intended + to be used on boot floppies. + . + Parted currently supports DOS, Mac, Sun, BSD, GPT and PC98 + disklabels/partition tables, as well as a 'loop' (raw disk) + type which allows use on RAID/LVM. Filesystems supported are + ext2, ext3, fat (FAT16 and FAT32) and linux-swap. Parted can + also detect HFS (Mac OS), JFS, NTFS, ReiserFS, UFS and XFS + filesystems, but cannot create/remove/resize/check these + filesystems yet. + . + The nature of this software means that any bugs could cause + massive data loss. While there are no known bugs at the moment, + they could exist, so please back up all important files before + running it, and do so at your own risk. + +Package: libparted1.4 +Architecture: any +Section: libs +Depends: ${shlibs:Depends} +Suggests: libparted1.4-dev +Conflicts: parted (<< 1.4.13+14pre1), libparted0, libparted1, libparted2 +Replaces: libparted0, libparted1, libparted2 +Provides: libparted +Description: The GNU Parted disk partitioning library, shared libraries. + GNU Parted is a program that allows you to create, destroy, + resize, move and copy hard disk partitions. This is useful + for creating space for new operating systems, reorganising + disk usage, and copying data to new hard disks. + . + This package contains libparted, the required shared library + used by Parted. + . + Parted currently supports DOS, Mac, Sun, BSD, GPT and PC98 + disklabels/partition tables, as well as a 'loop' (raw disk) + type which allows use on RAID/LVM. Filesystems supported are + ext2, ext3, fat (FAT16 and FAT32) and linux-swap. Parted can + also detect HFS (Mac OS), JFS, NTFS, ReiserFS, UFS and XFS + filesystems, but cannot create/remove/resize/check these + filesystems yet. + . + Please note that libparted1.4 packages are actually + newer than the libparted2 packages. I have re-numbered the + packages because of problems with new, incompatible versions + of libparted being released, and also to create more + consistency of version numbers across the package. See + README.Debian for more details. + . + The nature of this software means that any bugs could cause + massive data loss. While there are no known bugs at the moment, + they could exist, so please back up all important files before + running it, and do so at your own risk. + +Package: libparted1.4-i18n +Architecture: all +Section: libs +Depends: libparted1.4 +Replaces: libparted0, libparted1, libparted2, libparted1.4 (<< 1.4.24-2), parted (<< 1.4.13+14pre1), +Conflicts: libparted-i18n +Provides: libparted-i18n +Description: The GNU Parted disk partitioning library, i18n support + GNU Parted is a program that allows you to create, destroy, + resize, move and copy hard disk partitions. This is useful + for creating space for new operating systems, reorganising + disk usage, and copying data to new hard disks. + . + This package contains the i18n message catalogs for both + libparted and the parted executable. + . + Parted currently supports DOS, Mac, Sun, BSD, GPT and PC98 + disklabels/partition tables, as well as a 'loop' (raw disk) + type which allows use on RAID/LVM. Filesystems supported are + ext2, ext3, fat (FAT16 and FAT32) and linux-swap. Parted can + also detect HFS (Mac OS), JFS, NTFS, ReiserFS, UFS and XFS + filesystems, but cannot create/remove/resize/check these + filesystems yet. + . + Please note that libparted1.4 packages are actually + newer than the libparted2 packages. I have re-numbered the + packages because of problems with new, incompatible versions + of libparted being released, and also to create more + consistency of version numbers across the package. See + README.Debian for more details. + . + The nature of this software means that any bugs could cause + massive data loss. While there are no known bugs at the moment, + they could exist, so please back up all important files before + running it, and do so at your own risk. + +Package: libparted1.4-dev +Architecture: any +Section: devel +Depends: libc6-dev, libparted1.4 (= ${Source-Version}) +Suggests: parted (= ${Source-Version}), parted-doc +Conflicts: libparted-dev, parted (<< 1.2.11) +Replaces: libparted0-dev, libparted1-dev, libparted2-dev +Provides: libparted-dev +Description: The GNU Parted disk partitioning library, development files + GNU Parted is a program that allows you to create, destroy, + resize, move and copy hard disk partitions. This is useful + for creating space for new operating systems, reorganising + disk usage, and copying data to new hard disks. + . + This package contains the static library and header files + for libparted, which are really only of interest to parted + developers. + . + Parted currently supports DOS, Mac, Sun, BSD, GPT and PC98 + disklabels/partition tables, as well as a 'loop' (raw disk) + type which allows use on RAID/LVM. Filesystems supported are + ext2, ext3, fat (FAT16 and FAT32) and linux-swap. Parted can + also detect HFS (Mac OS), JFS, NTFS, ReiserFS, UFS and XFS + filesystems, but cannot create/remove/resize/check these + filesystems yet. + . + Please note that libparted1.4 packages are actually + newer than the libparted2 packages. I have re-numbered the + packages because of problems with new, incompatible versions + of libparted being released, and also to create more + consistency of version numbers across the package. See + README.Debian for more details. + . + The nature of this software means that any bugs could cause + massive data loss. While there are no known bugs at the moment, + they could exist, so please back up all important files before + running it, and do so at your own risk. + +Package: libparted1.4-dbg +Architecture: any +Section: devel +Priority: extra +Depends: libparted1.4 (= ${Source-Version}), libparted1.4-dev (= ${Source-Version}) +Conflicts: libparted-dbg +Provides: libparted-dbg +Description: The GNU Parted disk partitioning library, development files + GNU Parted is a program that allows you to create, destroy, + resize, move and copy hard disk partitions. This is useful + for creating space for new operating systems, reorganising + disk usage, and copying data to new hard disks. + . + This package contains the debugging static library for + libparted, which are really only of interest to parted + developers who need to debug their programs. + . + The debugging libraries are installed as /usr/lib/libparted_g.a + Link specifically with them if you want to debug. + . + Parted currently supports DOS, Mac, Sun, BSD, GPT and PC98 + disklabels/partition tables, as well as a 'loop' (raw disk) + type which allows use on RAID/LVM. Filesystems supported are + ext2, ext3, fat (FAT16 and FAT32) and linux-swap. Parted can + also detect HFS (Mac OS), JFS, NTFS, ReiserFS, UFS and XFS + filesystems, but cannot create/remove/resize/check these + filesystems yet. + . + The nature of this software means that any bugs could cause + massive data loss. While there are no known bugs at the moment, + they could exist, so please back up all important files before + running it, and do so at your own risk. + +Package: parted-doc +Architecture: all +Section: doc +Suggests: parted | libparted1.4-dev +Description: The GNU Parted disk partition resizing program documentation + GNU Parted is a program that allows you to create, destroy, + resize, move and copy hard disk partitions. This is useful + for creating space for new operating systems, reorganising + disk usage, and copying data to new hard disks. This package + contains user documentation for parted (for the 'parted' + package) and API documentation for libparted (for the + 'libparted1.4' and 'libparted1.4-dev' packages). --- parted-1.4.24.orig/debian/libparted1.4.files +++ parted-1.4.24/debian/libparted1.4.files @@ -0,0 +1 @@ +lib/libparted*.so.* --- parted-1.4.24.orig/debian/libparted1.4-dev.files +++ parted-1.4.24/debian/libparted1.4-dev.files @@ -0,0 +1,5 @@ +usr/lib/libparted.a +usr/lib/libparted.la +usr/lib/libparted.so +usr/include +usr/share/aclocal/parted.m4 --- parted-1.4.24.orig/doc/API +++ parted-1.4.24/doc/API @@ -547,7 +547,8 @@ PED_PARTITION_HIDDEN=4, PED_PARTITION_RAID=5, PED_PARTITION_LVM=6, - PED_PARTITION_LBA=7 + PED_PARTITION_HPSERVICE=7, + PED_PARTITION_LBA=8 } PedPartitionFlag; #define PED_PARTITION_FIRST_FLAG PED_PARTITION_BOOT #define PED_PARTITION_LAST_FLAG PED_PARTITION_LBA --- parted-1.4.24.orig/doc/USER +++ parted-1.4.24/doc/USER @@ -339,7 +339,7 @@ select DEVICE choose the device to edit set MINOR FLAG STATE change a flag on partition MINOR -FLAG is one of: boot, root, swap, hidden, raid, lvm, lba +FLAG is one of: boot, root, swap, hidden, raid, lvm, lba, hp-service FS-TYPE is one of: ext2, FAT, hfs, linux-swap, ntfs, reiserfs --- parted-1.4.24.orig/doc/parted.8 +++ parted-1.4.24/doc/parted.8 @@ -102,7 +102,8 @@ .TP .B set \fIpartition\fP \fIflag\fP \fIstate\fP change the state of the \fIflag\fP on \fIpartition\fP to \fIstate\fP. Flags -supported are: "boot", "root", "swap", "hidden", "raid", "lvm" and "lba". +supported are: "boot", "root", "swap", "hidden", "raid", "lvm", "lba" and +"hp-service". \fIstate\fP should be either "on" or "off" .RS .SH REPORTING BUGS --- parted-1.4.24.orig/include/parted/disk.h +++ parted-1.4.24/include/parted/disk.h @@ -52,7 +52,8 @@ PED_PARTITION_HIDDEN=4, PED_PARTITION_RAID=5, PED_PARTITION_LVM=6, - PED_PARTITION_LBA=7 + PED_PARTITION_HPSERVICE=7, + PED_PARTITION_LBA=8 } PedPartitionFlag; #define PED_PARTITION_FIRST_FLAG PED_PARTITION_BOOT #define PED_PARTITION_LAST_FLAG PED_PARTITION_LBA --- parted-1.4.24.orig/include/parted/disk_gpt.h +++ parted-1.4.24/include/parted/disk_gpt.h @@ -42,35 +42,47 @@ typedef uint16_t efi_char16_t; /* UNICODE character */ +/* This is a struct so code can do "blah->foo = PARTITION_SYSTEM_GUID;" */ typedef struct { - uint32_t time_low; - uint16_t time_mid; - uint16_t time_hi_and_version; - uint8_t clock_seq_hi_and_reserved; - uint8_t clock_seq_low; - uint8_t node[6]; -} __attribute__ ((packed)) efi_guid_t; - + uint8_t guid[16]; +} efi_guid_t; +/* A GUID is treated as a little-endian string, except when calling + * libuuid functions, when we swap it. + */ +#define EFI_GUID(a,b,c,b0,b1,b2,b3,b4,b5,b6,b7) (efi_guid_t) \ +{{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \ + (b) & 0xff, ((b) >> 8) & 0xff, \ + (c) & 0xff, ((c) >> 8) & 0xff, \ + (b0), (b1), (b2), (b3), (b4), (b5), (b6), (b7) \ +}} + #define UNUSED_ENTRY_GUID \ - ((efi_guid_t) { 0x00000000, 0x0000, 0x0000, 0x00, 0x00, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}) + EFI_GUID(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) #define PARTITION_SYSTEM_GUID \ - ((efi_guid_t) { 0xC12A7328, 0xF81F, 0x11d2, 0xBA, 0x4B, { 0x00, 0xA0, 0xC9, 0x3E, 0xC9, 0x3B }}) + EFI_GUID(0xC12A7328, 0xF81F, 0x11d2, 0xBA, 0x4B, 0x00, 0xA0, 0xC9, 0x3E, 0xC9, 0x3B) #define LEGACY_MBR_PARTITION_GUID \ - ((efi_guid_t) { 0x024DEE41, 0x33E7, 0x11d3, 0x9D, 0x69, { 0x00, 0x08, 0xC7, 0x81, 0xF3, 0x9F }}) + EFI_GUID(0x024DEE41, 0x33E7, 0x11d3, 0x9D, 0x69, 0x00, 0x08, 0xC7, 0x81, 0xF3, 0x9F) #define PARTITION_MSFT_RESERVED_GUID \ - ((efi_guid_t) { 0xE3C9E316, 0x0B5C, 0x4DB8, 0x81, 0x7D, { 0xF9, 0x2D, 0xF0, 0x02, 0x15, 0xAE }}) + EFI_GUID(0xE3C9E316, 0x0B5C, 0x4DB8, 0x81, 0x7D, 0xF9, 0x2D, 0xF0, 0x02, 0x15, 0xAE) #define PARTITION_BASIC_DATA_GUID \ - ((efi_guid_t) { 0xEBD0A0A2, 0xB9E5, 0x4433, 0x87, 0xC0, { 0x68, 0xB6, 0xB7, 0x26, 0x99, 0xC7 }}) + EFI_GUID(0xEBD0A0A2, 0xB9E5, 0x4433, 0x87, 0xC0, 0x68, 0xB6, 0xB7, 0x26, 0x99, 0xC7) #define PARTITION_RAID_GUID \ - ((efi_guid_t) { 0xa19d880f, 0x05fc, 0x4d3b, 0xa0, 0x06, { 0x74, 0x3f, 0x0f, 0x84, 0x91, 0x1e }}) + EFI_GUID(0xa19d880f, 0x05fc, 0x4d3b, 0xa0, 0x06, 0x74, 0x3f, 0x0f, 0x84, 0x91, 0x1e) #define PARTITION_SWAP_GUID \ - ((efi_guid_t) { 0x0657fd6d, 0xa4ab, 0x43c4, 0x84, 0xe5, { 0x09, 0x33, 0xc8, 0x4b, 0x4f, 0x4f }}) + EFI_GUID(0x0657fd6d, 0xa4ab, 0x43c4, 0x84, 0xe5, 0x09, 0x33, 0xc8, 0x4b, 0x4f, 0x4f) #define PARTITION_LVM_GUID \ - ((efi_guid_t) { 0xe6d6d379, 0xf507, 0x44c2, 0xa2, 0x3c, { 0x23, 0x8f, 0x2a, 0x3d, 0xf9, 0x28 }}) + EFI_GUID(0xe6d6d379, 0xf507, 0x44c2, 0xa2, 0x3c, 0x23, 0x8f, 0x2a, 0x3d, 0xf9, 0x28) #define PARTITION_RESERVED_GUID \ - ((efi_guid_t) { 0x8da63339, 0x0007, 0x60c0, 0xc4, 0x36, { 0x08, 0x3a, 0xc8, 0x23, 0x09, 0x08 }}) + EFI_GUID(0x8da63339, 0x0007, 0x60c0, 0xc4, 0x36, 0x08, 0x3a, 0xc8, 0x23, 0x09, 0x08) +#define PARTITION_HPSERVICE_GUID \ + EFI_GUID(0xe2a1e728, 0x32e3, 0x11d6, 0xa6, 0x82, 0x7b, 0x03, 0xa0, 0x00, 0x00, 0x00) + +/* NOTE: The following structure is _always_ in little-endian format, + * regardless of local CPU byte-order. This is to simplify CRC calculations + * and checking. + */ typedef struct _GuidPartitionTableHeader_t { uint64_t Signature; uint32_t Revision; @@ -89,18 +101,16 @@ uint8_t Reserved2[GPT_BLOCK_SIZE - 92]; } __attribute__ ((packed)) GuidPartitionTableHeader_t; -typedef struct _GuidPartitionEntryAttributes_t { - uint64_t RequiredToFunction:1; - uint64_t Reserved:47; - uint64_t GuidSpecific:16; -} __attribute__ ((packed)) GuidPartitionEntryAttributes_t; - +/* NOTE: The following structure is _always_ in little-endian format, + * regardless of local CPU byte-order. This is to simplify CRC calculations + * and checking. + */ typedef struct _GuidPartitionEntry_t { efi_guid_t PartitionTypeGuid; efi_guid_t UniquePartitionGuid; uint64_t StartingLBA; uint64_t EndingLBA; - GuidPartitionEntryAttributes_t Attributes; + uint64_t Attributes; efi_char16_t PartitionName[72 / sizeof(efi_char16_t)]; } __attribute__ ((packed)) GuidPartitionEntry_t; --- parted-1.4.24.orig/include/parted/endian.h +++ parted-1.4.24/include/parted/endian.h @@ -63,7 +63,7 @@ #define PED_BE16_TO_CPU(x) (x) #define PED_LE32_TO_CPU(x) PED_SWAP32(x) #define PED_BE32_TO_CPU(x) (x) -#define PED_LE64_TO_CPU(x) PED_SWAP32(x) +#define PED_LE64_TO_CPU(x) PED_SWAP64(x) #define PED_BE64_TO_CPU(x) (x) #else /* !WORDS_BIGENDIAN */ --- parted-1.4.24.orig/libparted/disk.c +++ parted-1.4.24/libparted/disk.c @@ -1809,6 +1809,8 @@ return N_("lvm"); case PED_PARTITION_LBA: return N_("lba"); + case PED_PARTITION_HPSERVICE: + return N_("hp-service"); default: ped_exception_throw ( --- parted-1.4.24.orig/libparted/disk_gpt.c +++ parted-1.4.24/libparted/disk_gpt.c @@ -121,41 +121,35 @@ }; - -static void -gpt_le_guid_to_cpu(efi_guid_t *guid) -{ - guid->time_low = PED_LE32_TO_CPU(guid->time_low); - guid->time_mid = PED_LE16_TO_CPU(guid->time_mid); - guid->time_hi_and_version = PED_LE16_TO_CPU(guid->time_hi_and_version); - /* no need to change clock_seq and node[6]. - They're already arrays of chars */ - return; -} - -static void -gpt_cpu_to_le_guid(efi_guid_t *guid) -{ - guid->time_low = PED_CPU_TO_LE32(guid->time_low); - guid->time_mid = PED_CPU_TO_LE16(guid->time_mid); - guid->time_hi_and_version = PED_CPU_TO_LE16(guid->time_hi_and_version); - /* no need to change clock_seq and node[6]. - They're already arrays of chars */ - return; -} - +/** + * swap_uuid_and_efi_guid() - converts between uuid formats + * @uuid - uuid_t in either format (converts it to the other) + * + * There are two different representations for Globally Unique Identifiers + * (GUIDs or UUIDs). + * + * The RFC specifies a UUID as a string of 16 bytes, essentially + * a big-endian array of char. + * Intel, in their EFI Specification, references the same RFC, but + * then defines a GUID as a structure of little-endian fields. + * Coincidentally, both structures have the same format when unparsed. + * + * When read from disk, EFI GUIDs are in struct of little endian format, + * and need to be converted to and from a uuid_t round calls to libuuid + * functions. + * + * Blame Intel. + */ static void -gpt_le_part_attributes_to_cpu(GuidPartitionEntryAttributes_t *a) +swap_uuid_and_efi_guid(uuid_t uuid) { - uint64_t *b = (uint64_t *)a; - *b = PED_LE64_TO_CPU(*b); -} + uint8_t t, *p = (uint8_t *)uuid; -static void -gpt_cpu_to_le_part_attributes(GuidPartitionEntryAttributes_t *a) -{ - uint64_t *b = (uint64_t *)a; - *b = PED_CPU_TO_LE64(*b); + PED_ASSERT(uuid != NULL, return); + t = p[0]; p[0] = p[3]; p[3] = t; + t = p[1]; p[1] = p[2]; p[2] = t; + t = p[4]; p[4] = p[5]; p[5] = t; + t = p[6]; p[6] = p[7]; p[7] = t; } @@ -183,7 +177,7 @@ { int i, found = 0, signature = 0; PED_ASSERT(mbr != NULL, return 0); - signature = (mbr->Signature == MSDOS_MBR_SIGNATURE); + signature = (PED_LE16_TO_CPU(mbr->Signature) == MSDOS_MBR_SIGNATURE); for (i=0; signature && i<4; i++) { if (mbr->PartitionRecord[i].OSType == EFI_PMBR_OSTYPE_EFI_GPT) { @@ -246,34 +240,22 @@ PED_ASSERT(gpt != NULL, return NULL); ptes = (GuidPartitionEntry_t *) - ped_malloc(gpt->NumberOfPartitionEntries * - gpt->SizeOfPartitionEntry); + ped_malloc(PED_LE32_TO_CPU(gpt->NumberOfPartitionEntries) * + PED_LE32_TO_CPU(gpt->SizeOfPartitionEntry)); PED_ASSERT(ptes != NULL, return NULL); - memset(ptes, 0, gpt->NumberOfPartitionEntries * - gpt->SizeOfPartitionEntry); + memset(ptes, 0, PED_LE32_TO_CPU(gpt->NumberOfPartitionEntries) * + PED_LE32_TO_CPU(gpt->SizeOfPartitionEntry)); - if (!ped_device_read(dev, ptes, gpt->PartitionEntryLBA, - gpt->NumberOfPartitionEntries * - gpt->SizeOfPartitionEntry / dev->sector_size)) { + if (!ped_device_read(dev, ptes, PED_LE64_TO_CPU(gpt->PartitionEntryLBA), + PED_LE32_TO_CPU(gpt->NumberOfPartitionEntries) * + PED_LE32_TO_CPU(gpt->SizeOfPartitionEntry) / dev->sector_size)) { ped_free(ptes); return NULL; } - /* Fixup endianness */ - for (i=0; iNumberOfPartitionEntries; i++) { - gpt_le_guid_to_cpu(&ptes[i].PartitionTypeGuid); - gpt_le_guid_to_cpu(&ptes[i].UniquePartitionGuid); - ptes[i].StartingLBA = PED_LE64_TO_CPU(ptes[i].StartingLBA); - ptes[i].EndingLBA = PED_LE64_TO_CPU(ptes[i].EndingLBA); - gpt_le_part_attributes_to_cpu(&ptes[i].Attributes); - for (j=0; j<(72/sizeof(efi_char16_t)); j++) { - ptes[i].PartitionName[j] = (efi_char16_t)(PED_LE16_TO_CPU((uint16_t)(ptes[i].PartitionName[j]))); - } - } - return ptes; } @@ -296,7 +278,6 @@ GuidPartitionTableHeader_t * gpt, GuidPartitionEntry_t *ptes) { - GuidPartitionEntry_t *new_ptes; unsigned long ptes_size; int rc; unsigned int i, j; @@ -306,34 +287,17 @@ PED_ASSERT(dev != NULL, return NULL); PED_ASSERT(dev->sector_size != 0, return NULL); - ptes_size = gpt->NumberOfPartitionEntries * - gpt->SizeOfPartitionEntry; + ptes_size = PED_LE32_TO_CPU(gpt->NumberOfPartitionEntries) * + PED_LE32_TO_CPU(gpt->SizeOfPartitionEntry); - new_ptes = ped_malloc(ptes_size); - if (!new_ptes) return NULL; - memcpy(new_ptes, ptes, ptes_size); - - /* Fixup endianness */ - for (i=0; iNumberOfPartitionEntries; i++) { - gpt_cpu_to_le_guid(&new_ptes->PartitionTypeGuid); - gpt_cpu_to_le_guid(&new_ptes->UniquePartitionGuid); - new_ptes[i].StartingLBA = PED_CPU_TO_LE64(new_ptes[i].StartingLBA); - new_ptes[i].EndingLBA = PED_CPU_TO_LE64(new_ptes[i].EndingLBA); - gpt_cpu_to_le_part_attributes(&new_ptes[i].Attributes); - - for (j=0; j<(72/sizeof(efi_char16_t)); j++) { - new_ptes[i].PartitionName[j] = (efi_char16_t)(PED_CPU_TO_LE16((uint16_t)(new_ptes[i].PartitionName[j]))); - } - } - - rc = ped_device_write(dev, new_ptes, gpt->PartitionEntryLBA, + rc = ped_device_write(dev, ptes, PED_LE64_TO_CPU(gpt->PartitionEntryLBA), ptes_size / dev->sector_size); - ped_free(new_ptes); if (!rc) return NULL; return ptes; } +#ifdef GPT_DEBUG static void gpt_print_part_entry(GuidPartitionEntry_t * pte, int i) { @@ -347,20 +311,23 @@ } printf("GUID Partition Entry %d:\n", i); memcpy(uuid, &pte->PartitionTypeGuid, sizeof(uuid_t)); + swap_uuid_and_efi_guid(uuid); uuid_unparse(uuid, uuid_buffer); printf("\tPartitionTypeGuid : %s\n", uuid_buffer); memcpy(uuid, &pte->UniquePartitionGuid, sizeof(uuid_t)); + swap_uuid_and_efi_guid(uuid); uuid_unparse(uuid, uuid_buffer); printf("\tUniquePartitionGuid : %s\n", uuid_buffer); - printf("\tStartingLBA : " PRIx64 "\n", pte->StartingLBA); - printf("\tEndingLBA : " PRIx64 "\n", pte->EndingLBA); + printf("\tStartingLBA : %" PRIx64 "\n", PED_LE64_TO_CPU(pte->StartingLBA)); + printf("\tEndingLBA : %" PRIx64 "\n", PED_LE64_TO_CPU(pte->EndingLBA)); printf("\tAttributes : "); printf("\tRequiredToFunction: %x", - pte->Attributes.RequiredToFunction); + PED_LE64_TO_CPU(pte->Attributes) >> 63); printf("\tGuidSpecific: %x\n", - pte->Attributes.GuidSpecific); + PED_LE64_TO_CPU(pte->Attributes) & 0xffff); // printf("\tPartitionName : Unicode string.\n"); + // NOTE: PartitionName is in little-endian order return; } @@ -371,24 +338,27 @@ uuid_t uuid; printf("GUID Partition Table Header\n"); PED_ASSERT(gpt != NULL, return); - printf("Signature : 0x" PRIx64 "\n", gpt->Signature); - printf("Revision : 0x%x\n", gpt->Revision); - printf("HeaderSize : 0x%x\n", gpt->HeaderSize); - printf("HeaderCRC32 : 0x%x\n", gpt->HeaderCRC32); - printf("MyLBA : 0x" PRIx64 "\n", gpt->MyLBA); - printf("AlternateLBA : 0x" PRIx64 "\n", gpt->AlternateLBA); - printf("FirstUsableLBA : 0x" PRIx64 "\n", gpt->FirstUsableLBA); - printf("LastUsableLBA : 0x" PRIx64 "\n", gpt->LastUsableLBA); + printf("Signature : 0x%" PRIx64 "\n", PED_LE64_TO_CPU(gpt->Signature)); + printf("Revision : 0x%x\n", PED_LE32_TO_CPU(gpt->Revision)); + printf("HeaderSize : 0x%x\n", PED_LE32_TO_CPU(gpt->HeaderSize)); + printf("HeaderCRC32 : 0x%x\n", PED_LE32_TO_CPU(gpt->HeaderCRC32)); + printf("MyLBA : 0x%" PRIx64 "\n", PED_LE64_TO_CPU(gpt->MyLBA)); + printf("AlternateLBA : 0x%" PRIx64 "\n", PED_LE64_TO_CPU(gpt->AlternateLBA)); + printf("FirstUsableLBA : 0x%" PRIx64 "\n", PED_LE64_TO_CPU(gpt->FirstUsableLBA)); + printf("LastUsableLBA : 0x%" PRIx64 "\n", PED_LE64_TO_CPU(gpt->LastUsableLBA)); memcpy(uuid, &gpt->DiskGUID, sizeof(uuid_t)); + swap_uuid_and_efi_guid(uuid); uuid_unparse(uuid, uuid_buffer); printf("DiskGUID : %s\n", uuid_buffer); - printf("PartitionEntryLBA : " PRIx64 "\n", gpt->PartitionEntryLBA); + printf("PartitionEntryLBA : %" PRIx64 "\n", PED_LE64_TO_CPU(gpt->PartitionEntryLBA)); printf("NumberOfPartitionEntries : %x\n", - gpt->NumberOfPartitionEntries); - printf("SizeOfPartitionEntry : %x\n", gpt->SizeOfPartitionEntry); + PED_LE32_TO_CPU(gpt->NumberOfPartitionEntries)); + printf("SizeOfPartitionEntry : %x\n", PED_LE32_TO_CPU(gpt->SizeOfPartitionEntry)); printf("PartitionEntryArrayCRC32 : %x\n", - gpt->PartitionEntryArrayCRC32); return; + PED_LE32_TO_CPU(gpt->PartitionEntryArrayCRC32)); + return; } +#endif /************************************************************ @@ -417,24 +387,6 @@ return NULL; } - - /* Fixup endianness */ - gpt->Signature = PED_LE64_TO_CPU(gpt->Signature); - gpt->Revision = PED_LE32_TO_CPU(gpt->Revision); - gpt->HeaderSize = PED_LE32_TO_CPU(gpt->HeaderSize); - gpt->HeaderCRC32 = PED_LE32_TO_CPU(gpt->HeaderCRC32); - gpt->Reserved1 = PED_LE32_TO_CPU(gpt->Reserved1); - gpt->MyLBA = PED_LE64_TO_CPU(gpt->MyLBA); - gpt->AlternateLBA = PED_LE64_TO_CPU(gpt->AlternateLBA); - gpt->FirstUsableLBA = PED_LE64_TO_CPU(gpt->FirstUsableLBA); - gpt->LastUsableLBA = PED_LE64_TO_CPU(gpt->LastUsableLBA); - gpt->PartitionEntryLBA = PED_LE64_TO_CPU(gpt->PartitionEntryLBA); - gpt->NumberOfPartitionEntries = PED_LE32_TO_CPU(gpt->NumberOfPartitionEntries); - gpt->SizeOfPartitionEntry = PED_LE32_TO_CPU(gpt->SizeOfPartitionEntry); - gpt->PartitionEntryArrayCRC32 = PED_LE32_TO_CPU(gpt->PartitionEntryArrayCRC32); - gpt_le_guid_to_cpu(&gpt->DiskGUID); - /* Ignore the reserved bytes */ - return gpt; } @@ -454,34 +406,11 @@ gpt_write_header(PedDevice *dev, GuidPartitionTableHeader_t * gpt) { - GuidPartitionTableHeader_t *new_gpt; int rc; PED_ASSERT(gpt != NULL, return 0); - new_gpt = ped_malloc(sizeof(*gpt)); - if (!new_gpt) return 0; - memcpy(new_gpt, gpt, sizeof(*gpt)); - - /* Fixup endianness */ - new_gpt->Signature = PED_CPU_TO_LE64(gpt->Signature); - new_gpt->Revision = PED_CPU_TO_LE32(gpt->Revision); - new_gpt->HeaderSize = PED_CPU_TO_LE32(gpt->HeaderSize); - new_gpt->HeaderCRC32 = PED_CPU_TO_LE32(gpt->HeaderCRC32); - new_gpt->Reserved1 = PED_CPU_TO_LE32(gpt->Reserved1); - new_gpt->MyLBA = PED_CPU_TO_LE64(gpt->MyLBA); - new_gpt->AlternateLBA = PED_CPU_TO_LE64(gpt->AlternateLBA); - new_gpt->FirstUsableLBA = PED_CPU_TO_LE64(gpt->FirstUsableLBA); - new_gpt->LastUsableLBA = PED_CPU_TO_LE64(gpt->LastUsableLBA); - new_gpt->PartitionEntryLBA = PED_CPU_TO_LE64(gpt->PartitionEntryLBA); - new_gpt->NumberOfPartitionEntries = PED_CPU_TO_LE32(gpt->NumberOfPartitionEntries); - new_gpt->SizeOfPartitionEntry = PED_CPU_TO_LE32(gpt->SizeOfPartitionEntry); - new_gpt->PartitionEntryArrayCRC32 = PED_CPU_TO_LE32(gpt->PartitionEntryArrayCRC32); - gpt_cpu_to_le_guid(&new_gpt->DiskGUID); - /* Ignore the reserved bytes */ - - rc = ped_device_write(dev, new_gpt, gpt->MyLBA, GPT_HEADER_SECTORS); - ped_free(new_gpt); + rc = ped_device_write(dev, gpt, PED_LE64_TO_CPU(gpt->MyLBA), GPT_HEADER_SECTORS); return rc; } @@ -513,39 +442,39 @@ if (!(*gpt = gpt_read_header(dev, lba))) return 0; /* Check the GUID Partition Table Signature */ - if ((*gpt)->Signature != GPT_HEADER_SIGNATURE) { + if (PED_LE64_TO_CPU((*gpt)->Signature) != GPT_HEADER_SIGNATURE) { ped_exception_throw ( PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL, _("GUID Partition Table Header Signature is wrong: " - "" PRIx64 " should be " PRIx64 ""), - (*gpt)->Signature, GPT_HEADER_SIGNATURE); + "%" PRIx64 " should be %" PRIx64 ""), + PED_LE64_TO_CPU((*gpt)->Signature), GPT_HEADER_SIGNATURE); goto error_free_gpt; } /* Check the GUID Partition Table Header CRC */ - origcrc = (*gpt)->HeaderCRC32; + origcrc = PED_LE32_TO_CPU((*gpt)->HeaderCRC32); (*gpt)->HeaderCRC32 = 0; - crc = efi_crc32(*gpt, (*gpt)->HeaderSize); + crc = efi_crc32(*gpt, PED_LE32_TO_CPU((*gpt)->HeaderSize)); if (crc != origcrc) { ped_exception_throw ( PED_EXCEPTION_WARNING, PED_EXCEPTION_CANCEL, _("GPT Header CRC check failed, %x should be %x."), origcrc, crc); - (*gpt)->HeaderCRC32 = origcrc; + (*gpt)->HeaderCRC32 = PED_CPU_TO_LE32(origcrc); goto error_free_gpt; } - (*gpt)->HeaderCRC32 = origcrc; + (*gpt)->HeaderCRC32 = PED_CPU_TO_LE32(origcrc); /* Check that the MyLBA entry points to the LBA that contains the GPT we read */ - if ((*gpt)->MyLBA != lba) { + if (PED_LE64_TO_CPU((*gpt)->MyLBA) != lba) { ped_exception_throw ( PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL, - "MyLBA " PRIx64 " != lba " PRIx64 ".\n", - (*gpt)->MyLBA, lba); + "MyLBA %" PRIx64 " != lba %" PRIx64 ".\n", + PED_LE64_TO_CPU((*gpt)->MyLBA), lba); goto error_free_gpt; } @@ -553,15 +482,15 @@ goto error_free_gpt; /* Check the GUID Partition Entry Array CRC */ - crc = efi_crc32(*ptes, (*gpt)->NumberOfPartitionEntries * - (*gpt)->SizeOfPartitionEntry); - if (crc != (*gpt)->PartitionEntryArrayCRC32) { + crc = efi_crc32(*ptes, PED_LE32_TO_CPU((*gpt)->NumberOfPartitionEntries) * + PED_LE32_TO_CPU((*gpt)->SizeOfPartitionEntry)); + if (crc != PED_LE32_TO_CPU((*gpt)->PartitionEntryArrayCRC32)) { ped_exception_throw ( PED_EXCEPTION_WARNING, PED_EXCEPTION_CANCEL, _("GPT Partition Entry Array CRC check failed, " "%x should be %x."), - (*gpt)->PartitionEntryArrayCRC32, crc); + PED_LE32_TO_CPU((*gpt)->PartitionEntryArrayCRC32), crc); goto error_free_ptes; } @@ -625,14 +554,14 @@ PED_ASSERT(ptes != NULL, return 0); pgpt->PartitionEntryArrayCRC32 = - agpt->PartitionEntryArrayCRC32 = - efi_crc32(ptes, pgpt->NumberOfPartitionEntries * - pgpt->SizeOfPartitionEntry); + agpt->PartitionEntryArrayCRC32 = PED_CPU_TO_LE32( + efi_crc32(ptes, PED_LE32_TO_CPU(pgpt->NumberOfPartitionEntries) * + PED_LE32_TO_CPU(pgpt->SizeOfPartitionEntry))); pgpt->HeaderCRC32 = 0; - pgpt->HeaderCRC32 = efi_crc32(pgpt, pgpt->HeaderSize); + pgpt->HeaderCRC32 = PED_CPU_TO_LE32(efi_crc32(pgpt, PED_LE32_TO_CPU(pgpt->HeaderSize))); agpt->HeaderCRC32 = 0; - agpt->HeaderCRC32 = efi_crc32(agpt, agpt->HeaderSize); + agpt->HeaderCRC32 = PED_CPU_TO_LE32(efi_crc32(agpt, PED_LE32_TO_CPU(agpt->HeaderSize))); return 1; } @@ -649,33 +578,35 @@ // printf("in CreateNewGuidPartitionTableHeader()\n"); memset(&gpt, 0, sizeof(gpt)); - gpt.Signature = GPT_HEADER_SIGNATURE; - gpt.Revision = GPT_HEADER_REVISION_V1_02; - gpt.HeaderSize = 92; /* per 1.02 spec */ - gpt.MyLBA = 1; - gpt.AlternateLBA = last_lba(dev); - gpt.FirstUsableLBA = (GPT_DEFAULT_RESERVED_PARTITION_ENTRY_ARRAY_SIZE / - dev->sector_size) + 2; - gpt.LastUsableLBA = - gpt.AlternateLBA - + gpt.Signature = PED_CPU_TO_LE64(GPT_HEADER_SIGNATURE); + gpt.Revision = PED_CPU_TO_LE32(GPT_HEADER_REVISION_V1_02); + gpt.HeaderSize = PED_CPU_TO_LE32(92); /* per 1.02 spec */ + gpt.MyLBA = PED_CPU_TO_LE64(1); + gpt.AlternateLBA = PED_CPU_TO_LE64(last_lba(dev)); + gpt.FirstUsableLBA = PED_CPU_TO_LE64((GPT_DEFAULT_RESERVED_PARTITION_ENTRY_ARRAY_SIZE / + dev->sector_size) + 2); + gpt.LastUsableLBA = PED_CPU_TO_LE64( + PED_LE64_TO_CPU(gpt.AlternateLBA) - (GPT_DEFAULT_RESERVED_PARTITION_ENTRY_ARRAY_SIZE / - dev->sector_size) - 1; + dev->sector_size) - 1); uuid_generate(uuid); + swap_uuid_and_efi_guid(uuid); memcpy(&(gpt.DiskGUID), uuid, sizeof(uuid)); - gpt.PartitionEntryLBA = 2; - gpt.NumberOfPartitionEntries = GPT_DEFAULT_RESERVED_PARTITION_ENTRIES; - gpt.SizeOfPartitionEntry = sizeof(GuidPartitionEntry_t); + gpt.PartitionEntryLBA = PED_CPU_TO_LE64(2); + gpt.NumberOfPartitionEntries = PED_CPU_TO_LE32(GPT_DEFAULT_RESERVED_PARTITION_ENTRIES); + gpt.SizeOfPartitionEntry = PED_CPU_TO_LE32(sizeof(GuidPartitionEntry_t)); memset(ptes, 0, - gpt.NumberOfPartitionEntries * gpt.SizeOfPartitionEntry); + PED_LE32_TO_CPU(gpt.NumberOfPartitionEntries) * + PED_LE32_TO_CPU(gpt.SizeOfPartitionEntry)); /* Fix up Alternate GPT */ memcpy(&agpt, &gpt, sizeof(gpt)); agpt.MyLBA = gpt.AlternateLBA; agpt.AlternateLBA = gpt.MyLBA; - agpt.PartitionEntryLBA = agpt.MyLBA - + agpt.PartitionEntryLBA = PED_CPU_TO_LE64(PED_LE64_TO_CPU(agpt.MyLBA) - (GPT_DEFAULT_RESERVED_PARTITION_ENTRY_ARRAY_SIZE / - dev->sector_size); + dev->sector_size)); if (!gpt_update_headers(&gpt, &agpt, ptes)) return 0; @@ -744,24 +675,23 @@ memcpy(*badgpt, goodgpt, sizeof(*goodgpt)); - /* Change badgpt values */ + /* Change badgpt values (both little-endian, no swapping) */ (*badgpt)->MyLBA = goodgpt->AlternateLBA; (*badgpt)->AlternateLBA = goodgpt->MyLBA; - if ((*badgpt)->MyLBA == 1) - (*badgpt)->PartitionEntryLBA = (*badgpt)->MyLBA + 1; + if (PED_LE64_TO_CPU((*badgpt)->MyLBA) == 1) + (*badgpt)->PartitionEntryLBA = PED_CPU_TO_LE64(PED_LE64_TO_CPU((*badgpt)->MyLBA) + 1); else - (*badgpt)->PartitionEntryLBA = (*badgpt)->MyLBA - + (*badgpt)->PartitionEntryLBA = PED_CPU_TO_LE64(PED_LE64_TO_CPU((*badgpt)->MyLBA) - (GPT_DEFAULT_RESERVED_PARTITION_ENTRY_ARRAY_SIZE / - dev->sector_size); + dev->sector_size)); return gpt_update_headers(*badgpt, goodgpt, ptes); } - - +#ifdef GPT_DEBUG static void gpt_print_legacy_part(PartitionRecord_t * pr, int i) { @@ -796,6 +726,8 @@ printf("Signature: %x\n", mbr->Signature); return; } +#endif + static void erase_gpt(PedDevice * dev, GuidPartitionTableHeader_t * gpt, @@ -805,10 +737,10 @@ PED_ASSERT(dev != NULL, return); if (gpt == NULL || ptes == NULL) return; - header_lba = gpt->MyLBA; + header_lba = PED_LE64_TO_CPU(gpt->MyLBA); memset(ptes, 0, - gpt->NumberOfPartitionEntries * - gpt->SizeOfPartitionEntry); + PED_LE32_TO_CPU(gpt->NumberOfPartitionEntries) * + PED_LE32_TO_CPU(gpt->SizeOfPartitionEntry)); gpt_write_part_entries(dev, gpt, ptes); memset(gpt, 0, sizeof(*gpt)); ped_device_write(dev, gpt, header_lba, GPT_HEADER_SECTORS); @@ -973,7 +905,7 @@ good_pgpt = gpt_is_valid(dev, 1, pgpt, &pptes); if (good_pgpt) { /* Primary GPT is OK, check the alternate and warn if bad */ - good_agpt = gpt_is_valid(dev, (*pgpt)->AlternateLBA, + good_agpt = gpt_is_valid(dev, PED_LE64_TO_CPU((*pgpt)->AlternateLBA), agpt, &aptes); if (!good_agpt) { @@ -1028,7 +960,7 @@ #ifdef GPT_DEBUG static void -print_disk_info(PedDevice *dev) +gpt_print_disk_info(PedDevice *dev) { unsigned int i; LegacyMBR_t mbr; @@ -1042,13 +974,6 @@ } if (mbr.PartitionRecord[0].OSType == EFI_PMBR_OSTYPE_EFI_GPT) { - /* This is an EFI GPT disk */ - if (!ped_device_read(dev, &pgpt, - GPT_PRIMARY_HEADER_LBA, - GPT_HEADER_SECTORS)) { - printf("print_disk_info error: ped_device_read(gpt) error.\n"); - return; - } printf("This is an EFI GPT disk.\n"); if (gpt_find_valid(dev, &pgpt, &agpt, &pte)) { if (pgpt) gpt = pgpt; @@ -1058,7 +983,8 @@ printf("GUID Partition Table is invalid.\n"); return; } - for (i = 0; pte && i < gpt->NumberOfPartitionEntries; i++) { + gpt_print_header(gpt); + for (i = 0; pte && i < PED_LE32_TO_CPU(gpt->NumberOfPartitionEntries); i++) { /* Partition entry is unused if all bytes are 0 */ if (memcmp(&zeropte, &pte[i], sizeof(zeropte))) gpt_print_part_entry(&pte[i], i); @@ -1081,7 +1007,6 @@ ped_disk_gpt_init() { PED_ASSERT(sizeof(GuidPartitionTableHeader_t) == 512, return); - PED_ASSERT(sizeof(GuidPartitionEntryAttributes_t) == 8, return); PED_ASSERT(sizeof(GuidPartitionEntry_t) == 128, return); ped_register_disk_type(&gpt_disk_type); @@ -1138,6 +1063,9 @@ if (!gpt_read(disk)) goto error_free_disk_specific; +#ifdef GPT_DEBUG + gpt_print_disk_info(dev); +#endif return disk; error_free_disk_specific: @@ -1228,14 +1156,14 @@ gpt_disk_data->ptes); } - for (i = 0; i < gpt_disk_data->pgpt->NumberOfPartitionEntries; i++) { + for (i = 0; i < PED_LE32_TO_CPU(gpt_disk_data->pgpt->NumberOfPartitionEntries); i++) { if (!efi_guidcmp(gpt_disk_data->ptes[i].PartitionTypeGuid, unused)) continue; part = ped_partition_alloc(disk, PED_PARTITION_PRIMARY, NULL, - gpt_disk_data->ptes[i].StartingLBA, - gpt_disk_data->ptes[i].EndingLBA); + PED_LE64_TO_CPU(gpt_disk_data->ptes[i].StartingLBA), + PED_LE64_TO_CPU(gpt_disk_data->ptes[i].EndingLBA)); if (!part) return 0; @@ -1286,8 +1214,8 @@ PED_ASSERT(part->disk_specific != NULL, return 0); gpt_part_data = part->disk_specific; PED_ASSERT(gpt_part_data->pte != NULL, return 0); - gpt_part_data->pte->StartingLBA = part->geom.start; - gpt_part_data->pte->EndingLBA = part->geom.end; + gpt_part_data->pte->StartingLBA = PED_CPU_TO_LE64(part->geom.start); + gpt_part_data->pte->EndingLBA = PED_CPU_TO_LE64(part->geom.end); } return 1; @@ -1407,22 +1335,23 @@ PED_ASSERT(gpt_disk_data->ptes != NULL, return NULL); - for (i = 0; i < gpt_disk_data->pgpt->NumberOfPartitionEntries; i++) { + for (i = 0; i < PED_LE32_TO_CPU(gpt_disk_data->pgpt->NumberOfPartitionEntries); i++) { if (!efi_guidcmp (gpt_disk_data->ptes[i].PartitionTypeGuid, unused_entry_guid)) { break; } } /* No unused entries */ - if (i == gpt_disk_data->pgpt->NumberOfPartitionEntries){ + if (i == PED_LE32_TO_CPU(gpt_disk_data->pgpt->NumberOfPartitionEntries)){ ped_free(part); return NULL; } part->num = i + 1; - gpt_disk_data->ptes[i].StartingLBA = part->geom.start; - gpt_disk_data->ptes[i].EndingLBA = part->geom.end; + gpt_disk_data->ptes[i].StartingLBA = PED_CPU_TO_LE64(part->geom.start); + gpt_disk_data->ptes[i].EndingLBA = PED_CPU_TO_LE64(part->geom.end); uuid_generate(uuid); + swap_uuid_and_efi_guid(uuid); memcpy(&(gpt_disk_data->ptes[i].UniquePartitionGuid), uuid, sizeof(uuid)); gpt_disk_data->ptes[i].PartitionTypeGuid = PARTITION_BASIC_DATA_GUID; @@ -1515,16 +1444,16 @@ gpt_disk_data = disk->disk_specific; /* allocate space for the header */ - gptlength = gpt_disk_data->pgpt->HeaderSize / disk->dev->sector_size; - if (gpt_disk_data->pgpt->HeaderSize % disk->dev->sector_size) + gptlength = PED_LE32_TO_CPU(gpt_disk_data->pgpt->HeaderSize) / disk->dev->sector_size; + if (PED_LE32_TO_CPU(gpt_disk_data->pgpt->HeaderSize) % disk->dev->sector_size) gptlength++; /* allocate space for the ptes */ pteslength = - (gpt_disk_data->pgpt->NumberOfPartitionEntries * - gpt_disk_data->pgpt->SizeOfPartitionEntry) / + (PED_LE32_TO_CPU(gpt_disk_data->pgpt->NumberOfPartitionEntries) * + PED_LE32_TO_CPU(gpt_disk_data->pgpt->SizeOfPartitionEntry)) / disk->dev->sector_size; - if ((gpt_disk_data->pgpt->NumberOfPartitionEntries * - gpt_disk_data->pgpt->SizeOfPartitionEntry) % + if ((PED_LE32_TO_CPU(gpt_disk_data->pgpt->NumberOfPartitionEntries) * + PED_LE32_TO_CPU(gpt_disk_data->pgpt->SizeOfPartitionEntry)) % disk->dev->sector_size) pteslength++; @@ -1686,6 +1615,15 @@ PARTITION_BASIC_DATA_GUID; break; + case PED_PARTITION_HPSERVICE: + if (state) + gpt_part_data->pte->PartitionTypeGuid = + PARTITION_HPSERVICE_GUID; + else + gpt_part_data->pte->PartitionTypeGuid = + PARTITION_BASIC_DATA_GUID; + + break; case PED_PARTITION_LBA: if (!state) return 0; break; @@ -1720,6 +1658,9 @@ case PED_PARTITION_LVM: return (!efi_guidcmp(gpt_part_data->pte->PartitionTypeGuid, PARTITION_LVM_GUID)); + case PED_PARTITION_HPSERVICE: + return (!efi_guidcmp(gpt_part_data->pte->PartitionTypeGuid, + PARTITION_HPSERVICE_GUID)); case PED_PARTITION_BOOT: return (!efi_guidcmp(gpt_part_data->pte->PartitionTypeGuid, PARTITION_SYSTEM_GUID)); @@ -1742,6 +1683,7 @@ case PED_PARTITION_RAID: case PED_PARTITION_LVM: case PED_PARTITION_LBA: + case PED_PARTITION_HPSERVICE: case PED_PARTITION_BOOT: return 1; case PED_PARTITION_ROOT: @@ -1767,7 +1709,7 @@ memset(gpt_part_data->pte->PartitionName, 0, sizeof(gpt_part_data->pte->PartitionName)); for (i=0; i < (72 / sizeof(efi_char16_t)) && i < strlen(name); i++) { - gpt_part_data->pte->PartitionName[i] = name[i]; + gpt_part_data->pte->PartitionName[i] = PED_CPU_TO_LE16(name[i]); } return; } @@ -1789,7 +1731,7 @@ memset(name, 0, namelen); for (i=0; i < namelen ; i++) { - name[i] = gpt_part_data->pte->PartitionName[i]; + name[i] = PED_LE16_TO_CPU(gpt_part_data->pte->PartitionName[i]); } return name; @@ -1805,7 +1747,7 @@ gpt_disk_data = disk->disk_specific; if (gpt_disk_data && gpt_disk_data->pgpt) - rc = gpt_disk_data->pgpt->NumberOfPartitionEntries; + rc = PED_LE32_TO_CPU(gpt_disk_data->pgpt->NumberOfPartitionEntries); return rc; } @@ -1827,8 +1769,9 @@ /* Alignments can be on any sector */ /* Geometry must reside within the usable LBAs */ if (!ped_geometry_init (&max_geom, disk, - gpt->FirstUsableLBA, - gpt->LastUsableLBA - gpt->FirstUsableLBA + 1)) + PED_LE64_TO_CPU(gpt->FirstUsableLBA), + PED_LE64_TO_CPU(gpt->LastUsableLBA) - + PED_LE64_TO_CPU(gpt->FirstUsableLBA) + 1)) return NULL; return ped_constraint_new (ped_alignment_any, ped_alignment_any,