--- parted-2.3.orig/debian/README.Debian +++ parted-2.3/debian/README.Debian @@ -0,0 +1,67 @@ +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. + +General: + * Actively maintained + * Support for CHS and LBA addressing modes + * Support for logical sector sizes not equal to 512 + * Support for device's alignment requirements (e.g. physical sector sizes that + are a multiple of the logical sector size) + * Uses SI units (byte multiples of 1000), supporting arbitrary specification + of disk locations in sectors, bytes, kilobytes, megabytes, gigabytes, + cylinders and CHS notation + * Knows about, detects and works around quirks of other partitioning tools and + operating system implementations + +Operating system support: + * GNU/Linux + * GNU/Hurd + * BeOS + * FreeBSD + +Parted currently supports: + * Intel EFI/GPT parition tables + * MS-DOS partition tables + * Raw access (useful for RAID/LVM) + * MIPS/DVH partition tables + * Amiga partition tables + * PC98 partition tabled + * Sun disk labels + * BSD disk labels (Linux-style; currently broken from a BSD view) + * Macintosh parition maps + +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 | * | * | * | * | * +linux-swap | * | * | * | * | * +hfs/hfs+ | * | | *[1,5]| | +jfs | * | | | | +ntfs | * | | | | +reiserfs | * | *[6] | *[1,6]| *[6] | *[3,6] +ufs | * | | | | +xfs | * | | | | + +[1] The start of the partition must stay fixed. +[2] The partition you copy to must be bigger or exactly the same size as the + partition you copy from. +[3] Limited checking is done when the file system is opened. This is the only + checking at the moment. All commands (including resize) will gracefully + fail, leaving the file system intact, if there are any errors. +[4] You can always shrink your partition. If you can't use FAT32 for some + reason, you may not be able to grow your partition due to restrictions in + cluster size. +[5] Parted can only shrink HFS and HFS+ filesystems. +[6] ReiserFS support is enabled if you install libreiserfs. + + -- Xavier Oswald Wed, 25 Apr 2007 23:31:15 +0200 --- parted-2.3.orig/debian/README.source +++ parted-2.3/debian/README.source @@ -0,0 +1,58 @@ +This package uses quilt to manage all modifications to the upstream +source. Changes are stored in the source package as diffs in +debian/patches and applied during the build. + +To configure quilt to use debian/patches instead of patches, you want +either to export QUILT_PATCHES=debian/patches in your environment +or use this snippet in your ~/.quiltrc: + + for where in ./ ../ ../../ ../../../ ../../../../ ../../../../../; do + if [ -e ${where}debian/rules -a -d ${where}debian/patches ]; then + export QUILT_PATCHES=debian/patches + break + fi + done + +To get the fully patched source after unpacking the source package, cd to +the root level of the source package and run: + + quilt push -a + +The last patch listed in debian/patches/series will become the current +patch. + +To add a new set of changes, first run quilt push -a, and then run: + + quilt new + +where is a descriptive name for the patch, used as the filename in +debian/patches. Then, for every file that will be modified by this patch, +run: + + quilt add + +before editing those files. You must tell quilt with quilt add what files +will be part of the patch before making changes or quilt will not work +properly. After editing the files, run: + + quilt refresh + +to save the results as a patch. + +Alternately, if you already have an external patch and you just want to +add it to the build system, run quilt push -a and then: + + quilt import -P /path/to/patch + quilt push -a + +(add -p 0 to quilt import if needed). as above is the filename to +use in debian/patches. The last quilt push -a will apply the patch to +make sure it works properly. + +To remove an existing patch from the list of patches that will be applied, +run: + + quilt delete + +You may need to run quilt pop -a to unapply patches first before running +this command. --- parted-2.3.orig/debian/changelog +++ parted-2.3/debian/changelog @@ -0,0 +1,2091 @@ +parted (2.3-15) unstable; urgency=low + + [ Pino Toscano ] + * Disable DMI detection on the Hurd (closes: #719628). + * Don't match tarball compression extensions in watch file (closes: + #719630). + + -- Colin Watson Tue, 13 Aug 2013 22:01:46 +0100 + +parted (2.3-14) unstable; urgency=low + + * Merge fix-head-size-assertion.patch from Ubuntu: change an + assert so it correctly recovers instead of aborting the program + (closes: #620273). + * Merge dm_p_separator.patch from Ubuntu: parted would add a + 'p' between the base device name and the partition number for + all device-mapper devices instead of only if the base name + ended in a digit. + * Merge remove-dev_t-dep.patch from Ubuntu: parted was making + bad assumptions about the meaning of the values of dev_t, + causing it to fail to detect in-use partitions on all dmraid + disks, and regular disk partitions > #16. + * Merge skip-floppy.patch from Ubuntu: add floppies to the list + of ignored devices since they can not be partitioned anyhow, + and often people have no floppy though their bios thinks they do, + and touching it causes hangs. + * Merge gptsync.patch from Ubuntu: On Intel Mac systems, write a + synced MBR rather than a protective MBR. + * Merge loop-partitions.patch from Ubuntu: backport some changes + to allow the use of partitions on loop devices. This also + allows more than 16 partitions. + * Merge dmraid.patch from Ubuntu: Don't probe dmraid partition + devices. Also set UUID of newly created dmraid partition devices. + * Merge dm-part-sync.patch from Ubuntu: refactor device-mapper + partition sync code so it does not fail when unmodified partitions + are mounted. + * Merge udevadm-settle.patch from Ubuntu: Run udevadm settle around + partition table rereads, to avoid races. + * Merge 16-dos-partitions.patch from Ubuntu: the kernel was not + being informed of partitions above #16 on dos partition tables + (closes: #667638). + * Merge hfs-probe-corrupt.patch from Ubuntu: don't let a corrupt + FS evoke failed assertion. + * Backport online resize patches: 0001-parted-resizepart-command.patch, + 0003-libparted-Add-support-for-BLKPG-ioctl-partition-resi.patch, + and 0004-parted-make-_partition_warn_busy-actually-a-warning.patch + * Merge fewer-gpt-entries.patch: Backport upstream patches to handle + GPT labels with fewer than 128 partition entries (LP: #1187560). + * debian/patches/avoid-disturbing-partitions.patch: Don't remove and + re-add unmodified partitions (LP: #1060484). + * debian/patches/linux-specific-gpt-type.patch: Backport upstream + changes to use a linux specific partition type code instead of + Microsoft's, which causes Windows to offer to format the partition. + + -- Phillip Susi Mon, 12 Aug 2013 10:11:10 +0100 + +parted (2.3-13) unstable; urgency=low + + * Use dh-autoreconf. + * Avoid assuming that gets is declared (closes: #699653). + + -- Colin Watson Thu, 09 May 2013 10:48:00 +0100 + +parted (2.3-12) unstable; urgency=low + + * Breaks: python-parted (<< 3.6-5); previous versions were broken by the + PED_PARTITION_LAST_FLAG change in 2.3-11.1 (closes: #697588). + + -- Colin Watson Mon, 07 Jan 2013 12:13:14 +0000 + +parted (2.3-11.1) unstable; urgency=low + + * Non-maintainer upload. + * Cherry-pick upstream patches to fix the handling of GPT partition + flags when modifying a GPT. This, most particularly fixes the + handling of 'legagy BIOS bootable'. + Thanks to Jérémy Bobbio for providing the patch and analysis. + Closes: #673042 + + -- Christian Perrier Tue, 01 Jan 2013 14:44:03 +0100 + +parted (2.3-11) unstable; urgency=medium + + * Non-maintainer upload to fix partitioned md devices (bug #684713) + * backport md-partitions.patch: libparted/arch/linux.c + (_device_get_partition_range): Use /sys/block/DEV/ext_range instead + of range sysfs file. + + -- Miquel van Smoorenburg Thu, 13 Sep 2012 15:35:00 +0200 + +parted (2.3-10) unstable; urgency=low + + * Acknowledge NMUs with thanks (closes: #676593). + * Back out non-registered-device.diff, which had already been applied + upstream in 2.3. + * Rearrange patch ordering slightly. + * Update debian/watch for upstream switch to .tar.xz. + * Use dpkg-buildflags to enable hardening options. + * Build with V=1 so that tools such as blhc can scan more effectively for + missing build flags. + * Remove Sven Luther from Uploaders with thanks for his past contributions + (closes: #677756). + * Revert ABI symbols change from 2.3-9.2, since whatever prompted that + change seems to have changed back (closes: #678788). + + -- Colin Watson Wed, 27 Jun 2012 00:01:04 +0100 + +parted (2.3-9.2) unstable; urgency=low + + * Non-maintainer upload. + * Add partition table re-read on hurd-i386 (Closes: #669936). + * Backport gnulib fix for set but not used variables (Closes: #676590). + * Update ABI symbol list (Closes: #676591). + + -- Samuel Thibault Fri, 08 Jun 2012 02:04:11 +0200 + +parted (2.3-9.1) unstable; urgency=low + + * Non-maintainer upload. + * kfreebsd_lvm.patch: Support LVM on GNU/kFreeBSD. (Closes: #644825) + * hurd-partition-path.patch: Fix wrong path for GNU/Hurd partitions, + patch from Jeremie Koenig. (Closes: #586696) + * non-registered-device.diff: Fix NULL dereference condition, patch + from Jeremie Koenig. (Closes: #586682) + + -- Robert Millan Mon, 09 Apr 2012 09:46:19 +0000 + +parted (2.3-9) unstable; urgency=low + + [ Colin Watson ] + * Add build-arch and build-indep targets to debian/rules. + + [ Svante Signell ] + * Avoid building debian/rules targets more than once (closes: #649741). + + -- Colin Watson Sat, 31 Mar 2012 18:51:13 +0100 + +parted (2.3-8) unstable; urgency=low + + [ Robert Millan ] + * Add detection of ZFS volumes (closes: #635384). + * Add detection of GEOM encryption devices (closes: #635393). + + -- Colin Watson Sat, 30 Jul 2011 14:37:34 +0100 + +parted (2.3-7) unstable; urgency=low + + * Use [linux-any] in debian/control rather than [!hurd-i386 !kfreebsd-i386 + !kfreebsd-amd64]. + * Remove libparted.la from libparted0-dev. + * Convert to multiarch. + + -- Colin Watson Sun, 17 Jul 2011 14:25:45 +0100 + +parted (2.3-6) unstable; urgency=low + + * Backport from upstream: + - Accommodate two-component Linux version numbers like 3.0 + (LP: #796865). + * Rewrite package descriptions and add a Homepage field (thanks, Justin B + Rye; closes: #615124). + + -- Colin Watson Wed, 15 Jun 2011 15:21:08 +0100 + +parted (2.3-5) unstable; urgency=low + + * Remove DASD restriction on _disk_sync_part_table, as otherwise DASD + partitioning will never work properly (closes: #605759). + + -- Colin Watson Sun, 19 Dec 2010 12:57:43 +0000 + +parted (2.3-4) unstable; urgency=low + + * Fix used-uninitialised bug on devices smaller than one cylinder (closes: + #602568). + * Ignore zero-length devices (closes: #602533). + + -- Colin Watson Fri, 19 Nov 2010 21:42:56 +0000 + +parted (2.3-3) unstable; urgency=low + + * Build-depend on check, so that we can run more of our test suite. + * Add ZFS detection support (thanks, Robert Millan; closes: #595007). + + -- Colin Watson Sun, 17 Oct 2010 11:13:02 +0100 + +parted (2.3-2) unstable; urgency=low + + * Fix patch ordering: btrfs.patch is for upstream merging, not a symbols + patch. + * Remove limits on loop labels (closes: #592679). There's no reason to + impose any particular limit on loop labels, since they just represent a + single large partition. Sector counts over 2^32 are needed for large + RAID arrays. + * Backport upstream patch to update tests/t4000-sun-raid-type.sh so that + the test suite passes again. + * Add support for detection of FreeBSD UFS file systems and creation of + the partition on DOS and GPT labels (thanks, Aurelien Jarno; closes: + #588364). + + -- Colin Watson Thu, 19 Aug 2010 12:19:36 +0100 + +parted (2.3-1) unstable; urgency=low + + * New upstream release. + * debian/patches/update-ext4-code.patch: refreshed against newer code. + * debian/patches/linux-exports.patch: dropped, merged upstream. + * debian/patches/kfreebsd-gnu.patch: refreshed against newer code. + * debian/patches/sun-revert-disk-flag.patch: backported to revert the + disk flag implementation. Refs: #579948. + + -- Otavio Salvador Tue, 29 Jun 2010 12:26:47 -0300 + +parted (2.2-7) unstable; urgency=low + + * Update GNU/kFreeBSD patch, from Luca Favatella's Google Summer of Code + project last year via Aurelien Jarno. Among other things, this no + longer requires libgeom (closes: #580224). + + -- Colin Watson Mon, 14 Jun 2010 16:22:28 +0100 + +parted (2.2-6) unstable; urgency=low + + * libparted0-dev should depend on libgeom-dev on kFreeBSD (thanks, Petr + Salinger; closes: #576684). + * Use proper epoch in libdevmapper-dev build-dependency (closes: #580415). + * Add btrfs discovery support (thanks, Luca Bruno; closes: #567176). + + -- Colin Watson Mon, 14 Jun 2010 13:53:27 +0100 + +parted (2.2-5) unstable; urgency=low + + * Fix brown-paper-bag build error in kFreeBSD patch. + + -- Colin Watson Tue, 06 Apr 2010 11:06:54 +0100 + +parted (2.2-4) unstable; urgency=low + + * Policy version 3.8.4: no changes required. + * Merge from maint-1.8 branch: + - Version libparted[12] conflicts/replaces in preparation for + upstream-maintained sonames in 2.2 and newer. + * Rename libparted0 to libparted0debian1 (LP: #535368), and also + libparted0-dbg to libparted0debian1-dbg in case anything is relying on + those package names matching. This is unfortunate, but is needed to + work around historical unversioned Conflicts on libparted0, libparted1, + and libparted2, which would break upgrades from lenny. Add a dummy + libparted0 package to provide smooth upgrades from earlier 2.2-* + versions. + + -- Colin Watson Sat, 03 Apr 2010 11:53:56 +0100 + +parted (2.2-3) unstable; urgency=low + + * Restore GNU/kFreeBSD support (closes: #575007). + * Don't rebuild autotools files during the build. + * Guard against FreeBSD kern.geom.conftxt not being newline-terminated. + * Fix FreeBSD support for file devices. + * Add GPT device naming support on kFreeBSD (thanks, Robert Millan; + closes: #548436). + * Strings from struct ata_params are not guaranteed to be null terminated + (thanks, Aurelien Jarno; closes: #559645). + + -- Colin Watson Fri, 26 Mar 2010 11:06:34 +0000 + +parted (2.2-2) unstable; urgency=low + + * Upload to unstable. + + -- Colin Watson Sun, 21 Mar 2010 23:25:35 +0000 + +parted (2.2-1) experimental; urgency=low + + * New upstream release. + + [ Colin Watson ] + * Upstream now uses libtool's versioning system, so the SONAME has changed + from "libparted-2.1.so.0" to "libparted.so.0". Change library package + names to libparted0 etc. to match. This actually returns to a SONAME + that was used for a few months in 2000, but it seems unlikely that that + will cause any problems and I'd rather keep in sync with upstream. + + -- Colin Watson Mon, 08 Mar 2010 13:48:02 +0000 + +parted (2.1-4) experimental; urgency=low + + * Make libparted-2.1-dev depend on packages that deliver other libraries + listed in libparted.la (closes: #526896). + + -- Colin Watson Mon, 01 Mar 2010 17:00:33 +0000 + +parted (2.1-3) experimental; urgency=low + + * linux-exports.patch: Don't export linux_get_minimum_alignment or + linux_get_optimum_alignment functions. + + -- Colin Watson Fri, 26 Feb 2010 17:38:54 +0000 + +parted (2.1-2) experimental; urgency=low + + * Build-depend on libblkid-dev, since otherwise we don't get + minimum/optimum alignment handling on Linux. + + -- Colin Watson Fri, 26 Feb 2010 12:51:06 +0000 + +parted (2.1-1) experimental; urgency=low + + * New upstream release + + [ Otavio Salvador ] + * control.in: bump preferred soname for libreadline (closes: #553824). + + [ Colin Watson ] + * control.in: Remove copy-and-paste error from libparted1.8-i18n + description (closes: #497626). + * copyright: Document parted.info's licence, namely GFDL 1.1 with no + invariant sections, front-cover texts, or back-cover texts (closes: + #500201). + * rules: Cell partition tables are misdetected as pc98, so disable pc98 + support on powerpc (closes: #487833). + * control.in: Don't build-depend on libdevmapper-dev on hurd-i386. + * control.in: Build-depend on libdevmapper-dev (>= 1.02.33), for + dm_task_set_major_minor. + + [ Xavier Oswald ] + * debian/control.in: + - Change my mail address + - Bump Standards-Version to 3.8.3 + - Update Build-Depends on debhelper 7 + * debian/compat: update version to 7 + * Parted not informing the kernel of changes to the partition table + (Closes: #557044), fixed upstream + + [ Otavio Salvador ] + * debian/watch: fix URL to download + * Switch to quilt to manage patches + - unpartitioned-disks.dpatch, drop (merged upstream) + - unblacklist-md.dpatch, drop (merged upstream) + - amiga-raid-lvm-fix.dpatch, drop (not used for ages) + - devfs.dpatch, drop (devfs is not used) + - reiserfs-libname.dpatch, drop (referenced library is unavailable) + + [ Xavier Oswald, Colin Watson ] + * Refresh update-ext4-code.patch + + [ Otavio Salvador ] + * Fix parted-doc info files installation + * Add lintian overrides for parted package + * Use soname in libparted udeb name + + -- Otavio Salvador Sat, 06 Feb 2010 16:39:19 -0200 + +parted (1.8.8.git.2009.07.19-6) unstable; urgency=medium + + * Version libparted[012] conflicts/replaces in preparation for + upstream-maintained sonames in 2.2 and newer. + + -- Colin Watson Mon, 08 Mar 2010 13:37:49 +0000 + +parted (1.8.8.git.2009.07.19-5) unstable; urgency=low + + * Update building system with automake 1.11 + + -- Otavio Salvador Tue, 18 Aug 2009 19:16:28 -0300 + +parted (1.8.8.git.2009.07.19-4) unstable; urgency=low + + [ Otavio Salvador ] + * Fix FTBFS in s390 due a missing prototype in dasd label. + + [ Aurelien Jarno ] + * Add FreeBSD architecture support files + * Regenerate configure and Makefile.in + + -- Otavio Salvador Wed, 12 Aug 2009 18:07:22 -0300 + +parted (1.8.8.git.2009.07.19-3) unstable; urgency=low + + [ Otavio Salvador ] + * control.in: use debug for libparted-dbg. + + [ Colin Watson ] + * control.in: Move libparted@LIBPKGVER@-i18n to section localization. + + [ Luca Favatella ] + * control.in: Remove libdevmapper-dev as build-dependency on GNU/kFreeBSD. + * debian/rules: Enable device-mapper only on Linux. + + [ Otavio Salvador ] + * Do not dynamicaly update soname. + + -- Otavio Salvador Mon, 10 Aug 2009 22:22:37 -0300 + +parted (1.8.8.git.2009.07.19-2) unstable; urgency=low + + * unblacklist-md.dpatch: Revert commit + f94e08bdb4ba0fa1b9fd35509e04c2d9ee84ff80, which broke RAID configuration + in d-i and isn't necessary given our unpartitioned-disks patch. + * Add myself to Uploaders, at Otavio's suggestion. + + -- Colin Watson Fri, 24 Jul 2009 15:31:04 +0100 + +parted (1.8.8.git.2009.07.19-1) unstable; urgency=low + + * New upstream snapshot. + + [ Max Vozeler ] + * Restore dependency on the patch-stamp target. (closes: #534248) + + [ Otavio Salvador ] + * Drop baseline-symbols patch. + * Update symbols - no soname bump required. + + -- Otavio Salvador Sun, 19 Jul 2009 13:11:09 -0300 + +parted (1.8.8.git.2009.06.03-2) unstable; urgency=low + + * libparted: move LinuxSpecific stuff to a private linux.h header + + -- Otavio Salvador Fri, 17 Jul 2009 19:07:08 -0300 + +parted (1.8.8.git.2009.06.03-1) unstable; urgency=low + + [ Otavio Salvador ] + * New upstream snapshot + * debian/control: add Vcs-{Git,Browser} fields + * Bump soname due the properly linkage to gnulib + * Do not install README-hacking + + -- Otavio Salvador Wed, 03 Jun 2009 21:36:33 -0300 + +parted (1.8.8.git.2009.05.23-1) experimental; urgency=low + + [ Otavio Salvador ] + * New upstream snapshot: + - Update build scripts. Closes: #525193 + - Fix FTBFS with GCC 4.4. Closes: #505346 + - Add ext4 support. Closes: #511224 + * Import packaging files + * Clean up build-depends. Closes: #482408 + * Set version as 1.8.8.1.147-f9f5-dirty + * debian/patches/parted-dmraid.dpatch: droped + * debian/patches/sparc-fix-raid.dpatch: droped + * debian/rules: do not call autotools during build + * Bump Standards-Version to 3.8.1; no changes required + * Bump library soname + * Check ABI symbols when compiling in amd64 + * Fix check-abi build target + + [ Colin Watson ] + * debian/patches/update-ext4-code.dpatch: add to improve ext4 support. + + -- Otavio Salvador Sat, 23 May 2009 20:42:05 -0300 + +parted (1.8.8.git.2008.03.24-11.1) unstable; urgency=low + + * Non-maintainer upload. + * Preserve hidden partitions in DOS-format partition tables if they are not + explicitly replaced. Closes: #491797125 + + -- Ben Hutchings Mon, 24 Nov 2008 01:28:08 +0000 + +parted (1.8.8.git.2008.03.24-11) unstable; urgency=low + + * Add patch to avoid using partition names for loop devices. Thanks to + Colin Watson for the patch. Closes: #502618 + + -- Otavio Salvador Wed, 22 Oct 2008 10:13:52 -0200 + +parted (1.8.8.git.2008.03.24-10) unstable; urgency=low + + * Merge from Ubuntu: debian/patches/parted-dmraid.dpatch: Patch to educate + libparted about dmraid arrays, which use device mapper. Libparted was + naming new partition nodes incorrectly, and not setting the UUIDs for + dmraid device nodes. (Closes: #497110) + + -- Giuseppe Iuculano Sat, 06 Sep 2008 15:02:11 +0200 + +parted (1.8.8.git.2008.03.24-9) unstable; urgency=low + + [ Otavio Salvador ] + * Bump package soname + + [ Guido Günther ] + * Return the correct partition names for multipath devices + * linux device-mapper map type detection (closes: #440675) + + -- Otavio Salvador Sat, 09 Aug 2008 18:51:31 -0300 + +parted (1.8.8.git.2008.03.24-8) unstable; urgency=low + + * Disable backtrace when building the udeb packages (closes: #488374). + + -- Otavio Salvador Mon, 28 Jul 2008 21:09:10 -0300 + +parted (1.8.8.git.2008.03.24-7) unstable; urgency=low + + * Upload to unstable + + -- Otavio Salvador Sat, 21 Jun 2008 15:58:02 -0300 + +parted (1.8.8.git.2008.03.24-6) experimental; urgency=low + + [ Otavio Salvador ] + * Give the parted udeb a menu item number. This allows it to be + selected manually in anna. Update the udeb description for + consistency and remove the long description to save space. Thanks to + Frans Pop (closes: #466826). + + [ Jim Meyering ] + * test for improved DOS-partition-table recognition + + [ Colin Watson ] + * bug fix: improve DOS partition table recognition + + [ Jim Meyering ] + * avoid const-related compiler warnings + + -- Otavio Salvador Tue, 03 Jun 2008 19:25:27 -0300 + +parted (1.8.8.git.2008.03.24-5) experimental; urgency=low + + * Disable LVM support for dasd labels + + -- Otavio Salvador Tue, 27 May 2008 21:52:48 -0300 + +parted (1.8.8.git.2008.03.24-4) experimental; urgency=low + + [ Otavio Salvador ] + * properly test for __s390__ and __s390x__ macros to disable O_DIRECT + on that + + [ Matt Davis ] + * Corrected a few memory leaks from unallocated ped_unit_format calls. + * Corrected memory leak when displaying partition flags. + * Corrected a small memory leak when displaying partition information + + [ Otavio Salvador ] + * do not loop in case message exception has no message + * fix memory leak in exception handler + * Ensure that autoreconf uses aclocal 1.0 + + -- Otavio Salvador Tue, 06 May 2008 14:35:08 -0300 + +parted (1.8.8.git.2008.03.24-3) experimental; urgency=low + + [ Otavio Salvador ] + * Bump version to 1.8.9 since it broke ABI interface + * Ensure that autoreconf uses automake 1.10 + * Add debian/libparted-i18n.files and debian/libparted-dev.files + removed by mistake + * Change soname and dependency requirements due ABI change + + [ Robert Millan ] + * Add support for GRUB / BIOS partition in GPT. + + -- Otavio Salvador Sat, 12 Apr 2008 16:18:46 -0300 + +parted (1.8.8.git.2008.03.24-2) experimental; urgency=low + + [ Bastian Blank ] + * Fix syntax error. + * Use host_cpu for s390 check. + + [ Jim Meyering ] + * Fix a typo: s/to defragmenting/to defragment/, Remove trailing + blanks. + * Don't write into line[-1] when line starts with a NUL byte. + + -- Otavio Salvador Wed, 09 Apr 2008 19:12:54 -0300 + +parted (1.8.8.git.2008.03.24-1) experimental; urgency=low + + [ Cyril Brulebois ] + * debian/rules: + - add “-fgnu89-inline” to “CFLAGS” and “UDEB_CFLAGS” to fix FTBFS + (Closes: #442308). + * debian/control.in: + - make the packages binNMU-safe by using binary:Version and + source:Version instead of Source-Version. + + [ Otavio Salvador ] + * Really duplicate disks instead of readd each partition so it preserves + the ordering and like (Closes: #294520). + * Point to GPL-3 instead of including it since it is now available. + * Package Patches: + - lvm2.dpatch: droped, equivalent code merged upstream; + + -- Otavio Salvador Mon, 24 Mar 2008 20:37:45 -0300 + +parted (1.8.7.git.2007.07.30-1) experimental; urgency=low + + * New upstream release. + + [ Xavier Oswald ] + * debian/README.Debian updated + * debian/parted-doc.docs updated + + [ Otavio Salvador ] + * Package Patches: + - doc-package.dpatch: redone from scratch; + - s390.dpatch: dropped, equivalent code merged upstream; + - parted-print-name.dpatch: likewise. + - errors-to-stderr.dpatch: likewise. + - devfs.dpatch: rediff. + - sparc-fix-raid.dpatch: likewise. + - lvm2.dpatch: readd the missing parts for the LVM partitions + probing; + * debian/rules: + - configure called with --enable-device-mapper to include + device-mapper support in; + - build gnulib when building udeb and debugging packages otherwise + they'd fail; + - change soname version; + * debian/control: + - add libdevmapper-dev as build-dependency; + - add pkg-config as build-dependency; + - cleanup udeb dependencies. Thanks to Frans Pop + by the patch; (Closes: #419609) + * debian/watch: use the GNU ftp since the HTTP address was giving + timeout; + * debian/libparted-dev.files: stop to provide parted.m4 but provides + pkgconfig, instead; + * debian/parted-doc.docs: drop COPYING; + * debian/copyright: updated since parted is now licensed on GPL3; + * debian/rules: change package names to follow soname; + + -- Otavio Salvador Mon, 30 Jul 2007 20:49:10 -0300 + +parted (1.8.1~git1-1) experimental; urgency=low + + * New git snapshot + * doc-package.dpatch: removed hunk that was merge upstream; + * debian/copyright: update FSF address; + * debian/control.in, debian/rules: bump automake requirement to 1.10; + * debian/patches/00list: disabled kfreebsd support by now; + + -- Otavio Salvador Mon, 27 Nov 2006 11:35:20 -0200 + +parted (1.8.0~rc3-1) experimental; urgency=low + + * New upstream release. + + [ Otavio Salvador ] + * doc-package.dpatch: fixed file paths; + * devfs.dpatch: minor change to make it apply again since linux.c had + its #includes massively changed; + * lvm2.dpatch: removed since upstream version now has device-manager + support natively; + * s390.dpatch: removed since upstream version now has device-manager + support natively; + * parted.files: we're not installing pt_BR manpage anymore since it + needs to be updated to new translation systems that is being use in + Parted now; + + [ Xavier Oswald ] + * add po4a as build-dependancy. + * Adding myself as comaintainer of the package. + * policy 3.7.2 + + -- Sven Luther Wed, 1 Nov 2006 19:27:46 +0100 + +parted (1.7.1-3) unstable; urgency=low + + * parted-print-name.dpatch : Fix bug in parted print, when there are no + extended partitions, but partition names. + * disabled parted part of kfreebsd-gnu.dpatch, since the patch caused + parted to have trouble in a d-i environment to print the partition table, + thus causing tools relying on parted -s print to find information about + the partition table to break, like the one checking for RAID partitions + in d-i. (Closes: #392767) + + -- Sven Luther Tue, 7 Nov 2006 17:45:28 +0100 + +parted (1.7.1-2.1) unstable; urgency=low + + * Non-maintainer upload. + * gpt.dpatch: Put the alternative GPT partition table one sector further + out, to avoid having it overlap with the last sector of one partition. + (Closes: #349718) + + -- Steinar H. Gunderson Wed, 5 Jul 2006 21:13:07 +0200 + + +parted (1.7.1-2) unstable; urgency=low + + [ Bastian Blank ] + * Fix s390 patch to not intend to use ibm disklabels on FBA. (Closes: #369580) + + [ Otavio Salvador ] + * Ack NMU. (Closes: #369491) + * Add Bastian Blank as uploader. + * Add libparted changelog in libparted1.7-1 and libparted1.7-dev + packages. (Closes: #369780) + * Apply patch from David Härdeman to improve lvm + support to include all kind of device-mapper devices. (Closes: #367965) + * Fix s390 patch to apply again after lvm support improvement. + + -- Otavio Salvador Fri, 2 Jun 2006 11:17:12 -0300 + +parted (1.7.1-1.1) unstable; urgency=low + + * Non-maintainer upload. + * Fix abi check. + + -- Bastian Blank Tue, 30 May 2006 17:00:54 +0200 + +parted (1.7.1-1) unstable; urgency=low + + * New upstream release. + - change soname version due a ABI change; + - update minor dependency requirement due ABI change; + * Update the baseline symbols to allow us to detect ABI changes. + * Enable ABI checking in build process (just in i386). + * Add cvs as build-dependency. (Closes: #368363). + + -- Otavio Salvador Mon, 29 May 2006 10:16:06 -0300 + +parted (1.7.0-1) unstable; urgency=low + + [ This version has some changes regarting to API and ABI so you'll + probably need to check your code if you link anything against it. ] + + * New upstream release. + - doc-package.dpatch: rediff since some parts was applied upstream + by me; + - reiserfs-libname.dpatch: rediff 'cause of files reorganization; + - devfs.dpatch: likewise; + - lvm2.dpatch: likewise; + - s390.dpatch: likewise; + - sparc-fix-raid: likewise; + - fix_rescue_segfault.dpatch: dropped since it was backport from + upstream; + - remove FAQ from parted-doc since upstream do not suply it + anymore. + * Use ABI brokeness detection code; + + -- Otavio Salvador Sat, 20 May 2006 00:32:36 -0300 + +parted (1.6.25.1-3) unstable; urgency=low + + * Apply patch to include kFreeBSD support. Thanks to Robert Millan + (Closes: #363381) + * Apply patch to use debhelper support for shlibs in udebs. Thanks to + Frans Pop (Closes: #360213) + * Apply patch to fix RAID usage in SPARC. Thanks to Fabio Di Nitto + (Closes: #355467) + + -- Otavio Salvador Thu, 20 Apr 2006 17:45:22 -0300 + +parted (1.6.25.1-2) unstable; urgency=medium + + [ Otavio Salvador ] + * New s390 patch. Urgency set to medium to try to hit testing in time to + release s390 in D-I Beta2 timeframe (Closes: #328992); + * Set capabitility level of debhelper to 4; + + -- Otavio Salvador Mon, 6 Feb 2006 21:37:10 -0200 + +parted (1.6.25.1-1) unstable; urgency=low + + [ Otavio Salvador ] + * New upstream release: + - sync_r388.dpatch: drop since is unneeded + * Really change libreadline dependency (Closes: #333957) + * Change DEPVER to 1.6.24 to force the right version number as + dependencie and to avoid ABI mistake (Closes: #322262) + * fix_rescue_segfault.dpatch: added. Backported from current development + version to avoid a segfault in some uses of rescue command. + + -- Otavio Salvador Thu, 17 Nov 2005 13:31:38 -0200 + +parted (1.6.24-4) unstable; urgency=low + + *** This version doesn't apply s390 support by default *** + + [ Otavio Salvador ] + * ubd.dpatch: update to new source code. + * Drop merged upstream patches: + - parted.8.dpatch + - id.po.dpatch + - es.po.dpatch + - sparc.dpatch + - gcc_warnings_fix.dpatch + - ubd.dpatch + - udev-devfs-rules.dpatch + * sync_r388.dpatch: add to include current upstream fixes. + * s390.dpatch: Resync with current upstream code. + * *Disable* s390.dpatch by default. It has some strange things that need + to be cleared. + + [ Bastian Blank ] + * s390.dpatch: Update to apply again. + + -- Otavio Salvador Mon, 10 Oct 2005 16:40:00 -0300 + +parted (1.6.24-3) unstable; urgency=high + + [ Otavio Salvador ] + * Applied patch from A. Costa to update README.Debian + about hfs support + * parted.8.dpatch: manpage patch from A. Costa + * id.po.dpatch: include Indonesian language + * es.po.dpatch: update Spanish language translation + * sparc.dpatch: recognize partitions on sun disklabel (Closes: #328694) + + -- Otavio Salvador Fri, 9 Sep 2005 10:49:35 -0300 + +parted (1.6.24-2) unstable; urgency=medium + + [ Otavio Salvador ] + * Bumb Standards-Version to 3.6.2 (no changes need) + * Update debian/watch to version 3 standard + * Change the build-dependency to libreadline5-dev | libreadline-dev to + allow the libreadline4-dev removal from archive ASAP. (Closes: #326309) + * Urgency set to medium since it hasn't code changes. + + -- Otavio Salvador Sat, 3 Sep 2005 12:57:49 -0300 + +parted (1.6.24-1) unstable; urgency=low + + [ Sven Luther ] + * New Upstream release. + + [ Otavio Salvador ] + * Applied my patch to solve building using Sarge's toolchain. (Closes: #321212) + * Patch included upstream to fix some small typos on German translation + (Jens Seidel ). (Closes: #313948) + * Really include udev-devfs-rules.dpatch but already on the updated + version (Colin Watson ). (Closes: #311664) + * Patch included upstream to update documentation for HFS and HFS+ + current status (Nikolaus Schulz ). (Closes: #298020) + * Applied patch to fix FTBFS on Hurd (Michael Banck + ). (Closes: #297580) + * gcc_warnings_fix.dpatch: Created to fix current warnings while + building using GCC 4.0. + * Change library soname to 13. + * Add myself on uploaders field. + + -- Otavio Salvador Sun, 21 Aug 2005 15:56:50 -0300 + +parted (1.6.23-3) unstable; urgency=low + + * Oh well, built -2 in a broken chroot, fixed now. + * Notice, i wwish to remember all readers that i have put out a request for + help for this package, and altough people replied, no long standing help + happened. As i am going to also need to take more upstream + responsabilities, i definitively want to recall for help on parted + packaging, especially for arches i am not so good with (and yes, this + includes x86 :). For the ubuntu guys, next time you make a patch, you are + welcome to do it in the parted subversion repository on alioth, and upload + both packages if i don't comment for a longer time like i did in June. + + -- Sven Luther Sun, 17 Jul 2005 07:33:11 +0200 + +parted (1.6.23-2) unstable; urgency=low + + * The following patches where taken from the ubuntu parted package : + - Fix gcc4 warning in lvm2 patch (Matthias Klose ) + - udev-devfs-rules.dpatch: Check for devfs-style /disc => /partN + transformation unconditionally; the system might be using udev with + devfs rules, and if not the test is harmless. + (Colin Watson ) + + -- Sven Luther Sat, 16 Jul 2005 22:15:46 +0000 + +parted (1.6.23-1) unstable; urgency=low + + * New upstream release (1.6.23) + - PedUnit: support for different units for sizes and offsets. + - Error message/UI cleanup. + - More CHS cleanup. + - Check /sys before trying deprecated SCSI_IOCTL_SEND_COMMAND. + - Better Apple_Free partition support. + - Allow resizing of extended partitions, even if some logical partitions + are mounted + - Various DVH changes. + - mac RAID and LVM support. + * New upstream release (1.6.22) + - hfs and hfs+ shrinking support merged in upstream. + - gcc4 fixes. + - minor UI and documentation changes/fixes. + - support lvm on mac partition tables. + * Backed out again the size column addition, was a patch from Jari Aalto + with regard to Bug #109613, but a new patch will + hopefully make it to 1.6.24. + * Unbashized dpatches (Closes: #298017) + * Fixed amiga partition tables to use RAID/LVM partition types instead of + subverting flags for it. + * Removed the s390 patch, which needs a full review with regard to the + PedUnit stuff i believe. In particular with regard to the sector size + support. Please try to get this one integrated upstream, as it is the last + problematic big debian-specific patch remaining. + + -- Sven Luther Mon, 11 Jul 2005 12:41:06 +0200 + +parted (1.6.21-1) unstable; urgency=low + + * Unstable build, as we will be moving 1.6.21 into sarge after all. + * Readded bunch of missing fixes from the sarge/sid branch : + - Dropped libreiserfs support. + - Now build depends on libreadline4-dev | libreadline-dev, to work around + the bogus libreadline5 upload during the sarge freeze. (Bug: #279574) + - Drop any udeb magic, fixing .udeb dependency generation (Bastian Blank). + (Bug: #270133) + - Added mention of HFS and HFS+ resize feature in manpage. (Bug: #275650) + + -- Sven Luther Sun, 30 Jan 2005 19:07:42 +0100 + +parted (1.6.21-0.exp.2) experimental; urgency=low + + * Dropped ubd patch, since it may be superceded by another fix in 1.6.21 : + - Sets the type to PED_DEVICE_UNKNOWN on block devices that don't fall + into the standard categories. This makes libparted correctly update + the kernel's view of partition tables, etc. + * Added comments about upstream status to all .dpatches. + * Dropped parted-bf, we no longer build this package in the sarge/sid version. + * Changed libparted1.6-udeb to provide libparted1.6-12. (Bug: #292781) + + -- Sven Luther Sun, 30 Jan 2005 18:47:10 +0100 + +parted (1.6.21-0.exp.1) experimental; urgency=low + + * New upstream release. + - renamed prep-boot PReP boot partition name to prep. + - Fixed PED_SWAP macros missing, obsoleting amiga-64bit dpatch. + - Fixed sun cylinder recording stuff, obsoleting sun_disklabel dpatch. + - Removed bogus assertion, obsoleting no-clobber dpatch. + - Only treat the device as devfs if it has /disc on the end. + - Now use _partition_is_mounted_by_dev instead of guessing the partition + device name. + - Sets the type to PED_DEVICE_UNKNOWN on block devices that don't fall + into the standard categories. This makes libparted correctly update + the kernel's view of partition tables, etc. + - Improved heuristic for finding broken dos partition tables: test if + any feasible solution geometry exists against the end cylinder rather + than 1024. This heuristic now has fewer false negatives and no false + positives. + + -- Sven Luther Sat, 29 Jan 2005 17:06:56 +0100 + +parted (1.6.20-0.exp.2) experimental; urgency=low + + * Fixed 64bit FTBFS in disk_amiga.c introduced by Andrew's cosmetic changes. + (Closes: #286462) + + -- Sven Luther Tue, 4 Jan 2005 22:52:18 +0100 + +parted (1.6.20-0.exp.1) experimental; urgency=low + + * New upstream release : + - now includes assorted debian patches, like the amiga partition table + support and the Smart BootManager stuff. + - dvh: zero out the boot file name record before writing the name in. + - only attempt to check file systems if checking is implemented for + that file system type. + - when correcting the boot sector, use fat_boot_sector_write() to make + sure the backup copy gets written (if applicable). + + -- Sven Luther Sat, 18 Dec 2004 19:26:17 +0100 + +parted (1.6.19-0.exp.3) experimental; urgency=low + + * Enabled MS-DOS disk label detection when Smart BootManager patch which was + forgotten previously :/ + + -- Sven Luther Tue, 14 Dec 2004 14:13:37 +0100 + +parted (1.6.19-0.exp.2) experimental; urgency=low + + * Re-enabled hfs patch, since i got a new version from Guillaume Knispel. + + -- Sven Luther Fri, 3 Dec 2004 18:45:16 +0100 + +parted (1.6.19-0.exp.1) experimental; urgency=low + + * New upstream release : + - refuses to resize Windows Dynamic Disk partitions. + - allows reparation of damaged FAT file systems with "check". + - assorted smaller changes. + + -- Sven Luther Sun, 28 Nov 2004 11:41:39 +0100 + +parted (1.6.18-0.exp.1) experimental; urgency=low + + * New upstream release : + - More dos CHS geometry fixes. + - Now knows about the new sun-ufs partition ID (0xbf). + - Longer than 32bit GPT partition fix. + - removed bogus (int) casts, may fix large partition table problem, see + Bug #279732. + * Legacy amiga hardware compatibility fixes : + - non-full blocks should be padded by 0x00 and not 0xff. + - builtin filesystem driver pointer offset was off by one, thus + causing libparted to overwrite them if partitions are added. + * Added RAID & LVM flag for partitions on amiga partition tables. + * Readded missing 1.6.9-3.2 fixes : + - MS-DOS disk label detection when Smart BootManager is installed fix by + Matt Kraai (Bug #259248). + - Recognize UML UBD devices by Matt Zimmerman (Bug #258188). + * Added PREP flag for MBR partition tables. (Bug #245451) + * Dropped hfs resize patch for now, as it doesn't apply cleanly to 1.6.18. + + -- Sven Luther Sat, 27 Nov 2004 11:57:51 +0100 + +parted (1.6.14-0.exp.2) experimental; urgency=low + + * Added new hfs patch. + + -- Sven Luther Wed, 8 Sep 2004 07:55:18 +0200 + +parted (1.6.14-0.exp.1) experimental; urgency=low + + * New upstream release. + + -- Sven Luther Mon, 6 Sep 2004 15:28:59 +0200 + +parted (1.6.12-0.exp.1) experimental; urgency=low + + * New upstream release. (Closes: #254502) + - should fix 2.6 kernel BIOS CHS geometry problems. Broke binary + compatibility though, thus the soname change. + * Substituted some inaccurate terms in the doc (Fabio Tranchitella). + (Closes: #211746) + * Update s390 patch (Bastian Blank). + * Always regenerate autoconf/automake files (Bastian Blank). + * Dropped dvh patch, since a cleaner version is now upstream (Sven Luther). + * New updated hfs-resize patch (Guillaume Knispel) + + * Thanks to Fabio Tranchitella, Bastian Blank, Guillaume Knispel and + Peter Samuelson who made this release possible. + + -- Sven Luther Thu, 2 Sep 2004 09:41:29 +0200 + +parted (1.6.11-9) unstable; urgency=low + + * Applied large-partitions patch to show correct partition data. Thanks + go to Peter Chubb for providing the patch. + (Closes: #279732) + + -- Sven Luther Thu, 25 Nov 2004 14:32:36 +0100 + +parted (1.6.11-8) unstable; urgency=low + + * Now build depends on libreadline4-dev | libreadline-dev, to work around + the bogus libreadline5 upload during the sarge freeze. (Closes: #279574) + + -- Sven Luther Thu, 4 Nov 2004 14:42:11 +0100 + +parted (1.6.11-7) unstable; urgency=low + + * Added LVM flag for partitions on amiga partition tables. + * Added PREP flag for MBR partition tables. (Closes: #245451) + * Added mention of HFS and HFS+ resize feature in manpage. + (Closes: #275650) + * Dropped libreiserfs0.3-0 recommend, as it is no more part of sarge. + (Closes: #276887) + * Really readded missing 1.6.9-3.2 fixes : + - MS-DOS disk label detection when Smart BootManager is installed fix by + Matt Kraai (Bug #259248). + + -- Sven Luther Mon, 1 Nov 2004 12:03:25 +0100 + +parted (1.6.11-6) unstable; urgency=low + + * Really apply the chs patch this time. + * Rewrote description and README.Debian to take care of removed reiserfs + support as well as added amiga filesystem probing support. + (Closes: #273751) + + -- Sven Luther Tue, 28 Sep 2004 06:11:58 +0200 + +parted (1.6.11-5) unstable; urgency=low + + * Added RAID flag to amiga partition tables. + * Removed libreiserfs support, since progreiserfs will be kicked from sarge + (Closes: #272783). + + -- Sven Luther Sat, 25 Sep 2004 00:32:15 +0200 + +parted (1.6.11-4) unstable; urgency=low + + * Legacy amiga hardware compatibility fixes : + - non-full blocks should be padded by 0x00 and not 0xff. + - builtin filesystem driver pointer offset was off by one, thus causing + libparted to overwrite them if partitions are added. + * Readded missing 1.6.9-3.2 fixes : + - MS-DOS disk label detection when Smart BootManager is installed fix by + Matt Kraai (Bug #259248). + - Recognize UML UBD devices by Matt Zimmerman (Bug #258188). + - gcc 3.4 build fixes by Andreas Jochens (Bug #259534). + * Dropped last remains of the parted-bf package. + + -- Sven Luther Fri, 17 Sep 2004 10:51:34 +0200 + +parted (1.6.11-3) unstable; urgency=low + + * Drop any udeb magic, fixing .udeb dependency generation (Bastian Blank). + (Closes: #270133) + * Moved the maintainer address to the parted-maintainers alioth list. + + -- Sven Luther Mon, 6 Sep 2004 14:13:12 +0200 + +parted (1.6.11-2) unstable; urgency=low + + * Should have gone into unstable, not experimental :/ + + -- Sven Luther Fri, 3 Sep 2004 19:27:47 +0200 + +parted (1.6.11-1) experimental; urgency=low + + * New upstream release. (Closes: #254502) + - should fix 2.6 kernel BIOS CHS geometry problems. Broke binary + compatibility though, thus the soname change. + * Substituted some inaccurate terms in the doc (Fabio Tranchitella). + (Closes: #211746) + * Update s390 patch (Bastian Blank). + * Always regenerate autoconf/automake files (Bastian Blank). + * New updated hfs-resize patch (Guillaume Knispel) + * Added backported CHS BIOS geometry fix. + - libparted/disk_dos.c (read_table, process_bad_chs): now probes + Microsoft file systems for BIOS CHS geometry. This idea was + suggested by Steffen Winterfeldt . + + * Thanks to Fabio Tranchitella, Bastian Blank, Guillaume Knispel and + Peter Samuelson who made this release possible. + + -- Sven Luther Thu, 2 Sep 2004 09:41:29 +0200 + +parted (1.6.9-3.2) unstable; urgency=low + + * Non-maintainer upload with maintainer approval. + * Detect a MS-DOS disk label when Smart BootManager is installed + (closes: #259248). + * Fix build failure, thanks to Andreas Jochens (closes: #259534). + * Recognize UML UBD devices, thanks to Matt Zimmerman (closes: #258188). + + -- Matt Kraai Sun, 08 Aug 2004 11:00:32 -0700 + +parted (1.6.9-3.1) unstable; urgency=low + + * Non-maintainer upload with permission of the maintainer. + * Add patch to write a proper DVH header. Thanks to Thiemo Seufer. + (Closes: #239371) + + -- Martin Michlmayr Sun, 20 Jun 2004 14:10:44 +0100 + +parted (1.6.9-3) unstable; urgency=low + + * Non-maintainer upload with permission of the maintainer. + * Add patch to find LVM2 devices by looking in /dev/mapper. Thanks + to Andres Salomon. (Closes: #247174) + + -- Martin Michlmayr Sun, 09 May 2004 00:23:33 +0100 + +parted (1.6.9-2) unstable; urgency=low + + * Add devfs partition detection patch for 2.6 kernels, thanks to + Joey Hess . (Closes: #243635) + * Added a more complete s390 sector size patch by Lucius Leland + . (Closes: #243554) + + -- Sven Luther Wed, 14 Apr 2004 10:27:58 +0200 + +parted (1.6.9-1) unstable; urgency=low + + * New upstream release, gcc-33, linux-kernel-header, m68k-padding, palo and + parted-m4 are now included upstream. + * Really apply sun disk label patch. + + -- Sven Luther Wed, 14 Apr 2004 09:14:21 +0200 + +parted (1.6.6-11) unstable; urgency=low + + * Fixed broken sun disk label reading. Thanks to Peter Samuelson for testing + and providing the patch. (Closes: #238091) + * libparted-udeb not provides libparted1.6-0 too. (Closes: #239334) + + -- Sven Luther Mon, 29 Mar 2004 14:50:31 +0200 + +parted (1.6.6-10) unstable; urgency=low + + * Added patch by Bastian Blank to take sector size in account on hardware + needing bigger than 512 byte. (Closes: #236325) + + -- Sven Luther Thu, 18 Mar 2004 14:18:58 +0100 + +parted (1.6.6-9) unstable; urgency=low + + * debian/control.in: Added dpatch Build-Dependancy, debian/control is + generated from this file, which is why this build-dep kept being deleted. + (closes: #232570) + * Created new errors-to-stderr patch to print exceptions to stderr when in + script mode (closes: #196040) + + -- Timshel Knoll-Miller Tue, 24 Feb 2004 10:54:11 +1100 + +parted (1.6.6-8) unstable; urgency=low + + * Added read-gpt-1.02 patch to allow reading GPT header revision 1.02 + (closes: #210584) + * Added minor documenation fix to doc-package patch + (closes: #211747) + + -- Timshel Knoll-Miller Wed, 11 Feb 2004 18:08:14 +1100 + +parted (1.6.6-7) unstable; urgency=low + + * Added palo patch needed on parisc, thanks go to Richard Hirst + for providing a patch. + (Closes: #229626). + * Added parted.m4 patch provided by Petter Reinholdtsen , + (Closes: #223764). + + -- Sven Luther Tue, 27 Jan 2004 11:16:30 +0100 + +parted (1.6.6-6) unstable; urgency=low + + * dpatch build-depency got lost again :(. + + -- Sven Luther Sun, 25 Jan 2004 12:34:20 +0100 + +parted (1.6.6-5) unstable; urgency=low + + * Added hfs resize patch from Guillaume Knispel . + (Closes: #226115) + + -- Sven Luther Sat, 24 Jan 2004 16:33:14 +0100 + +parted (1.6.6-4) unstable; urgency=low + + * Aknowledge Petter's NMU. (Closes: #225875) + * Fix amiga block checksum fixing. + + -- Sven Luther Thu, 22 Jan 2004 19:48:50 +0100 + +parted (1.6.6-3.1) unstable; urgency=low + + * Non-maintainer upload to fix d-i problem before deadline. + * Add build-depend on dpatch. (Closes: #225875) + + -- Petter Reinholdtsen Fri, 2 Jan 2004 18:27:52 +0100 + +parted (1.6.6-3) unstable; urgency=low + + * Removed some extra () around BLKGETSIZE64 that were not really needed. + * Removed a fs->clobber assertion that did break since the amiga filesystem + doesn't provide a clobber op. (Closes: #225754) + + -- Sven Luther Thu, 1 Jan 2004 20:40:39 +0100 + +parted (1.6.6-2) unstable; urgency=low + + * Adding myself as comaintainer of the package, as discussed with Timshel + Knoll. + * Start using dpatch, and move all debian specific patches into + debian/patches/*.dpatch. Thanks to Petter Reinholdtsen + for doing the work. + * Added libuuid dependency to udebs. Thanks to Matt Kraai + for providing the patch and following this. (Closes: #221225, #221226) + + -- Sven Luther Wed, 31 Dec 2003 08:54:24 +0100 + +parted (1.6.6-1.2) unstable; urgency=low + + * Added amiga filesystem probing support. (Closes: #219947) + * Fixed wrong linux/fs.h header copying. (Closes: #218980) + * Now build-depends on the fixed version of linux-kernel-headers, so we + don't get bit by the __invalid_size_argument_for_IOC signedness problem. + (See bug #219940) + + -- Sven Luther Tue, 16 Dec 2003 14:22:33 +0100 + +parted (1.6.6-1.1) unstable; urgency=low + + * Added amiga RDB partitioning support. (Closes: #212536) + * Do not install policy-prohibited control files in udebs. + Thanks to Matt Kraai for the patch. (Closes: #216133) + + -- Sven Luther Wed, 29 Oct 2003 16:11:35 +0100 + +parted (1.6.6-1) unstable; urgency=low + + * New upstream release + + -- Timshel Knoll Tue, 2 Sep 2003 00:43:00 +1000 + +parted (1.6.5-3) unstable; urgency=low + + * Policy 3.5.9, Made udebs Priority: extra + * Changed descriptions to add that parted can remove all listed + filesystems (closes: #191523) + * Applied missing type suffix compile fix patch for gcc-3.3 and hurd, + thanks to Ognyan Kulev and Sven Luther (closes: #195318, #200337) + * m68k padding fix patch patch from Sven Luther (closes: #207634) + + -- Timshel Knoll Sat, 30 Aug 2003 10:44:52 +1000 + +parted (1.6.5-2) unstable; urgency=low + + * NMU with maintainers consent. + * Fixed some gcc 3.3 build problems. (Closes: #200337) + + -- Sven Luther Thu, 24 Jul 2003 10:36:15 +0200 + +parted (1.6.5-1) unstable; urgency=low + + * New upstream release + * Made libparted1.6-dev and libparted1.6-dbg Section: libdevel + + -- Timshel Knoll Wed, 30 Apr 2003 16:01:19 +1000 + +parted (1.6.4-2) unstable; urgency=low + + * debian/control.in: Build-Depends: debhelper (>= 4.1.1), as dh_shlibdeps' + -L flag was introduced in that version (closes: #179473) + * debian/rules: Update config.sub and config.guess on clean + + -- Timshel Knoll Wed, 19 Feb 2003 22:13:22 +1100 + +parted (1.6.4-1) unstable; urgency=low + + * New upstream release + + ped_disk_destroy API documentation inconsistency fixed (closes: #168850) + + the invalidate: busy buffer warning message issue was actually fixed + in the 1.6.0-pre5 release (closes: #146607) + + Mention is now made of the root disk in the info docs (closes: #157003) + * Standards-Version: 3.5.8: + + Support building with gcc -g by default, support DEB_BUILD_OPTIONS=noopt + * Made libparted1.6-0 Suggests: parted | nparted (closes: #168177) + * Removed . from end of libparted1.6-0 synopsis to fix lintian error + * Build udeb packages libparted1.6-udeb and parted-udeb for + debian-installer, built with the -Os gcc flag to optimise for size + (parted-bf is also now built with -Os) (thanks to + Dann Frazier for a udeb patch) (closes: #172020) + * Made libparted's reiserfs support dlopen the full filename of libreiserfs, + rather than just the libreiserfs.so symlink. This means that parted's + reiserfs support will now work without the libreiserfs0.3-dev package + being installed (closes: #163107) + + -- Timshel Knoll Tue, 10 Dec 2002 23:25:59 +1100 + +parted (1.6.3-3) unstable; urgency=low + + * GNU Parted is now built against libreiserfs (closes: #156149) + * debian/control: + + Build-Depend on libreiserfs0.3-dev + + libparted1.6-0 now Recommends: libreiserfs0.3-0 + + -- Timshel Knoll Wed, 11 Sep 2002 01:45:21 +1000 + +parted (1.6.3-2) unstable; urgency=low + + * debian/rules: use readlink to read link destination (closes: #157821) + + -- Timshel Knoll Thu, 22 Aug 2002 18:18:23 +1000 + +parted (1.6.3-1) unstable; urgency=low + + * New upstream release + * debian/control: + + Fixed Priority: override disparities (default Priority was still extra + from when these were experimental parted1.6 packages) + + Remove details of pre-release status notice from package description + (closes: #152655, #154818) + * Direct people looking for info docs to the parted-doc package + (closes: #152042) + * Wierd ... ls -l x | awk '{ print $11 }' is no longer giving the symlink + dest, $10 is though :-/. I'll see how this goes with $10 ... + + -- Timshel Knoll Tue, 20 Aug 2002 19:40:44 +1000 + +parted (1.6.2-1) unstable; urgency=low + + * New upstream release + * Build-Depend on texinfo (>= 4.2), as parted.texi uses a new 4.2 directive + + -- Timshel Knoll Wed, 10 Jul 2002 08:51:17 +1000 + +parted (1.6.1-1) unstable; urgency=low + + * New upstream release + + -- Timshel Knoll Tue, 18 Jun 2002 16:42:47 +1000 + +parted (1.6.0-1) unstable; urgency=low + + * New upstream release + * Source package renamed back to "parted", 1.6 is now considered + "stable" so uploaded to sid + + -- Timshel Knoll Tue, 30 Apr 2002 23:05:42 +1000 + +parted1.6 (1.5+1.6.0-pre10-1) experimental; urgency=low + + * New upstream pre-release + * This upstream release supports creating/resizing reiserfs filesystems, + if Yury Umanets' libreiserfs is installed. However, there is no Debian + package of libreiserfs (yet - I am working on it). So if you want this + support, you'll have to fetch progsreiserfs from + http://reiserfs.linux.kiev.ua/ and compile/install it yourself for this + support to be activated. + + -- Timshel Knoll Fri, 26 Apr 2002 01:51:04 +1000 + +parted1.6 (1.5+1.6.0-pre9-1) experimental; urgency=low + + * New upstream pre-release + + -- Timshel Knoll Wed, 10 Apr 2002 15:11:52 +1000 + +parted1.6 (1.5+1.6.0-pre8-1) experimental; urgency=low + + * New upstream pre-release + + -- Timshel Knoll Mon, 8 Apr 2002 23:23:20 +1000 + +parted1.6 (1.5+1.6.0-pre7-1) experimental; urgency=low + + * New upstream pre-release + + -- Timshel Knoll Sat, 6 Apr 2002 01:08:35 +1000 + +parted1.6 (1.5+1.6.0-pre6-1) experimental; urgency=low + + * New upstream pre-release + + -- Timshel Knoll Sat, 6 Apr 2002 00:42:30 +1000 + +parted1.6 (1.5+1.6.0-pre5-2) experimental; urgency=low + + * Recompile against latest e2fsprogs to fix dependancy issues + (see e2fsprogs #139274) + + -- Timshel Knoll Tue, 26 Mar 2002 18:19:58 +1100 + +parted1.6 (1.5+1.6.0-pre5-1) experimental; urgency=low + + * New upstream pre-release + * debian/{partprobe.8, parted.manpages, rules}: manpage added for partprobe + (closes: #137104) + * debian/control.in: make all parted1.6 packages Priority: extra, as + parted1.6 and parted1.6-doc Conflict: with the optional parted and + parted-doc packages. + * removed "#include " from libparted/fs_linux_swap/linux_swap.c, + which should fix build problems on ia64. + + -- Timshel Knoll Tue, 26 Mar 2002 17:09:08 +1100 + +parted1.6 (1.5+1.6.0-pre4-1) experimental; urgency=low + + * New upstream pre-release + * debian/control.in, debian/rules: ship locales package separately. This + means that libparted1.6-0 no longer needs to Conflict: libparted1.4, + both packages can be installed concurrently. Actually, I just realised + that libparted1.6-0 never actually needed to Conflict: libparted1.4, + Replaces: libparted1.4 would have been enough ... + * debian/control.in: + - Added pre-release status of package to package descriptions + (closes: #137475) + - Made libparted1.6-0 Replaces: libparted1.4 (<< 1.4.24-2). + libparted1.4 (>= 1.4.24-2) should be able to co-exist with libparted1.6, + but I forgot about the (<< 1.4.24-2) case ... (closes: #137567) + * debian/rules: + - debian/rules: use DESTDIR rather than prefix when 'make install'ing. + Use $(CURDIR) instead of `pwd`. + - lots of small fixes + - remove the locales dir from debian/tmp before checking if any files + are left after dh_movefiles + * debian/parted.files: Grab all of sbin rather than just sbin/parted. + This picks up partprobe + * debian/parted.undocumented: partprobe currently has no manpage (will be + fixed before 1.6.0-1 goes into sid) + + -- Timshel Knoll Wed, 13 Mar 2002 15:18:43 +1100 + +parted1.6 (1.5+1.6.0-pre3-1) experimental; urgency=low + + * New upstream pre-release + * debian/control.in: -doc package name changed to parted1.6-doc ... + * debian/rules: generate parted1.6-doc.* files + + -- Timshel Knoll Tue, 5 Mar 2002 14:20:04 +1100 + +parted1.6 (1.5+1.6.0-pre2-1) experimental; urgency=low + + * New upstream pre-release, built for experimental + * Don't include doc/USER in parted-doc, use the doc/parted.info texinfo file + instead ... + * Build the library packages as libparted[upstream 2 digit version]-[soname] + eg. libparted1.6-0 + + -- Timshel Knoll Fri, 1 Feb 2002 21:02:00 +1100 + +parted1.6 (1.5+1.6.0-pre1-1) unstable; urgency=low + + * New packages of 1.6 pre-release series + * Fixed compile warnings (hence errors with -Werror) in + libparted/disk_mips.c + + -- Timshel Knoll Fri, 1 Feb 2002 18:41:31 +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 --- parted-2.3.orig/debian/compat +++ parted-2.3/debian/compat @@ -0,0 +1 @@ +7 --- parted-2.3.orig/debian/control +++ parted-2.3/debian/control @@ -0,0 +1,175 @@ +Source: parted +Section: admin +Priority: optional +Maintainer: Parted Maintainer Team +Uploaders: Otavio Salvador , Bastian Blank , Xavier Oswald , Colin Watson +Standards-Version: 3.8.4 +Vcs-Git: git://git.debian.org/git/parted/debian/parted.git +Vcs-Browser: http://git.debian.org/?p=parted/debian/parted.git +Homepage: http://www.gnu.org/software/parted +Build-Depends: + dpkg-dev (>= 1.15.7~), + debhelper (>= 8.1.3), + quilt, + libncurses-dev | libncurses5-dev, + libreadline-dev | libreadline6-dev, + libdevmapper-dev (>= 2:1.02.33) [linux-any], + uuid-dev, + gettext, + texinfo (>= 4.2), + debianutils (>= 1.13.1), + libblkid-dev, + po4a, + pkg-config, + check, + dh-autoreconf, + autopoint + +Package: parted +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Suggests: parted-doc +Conflicts: fsresize, parted1.6 +Replaces: fsresize, parted1.6 +Description: disk partition manipulator + GNU Parted is a program that allows you to create, destroy, resize, + move, and copy disk partitions. This is useful for creating space + for new operating systems, reorganizing disk usage, and copying data + to new hard disks. + . + This package contains the binary and manual page. Further + documentation is available in parted-doc. + . + Parted currently supports DOS, Mac, Sun, BSD, GPT, MIPS, and PC98 + partitioning formats, as well as a "loop" (raw disk) type which + allows use on RAID/LVM. It can detect and remove ASFS/AFFS/APFS, + Btrfs, ext2/3/4, FAT16/32, HFS, JFS, linux-swap, UFS, XFS, and ZFS + file systems. Parted also has the ability to create and modify file + systems of some of these types, but using it to perform file system + operations is now deprecated. + . + The nature of this software means that any bugs could cause massive + data loss. While there are no such bugs known 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-udeb +XC-Package-Type: udeb +Architecture: any +Section: debian-installer +Priority: extra +XB-Installer-Menu-Item: 99999 +Depends: ${shlibs:Depends} +Description: Manually partition a hard drive (parted) + +Package: libparted0 +Architecture: any +Section: libs +Priority: extra +Depends: ${misc:Depends}, libparted0debian1 (= ${binary:Version}) +Description: disk partition manipulator - dummy package + This is a dummy package providing smooth upgrades to + libparted0debian1. You can safely remove it if no other + package depends on it. + +Package: libparted0debian1 +Architecture: any +Section: libs +Pre-Depends: ${misc:Pre-Depends} +Depends: ${shlibs:Depends}, ${misc:Depends} +Suggests: parted | nparted, libparted0-dev, libparted0-i18n (= ${source:Version}) +Conflicts: parted (<< 1.4.13+14pre1), libparted1 (<< 2.2), libparted2 (<< 2.2) +Replaces: libparted0 (<< 2.2-4), libparted1 (<< 2.2), libparted2 (<< 2.2), libparted1.4 (<< 1.4.24-2) +Provides: libparted +Breaks: python-parted (<< 3.6-5) +Multi-Arch: same +Description: disk partition manipulator - shared library + GNU Parted is a program that allows you to create, destroy, resize, + move, and copy disk partitions. This is useful for creating space + for new operating systems, reorganizing disk usage, and copying data + to new hard disks. + . + This package contains the shared library. + +Package: libparted0-udeb +XC-Package-Type: udeb +Architecture: any +Section: debian-installer +Priority: extra +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: disk partition manipulator - library udeb + GNU Parted is a program that allows you to create, destroy, resize, + move, and copy disk partitions. This is useful for creating space + for new operating systems, reorganizing disk usage, and copying data + to new hard disks. + . + This is a cut-down library package for use in debian-installer. + +Package: libparted0-i18n +Architecture: all +Section: localization +Depends: libparted0debian1, ${misc:Depends} +Replaces: libparted1 (<< 2.2), libparted2 (<< 2.2), libparted1.4 (<< 1.4.24-2), libparted1.6 (<< 1.5+1.6.0-pre3-2), libparted1.4-i18n, parted (<< 1.4.13+14pre1) +Conflicts: libparted-i18n +Provides: libparted-i18n +Description: disk partition manipulator - i18n support + GNU Parted is a program that allows you to create, destroy, resize, + move, and copy disk partitions. This is useful for creating space + for new operating systems, reorganizing disk usage, and copying data + to new hard disks. + . + This package contains localization data. + +Package: libparted0-dev +Architecture: any +Section: libdevel +Depends: libc6-dev, libparted0debian1 (= ${binary:Version}), libdevmapper-dev (>= 1.02.33) [linux-any], uuid-dev, libblkid-dev, ${misc:Depends} +Suggests: parted (= ${binary:Version}), parted-doc +Conflicts: libparted-dev, parted (<< 1.2.11) +Replaces: libparted-dev, libparted2-dev (<< 2.2) +Provides: libparted-dev +Description: disk partition manipulator - development files + GNU Parted is a program that allows you to create, destroy, resize, + move, and copy disk partitions. This is useful for creating space + for new operating systems, reorganizing 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. + +Package: libparted0debian1-dbg +Architecture: any +Section: debug +Priority: extra +Depends: libparted0debian1 (= ${binary:Version}), libparted0-dev (= ${binary:Version}), ${misc:Depends} +Conflicts: libparted-dbg +Replaces: libparted-dbg, libparted0-dbg (<< 2.2-4) +Provides: libparted-dbg +Description: disk partition manipulator - debugging symbols + GNU Parted is a program that allows you to create, destroy, resize, + move, and copy disk partitions. This is useful for creating space + for new operating systems, reorganizing disk usage, and copying data + to new hard disks. + . + This package contains the debugging static library for libparted, + which is 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. + +Package: parted-doc +Architecture: all +Section: doc +Suggests: parted | libparted0-dev +Conflicts: parted1.6-doc +Replaces: parted1.6-doc +Depends: ${misc:Depends}, install-info +Description: disk partition manipulator - documentation + GNU Parted is a program that allows you to create, destroy, resize, + move, and copy disk partitions. This is useful for creating space + for new operating systems, reorganizing disk usage, and copying data + to new hard disks. + . + This package contains user documentation for parted and API + documentation for the library packages. --- parted-2.3.orig/debian/control.in +++ parted-2.3/debian/control.in @@ -0,0 +1,175 @@ +Source: parted@BINPKGVER@ +Section: admin +Priority: optional +Maintainer: Parted Maintainer Team +Uploaders: Otavio Salvador , Bastian Blank , Xavier Oswald , Colin Watson +Standards-Version: 3.8.4 +Vcs-Git: git://git.debian.org/git/parted/debian/parted.git +Vcs-Browser: http://git.debian.org/?p=parted/debian/parted.git +Homepage: http://www.gnu.org/software/parted +Build-Depends: + dpkg-dev (>= 1.15.7~), + debhelper (>= 8.1.3), + quilt, + libncurses-dev | libncurses5-dev, + libreadline-dev | libreadline6-dev, + libdevmapper-dev (>= 2:1.02.33) [linux-any], + uuid-dev, + gettext, + texinfo (>= 4.2), + debianutils (>= 1.13.1), + libblkid-dev, + po4a, + pkg-config, + check, + dh-autoreconf, + autopoint + +Package: parted@BINPKGVER@ +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Suggests: parted@BINPKGVER@-doc +Conflicts: fsresize, parted1.6 +Replaces: fsresize, parted1.6 +Description: disk partition manipulator + GNU Parted is a program that allows you to create, destroy, resize, + move, and copy disk partitions. This is useful for creating space + for new operating systems, reorganizing disk usage, and copying data + to new hard disks. + . + This package contains the binary and manual page. Further + documentation is available in parted-doc. + . + Parted currently supports DOS, Mac, Sun, BSD, GPT, MIPS, and PC98 + partitioning formats, as well as a "loop" (raw disk) type which + allows use on RAID/LVM. It can detect and remove ASFS/AFFS/APFS, + Btrfs, ext2/3/4, FAT16/32, HFS, JFS, linux-swap, UFS, XFS, and ZFS + file systems. Parted also has the ability to create and modify file + systems of some of these types, but using it to perform file system + operations is now deprecated. + . + The nature of this software means that any bugs could cause massive + data loss. While there are no such bugs known 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@BINPKGVER@-udeb +XC-Package-Type: udeb +Architecture: any +Section: debian-installer +Priority: extra +XB-Installer-Menu-Item: 99999 +Depends: ${shlibs:Depends} +Description: Manually partition a hard drive (parted) + +Package: libparted@LIBSONAME@ +Architecture: any +Section: libs +Priority: extra +Depends: ${misc:Depends}, libparted@LIBSONAME@debian1 (= ${binary:Version}) +Description: disk partition manipulator - dummy package + This is a dummy package providing smooth upgrades to + libparted@LIBSONAME@debian1. You can safely remove it if no other + package depends on it. + +Package: libparted@LIBSONAME@debian1 +Architecture: any +Section: libs +Pre-Depends: ${misc:Pre-Depends} +Depends: ${shlibs:Depends}, ${misc:Depends} +Suggests: parted | nparted, libparted@LIBSONAME@-dev, libparted@LIBSONAME@-i18n (= ${source:Version}) +Conflicts: parted (<< 1.4.13+14pre1), libparted1 (<< 2.2), libparted2 (<< 2.2) +Replaces: libparted0 (<< 2.2-4), libparted1 (<< 2.2), libparted2 (<< 2.2), libparted1.4 (<< 1.4.24-2) +Provides: libparted +Breaks: python-parted (<< 3.6-5) +Multi-Arch: same +Description: disk partition manipulator - shared library + GNU Parted is a program that allows you to create, destroy, resize, + move, and copy disk partitions. This is useful for creating space + for new operating systems, reorganizing disk usage, and copying data + to new hard disks. + . + This package contains the shared library. + +Package: libparted@LIBSONAME@-udeb +XC-Package-Type: udeb +Architecture: any +Section: debian-installer +Priority: extra +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: disk partition manipulator - library udeb + GNU Parted is a program that allows you to create, destroy, resize, + move, and copy disk partitions. This is useful for creating space + for new operating systems, reorganizing disk usage, and copying data + to new hard disks. + . + This is a cut-down library package for use in debian-installer. + +Package: libparted@LIBSONAME@-i18n +Architecture: all +Section: localization +Depends: libparted@LIBSONAME@debian1, ${misc:Depends} +Replaces: libparted1 (<< 2.2), libparted2 (<< 2.2), libparted1.4 (<< 1.4.24-2), libparted1.6 (<< 1.5+1.6.0-pre3-2), libparted1.4-i18n, parted (<< 1.4.13+14pre1) +Conflicts: libparted-i18n +Provides: libparted-i18n +Description: disk partition manipulator - i18n support + GNU Parted is a program that allows you to create, destroy, resize, + move, and copy disk partitions. This is useful for creating space + for new operating systems, reorganizing disk usage, and copying data + to new hard disks. + . + This package contains localization data. + +Package: libparted@LIBSONAME@-dev +Architecture: any +Section: libdevel +Depends: libc6-dev, libparted@LIBSONAME@debian1 (= ${binary:Version}), libdevmapper-dev (>= 1.02.33) [linux-any], uuid-dev, libblkid-dev, ${misc:Depends} +Suggests: parted@BINPKGVER@ (= ${binary:Version}), parted@BINPKGVER@-doc +Conflicts: libparted-dev, parted (<< 1.2.11) +Replaces: libparted-dev, libparted2-dev (<< 2.2) +Provides: libparted-dev +Description: disk partition manipulator - development files + GNU Parted is a program that allows you to create, destroy, resize, + move, and copy disk partitions. This is useful for creating space + for new operating systems, reorganizing 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. + +Package: libparted@LIBSONAME@debian1-dbg +Architecture: any +Section: debug +Priority: extra +Depends: libparted@LIBSONAME@debian1 (= ${binary:Version}), libparted@LIBSONAME@-dev (= ${binary:Version}), ${misc:Depends} +Conflicts: libparted-dbg +Replaces: libparted-dbg, libparted0-dbg (<< 2.2-4) +Provides: libparted-dbg +Description: disk partition manipulator - debugging symbols + GNU Parted is a program that allows you to create, destroy, resize, + move, and copy disk partitions. This is useful for creating space + for new operating systems, reorganizing disk usage, and copying data + to new hard disks. + . + This package contains the debugging static library for libparted, + which is 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. + +Package: parted@BINPKGVER@-doc +Architecture: all +Section: doc +Suggests: parted@BINPKGVER@ | libparted@LIBSONAME@-dev +Conflicts: parted1.6-doc +Replaces: parted1.6-doc +Depends: ${misc:Depends}, install-info +Description: disk partition manipulator - documentation + GNU Parted is a program that allows you to create, destroy, resize, + move, and copy disk partitions. This is useful for creating space + for new operating systems, reorganizing disk usage, and copying data + to new hard disks. + . + This package contains user documentation for parted and API + documentation for the library packages. --- parted-2.3.orig/debian/copyright +++ parted-2.3/debian/copyright @@ -0,0 +1,429 @@ +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-2007 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 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. + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License v3 can be found in `/usr/share/common-licenses/GPL-3'. + + -- Otavio Salvador Mon, 24 Mar 2008 23:30:11 +0000 + + +The info documentation, contained in the parted-doc package, is licensed as +follows: + + Copyright (C) 1999-2009 Free Software Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.1 or + any later version published by the Free Software Foundation; with no + Invariant Sections, with no Front-Cover Texts, and with no Back-Cover + Texts. A copy of the license is included in the section entitled ``GNU + Free Documentation License''. + +(Note that, since this specifies no unmodifiable sections, the documentation +is free per http://www.debian.org/vote/2006/vote_001#outcome.) + +The complete text of the GNU FDL 1.1, taken from Appendix A to parted.info, +follows. + +A.1 GNU Free Documentation License +================================== + + Version 1.1, March 2000 + + Copyright (C) 2000 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + 0. PREAMBLE + + The purpose of this License is to make a manual, textbook, or other + written document "free" in the sense of freedom: to assure everyone + the effective freedom to copy and redistribute it, with or without + modifying it, either commercially or noncommercially. Secondarily, + this License preserves for the author and publisher a way to get + credit for their work, while not being considered responsible for + modifications made by others. + + This License is a kind of "copyleft", which means that derivative + works of the document must themselves be free in the same sense. + It complements the GNU General Public License, which is a copyleft + license designed for free software. + + We have designed this License in order to use it for manuals for + free software, because free software needs free documentation: a + free program should come with manuals providing the same freedoms + that the software does. But this License is not limited to + software manuals; it can be used for any textual work, regardless + of subject matter or whether it is published as a printed book. + We recommend this License principally for works whose purpose is + instruction or reference. + + 1. APPLICABILITY AND DEFINITIONS + + This License applies to any manual or other work that contains a + notice placed by the copyright holder saying it can be distributed + under the terms of this License. The "Document", below, refers to + any such manual or work. Any member of the public is a licensee, + and is addressed as "you". + + A "Modified Version" of the Document means any work containing the + Document or a portion of it, either copied verbatim, or with + modifications and/or translated into another language. + + A "Secondary Section" is a named appendix or a front-matter + section of the Document that deals exclusively with the + relationship of the publishers or authors of the Document to the + Document's overall subject (or to related matters) and contains + nothing that could fall directly within that overall subject. + (For example, if the Document is in part a textbook of + mathematics, a Secondary Section may not explain any mathematics.) + The relationship could be a matter of historical connection with + the subject or with related matters, or of legal, commercial, + philosophical, ethical or political position regarding them. + + The "Invariant Sections" are certain Secondary Sections whose + titles are designated, as being those of Invariant Sections, in + the notice that says that the Document is released under this + License. + + The "Cover Texts" are certain short passages of text that are + listed, as Front-Cover Texts or Back-Cover Texts, in the notice + that says that the Document is released under this License. + + A "Transparent" copy of the Document means a machine-readable copy, + represented in a format whose specification is available to the + general public, whose contents can be viewed and edited directly + and straightforwardly with generic text editors or (for images + composed of pixels) generic paint programs or (for drawings) some + widely available drawing editor, and that is suitable for input to + text formatters or for automatic translation to a variety of + formats suitable for input to text formatters. A copy made in an + otherwise Transparent file format whose markup has been designed + to thwart or discourage subsequent modification by readers is not + Transparent. A copy that is not "Transparent" is called "Opaque". + + Examples of suitable formats for Transparent copies include plain + ASCII without markup, Texinfo input format, LaTeX input format, + SGML or XML using a publicly available DTD, and + standard-conforming simple HTML designed for human modification. + Opaque formats include PostScript, PDF, proprietary formats that + can be read and edited only by proprietary word processors, SGML + or XML for which the DTD and/or processing tools are not generally + available, and the machine-generated HTML produced by some word + processors for output purposes only. + + The "Title Page" means, for a printed book, the title page itself, + plus such following pages as are needed to hold, legibly, the + material this License requires to appear in the title page. For + works in formats which do not have any title page as such, "Title + Page" means the text near the most prominent appearance of the + work's title, preceding the beginning of the body of the text. + + 2. VERBATIM COPYING + + You may copy and distribute the Document in any medium, either + commercially or noncommercially, provided that this License, the + copyright notices, and the license notice saying this License + applies to the Document are reproduced in all copies, and that you + add no other conditions whatsoever to those of this License. You + may not use technical measures to obstruct or control the reading + or further copying of the copies you make or distribute. However, + you may accept compensation in exchange for copies. If you + distribute a large enough number of copies you must also follow + the conditions in section 3. + + You may also lend copies, under the same conditions stated above, + and you may publicly display copies. + + 3. COPYING IN QUANTITY + + If you publish printed copies of the Document numbering more than + 100, and the Document's license notice requires Cover Texts, you + must enclose the copies in covers that carry, clearly and legibly, + all these Cover Texts: Front-Cover Texts on the front cover, and + Back-Cover Texts on the back cover. Both covers must also clearly + and legibly identify you as the publisher of these copies. The + front cover must present the full title with all words of the + title equally prominent and visible. You may add other material + on the covers in addition. Copying with changes limited to the + covers, as long as they preserve the title of the Document and + satisfy these conditions, can be treated as verbatim copying in + other respects. + + If the required texts for either cover are too voluminous to fit + legibly, you should put the first ones listed (as many as fit + reasonably) on the actual cover, and continue the rest onto + adjacent pages. + + If you publish or distribute Opaque copies of the Document + numbering more than 100, you must either include a + machine-readable Transparent copy along with each Opaque copy, or + state in or with each Opaque copy a publicly-accessible + computer-network location containing a complete Transparent copy + of the Document, free of added material, which the general + network-using public has access to download anonymously at no + charge using public-standard network protocols. If you use the + latter option, you must take reasonably prudent steps, when you + begin distribution of Opaque copies in quantity, to ensure that + this Transparent copy will remain thus accessible at the stated + location until at least one year after the last time you + distribute an Opaque copy (directly or through your agents or + retailers) of that edition to the public. + + It is requested, but not required, that you contact the authors of + the Document well before redistributing any large number of + copies, to give them a chance to provide you with an updated + version of the Document. + + 4. MODIFICATIONS + + You may copy and distribute a Modified Version of the Document + under the conditions of sections 2 and 3 above, provided that you + release the Modified Version under precisely this License, with + the Modified Version filling the role of the Document, thus + licensing distribution and modification of the Modified Version to + whoever possesses a copy of it. In addition, you must do these + things in the Modified Version: + + A. Use in the Title Page (and on the covers, if any) a title + distinct from that of the Document, and from those of + previous versions (which should, if there were any, be listed + in the History section of the Document). You may use the + same title as a previous version if the original publisher of + that version gives permission. + + B. List on the Title Page, as authors, one or more persons or + entities responsible for authorship of the modifications in + the Modified Version, together with at least five of the + principal authors of the Document (all of its principal + authors, if it has less than five). + + C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. + + D. Preserve all the copyright notices of the Document. + + E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. + + F. Include, immediately after the copyright notices, a license + notice giving the public permission to use the Modified + Version under the terms of this License, in the form shown in + the Addendum below. + + G. Preserve in that license notice the full lists of Invariant + Sections and required Cover Texts given in the Document's + license notice. + + H. Include an unaltered copy of this License. + + I. Preserve the section entitled "History", and its title, and + add to it an item stating at least the title, year, new + authors, and publisher of the Modified Version as given on + the Title Page. If there is no section entitled "History" in + the Document, create one stating the title, year, authors, + and publisher of the Document as given on its Title Page, + then add an item describing the Modified Version as stated in + the previous sentence. + + J. Preserve the network location, if any, given in the Document + for public access to a Transparent copy of the Document, and + likewise the network locations given in the Document for + previous versions it was based on. These may be placed in + the "History" section. You may omit a network location for a + work that was published at least four years before the + Document itself, or if the original publisher of the version + it refers to gives permission. + + K. In any section entitled "Acknowledgments" or "Dedications", + preserve the section's title, and preserve in the section all + the substance and tone of each of the contributor + acknowledgments and/or dedications given therein. + + L. Preserve all the Invariant Sections of the Document, + unaltered in their text and in their titles. Section numbers + or the equivalent are not considered part of the section + titles. + + M. Delete any section entitled "Endorsements". Such a section + may not be included in the Modified Version. + + N. Do not retitle any existing section as "Endorsements" or to + conflict in title with any Invariant Section. + + If the Modified Version includes new front-matter sections or + appendices that qualify as Secondary Sections and contain no + material copied from the Document, you may at your option + designate some or all of these sections as invariant. To do this, + add their titles to the list of Invariant Sections in the Modified + Version's license notice. These titles must be distinct from any + other section titles. + + You may add a section entitled "Endorsements", provided it contains + nothing but endorsements of your Modified Version by various + parties--for example, statements of peer review or that the text + has been approved by an organization as the authoritative + definition of a standard. + + You may add a passage of up to five words as a Front-Cover Text, + and a passage of up to 25 words as a Back-Cover Text, to the end + of the list of Cover Texts in the Modified Version. Only one + passage of Front-Cover Text and one of Back-Cover Text may be + added by (or through arrangements made by) any one entity. If the + Document already includes a cover text for the same cover, + previously added by you or by arrangement made by the same entity + you are acting on behalf of, you may not add another; but you may + replace the old one, on explicit permission from the previous + publisher that added the old one. + + The author(s) and publisher(s) of the Document do not by this + License give permission to use their names for publicity for or to + assert or imply endorsement of any Modified Version. + + 5. COMBINING DOCUMENTS + + You may combine the Document with other documents released under + this License, under the terms defined in section 4 above for + modified versions, provided that you include in the combination + all of the Invariant Sections of all of the original documents, + unmodified, and list them all as Invariant Sections of your + combined work in its license notice. + + The combined work need only contain one copy of this License, and + multiple identical Invariant Sections may be replaced with a single + copy. If there are multiple Invariant Sections with the same name + but different contents, make the title of each such section unique + by adding at the end of it, in parentheses, the name of the + original author or publisher of that section if known, or else a + unique number. Make the same adjustment to the section titles in + the list of Invariant Sections in the license notice of the + combined work. + + In the combination, you must combine any sections entitled + "History" in the various original documents, forming one section + entitled "History"; likewise combine any sections entitled + "Acknowledgments", and any sections entitled "Dedications". You + must delete all sections entitled "Endorsements." + + 6. COLLECTIONS OF DOCUMENTS + + You may make a collection consisting of the Document and other + documents released under this License, and replace the individual + copies of this License in the various documents with a single copy + that is included in the collection, provided that you follow the + rules of this License for verbatim copying of each of the + documents in all other respects. + + You may extract a single document from such a collection, and + distribute it individually under this License, provided you insert + a copy of this License into the extracted document, and follow + this License in all other respects regarding verbatim copying of + that document. + + 7. AGGREGATION WITH INDEPENDENT WORKS + + A compilation of the Document or its derivatives with other + separate and independent documents or works, in or on a volume of + a storage or distribution medium, does not as a whole count as a + Modified Version of the Document, provided no compilation + copyright is claimed for the compilation. Such a compilation is + called an "aggregate", and this License does not apply to the + other self-contained works thus compiled with the Document, on + account of their being thus compiled, if they are not themselves + derivative works of the Document. + + If the Cover Text requirement of section 3 is applicable to these + copies of the Document, then if the Document is less than one + quarter of the entire aggregate, the Document's Cover Texts may be + placed on covers that surround only the Document within the + aggregate. Otherwise they must appear on covers around the whole + aggregate. + + 8. TRANSLATION + + Translation is considered a kind of modification, so you may + distribute translations of the Document under the terms of section + 4. Replacing Invariant Sections with translations requires special + permission from their copyright holders, but you may include + translations of some or all Invariant Sections in addition to the + original versions of these Invariant Sections. You may include a + translation of this License provided that you also include the + original English version of this License. In case of a + disagreement between the translation and the original English + version of this License, the original English version will prevail. + + 9. TERMINATION + + You may not copy, modify, sublicense, or distribute the Document + except as expressly provided for under this License. Any other + attempt to copy, modify, sublicense or distribute the Document is + void, and will automatically terminate your rights under this + License. However, parties who have received copies, or rights, + from you under this License will not have their licenses + terminated so long as such parties remain in full compliance. + + 10. FUTURE REVISIONS OF THIS LICENSE + + The Free Software Foundation may publish new, revised versions of + the GNU Free Documentation License from time to time. Such new + versions will be similar in spirit to the present version, but may + differ in detail to address new problems or concerns. See + `http://www.gnu.org/copyleft/'. + + Each version of the License is given a distinguishing version + number. If the Document specifies that a particular numbered + version of this License "or any later version" applies to it, you + have the option of following the terms and conditions either of + that specified version or of any later version that has been + published (not as a draft) by the Free Software Foundation. If + the Document does not specify a version number of this License, + you may choose any version ever published (not as a draft) by the + Free Software Foundation. + +A.1.1 ADDENDUM: How to use this License for your documents +---------------------------------------------------------- + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and license +notices just after the title page: + + Copyright (C) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.1 + or any later version published by the Free Software Foundation; + with the Invariant Sections being LIST THEIR TITLES, with the + Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. + A copy of the license is included in the section entitled ``GNU + Free Documentation License''. + + If you have no Invariant Sections, write "with no Invariant Sections" +instead of saying which ones are invariant. If you have no Front-Cover +Texts, write "no Front-Cover Texts" instead of "Front-Cover Texts being +LIST"; likewise for Back-Cover Texts. + + If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, to +permit their use in free software. --- parted-2.3.orig/debian/libparted-dev.files +++ parted-2.3/debian/libparted-dev.files @@ -0,0 +1,5 @@ +usr/lib/libparted.a +usr/lib/libparted.so +usr/lib/pkgconfig +usr/include + --- parted-2.3.orig/debian/libparted-i18n.files +++ parted-2.3/debian/libparted-i18n.files @@ -0,0 +1 @@ +usr/share/locale --- parted-2.3.orig/debian/libparted.files.in +++ parted-2.3/debian/libparted.files.in @@ -0,0 +1 @@ +lib/@DEB_HOST_MULTIARCH@/libparted*.so.* --- parted-2.3.orig/debian/libparted.lintian-overrides.in +++ parted-2.3/debian/libparted.lintian-overrides.in @@ -0,0 +1 @@ +libparted@LIBSONAME@debian1: package-name-doesnt-match-sonames libparted@LIBSONAME@ --- parted-2.3.orig/debian/parted-bf.manpages +++ parted-2.3/debian/parted-bf.manpages @@ -0,0 +1 @@ +doc/parted.8 --- parted-2.3.orig/debian/parted-doc.docs +++ parted-2.3/debian/parted-doc.docs @@ -0,0 +1,9 @@ +NEWS +AUTHORS +BUGS +README +THANKS +TODO +doc/API +doc/FAT +doc/USER.jp --- parted-2.3.orig/debian/parted-doc.files +++ parted-2.3/debian/parted-doc.files @@ -0,0 +1 @@ +usr/share/info/parted.info --- parted-2.3.orig/debian/parted.files +++ parted-2.3/debian/parted.files @@ -0,0 +1,3 @@ +sbin +usr/share/man/man8/parted.8 +usr/share/man/man8/partprobe.8 --- parted-2.3.orig/debian/parted.lintian-overrides +++ parted-2.3/debian/parted.lintian-overrides @@ -0,0 +1 @@ +parted: manpage-has-bad-whatis-entry usr/share/man/man8/parted.8.gz --- parted-2.3.orig/debian/patches/0001-parted-resizepart-command.patch +++ parted-2.3/debian/patches/0001-parted-resizepart-command.patch @@ -0,0 +1,134 @@ +From be7c4b8da40aca5296f96d09ae73fbb7f5250b99 Mon Sep 17 00:00:00 2001 +From: Petr Uzel +Date: Mon, 26 Sep 2011 17:21:01 +0200 +Subject: [PATCH 1/6] parted: resizepart command + +TODO +--- + parted/parted.c | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 89 insertions(+) + +Index: b/parted/parted.c +=================================================================== +--- a/parted/parted.c ++++ b/parted/parted.c +@@ -150,6 +150,9 @@ + static const char* start_end_msg = N_("START and END are disk locations, such as " + "4GB or 10%. Negative values count from the end of the disk. " + "For example, -1s specifies exactly the last sector.\n"); ++static const char* end_msg = N_("END is disk location, such as " ++ "4GB or 10%. Negative value counts from the end of the disk. " ++ "For example, -1s specifies exactly the last sector.\n"); + static const char* state_msg = N_("STATE is one of: on, off\n"); + static const char* device_msg = N_("DEVICE is usually /dev/hda or /dev/sda\n"); + static const char* name_msg = N_("NAME is any word you want\n"); +@@ -466,6 +469,21 @@ + return result; + } + ++ ++static PedConstraint* ++constraint_from_start_end_fixed_start (PedDevice* dev, PedSector start_sector, ++ PedGeometry* range_end) ++{ ++ PedGeometry range_start; ++ range_start.dev = dev; ++ range_start.start = start_sector; ++ range_start.end = start_sector; ++ range_start.length = 1; ++ ++ return ped_constraint_new (ped_alignment_any, ped_alignment_any, ++ &range_start, range_end, 1, dev->length); ++} ++ + void + help_on (char* topic) + { +@@ -2004,11 +2022,69 @@ + } + + static int ++do_resizepart (PedDevice** dev) ++{ ++ PedDisk *disk; ++ PedPartition *part = NULL; ++ PedSector start, end, oldend; ++ PedGeometry *range_end = NULL; ++ PedConstraint* constraint; ++ ++ disk = ped_disk_new (*dev); ++ if (!disk) ++ goto error; ++ ++ if (ped_disk_is_flag_available(disk, PED_DISK_CYLINDER_ALIGNMENT)) ++ if (!ped_disk_set_flag(disk, PED_DISK_CYLINDER_ALIGNMENT, ++ alignment == ALIGNMENT_CYLINDER)) ++ goto error; ++ ++ if (!command_line_get_partition (_("Partition number?"), disk, &part)) ++ goto error; ++ if (!_partition_warn_busy (part)) ++ goto error; ++ ++ start = part->geom.start; ++ end = oldend = part->geom.end; ++ if (!command_line_get_sector (_("End?"), *dev, &end, &range_end)) ++ goto error; ++ /* Do not move start of the partition */ ++ constraint = constraint_from_start_end_fixed_start (*dev, start, range_end); ++ if (!ped_disk_set_partition_geom (disk, part, constraint, ++ start, end)) ++ goto error_destroy_constraint; ++ /* warn when shrinking partition - might lose data */ ++ if (part->geom.end < oldend) ++ if (ped_exception_throw ( ++ PED_EXCEPTION_WARNING, ++ PED_EXCEPTION_YES_NO, ++ _("Shrinking a partition can cause data loss, " \ ++ "are you sure you want to continue?")) != PED_EXCEPTION_YES) ++ goto error_destroy_constraint; ++ ped_disk_commit (disk); ++ ped_constraint_destroy (constraint); ++ if (range_end != NULL) ++ ped_geometry_destroy (range_end); ++ ++ if ((*dev)->type != PED_DEVICE_FILE) ++ disk_is_modified = 1; ++ ++ return 1; ++ ++error_destroy_constraint: ++ ped_constraint_destroy (constraint); ++error: ++ if (range_end != NULL) ++ ped_geometry_destroy (range_end); ++ return 0; ++} ++ ++ ++static int + do_rm (PedDevice** dev) + { +- PedDisk* disk; ++ PedDisk* disk; + PedPartition* part = NULL; +- + disk = ped_disk_new (*dev); + if (!disk) + goto error; +@@ -2423,6 +2499,15 @@ + NULL), + str_list_create (_(part_type_msg), _(start_end_msg), NULL), 1)); + ++//XXX: mention that this command does never move start of the partition ++command_register (commands, command_create ( ++ str_list_create_unique ("resizepart", _("resizepart"), NULL), ++ do_resizepart, ++ str_list_create ( ++_("resizepart NUMBER END resize partition NUMBER"), ++NULL), ++ str_list_create (_(number_msg), _(end_msg), NULL), 1)); ++ + command_register (commands, command_create ( + str_list_create_unique ("move", _("move"), NULL), + do_move, --- parted-2.3.orig/debian/patches/0003-libparted-Add-support-for-BLKPG-ioctl-partition-resi.patch +++ parted-2.3/debian/patches/0003-libparted-Add-support-for-BLKPG-ioctl-partition-resi.patch @@ -0,0 +1,86 @@ +From 6ca0769fcc25f1e4fc7b40769eabd05804670b30 Mon Sep 17 00:00:00 2001 +From: Phillip Susi +Date: Tue, 29 Nov 2011 14:05:48 -0500 +Subject: [PATCH 3/6] libparted: Add support for BLKPG ioctl partition resize + +When resizing a partition ( same partition number, same +start sector, different end sector ), if removing the old +partition fails because it is in use, try to use the +new BLKPG_RES_PARTITION request to update the kernel +partition table with the new size. +--- + libparted/arch/linux.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 56 insertions(+) + +--- a/libparted/arch/linux.c ++++ b/libparted/arch/linux.c +@@ -2481,6 +2481,53 @@ + BLKPG_DEL_PARTITION); + } + ++#ifdef BLKPG_RESIZE_PARTITION ++static int _blkpg_resize_partition (PedDisk* disk, const PedPartition *part) ++{ ++ struct blkpg_partition linux_part; ++ const char* vol_name; ++ char* dev_name; ++ ++ PED_ASSERT(disk != NULL, return 0); ++ PED_ASSERT(disk->dev->sector_size % PED_SECTOR_SIZE_DEFAULT == 0, return 0); ++ ++ dev_name = _device_get_part_path (disk->dev, part->num); ++ if (!dev_name) ++ return 0; ++ memset (&linux_part, 0, sizeof (linux_part)); ++ linux_part.start = part->geom.start * disk->dev->sector_size; ++ /* see fs/partitions/msdos.c:msdos_partition(): "leave room for LILO" */ ++ if (part->type & PED_PARTITION_EXTENDED) ++ linux_part.length = part->geom.length == 1 ? 512 : 1024; ++ else ++ linux_part.length = part->geom.length * disk->dev->sector_size; ++ linux_part.pno = part->num; ++ strncpy (linux_part.devname, dev_name, BLKPG_DEVNAMELTH); ++ if (vol_name) ++ strncpy (linux_part.volname, vol_name, BLKPG_VOLNAMELTH); ++ ++ free (dev_name); ++ ++ if (!_blkpg_part_command (disk->dev, &linux_part, ++ BLKPG_RESIZE_PARTITION)) { ++ return ped_exception_throw ( ++ PED_EXCEPTION_ERROR, ++ PED_EXCEPTION_IGNORE_CANCEL, ++ _("Error informing the kernel about modifications to " ++ "partition %s -- %s. This means Linux won't know " ++ "about any changes you made to %s until you reboot " ++ "-- so you shouldn't mount it or use it in any way " ++ "before rebooting."), ++ linux_part.devname, ++ strerror (errno), ++ linux_part.devname) ++ == PED_EXCEPTION_IGNORE; ++ } ++ ++ return 1; ++} ++#endif ++ + /* Read the unsigned long long from /sys/block/DEV_BASE/PART_BASE/ENTRY + and set *VAL to that value, where DEV_BASE is the last component of path to + block device corresponding to PART and PART_BASE is the sysfs name of PART. +@@ -2696,6 +2743,15 @@ + if (start == part->geom.start + && length == part->geom.length) + ok[i - 1] = 1; ++#ifdef BLKPG_RESIZE_PARTITION ++ if (start == part->geom.start ++ && length != part->geom.length) ++ { ++ /* try to resize */ ++ if (_blkpg_resize_partition (disk, part)) ++ ok[i - 1] = 1; ++ } ++#endif + /* If the new partition is unchanged and the + existing one was not removed because it was + in use, then reset the error flag and do not --- parted-2.3.orig/debian/patches/0004-parted-make-_partition_warn_busy-actually-a-warning-.patch +++ parted-2.3/debian/patches/0004-parted-make-_partition_warn_busy-actually-a-warning-.patch @@ -0,0 +1,45 @@ +From 7ef73999b35294a8fd30f5af4eb6221a0ce62802 Mon Sep 17 00:00:00 2001 +From: Phillip Susi +Date: Wed, 30 Nov 2011 13:13:58 -0500 +Subject: [PATCH 4/6] parted: make _partition_warn_busy actually a warning + instead of an error + +This function was throwing a PED_EXCEPTION_ERROR with only the +PED_EXCEPTION_CANCEL option. Converted to a PED_EXCEPTION_WARNING +with the option to continue anyhow. +--- + parted/parted.c | 19 +++++++++++-------- + tests/t1101-busy-partition.sh | 2 +- + tests/t9041-undetected-in-use-16th-partition.sh | 4 ++-- + 3 files changed, 14 insertions(+), 11 deletions(-) + +Index: b/parted/parted.c +=================================================================== +--- a/parted/parted.c ++++ b/parted/parted.c +@@ -224,14 +224,17 @@ + + if (ped_partition_is_busy (part)) { + path = ped_partition_get_path (part); +- ped_exception_throw ( +- PED_EXCEPTION_ERROR, +- PED_EXCEPTION_CANCEL, +- _("Partition %s is being used. You must unmount it " +- "before you modify it with Parted."), +- path); +- free (path); +- return 0; ++ if (ped_exception_throw ( ++ PED_EXCEPTION_WARNING, ++ PED_EXCEPTION_YES_NO, ++ _("Partition %s is being used. Are you sure you " \ ++ "want to continue?"), ++ path) != PED_EXCEPTION_YES) ++ { ++ free (path); ++ return 0; ++ } ++ free (path); + } + return 1; + } --- parted-2.3.orig/debian/patches/16-dos-partitions.patch +++ parted-2.3/debian/patches/16-dos-partitions.patch @@ -0,0 +1,55 @@ +From: Phillip Susi +Subject: Fix > 16 dos partitions +Description: The msdos partition table claimed a maximum partition + count of 16 but would allow you to go beyond that. This resulted + in the kernel not being informed of those partitions. Corrected + to enforce the limit and raise the limit to 64 partitions. +Forwarded: Yes + +--- a/libparted/labels/dos.c ++++ b/libparted/labels/dos.c +@@ -104,7 +104,7 @@ static const char MBR_BOOT_CODE[] = { + * (i.e. 1022 is sometimes used to indicate "use LBA"). + */ + #define MAX_CHS_CYLINDER 1021 +-#define MAX_TOTAL_PART 16 ++#define MAX_TOTAL_PART 64 + + typedef struct _DosRawPartition DosRawPartition; + typedef struct _DosRawTable DosRawTable; +@@ -2332,17 +2332,23 @@ next_primary (const PedDisk* disk) + if (!ped_disk_get_partition (disk, i)) + return i; + } +- return 0; ++ return -1; + } + + static int + next_logical (const PedDisk* disk) + { + int i; +- for (i=5; 1; i++) { ++ for (i=5; i<=MAX_TOTAL_PART; i++) { + if (!ped_disk_get_partition (disk, i)) + return i; + } ++ ped_exception_throw ( ++ PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL, ++ _("Can not create any more partitions"), ++ disk->dev->path); ++ return -1; ++ + } + + static int +@@ -2361,7 +2367,8 @@ msdos_partition_enumerate (PedPartition* + part->num = next_logical (part->disk); + else + part->num = next_primary (part->disk); +- ++ if (part->num == -1) ++ return 0; + return 1; + } + --- parted-2.3.orig/debian/patches/avoid-disturbing-partitions.patch +++ parted-2.3/debian/patches/avoid-disturbing-partitions.patch @@ -0,0 +1,116 @@ +Author: Phillip Susi +Description: The partition sync logic was first removing all + partitions, then trying to re-add them. This resulted in many + udev events triggering annoying behavior like auto mounting. + Refactor the code to avoid removing and re-adding unmodified + partitions. + +--- a/libparted/arch/linux.c ++++ b/libparted/arch/linux.c +@@ -2705,60 +2705,52 @@ + int *errnums = ped_malloc(sizeof(int) * lpn); + if (!errnums) + goto cleanup; +- +- /* Attempt to remove each and every partition, retrying for +- up to max_sleep_seconds upon any failure due to EBUSY. */ +- unsigned int sleep_microseconds = 10000; +- unsigned int max_sleep_seconds = 1; +- unsigned int n_sleep = (max_sleep_seconds +- * 1000000 / sleep_microseconds); + int i; +- for (i = 0; i < n_sleep; i++) { +- if (i) +- usleep (sleep_microseconds); +- bool busy = false; +- int j; +- for (j = 0; j < lpn; j++) { +- if (!ok[j]) { +- ok[j] = remove_partition (disk, j + 1); +- errnums[j] = errno; +- if (!ok[j] && errnums[j] == EBUSY) +- busy = true; +- } +- } +- if (!busy) +- break; +- } +- + for (i = 1; i <= lpn; i++) { + PedPartition *part = ped_disk_get_partition (disk, i); + if (part) { +- if (!ok[i - 1] && errnums[i - 1] == EBUSY) { +- unsigned long long length; +- unsigned long long start; +- /* get start and length of existing partition */ +- if (!get_partition_start_and_length(part, +- &start, &length)) +- goto cleanup; +- if (start == part->geom.start +- && length == part->geom.length) +- ok[i - 1] = 1; ++ unsigned long long length; ++ unsigned long long start; ++ /* get start and length of existing partition */ ++ if (!get_partition_start_and_length(part, ++ &start, &length)) ++ goto remove_partition; ++ if (start == part->geom.start ++ && length == part->geom.length) ++ { ++ ok[i - 1] = 1; ++ continue; ++ } + #ifdef BLKPG_RESIZE_PARTITION +- if (start == part->geom.start +- && length != part->geom.length) ++ if (start == part->geom.start ++ && length != part->geom.length) ++ { ++ /* try to resize */ ++ if (_blkpg_resize_partition (disk, part)) + { +- /* try to resize */ +- if (_blkpg_resize_partition (disk, part)) +- ok[i - 1] = 1; ++ ok[i - 1] = 1; ++ continue; + } +-#endif +- /* If the new partition is unchanged and the +- existing one was not removed because it was +- in use, then reset the error flag and do not +- try to add it since it is already there. */ +- continue; + } +- ++#endif ++ } ++ /* Attempt to remove the partition, retrying for ++ up to max_sleep_seconds upon any failure due to EBUSY. */ ++ unsigned int sleep_microseconds = 10000; ++ unsigned int max_sleep_seconds = 1; ++ unsigned int n_sleep = (max_sleep_seconds ++ * 1000000 / sleep_microseconds); ++ remove_partition: ++ do { ++ ok[i-1] = remove_partition (disk, i); ++ errnums[i-1] = errno; ++ if (ok[i-1] || errnums[i-1] != EBUSY) ++ break; ++ usleep (sleep_microseconds); ++ } while (n_sleep--); ++ if (!ok[i-1] && errnums[i-1] == ENXIO) ++ ok[i-1] = 1; /* it already doesn't exist */ ++ if (part && ok[i-1]) { + /* add the (possibly modified or new) partition */ + if (!add_partition (disk, part)) { + ped_exception_throw ( +@@ -2768,6 +2760,7 @@ + i, strerror (errno)); + goto cleanup; + } ++ ok[i-1] = 1; + } + } + --- parted-2.3.orig/debian/patches/btrfs.patch +++ parted-2.3/debian/patches/btrfs.patch @@ -0,0 +1,199 @@ +Description: Initial btrfs support, only recognize it for now + Add initial btrfs support to libparted; just discovering the declared magic + entry at the right place to recognize filesystem type, for the moment. +Author: Luca Bruno +Origin: http://lists.alioth.debian.org/pipermail/parted-devel/2009-February/002585.html +Bug-Debian: http://bugs.debian.org/567176 +Last-Update: 2012-11-06 + +Index: b/configure.ac +=================================================================== +--- a/configure.ac ++++ b/configure.ac +@@ -629,6 +629,7 @@ + libparted/labels/Makefile + libparted/fs/Makefile + libparted/fs/amiga/Makefile ++libparted/fs/btrfs/Makefile + libparted/fs/ext2/Makefile + libparted/fs/fat/Makefile + libparted/fs/hfs/Makefile +Index: b/libparted/fs/Makefile.am +=================================================================== +--- a/libparted/fs/Makefile.am ++++ b/libparted/fs/Makefile.am +@@ -4,7 +4,7 @@ + # + # This file may be modified and/or distributed without restriction. + +-SUBDIRS = amiga ext2 ufs fat ntfs hfs linux_swap xfs jfs reiserfs # bfs ++SUBDIRS = amiga ext2 ufs fat ntfs hfs linux_swap xfs jfs reiserfs btrfs # bfs + + partedincludedir = -I$(top_srcdir)/include + noinst_LTLIBRARIES = libfs.la +@@ -24,7 +24,8 @@ + linux_swap/liblinuxswap.la \ + xfs/libxfs.la \ + jfs/libjfs.la \ +- reiserfs/libreiserfs.la ++ reiserfs/libreiserfs.la \ ++ btrfs/libbtrfs.la + # bfs/libbfs.la + + libfs_la_SOURCES = +Index: b/libparted/fs/btrfs/Makefile.am +=================================================================== +--- /dev/null ++++ b/libparted/fs/btrfs/Makefile.am +@@ -0,0 +1,8 @@ ++partedincludedir = -I$(top_srcdir)/include ++ ++noinst_LTLIBRARIES = libbtrfs.la ++libbtrfs_la_SOURCES = btrfs.c ++ ++INCLUDES = $(partedincludedir) $(INTLINCS) ++ ++MAINTAINERCLEANFILES = Makefile.in +Index: b/libparted/fs/btrfs/btrfs.c +=================================================================== +--- /dev/null ++++ b/libparted/fs/btrfs/btrfs.c +@@ -0,0 +1,102 @@ ++/* ++ libparted - a library for manipulating disk partitions ++ Copyright (C) 2000, 2009 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 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 . ++*/ ++ ++#include ++ ++#include ++#include ++ ++#if ENABLE_NLS ++# include ++# define _(String) dgettext (PACKAGE, String) ++#else ++# define _(String) (String) ++#endif /* ENABLE_NLS */ ++ ++#include ++ ++#define BTRFS_BLOCK_SIZES ((int[2]){1024, 0}) ++#define BTRFS_SUPER_INFO_SIZE 4096 ++#define BTRFS_SUPER_INFO_OFFSET (64 * 1024) ++ ++//Should be definitive, as of v0.18 ++#define BTRFS_SIGNATURE "_BHRfS_M" ++ ++static PedGeometry* ++btrfs_probe (PedGeometry* geom) ++{ ++ char buf[BTRFS_SUPER_INFO_SIZE]; ++ ++ if (!ped_geometry_read (geom, buf, (BTRFS_SUPER_INFO_OFFSET / 512), (BTRFS_SUPER_INFO_SIZE / 512))) ++ return 0; ++ ++ if (strncmp (BTRFS_SIGNATURE, buf + 64, strlen (BTRFS_SIGNATURE)) == 0) ++ return ped_geometry_new (geom->dev, geom->start, geom->length); ++ else ++ return NULL; ++} ++ ++#ifndef DISCOVER_ONLY ++static int ++btrfs_clobber (PedGeometry* geom) ++{ ++ char buf[BTRFS_SUPER_INFO_SIZE]; ++ ++ memset (buf, 0, BTRFS_SUPER_INFO_SIZE); ++ return ped_geometry_write (geom, buf, (BTRFS_SUPER_INFO_OFFSET / 512), (BTRFS_SUPER_INFO_SIZE / 512)); ++} ++#endif /* !DISCOVER_ONLY */ ++ ++static PedFileSystemOps btrfs_ops = { ++ probe: btrfs_probe, ++#ifndef DISCOVER_ONLY ++ clobber: btrfs_clobber, ++#else ++ clobber: NULL, ++#endif ++ open: NULL, ++ create: NULL, ++ close: NULL, ++ check: NULL, ++ copy: NULL, ++ resize: NULL, ++ get_create_constraint: NULL, ++ get_resize_constraint: NULL, ++ get_copy_constraint: NULL ++}; ++ ++static PedFileSystemType btrfs_type = { ++ next: NULL, ++ ops: &btrfs_ops, ++ name: "btrfs", ++ block_sizes: BTRFS_BLOCK_SIZES ++}; ++ ++void ++ped_file_system_btrfs_init () ++{ ++ ped_file_system_type_register (&btrfs_type); ++} ++ ++void ++ped_file_system_btrfs_done () ++{ ++ ped_file_system_type_unregister (&btrfs_type); ++} ++ ++ +Index: b/libparted/libparted.c +=================================================================== +--- a/libparted/libparted.c ++++ b/libparted/libparted.c +@@ -109,6 +109,7 @@ + extern void ped_file_system_hfs_init (void); + extern void ped_file_system_fat_init (void); + extern void ped_file_system_ext2_init (void); ++extern void ped_file_system_btrfs_init (void); + + static void + init_file_system_types () +@@ -123,6 +124,7 @@ + ped_file_system_hfs_init (); + ped_file_system_fat_init (); + ped_file_system_ext2_init (); ++ ped_file_system_btrfs_init (); + } + #endif /* ENABLE_FS */ + +@@ -188,6 +190,7 @@ + extern void ped_file_system_reiserfs_done (void); + extern void ped_file_system_ufs_done (void); + extern void ped_file_system_xfs_done (void); ++extern void ped_file_system_btrfs_done (void); + extern void ped_file_system_amiga_done (void); + + static void +@@ -202,6 +205,7 @@ + ped_file_system_reiserfs_done (); + ped_file_system_ufs_done (); + ped_file_system_xfs_done (); ++ ped_file_system_btrfs_done (); + ped_file_system_amiga_done (); + } + #endif /* ENABLE_FS */ --- parted-2.3.orig/debian/patches/dasd-sync.patch +++ parted-2.3/debian/patches/dasd-sync.patch @@ -0,0 +1,47 @@ +Description: Remove DASD restriction on _disk_sync_part_table +Origin: upstream, http://git.debian.org/?p=parted/parted.git;a=commitdiff;h=9fa0e1800db5b9f094ae481fd95a51da03f19e95 +Bug-Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=651478 +Bug-Debian: http://bugs.debian.org/605759 +Forwarded: not-needed +Author: Brian C. Lane +Last-Update: 2010-12-19 + +--- a/libparted/arch/linux.c ++++ b/libparted/arch/linux.c +@@ -40,6 +40,7 @@ + #include + #include /* for uname() */ + #include ++#include + #ifdef ENABLE_DEVICE_MAPPER + #include + #endif +@@ -2944,20 +2945,15 @@ + return 1; + + if (disk->dev->type != PED_DEVICE_FILE) { +- /* The ioctl() command BLKPG_ADD_PARTITION does not notify +- * the devfs system; consequently, /proc/partitions will not +- * be up to date, and the proper links in /dev are not +- * created. Therefore, if using DevFS, we must get the kernel +- * to re-read and grok the partition table. +- */ +- /* Work around kernel dasd problem so we really do BLKRRPART */ +- int ok = 1; +- if (disk->dev->type != PED_DEVICE_DASD && _have_blkpg ()) { +- if (!_disk_sync_part_table (disk)) +- ok = 0; +- } + +- return ok; ++ /* We now require BLKPG support. If this assertion fails, ++ please write to the mailing list describing your system. ++ Assuming it's never triggered, ... ++ FIXME: remove this assertion in 2012. */ ++ assert (_have_blkpg ()); ++ ++ if (!_disk_sync_part_table (disk)) ++ return 0; + } + + return 1; --- parted-2.3.orig/debian/patches/dm-part-sync.patch +++ parted-2.3/debian/patches/dm-part-sync.patch @@ -0,0 +1,345 @@ +From: Phillip Susi +Subject: refactor device-mapper partition sync code +Forwarded: Yes +Description: The device-mapper partition sync code was still using the remove + all partitions, then add new partitions method. Refactor to use the same + algorithm as regular disks: try to remove all, and ignore any that could not + be removed but have not changed. +--- a/libparted/arch/linux.c ++++ b/libparted/arch/linux.c +@@ -269,6 +269,16 @@ + static int _partition_is_mounted_by_path (const char* path); + static int + _dm_is_part (const char *path); ++static int ++_dm_add_partition (PedDisk* disk, const PedPartition* part); ++static int ++_dm_remove_partition(PedDisk* disk, int partno); ++static bool ++_dm_get_partition_start_and_length(PedPartition const *part, ++ unsigned long long *start, ++ unsigned long long *length); ++static int ++_is_dmraid_device (char* devpath); + + + static int +@@ -2225,10 +2235,39 @@ + _probe_proc_partitions (); + } + ++static char *dm_canonical_path (PedDevice *dev) ++{ ++ char* dev_name = NULL; ++ LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev); ++ ++ /* Get map name from devicemapper */ ++ struct dm_task *task = dm_task_create (DM_DEVICE_INFO); ++ if (!task) ++ goto err; ++ if (!dm_task_set_major_minor (task, arch_specific->major, ++ arch_specific->minor, 0)) ++ goto err; ++ if (!dm_task_run(task)) ++ goto err; ++ dev_name = ped_malloc (strlen (dm_task_get_name (task)) + ++ strlen ("/dev/mapper/") + 1); ++ strcpy (dev_name, "/dev/mapper/"); ++ strcat (dev_name, dm_task_get_name (task)); ++ /* Caution: dm_task_destroy frees dev_name. */ ++ dm_task_destroy (task); ++ return dev_name; ++err: ++ return NULL; ++} ++ + static char* + _device_get_part_path (PedDevice* dev, int num) + { +- int path_len = strlen (dev->path); ++ char* devpath; ++ if (dev->type == PED_DEVICE_DM) ++ devpath = dm_canonical_path (dev); ++ else devpath = dev->path; ++ int path_len = strlen (devpath); + int result_len = path_len + 16; + char* result; + +@@ -2239,18 +2278,19 @@ + /* Check for devfs-style /disc => /partN transformation + unconditionally; the system might be using udev with devfs rules, + and if not the test is harmless. */ +- if (!strcmp (dev->path + path_len - 5, "/disc")) { ++ if (!strcmp (devpath + path_len - 5, "/disc")) { + /* replace /disc with /path%d */ +- strcpy (result, dev->path); ++ strcpy (result, devpath); + snprintf (result + path_len - 5, 16, "/part%d", num); + } else if (dev->type == PED_DEVICE_DAC960 + || dev->type == PED_DEVICE_CPQARRAY + || dev->type == PED_DEVICE_ATARAID +- || isdigit (dev->path[path_len - 1])) +- snprintf (result, result_len, "%sp%d", dev->path, num); ++ || isdigit (devpath[path_len - 1])) ++ snprintf (result, result_len, "%sp%d", devpath, num); + else +- snprintf (result, result_len, "%s%d", dev->path, num); +- ++ snprintf (result, result_len, "%s%d", devpath, num); ++ if (dev->type == PED_DEVICE_DM) ++ free (devpath); + return result; + } + +@@ -2537,6 +2577,9 @@ + FILE* fp; + bool ok; + ++ if (dev->type == PED_DEVICE_DM) ++ return MAX_NUM_PARTS; ++ + r = snprintf(path, sizeof(path), "/sys/block/%s/range", + last_component(dev->path)); + if (r < 0 || r >= sizeof(path)) +@@ -2574,6 +2617,23 @@ + PED_ASSERT(disk->dev != NULL, return 0); + int lpn; + ++ int (*add_partition)(PedDisk* disk, const PedPartition *part); ++ int (*remove_partition)(PedDisk* disk, int partno); ++ bool (*get_partition_start_and_length)(PedPartition const *part, ++ unsigned long long *start, ++ unsigned long long *length); ++ ++ ++ if (disk->dev->type == PED_DEVICE_DM) { ++ add_partition = _dm_add_partition; ++ remove_partition = _dm_remove_partition; ++ get_partition_start_and_length = _dm_get_partition_start_and_length; ++ } else { ++ add_partition = _blkpg_add_partition; ++ remove_partition = _blkpg_remove_partition; ++ get_partition_start_and_length = _kernel_get_partition_start_and_length; ++ } ++ + /* lpn = largest partition number. */ + if (ped_disk_get_max_supported_partition_count(disk, &lpn)) + lpn = PED_MIN(lpn, _device_get_partition_range(disk->dev)); +@@ -2607,7 +2667,7 @@ + int j; + for (j = 0; j < lpn; j++) { + if (!ok[j]) { +- ok[j] = _blkpg_remove_partition (disk, j + 1); ++ ok[j] = remove_partition (disk, j + 1); + errnums[j] = errno; + if (!ok[j] && errnums[j] == EBUSY) + busy = true; +@@ -2624,9 +2684,9 @@ + unsigned long long length; + unsigned long long start; + /* get start and length of existing partition */ +- if (!_kernel_get_partition_start_and_length(part, +- &start, &length)) +- goto cleanup; ++ if (!get_partition_start_and_length(part, ++ &start, &length)) ++ goto cleanup; + if (start == part->geom.start + && length == part->geom.length) + ok[i - 1] = 1; +@@ -2638,7 +2698,7 @@ + } + + /* add the (possibly modified or new) partition */ +- if (!_blkpg_add_partition (disk, part)) { ++ if (!add_partition (disk, part)) { + ped_exception_throw ( + PED_EXCEPTION_ERROR, + PED_EXCEPTION_RETRY_CANCEL, +@@ -2686,24 +2746,34 @@ + + #ifdef ENABLE_DEVICE_MAPPER + static int +-_dm_remove_map_name(char *name) ++_dm_remove_partition(PedDisk* disk, int partno) + { + struct dm_task *task = NULL; + int rc; ++ char *part_name = _device_get_part_path (disk->dev, partno); + ++ int fd = open (part_name, O_RDONLY | O_EXCL); ++ if (fd == -1) { ++ if (errno == ENOENT) ++ errno = ENXIO; /* nothing to remove, device already doesn't exist */ ++ free (part_name); ++ return 0; ++ } ++ close (fd); + task = dm_task_create(DM_DEVICE_REMOVE); +- if (!task) +- return 1; +- +- dm_task_set_name (task, name); +- ++ if (!task) { ++ free (part_name); ++ return 0; ++ } ++ dm_task_set_name (task, part_name); + rc = dm_task_run(task); + dm_task_update_nodes(); + dm_task_destroy(task); ++ free (part_name); + if (!rc) +- return 1; ++ return 0; + +- return 0; ++ return 1; + } + + /* We consider a dm device that is a linear mapping with a * +@@ -2757,65 +2827,38 @@ + return rc; + } + +-static int +-_dm_remove_parts (PedDevice* dev) ++static bool ++_dm_get_partition_start_and_length(PedPartition const *part, ++ unsigned long long *start, ++ unsigned long long *length) + { +- struct dm_task* task = NULL; +- struct dm_info* info = alloca(sizeof *info); +- struct dm_names* names = NULL; +- unsigned int next = 0; +- int rc; +- LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev); +- +- task = dm_task_create(DM_DEVICE_LIST); +- if (!task) +- goto err; +- +- if (!dm_task_set_major_minor (task, arch_specific->major, +- arch_specific->minor, 0)) +- goto err; ++ struct dm_task* task = NULL; ++ int rc = 0; ++ char *target_type = NULL; ++ char *params; ++ char *path; ++ int major, minor; + ++ if (!(task = dm_task_create(DM_DEVICE_TABLE))) ++ return 0; ++ path = _device_get_part_path (part->disk->dev, part->num); ++ PED_ASSERT(path, return false); ++ dm_task_set_name(task, path); + if (!dm_task_run(task)) + goto err; +- +- memset(info, '\0', sizeof *info); +- dm_task_get_info(task, info); +- if (!info->exists) +- goto err; +- +- names = dm_task_get_names(task); +- if (!names) ++ dm_get_next_target(task, NULL, (uint64_t *)start, (uint64_t *)length, &target_type, ¶ms); ++ if (sscanf (params, "%d:%d %Ld", &major, &minor, start) != 3) + goto err; +- +- rc = 0; +- do { +- names = (void *) ((char *) names + next); +- +- if (_dm_is_part(info, names->name)) +- rc += _dm_remove_map_name(names->name); +- +- next = names->next; +- } while (next); +- +- dm_task_update_nodes(); +- dm_task_destroy(task); +- task = NULL; +- +- if (!rc) +- return 1; ++ rc = 1; + err: +- if (task) +- dm_task_destroy(task); +- ped_exception_throw (PED_EXCEPTION_WARNING, PED_EXCEPTION_IGNORE, +- _("parted was unable to re-read the partition " +- "table on %s (%s). This means Linux won't know " +- "anything about the modifications you made. "), +- dev->path, strerror (errno)); +- return 0; ++ free (path); ++ dm_task_destroy(task); ++ return rc; + } + ++ + static int +-_dm_add_partition (PedDisk* disk, PedPartition* part) ++_dm_add_partition (PedDisk* disk, const PedPartition* part) + { + char* vol_name = NULL; + const char* dev_name = NULL; +@@ -2868,7 +2911,7 @@ + free(vol_name); + return 1; + } else { +- _dm_remove_map_name(vol_name); ++ _dm_remove_partition (disk, part->num); + } + err: + dm_task_update_nodes(); +@@ -2878,34 +2921,6 @@ + free (vol_name); + return 0; + } +- +-static int +-_dm_reread_part_table (PedDisk* disk) +-{ +- int largest_partnum = ped_disk_get_last_partition_num (disk); +- if (largest_partnum <= 0) +- return 1; +- +- int rc = 1; +- int last = PED_MIN (largest_partnum, 16); +- int i; +- +- sync(); +- if (!_dm_remove_parts(disk->dev)) +- rc = 0; +- +- for (i = 1; i <= last; i++) { +- PedPartition* part; +- +- part = ped_disk_get_partition (disk, i); +- if (!part) +- continue; +- +- if (!_dm_add_partition (disk, part)) +- rc = 0; +- } +- return rc; +-} + #endif + + static int +@@ -2928,10 +2943,6 @@ + if (!_has_partitions (disk)) + return 1; + +-#ifdef ENABLE_DEVICE_MAPPER +- if (disk->dev->type == PED_DEVICE_DM) +- return _dm_reread_part_table (disk); +-#endif + if (disk->dev->type != PED_DEVICE_FILE) { + /* The ioctl() command BLKPG_ADD_PARTITION does not notify + * the devfs system; consequently, /proc/partitions will not --- parted-2.3.orig/debian/patches/dm_p_separator.patch +++ parted-2.3/debian/patches/dm_p_separator.patch @@ -0,0 +1,33 @@ +From: Phillip Susi +Description: Device mapper type should not automatically + mean add 'p' before the partition number. Fall back to + adding it only if the previous character is a digit. + This complies with kpartx behavior and linux behavior + "since the dawn of time". +Forwarded: yes +Last-Update: 2011-03-08 + +Index: b/libparted/arch/linux.c +=================================================================== +--- a/libparted/arch/linux.c 2011-03-08 10:43:36.726632247 -0500 ++++ b/libparted/arch/linux.c 2011-03-08 10:46:30.274635151 -0500 +@@ -2198,7 +2198,6 @@ + } else if (dev->type == PED_DEVICE_DAC960 + || dev->type == PED_DEVICE_CPQARRAY + || dev->type == PED_DEVICE_ATARAID +- || dev->type == PED_DEVICE_DM + || isdigit (dev->path[path_len - 1])) + snprintf (result, result_len, "%sp%d", dev->path, num); + else +@@ -2716,7 +2715,10 @@ + + dev_name = dm_task_get_name (task); + +- if (asprintf (&vol_name, "%sp%d", dev_name, part->num) == -1) ++ if (isdigit (dev_name[strlen (dev_name) - 1])) { ++ if (asprintf (&vol_name, "%sp%d", dev_name, part->num) == -1) ++ goto err; ++ } else if (asprintf (&vol_name, "%s%d", dev_name, part->num) == -1) + goto err; + + /* Caution: dm_task_destroy frees dev_name. */ --- parted-2.3.orig/debian/patches/dmraid.patch +++ parted-2.3/debian/patches/dmraid.patch @@ -0,0 +1,130 @@ +From: Phillip Susi +Subject: Hide non dmraid whole disk dm devices +Description: Don't probe dmraid partition devices. Also set + UUID of newly created dmraid partition devices. +Forwarded: yes + +--- a/libparted/arch/linux.c ++++ b/libparted/arch/linux.c +@@ -267,6 +267,9 @@ + + static char* _device_get_part_path (PedDevice* dev, int num); + static int _partition_is_mounted_by_path (const char* path); ++static int ++_dm_is_part (const char *path); ++ + + static int + _read_fd (int fd, char **buf) +@@ -484,13 +487,52 @@ + if (stat (buf, &st) != 0) + continue; + +- if (_is_dm_major(major(st.st_rdev))) ++ if (_is_dm_major(major(st.st_rdev)) && ++ (!_is_dmraid_device (buf) || !_dm_is_part(buf))) + _ped_device_probe (buf); + } + closedir (mapper_dir); + + return 1; + } ++ ++/* Checks whether the given device-mapper device is part of a dmraid array, ++ * by checking for the string "DMRAID-" at the start of the UUID. ++ */ ++static int ++_is_dmraid_device (char* devpath) ++{ ++ struct dm_task* task = NULL; ++ int rc = 0; ++ const char* dmraid_uuid; ++ char* dm_name = NULL; ++ ++ dm_name = strrchr (devpath, '/'); ++ if (dm_name && *dm_name && *(++dm_name)) ++ dm_name = strdup (dm_name); ++ else ++ dm_name = strdup (devpath); ++ if (!dm_name) ++ return 0; ++ ++ task = dm_task_create (DM_DEVICE_DEPS); ++ if (!task) ++ return 0; ++ ++ dm_task_set_name (task, dm_name); ++ if (!dm_task_run (task)) ++ goto err; ++ ++ dmraid_uuid = dm_task_get_uuid (task); ++ if (strncmp (dmraid_uuid, "DMRAID-", 7) == 0) { ++ rc = 1; ++ } ++ ++err: ++ free (dm_name); ++ dm_task_destroy (task); ++ return rc; ++} + #endif + + static int +@@ -2664,20 +2706,26 @@ + return 0; + } + ++/* We consider a dm device that is a linear mapping with a * ++ * single target that also is a dm device to be a partition */ ++ + static int +-_dm_is_part (struct dm_info *this, char *name) ++_dm_is_part (const char *path) + { + struct dm_task* task = NULL; + struct dm_info* info = alloca(sizeof *info); + struct dm_deps* deps = NULL; + int rc = 0; + unsigned int i; ++ char *target_type = NULL; ++ uint64_t start, length; ++ char *params; + + task = dm_task_create(DM_DEVICE_DEPS); + if (!task) + return 0; + +- dm_task_set_name(task, name); ++ dm_task_set_name(task, path); + if (!dm_task_run(task)) + goto err; + +@@ -2690,14 +2738,20 @@ + if (!deps) + goto err; + +- for (i = 0; i < deps->count; i++) { +- unsigned int ma = major(deps->device[i]), +- mi = minor(deps->device[i]); +- +- if (ma == this->major && mi == this->minor) +- rc = 1; +- } +- ++ if (deps->count != 1) ++ goto err; ++ if (!_is_dm_major(major(deps->device[0]))) ++ goto err; ++ dm_task_destroy(task); ++ if (!(task = dm_task_create(DM_DEVICE_TABLE))) ++ return 0; ++ dm_task_set_name(task, path); ++ if (!dm_task_run(task)) ++ goto err; ++ dm_get_next_target(task, NULL, &start, &length, &target_type, ¶ms); ++ if (strcmp (target_type, "linear")) ++ goto err; ++ rc = 1; + err: + dm_task_destroy(task); + return rc; --- parted-2.3.orig/debian/patches/doc-package.patch +++ parted-2.3/debian/patches/doc-package.patch @@ -0,0 +1,17 @@ +From: Timshel Knoll +Forwarded: not-needed +Description: Small documentation fixes + +Index: parted/doc/C/parted.8 +=================================================================== +--- parted.orig/doc/C/parted.8 2010-02-02 16:12:12.000000000 -0200 ++++ parted/doc/C/parted.8 2010-02-02 16:12:30.000000000 -0200 +@@ -174,7 +174,7 @@ + .BR info(1) + format + .IR "GNU partitioning software" +-manual. ++manual which is distributed with the parted-doc Debian package. + .SH AUTHOR + This manual page was written by Timshel Knoll , + for the Debian GNU/Linux system (but may be used by others). --- parted-2.3.orig/debian/patches/fewer-gpt-entries.patch +++ parted-2.3/debian/patches/fewer-gpt-entries.patch @@ -0,0 +1,106 @@ +Description: Handle GPT labels with fewer than 128 partition entries +Author: Robert Herndon +Author: Jim Meyering +Origin: upstream, http://git.savannah.gnu.org/cgit/parted.git/commit?id=bb4e43862127054f2b8744b9d8812cba78912bbb +Origin: upstream, http://git.savannah.gnu.org/cgit/parted.git/commit?id=ce85c5145ed5e267eacee338204cc777377e6b02 +Origin: upstream, http://git.savannah.gnu.org/cgit/parted.git/commit?id=b1e4a02c3f905ca566175e3c62cfa0c2a7cb1c1a +Origin: upstream, http://git.savannah.gnu.org/cgit/parted.git/commit?id=6d69c7183ec30e245834ed04b8755e3bc938b455 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1187560 +Forwarded: not-needed +Last-Update: 2013-06-17 + +Index: b/libparted/labels/gpt.c +=================================================================== +--- a/libparted/labels/gpt.c ++++ b/libparted/labels/gpt.c +@@ -838,9 +838,8 @@ + gpt_read_PE_array (PedDisk const *disk, GuidPartitionTableHeader_t const *gpt, + size_t *ptes_bytes) + { +- GPTDiskData *gpt_disk_data = disk->disk_specific; + uint32_t p_ent_size = PED_LE32_TO_CPU (gpt->SizeOfPartitionEntry); +- *ptes_bytes = p_ent_size * gpt_disk_data->entry_count; ++ *ptes_bytes = p_ent_size * PED_LE32_TO_CPU(gpt->NumberOfPartitionEntries); + size_t ptes_sectors = ped_div_round_up (*ptes_bytes, + disk->dev->sector_size); + +@@ -1513,13 +1512,15 @@ + + if (alternate) + { +- PedSector ptes_size = gpt_disk_data->entry_count +- * sizeof (GuidPartitionEntry_t) / disk->dev->sector_size; ++ size_t ss = disk->dev->sector_size; ++ PedSector ptes_bytes = (gpt_disk_data->entry_count ++ * sizeof (GuidPartitionEntry_t)); ++ PedSector ptes_sectors = (ptes_bytes + ss - 1) / ss; + + gpt->MyLBA = PED_CPU_TO_LE64 (disk->dev->length - 1); + gpt->AlternateLBA = PED_CPU_TO_LE64 (1); + gpt->PartitionEntryLBA +- = PED_CPU_TO_LE64 (disk->dev->length - 1 - ptes_size); ++ = PED_CPU_TO_LE64 (disk->dev->length - 1 - ptes_sectors); + } + else + { +@@ -1572,12 +1573,10 @@ + gpt_write (const PedDisk *disk) + { + GPTDiskData *gpt_disk_data; +- GuidPartitionEntry_t *ptes; + uint32_t ptes_crc; + uint8_t *pth_raw; + GuidPartitionTableHeader_t *gpt; + PedPartition *part; +- int ptes_size; + + PED_ASSERT (disk != NULL, goto error); + PED_ASSERT (disk->dev != NULL, goto error); +@@ -1585,11 +1584,12 @@ + + gpt_disk_data = disk->disk_specific; + +- ptes_size = sizeof (GuidPartitionEntry_t) * gpt_disk_data->entry_count; +- ptes = (GuidPartitionEntry_t *) ped_malloc (ptes_size); ++ size_t ptes_bytes = (gpt_disk_data->entry_count ++ * sizeof (GuidPartitionEntry_t)); ++ GuidPartitionEntry_t *ptes = malloc (ptes_bytes); + if (!ptes) + goto error; +- memset (ptes, 0, ptes_size); ++ memset (ptes, 0, ptes_bytes); + for (part = ped_disk_next_partition (disk, NULL); part; + part = ped_disk_next_partition (disk, part)) + { +@@ -1598,7 +1598,7 @@ + _partition_generate_part_entry (part, &ptes[part->num - 1]); + } + +- ptes_crc = efi_crc32 (ptes, ptes_size); ++ ptes_crc = efi_crc32 (ptes, ptes_bytes); + + if (is_apple) { + /* Write synced MBR */ +@@ -1622,8 +1622,9 @@ + free (pth_raw); + if (!write_ok) + goto error_free_ptes; +- if (!ped_device_write (disk->dev, ptes, 2, +- ptes_size / disk->dev->sector_size)) ++ size_t ss = disk->dev->sector_size; ++ PedSector ptes_sectors = (ptes_bytes + ss - 1) / ss; ++ if (!ped_device_write (disk->dev, ptes, 2, ptes_sectors)) + goto error_free_ptes; + + /* Write Alternate PTH & PTEs */ +@@ -1639,9 +1640,7 @@ + if (!write_ok) + goto error_free_ptes; + if (!ped_device_write (disk->dev, ptes, +- disk->dev->length - 1 - +- ptes_size / disk->dev->sector_size, +- ptes_size / disk->dev->sector_size)) ++ disk->dev->length - 1 - ptes_sectors, ptes_sectors)) + goto error_free_ptes; + + free (ptes); --- parted-2.3.orig/debian/patches/fix-head-size-assertion.patch +++ parted-2.3/debian/patches/fix-head-size-assertion.patch @@ -0,0 +1,74 @@ +From: Phillip Susi +Subject: Fix assertion failure: head_size <= 63 +Description: probe_partition_for_geom() was originally written + using PED_ASSERT() to test for failures in computing the disk + geometry based on existing partition table entries. That + macro has been modified to ignore the second argument ( which + was a return statement ), and instead abort the program. This + patch rewrites those tests to not use PED_ASSERT() so the + function correctly returns when the computations fail, and the + program can recover gracefully and operate normally. +Last-Update: 2011-03-08 +Bug-Ubuntu: http://launchpad.net/bugs/545911 + +Index: b/libparted/labels/dos.c +=================================================================== +--- a/libparted/labels/dos.c 2011-03-08 10:25:21.558631186 -0500 ++++ b/libparted/labels/dos.c 2011-03-08 10:25:33.770633724 -0500 +@@ -646,8 +645,10 @@ + if (cyl_size * denum != a_*H - A_*h) + return 0; + +- PED_ASSERT (cyl_size > 0, return 0); +- PED_ASSERT (cyl_size <= 255 * 63, return 0); ++ if (cyl_size <= 0) ++ return 0; ++ if (cyl_size > 255 * 63) ++ return 0; + + if (h > 0) + head_size = ( a_ - c * cyl_size ) / h; +@@ -658,18 +659,24 @@ + PED_ASSERT (0, return 0); + } + +- PED_ASSERT (head_size > 0, return 0); +- PED_ASSERT (head_size <= 63, return 0); ++ if (head_size <= 0) ++ return 0; ++ if (head_size > 63) ++ return 0; + + cylinders = part->disk->dev->length / cyl_size; + heads = cyl_size / head_size; + sectors = head_size; + +- PED_ASSERT (heads > 0, return 0); +- PED_ASSERT (heads < 256, return 0); ++ if (heads <= 0) ++ return 0; ++ if (heads > 255) ++ return 0; + +- PED_ASSERT (sectors > 0, return 0); +- PED_ASSERT (sectors <= 63, return 0); ++ if (sectors <= 0) ++ return 0; ++ if (sectors > 63) ++ return 0; + + /* Some broken OEM partitioning program(s) seem to have an out-by-one + * error on the end of partitions. We should offer to fix the +@@ -678,8 +685,10 @@ + if (((C + 1) * heads + H) * sectors + S == A) + C++; + +- PED_ASSERT ((c * heads + h) * sectors + s == a, return 0); +- PED_ASSERT ((C * heads + H) * sectors + S == A, return 0); ++ if ((c * heads + h) * sectors + s != a) ++ return 0; ++ if ((C * heads + H) * sectors + S != A) ++ return 0; + + bios_geom->cylinders = cylinders; + bios_geom->heads = heads; --- parted-2.3.orig/debian/patches/freebsd-geli.patch +++ parted-2.3/debian/patches/freebsd-geli.patch @@ -0,0 +1,30 @@ +Description: Detection of GEOM encryption devices (GELI) +Author: Robert Millan +Bug-Debian: http://bugs.debian.org/635393 +Forwarded: no +Last-Update: 2011-07-30 + +Index: b/libparted/arch/freebsd.c +=================================================================== +--- a/libparted/arch/freebsd.c ++++ b/libparted/arch/freebsd.c +@@ -1058,6 +1058,8 @@ + { + size_t listsize; + char *disklist, *pdisklist, *psave; ++ char buf[PATH_MAX]; ++ struct stat st; + + if (sysctlbyname("kern.disks", NULL, &listsize, NULL, 0) != 0) { + ped_exception_throw ( +@@ -1091,6 +1093,10 @@ + strncat (dev_name, token, sizeof(dev_name) - strlen(_PATH_DEV) - 1); + dev_name[sizeof(dev_name) - 1] = '\0'; + _ped_device_probe (dev_name); ++ ++ snprintf (buf, sizeof (buf), "%s.eli", dev_name); ++ if (stat (buf, &st) == 0) ++ _ped_device_probe (buf); + } + + free(disklist); --- parted-2.3.orig/debian/patches/freebsd-ufs.patch +++ parted-2.3/debian/patches/freebsd-ufs.patch @@ -0,0 +1,290 @@ +From: Aurelien Jarno +Subject: [PATCH] Add FreeBSD UFS support + +This patch adds support for detection of FreeBSD UFS file systems and +creation of the partition on DOS and GPT labels. It doesn't use the +system of slices used by default on FreeBSD and places the partition +directly in the dos label. This is something supported by the FreeBSD +kernel, and the default on Debian GNU/kFreeBSD. Even on plain FreeBSD, +some persons prefer to not use slices. + +This patch is used by debian-installer on Debian GNU/kFreeBSD for some +months already. + +Index: b/libparted/fs/ufs/ufs.c +=================================================================== +--- a/libparted/fs/ufs/ufs.c ++++ b/libparted/fs/ufs/ufs.c +@@ -48,6 +48,7 @@ + #define UFS_MAGIC_LFN 0x00095014 + #define UFS_MAGIC_FEA 0x00195612 + #define UFS_MAGIC_4GB 0x05231994 ++#define UFS2_MAGIC 0x19540119 + + struct ufs_csum { + uint32_t cs_ndir; /* number of directories */ +@@ -132,13 +133,50 @@ + int8_t fs_clean; /* file system is clean flag */ + int8_t fs_ronly; /* mounted read-only flag */ + int8_t fs_flags; /* currently unused flag */ +- int8_t fs_fsmnt[UFS_MAXMNTLEN]; /* name mounted on */ +-/* these fields retain the current block allocation info */ +- uint32_t fs_cgrotor; /* last cg searched */ +- uint32_t fs_csp[UFS_MAXCSBUFS]; /* list of fs_cs info buffers */ +- uint32_t fs_maxcluster; +- uint32_t fs_cpc; /* cyl per cycle in postbl */ +- uint16_t fs_opostbl[16][8]; /* old rotation block list head */ ++ union { ++ struct { ++ int8_t fs_fsmnt[UFS_MAXMNTLEN]; /* name mounted on */ ++ /* these fields retain the current block allocation info */ ++ uint32_t fs_cgrotor; /* last cg searched */ ++ uint32_t fs_csp[UFS_MAXCSBUFS]; /* list of fs_cs info buffers */ ++ uint32_t fs_maxcluster; ++ uint32_t fs_cpc; /* cyl per cycle in postbl */ ++ uint16_t fs_opostbl[16][8]; /* old rotation block list head */ ++ } fs_u1; ++ struct { ++ int8_t fs_fsmnt[468]; ++ uint8_t fs_volname[32]; ++ uint64_t fs_swuid; ++ int32_t fs_pad; ++ uint32_t fs_cgrotor; ++ uint32_t fs_ocsp[28]; ++ uint32_t fs_contigdirs; ++ uint32_t fs_csp; ++ uint32_t fs_maxcluster; ++ uint32_t fs_active; ++ int32_t fs_old_cpc; ++ int32_t fs_maxbsize; ++ int64_t fs_sparecon64[17]; ++ int64_t fs_sblockloc; ++ struct ufs2_csum_total { ++ uint64_t cs_ndir; ++ uint64_t cs_nbfree; ++ uint64_t cs_nifree; ++ uint64_t cs_nffree; ++ uint64_t cs_numclusters; ++ uint64_t cs_spare[3]; ++ } fs_cstotal; ++ struct ufs_timeval { ++ int32_t tv_sec; ++ int32_t tv_usec; ++ } fs_time; ++ int64_t fs_size; ++ int64_t fs_dsize; ++ uint64_t fs_csaddr; ++ int64_t fs_pendingblocks; ++ int32_t fs_pendinginodes; ++ } __attribute__((packed)) fs_u2; ++ } fs_u11; + union { + struct { + int32_t fs_sparecon[53];/* reserved for future constants */ +@@ -242,6 +280,45 @@ + return NULL; + } + ++static PedGeometry* ++ufs_probe_freebsd (PedGeometry* geom) ++{ ++ int offsets[] = { 0, 16, 128, 512 }; ++ int8_t buf[512 * 3]; ++ struct ufs_super_block *sb; ++ PedSector block_size; ++ PedSector block_count; ++ int i; ++ ++ if (geom->length < 5) ++ return 0; ++ ++ /* The UFS superblock could be on four different positions */ ++ for (i = 0; i < 4; i++) { ++ if (!ped_geometry_read (geom, buf, offsets[i], 3)) ++ return 0; ++ ++ sb = (struct ufs_super_block *)buf; ++ ++ /* Little endian is more likely on FreeBSD boxes */ ++ if (PED_LE32_TO_CPU(sb->fs_magic) == UFS2_MAGIC) { ++ block_size = PED_LE32_TO_CPU(sb->fs_fsize) / 512; ++ block_count = PED_LE32_TO_CPU(sb->fs_u11.fs_u2.fs_size); ++ return ped_geometry_new (geom->dev, geom->start, ++ block_size * block_count); ++ } ++ ++ /* Then try big endian */ ++ if (PED_BE32_TO_CPU(sb->fs_magic) == UFS2_MAGIC) { ++ block_size = PED_BE32_TO_CPU(sb->fs_fsize) / 512; ++ block_count = PED_BE32_TO_CPU(sb->fs_u11.fs_u2.fs_size); ++ return ped_geometry_new (geom->dev, geom->start, ++ block_size * block_count); ++ } ++ } ++ return NULL; ++} ++ + #ifndef DISCOVER_ONLY + static int + ufs_clobber (PedGeometry* geom) +@@ -293,6 +370,24 @@ + get_copy_constraint: NULL + }; + ++static PedFileSystemOps ufs_ops_freebsd = { ++ probe: ufs_probe_freebsd, ++#ifndef DISCOVER_ONLY ++ clobber: ufs_clobber, ++#else ++ clobber: NULL, ++#endif ++ open: NULL, ++ create: NULL, ++ close: NULL, ++ check: NULL, ++ copy: NULL, ++ resize: NULL, ++ get_create_constraint: NULL, ++ get_resize_constraint: NULL, ++ get_copy_constraint: NULL ++}; ++ + static PedFileSystemType ufs_type_sun = { + next: NULL, + ops: &ufs_ops_sun, +@@ -307,6 +402,12 @@ + block_sizes: HP_UFS_BLOCK_SIZES + }; + ++static PedFileSystemType ufs_type_freebsd_ufs = { ++ next: NULL, ++ ops: &ufs_ops_freebsd, ++ name: "freebsd-ufs" ++}; ++ + void + ped_file_system_ufs_init () + { +@@ -314,11 +415,13 @@ + + ped_file_system_type_register (&ufs_type_sun); + ped_file_system_type_register (&ufs_type_hp); ++ ped_file_system_type_register (&ufs_type_freebsd_ufs); + } + + void + ped_file_system_ufs_done () + { ++ ped_file_system_type_unregister (&ufs_type_freebsd_ufs); + ped_file_system_type_unregister (&ufs_type_hp); + ped_file_system_type_unregister (&ufs_type_sun); + } +Index: b/libparted/labels/dos.c +=================================================================== +--- a/libparted/labels/dos.c ++++ b/libparted/labels/dos.c +@@ -87,6 +87,7 @@ + #define PARTITION_LINUX 0x83 + #define PARTITION_LINUX_EXT 0x85 + #define PARTITION_LINUX_LVM 0x8e ++#define PARTITION_FREEBSD_UFS 0xa5 + #define PARTITION_HFS 0xaf + #define PARTITION_SUN_UFS 0xbf + #define PARTITION_DELL_DIAG 0xde +@@ -1382,6 +1383,8 @@ + dos_data->system = PARTITION_HFS; + else if (!strcmp (fs_type->name, "sun-ufs")) + dos_data->system = PARTITION_SUN_UFS; ++ else if (!strcmp (fs_type->name, "freebsd-ufs")) ++ dos_data->system = PARTITION_FREEBSD_UFS; + else if (is_linux_swap (fs_type->name)) + dos_data->system = PARTITION_LINUX_SWAP; + else +Index: b/libparted/labels/gpt.c +=================================================================== +--- a/libparted/labels/gpt.c ++++ b/libparted/labels/gpt.c +@@ -139,6 +139,10 @@ + ((efi_guid_t) { PED_CPU_TO_LE32 (0x5265636F), PED_CPU_TO_LE16 (0x7665), \ + PED_CPU_TO_LE16 (0x11AA), 0xaa, 0x11, \ + { 0x00, 0x30, 0x65, 0x43, 0xEC, 0xAC }}) ++#define PARTITION_FREEBSD_UFS_GUID \ ++ ((efi_guid_t) { PED_CPU_TO_LE32 (0x516e7cb6), PED_CPU_TO_LE16 (0x6ecf), \ ++ PED_CPU_TO_LE16 (0x11d6), 0x8f, 0xf8, \ ++ { 0x00, 0x02, 0x2d, 0x09, 0x71, 0x2b }}) + + struct __attribute__ ((packed)) _GuidPartitionTableHeader_t + { +@@ -1425,6 +1429,11 @@ + gpt_part_data->type = PARTITION_SWAP_GUID; + return 1; + } ++ if (strstr (fs_type->name, "freebsd-ufs")) ++ { ++ gpt_part_data->type = PARTITION_FREEBSD_UFS_GUID; ++ return 1; ++ } + } + + gpt_part_data->type = PARTITION_BASIC_DATA_GUID; +Index: b/tests/Makefile.am +=================================================================== +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -25,6 +25,7 @@ + t2300-dos-label-extended-bootcode.sh \ + t2310-dos-extended-2-sector-min-offset.sh \ + t2400-dos-hfs-partition-type.sh \ ++ t2500-freebsd-ufs.sh \ + t3000-resize-fs.sh \ + t3200-type-change.sh \ + t3300-palo-prep.sh \ +Index: b/tests/t2500-freebsd-ufs.sh +=================================================================== +--- /dev/null ++++ b/tests/t2500-freebsd-ufs.sh +@@ -0,0 +1,44 @@ ++#!/bin/sh ++# Probe FreeBSD UFS file system ++ ++# Copyright (C) 2010 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 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 . ++ ++if test "$VERBOSE" = yes; then ++ set -x ++ parted --version ++fi ++ ++: ${srcdir=.} ++. $srcdir/t-lib.sh ++require_512_byte_sector_size_ ++ ++dev=loop-file ++ss=$sector_size_ ++n_sectors=8000 ++ ++fail=0 ++ ++( type mkfs.ufs ) >/dev/null 2>&1 || skip_test_ "no freebsd-ufs support" ++ ++# create a freebsd-ufs file system ++dd if=/dev/zero of=$dev bs=1024 count=4096 >/dev/null || fail=1 ++mkfs.ufs `pwd`/$dev >/dev/null || fail=1 ++ ++# probe the freebsd-ufs file system ++parted -m -s $dev u s print >out 2>&1 || fail=1 ++grep '^1:.*:freebsd-ufs::;$' out || fail=1 ++ ++Exit $fail --- parted-2.3.orig/debian/patches/freebsd-zvol.patch +++ parted-2.3/debian/patches/freebsd-zvol.patch @@ -0,0 +1,74 @@ +Description: Detection of ZFS volumes (ZVOL) + ZFS volumes (ZVOL) are the ZFS equivalent of Logical Volumes in LVM. + . + They implement a block device which can be used for swap or legacy + filesystems. +Author: Robert Millan +Bug-Debian: http://bugs.debian.org/635384 +Forwarded: no +Last-Update: 2011-07-30 + +Index: b/libparted/arch/freebsd.c +=================================================================== +--- a/libparted/arch/freebsd.c ++++ b/libparted/arch/freebsd.c +@@ -23,6 +23,7 @@ + #include + + #include ++#include + #include + #include + #include +@@ -1096,12 +1097,51 @@ + return 1; + } + ++static int ++_probe_zfs_volumes () ++{ ++ DIR* pool_dir; ++ DIR* zvol_dir; ++ struct dirent* pool_dent; ++ struct dirent* zvol_dent; ++ char buf[PATH_MAX]; ++ struct stat st; ++ ++ pool_dir = opendir ("/dev/zvol"); ++ if (!pool_dir) ++ return 0; ++ ++ while ((pool_dent = readdir (pool_dir))) { ++ if (strcmp (pool_dent->d_name, ".") == 0 || strcmp (pool_dent->d_name, "..") == 0) ++ continue; ++ ++ snprintf (buf, sizeof (buf), "/dev/zvol/%s", pool_dent->d_name); ++ zvol_dir = opendir (buf); ++ ++ while ((zvol_dent = readdir (zvol_dir))) { ++ if (strcmp (zvol_dent->d_name, ".") == 0 || strcmp (zvol_dent->d_name, "..") == 0) ++ continue; ++ ++ snprintf (buf, sizeof (buf), "/dev/zvol/%s/%s", pool_dent->d_name, zvol_dent->d_name); ++ if (stat (buf, &st) != 0) ++ continue; ++ _ped_device_probe (buf); ++ } ++ closedir (zvol_dir); ++ } ++ closedir (pool_dir); ++ ++ return 1; ++} ++ + static void + freebsd_probe_all () + { + _probe_standard_devices (); + + _probe_kern_disks (); ++ ++ _probe_zfs_volumes (); + } + + static char* --- parted-2.3.orig/debian/patches/gnulib-gets.patch +++ parted-2.3/debian/patches/gnulib-gets.patch @@ -0,0 +1,36 @@ +Description: Avoid assuming that gets is declared +Origin: backport, http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=66712c23388e93e5c518ebc8515140fa0c807348 +Forwarded: no +Last-Update: 2012-11-06 + +--- a/lib/stdio.in.h ++++ b/lib/stdio.in.h +@@ -140,10 +140,12 @@ + #endif + + /* It is very rare that the developer ever has full control of stdin, +- so any use of gets warrants an unconditional warning. Assume it is +- always declared, since it is required by C89. */ ++ so any use of gets warrants an unconditional warning; besides, C11 ++ removed it. */ + #undef gets ++#if HAVE_RAW_DECL_GETS + _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); ++#endif + + #if @GNULIB_FOPEN@ + # if @REPLACE_FOPEN@ +--- a/m4/stdio_h.m4 ++++ b/m4/stdio_h.m4 +@@ -35,9 +35,9 @@ + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use, and which is not +- dnl guaranteed by C89. ++ dnl guaranteed by both C89 and C11. + gl_WARN_ON_USE_PREPARE([[#include +- ]], [dprintf fpurge fseeko ftello getdelim getline popen renameat ++ ]], [dprintf fpurge fseeko ftello getdelim getline gets popen renameat + snprintf tmpfile vdprintf vsnprintf]) + ]) + --- parted-2.3.orig/debian/patches/gnulib.patch +++ parted-2.3/debian/patches/gnulib.patch @@ -0,0 +1,22 @@ +--- a/lib/regex_internal.c.orig 2012-06-08 02:15:54.083227641 +0200 ++++ b/lib/regex_internal.c 2012-06-08 02:20:44.364702306 +0200 +@@ -738,16 +738,18 @@ + unsigned char buf[6]; + size_t mbclen; + ++ const unsigned char *pp = p; + if (BE (pstr->trans != NULL, 0)) + { + int i = mlen < 6 ? mlen : 6; + while (--i >= 0) + buf[i] = pstr->trans[p[i]]; ++ pp = buf; + } + /* XXX Don't use mbrtowc, we know which conversion + to use (UTF-8 -> UCS4). */ + memset (&cur_state, 0, sizeof (cur_state)); +- mbclen = __mbrtowc (&wc2, (const char *) p, mlen, ++ mbclen = __mbrtowc (&wc2, (const char *) pp, mlen, + &cur_state); + if (raw + offset - p <= mbclen + && mbclen < (size_t) -2) --- parted-2.3.orig/debian/patches/gpt-add-legacy_boot-partition-flag.patch +++ parted-2.3/debian/patches/gpt-add-legacy_boot-partition-flag.patch @@ -0,0 +1,156 @@ +From: Brian C. Lane +Subject: gpt: add legacy_boot partition flag +Origin: upstream, http://git.debian.org/?p=parted/parted.git;a=commitdiff;h=3dd52c822a +Forwarded: not-needed +Last-Update: 2011-02-25 + +Add support for the Legacy BIOS Bootable flag in the GPT +Attribute field. This is used by software like syslinux to +determine which partition to boot when in BIOS mode. + +See Page 105, Table 19 Bit 2 of the UEFI Spec 2.3 book. + +* doc/C/parted.8: Document legacy_boot. +* doc/parted.texi: Document legacy_boot. +* include/parted/disk.h: Add PED_PARTITION_LEGACY_BOOT flag. +* libparted/disk.c (ped_partition_flag_get_name): Add legacy_boot flag. +* libparted/labels/gpt.c (_parse_part_entry): +(_partition_generate_part_entry, gpt_partition_new): +(gpt_partition_set_flag, gpt_partition_get_flag): +(gpt_partition_is_flag_available): Add legacy_boot flag support. +--- + doc/C/parted.8 | 2 +- + doc/parted.texi | 4 ++++ + include/parted/disk.h | 5 +++-- + libparted/disk.c | 2 ++ + libparted/labels/gpt.c | 15 ++++++++++++++- + 5 files changed, 24 insertions(+), 4 deletions(-) + +--- a/doc/C/parted.8 ++++ b/doc/C/parted.8 +@@ -132,7 +132,7 @@ + .B set \fIpartition\fP \fIflag\fP \fIstate\fP + Change the state of the \fIflag\fP on \fIpartition\fP to \fIstate\fP. + Supported flags are: "boot", "root", "swap", "hidden", "raid", "lvm", "lba", +-and "palo". ++"legacy_boot" and "palo". + \fIstate\fP should be either "on" or "off". + .TP + .B unit \fIunit\fP +--- a/doc/parted.texi ++++ b/doc/parted.texi +@@ -1049,6 +1049,10 @@ + (GPT) - Enable this to record that the selected partition is a + GRUB BIOS partition. + ++@item legacy_boot ++(GPT) - this flag is used to tell special purpose software that the GPT ++partition may be bootable. ++ + @item boot + (Mac, MS-DOS, PC98) - should be enabled if you want to boot off the + partition. The semantics vary between disk labels. For MS-DOS disk +--- a/include/parted/disk.h ++++ b/include/parted/disk.h +@@ -69,10 +69,11 @@ + PED_PARTITION_MSFT_RESERVED=11, + PED_PARTITION_BIOS_GRUB=12, + PED_PARTITION_APPLE_TV_RECOVERY=13, +- PED_PARTITION_DIAG=14 ++ PED_PARTITION_DIAG=14, ++ PED_PARTITION_LEGACY_BOOT=15 + }; + #define PED_PARTITION_FIRST_FLAG PED_PARTITION_BOOT +-#define PED_PARTITION_LAST_FLAG PED_PARTITION_DIAG ++#define PED_PARTITION_LAST_FLAG PED_PARTITION_LEGACY_BOOT + + enum _PedDiskTypeFeature { + PED_DISK_TYPE_EXTENDED=1, /**< supports extended partitions */ +--- a/libparted/disk.c ++++ b/libparted/disk.c +@@ -2443,6 +2443,8 @@ + return N_("atvrecv"); + case PED_PARTITION_DIAG: + return N_("diag"); ++ case PED_PARTITION_LEGACY_BOOT: ++ return N_("legacy_boot"); + + default: + ped_exception_throw ( +--- a/libparted/labels/gpt.c ++++ b/libparted/labels/gpt.c +@@ -4,7 +4,7 @@ + original version by Matt Domsch + Disclaimed into the Public Domain + +- Portions Copyright (C) 2001-2003, 2005-2010 Free Software Foundation, Inc. ++ Portions Copyright (C) 2001-2003, 2005-2011 Free Software Foundation, Inc. + + EFI GUID Partition Table handling + Per Intel EFI Specification v1.02 +@@ -289,6 +289,7 @@ + int msftres; + int atvrecv; + int msftrecv; ++ int legacy_boot; + } GPTPartitionData; + + static PedDiskType gpt_disk_type; +@@ -1049,10 +1050,13 @@ + = gpt_part_data->boot = gpt_part_data->hp_service + = gpt_part_data->hidden = gpt_part_data->msftres + = gpt_part_data->msftrecv ++ = gpt_part_data->legacy_boot + = gpt_part_data->bios_grub = gpt_part_data->atvrecv = 0; + + if (pte->Attributes.RequiredToFunction & 0x1) + gpt_part_data->hidden = 1; ++ if (pte->Attributes.LegacyBIOSBootable & 0x1) ++ gpt_part_data->legacy_boot = 1; + + if (!guid_cmp (gpt_part_data->type, PARTITION_SYSTEM_GUID)) + gpt_part_data->boot = 1; +@@ -1556,6 +1560,8 @@ + + if (gpt_part_data->hidden) + pte->Attributes.RequiredToFunction = 1; ++ if (gpt_part_data->legacy_boot) ++ pte->Attributes.LegacyBIOSBootable = 1; + + for (i = 0; i < 72 / sizeof (efi_char16_t); i++) + pte->PartitionName[i] +@@ -1704,6 +1710,7 @@ + gpt_part_data->msftres = 0; + gpt_part_data->msftrecv = 0; + gpt_part_data->atvrecv = 0; ++ gpt_part_data->legacy_boot = 0; + uuid_generate ((unsigned char *) &gpt_part_data->uuid); + swap_uuid_and_efi_guid ((unsigned char *) (&gpt_part_data->uuid)); + memset (gpt_part_data->name, 0, sizeof gpt_part_data->name); +@@ -1996,6 +2003,9 @@ + case PED_PARTITION_HIDDEN: + gpt_part_data->hidden = state; + return 1; ++ case PED_PARTITION_LEGACY_BOOT: ++ gpt_part_data->legacy_boot = state; ++ return 1; + case PED_PARTITION_SWAP: + case PED_PARTITION_ROOT: + case PED_PARTITION_LBA: +@@ -2032,6 +2042,8 @@ + return gpt_part_data->atvrecv; + case PED_PARTITION_HIDDEN: + return gpt_part_data->hidden; ++ case PED_PARTITION_LEGACY_BOOT: ++ return gpt_part_data->legacy_boot; + case PED_PARTITION_SWAP: + case PED_PARTITION_LBA: + case PED_PARTITION_ROOT: +@@ -2056,6 +2068,7 @@ + case PED_PARTITION_DIAG: + case PED_PARTITION_APPLE_TV_RECOVERY: + case PED_PARTITION_HIDDEN: ++ case PED_PARTITION_LEGACY_BOOT: + return 1; + case PED_PARTITION_SWAP: + case PED_PARTITION_ROOT: --- parted-2.3.orig/debian/patches/gpt-add-partition-attribute-bits.patch +++ parted-2.3/debian/patches/gpt-add-partition-attribute-bits.patch @@ -0,0 +1,33 @@ +From: Brian C. Lane +Subject: gpt: add partition attribute bits: NoBlockIOProtocol, LegacyBIOSBootable +Origin: upstream, http://git.debian.org/?p=parted/parted.git;a=commitdiff;h=7fc2cf02e1e +Forwaded: not-needed +Last-Update: 2011-02-25 + +Add NoBlockIOProtocol and LegacyBIOSBootable flags to the GPT partition +Attributes entry. +--- + libparted/labels/gpt.c | 8 ++++++-- + 1 files changed, 6 insertions(+), 2 deletions(-) + +--- a/libparted/labels/gpt.c ++++ b/libparted/labels/gpt.c +@@ -174,12 +174,16 @@ + { + #ifdef __GNUC__ /* XXX narrow this down to !TinyCC */ + uint64_t RequiredToFunction:1; +- uint64_t Reserved:47; ++ uint64_t NoBlockIOProtocol:1; ++ uint64_t LegacyBIOSBootable:1; ++ uint64_t Reserved:45; + uint64_t GuidSpecific:16; + #else + # warning "Using crippled partition entry type" + uint32_t RequiredToFunction:1; +- uint32_t Reserved:32; ++ uint32_t NoBlockIOProtocol:1; ++ uint32_t LegacyBIOSBootable:1; ++ uint32_t Reserved:30; + uint32_t LOST:5; + uint32_t GuidSpecific:16; + #endif --- parted-2.3.orig/debian/patches/gptsync.patch +++ parted-2.3/debian/patches/gptsync.patch @@ -0,0 +1,669 @@ +From: Matthew Garrett +From: Colin Watson +Forwarded: no +Last-Update: 2013-08-13 +Description: GPT syncing for Intel Macs + On Intel Mac systems, write a synced MBR rather than a protective MBR. + +--- a/libparted/labels/gpt.c ++++ b/libparted/labels/gpt.c +@@ -10,6 +10,11 @@ + Per Intel EFI Specification v1.02 + http://developer.intel.com/technology/efi/efi.htm + ++ DMI handling from dmidecode: ++ (C) 2000-2002 Alan Cox ++ (C) 2002-2005 Jean Delvare ++ Reduced for Intel Mac detection by Colin Watson ++ + 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 +@@ -34,6 +39,8 @@ + #include + #include + #include ++#include ++#include + #include + #include + #include +@@ -282,6 +289,258 @@ + + static PedDiskType gpt_disk_type; + ++ ++#if (defined(__i386__) || defined(__x86_64__)) && !defined(__GNU__) ++# define USE_DMI ++#endif ++ ++#define APPLE_DMI "Apple Computer, Inc." ++#define APPLE_DMI_2 "Apple Inc." ++static int is_apple = 0; ++ ++#ifdef USE_DMI ++ ++#define WORD(x) (*(const uint16_t *)(x)) ++#define DWORD(x) (*(const uint32_t *)(x)) ++ ++struct dmi_header ++{ ++ uint8_t type; ++ uint8_t length; ++ uint16_t handle; ++}; ++ ++ ++static int ++checksum (const uint8_t *buf, size_t len) ++{ ++ uint8_t sum = 0; ++ size_t a; ++ ++ for (a = 0; a < len; a++) ++ sum += buf[a]; ++ return (sum == 0); ++} ++ ++/* Copy a physical memory chunk into a memory buffer. ++ * This function allocates memory. ++ */ ++static void * ++mem_chunk (size_t base, size_t len) ++{ ++ void *p; ++ int fd; ++ size_t mmoffset; ++ void *mmp; ++ ++ fd = open ("/dev/mem", O_RDONLY); ++ if (fd == -1) ++ return NULL; ++ ++ p = malloc (len); ++ if (p == NULL) ++ { ++ close (fd); ++ return NULL; ++ } ++ ++#ifdef _SC_PAGESIZE ++ mmoffset = base % sysconf (_SC_PAGESIZE); ++#else ++ mmoffset = base % getpagesize (); ++#endif ++ /* Please note that we don't use mmap() for performance reasons here, but ++ * to workaround problems many people encountered when trying to read from ++ * /dev/mem using regular read() calls. ++ */ ++ mmp = mmap (0, mmoffset + len, PROT_READ, MAP_SHARED, fd, base - mmoffset); ++ if (mmp == MAP_FAILED) { ++ free (p); ++ close (fd); ++ return NULL; ++ } ++ ++ memcpy (p, mmp + mmoffset, len); ++ ++ munmap (mmp, mmoffset + len); ++ ++ close (fd); ++ ++ return p; ++} ++ ++static const char * ++dmi_string (struct dmi_header *dm, uint8_t s) ++{ ++ char *bp = (char *) dm; ++ size_t i, len; ++ ++ if (s == 0) ++ return "Not Specified"; ++ ++ bp += dm->length; ++ while (s > 1 && *bp) ++ { ++ bp += strlen (bp); ++ bp++; ++ s--; ++ } ++ ++ if (!*bp) ++ return ""; ++ ++ /* ASCII filtering */ ++ len = strlen (bp); ++ for (i = 0; i < len; i++) ++ if (bp[i] < 32 || bp[i] == 127) ++ bp[i] = '.'; ++ ++ return bp; ++} ++ ++static char * ++dmi_table (uint32_t base, uint16_t len, uint16_t num) ++{ ++ uint8_t *buf; ++ uint8_t *data; ++ int i = 0; ++ char *ret = NULL; ++ ++ buf = mem_chunk (base, len); ++ if (buf == NULL) ++ return NULL; ++ ++ data = buf; ++ while (i < num && data + sizeof (struct dmi_header) <= buf + len) { ++ uint8_t *next; ++ struct dmi_header *h = (struct dmi_header *) data; ++ ++ /* Stop decoding at end of table marker */ ++ if (h->type == 127) ++ break; ++ ++ /* Look for the next handle */ ++ next = data + h->length; ++ while (next - buf + 1 < len && (next[0] != 0 || next[1] != 0)) ++ next++; ++ next += 2; ++ /* system-manufacturer */ ++ if (h->type == 1 && h->length > 0x04) { ++ ret = strdup (dmi_string (h, data[0x04])); ++ break; ++ } ++ ++ data = next; ++ i++; ++ } ++ ++ free (buf); ++ return ret; ++} ++ ++#define EFI_NOT_FOUND (-1) ++#define EFI_NO_SMBIOS (-2) ++static int ++address_from_efi (size_t *address) ++{ ++ FILE *efi_systab; ++ char linebuf[64]; ++ int ret; ++ ++ *address = 0; /* Prevent compiler warning */ ++ ++ efi_systab = fopen ("/sys/firmware/efi/systab", "r"); ++ if (efi_systab == NULL) ++ /* No EFI interface, fallback to memory scan */ ++ return EFI_NOT_FOUND; ++ ++ ret = EFI_NO_SMBIOS; ++ while ((fgets (linebuf, sizeof (linebuf) - 1, efi_systab)) != NULL) { ++ char *addrp = strchr (linebuf, '='); ++ *(addrp++) = '\0'; ++ if (strcmp (linebuf, "SMBIOS") == 0) { ++ *address = strtoul (addrp, NULL, 0); ++ ret = 0; ++ break; ++ } ++ } ++ fclose (efi_systab); ++ ++ return ret; ++} ++ ++static char * ++smbios_decode (uint8_t *buf) ++{ ++ if (checksum (buf, buf[0x05]) && ++ memcmp (buf + 0x10, "_DMI_", 5) == 0 && ++ checksum (buf + 0x10, 0x0F)) ++ return dmi_table (DWORD (buf + 0x18), WORD (buf + 0x16), ++ WORD (buf + 0x1C)); ++ ++ return NULL; ++} ++ ++static char * ++legacy_decode (uint8_t *buf) ++{ ++ if (checksum (buf, 0x0F)) ++ return dmi_table (DWORD (buf + 0x08), WORD (buf + 0x06), ++ WORD (buf + 0x0C)); ++ ++ return NULL; ++} ++ ++#endif /* USE_DMI */ ++ ++static char * ++dmi_system_manufacturer (void) ++{ ++#ifdef USE_DMI ++ uint8_t *buf; ++ size_t fp; ++ char *ret = NULL; ++ int efi; ++ ++ efi = address_from_efi (&fp); ++ if (efi == EFI_NO_SMBIOS) ++ return NULL; ++ ++ if (efi != EFI_NOT_FOUND) { ++ buf = mem_chunk (fp, 0x20); ++ if (buf == NULL) ++ return NULL; ++ ret = smbios_decode (buf); ++ if (ret) ++ goto out; ++ } ++ ++ buf = mem_chunk (0xF0000, 0x10000); ++ if (buf == NULL) ++ return NULL; ++ ++ for (fp = 0; fp <= 0xFFF0; fp += 16) { ++ if (memcmp (buf + fp, "_SM_", 4) == 0 && fp <= 0xFFE0) { ++ ret = smbios_decode (buf + fp); ++ if (ret) ++ break; ++ fp += 16; ++ } else if (memcmp (buf + fp, "_DMI_", 5) == 0) { ++ ret = legacy_decode (buf + fp); ++ if (ret) ++ break; ++ } ++ } ++ ++out: ++ free (buf); ++ return ret; ++#else /* !USE_DMI */ ++ return NULL; ++#endif /* USE_DMI */ ++} ++ ++ + static inline uint32_t + pth_get_size (const PedDevice *dev) + { +@@ -476,6 +735,9 @@ + if (!gpt_sig_found) + return 0; + ++ if (is_apple) ++ return 1; ++ + void *label; + if (!ptt_read_sector (dev, 0, &label)) + return 0; +@@ -889,6 +1151,10 @@ + * warn if it's not there, and treat the disk as MSDOS, with a note + * for users to use Parted to "fix up" their disk if they + * really want it to be considered GPT. ++ * ++ * Of course, this is incompatible with how Apple handle things. For ++ * legacy BIOS compatibility on Apple machines, we need a valid legacy MBR ++ * rather than a protective one. Aren't standards wonderful? + ************************************************************/ + static int + gpt_read (PedDisk *disk) +@@ -1095,6 +1361,129 @@ + return write_ok; + } + ++static void ++fill_raw_part (PartitionRecord_t* raw_part, PedPartition *part, PedSector offset, int number) ++{ ++ GPTPartitionData* gpt_part_data = part->disk_specific; ++ ++ if (part->fs_type) { ++ if (strncmp (part->fs_type->name, "fat", 3) == 0) ++ raw_part->OSType = 0x0b; ++ else if (strncmp (part->fs_type->name, "ntfs", 4) == 0) ++ raw_part->OSType = 0x07; ++ else if (strncmp (part->fs_type->name, "hfs", 3) == 0) ++ raw_part->OSType = 0xaf; ++ else if (strncmp (part->fs_type->name, "linux-swap", 10) == 0) ++ raw_part->OSType = 0x82; ++ else ++ raw_part->OSType = 0x83; ++ } else ++ raw_part->OSType = 0xda; ++ ++ /* Apple's firmware appears to become unhappy if the second partition ++ isn't bootable */ ++ ++ if (number == 2) ++ raw_part->BootIndicator = 0x80; ++ ++ raw_part->StartingLBA = PED_CPU_TO_LE32 ((part->geom.start - offset) ++ / (part->disk->dev->sector_size / 512)); ++ ++ raw_part->SizeInLBA = PED_CPU_TO_LE32 (part->geom.length ++ / (part->disk->dev->sector_size / 512)); ++ ++ /* EFI system partitions will have a FAT filesystem and ++ PARTITION_SYSTEM_GUID; however, it is not wise to rely on filesystem ++ probing */ ++ ++ if (number == 1) { ++ if (!guid_cmp (gpt_part_data->type, PARTITION_SYSTEM_GUID) || ++ !guid_cmp (gpt_part_data->type, PARTITION_BIOS_GRUB_GUID)) { ++ raw_part->OSType = EFI_PMBR_OSTYPE_EFI; ++ raw_part->OSType = EFI_PMBR_OSTYPE_EFI; ++ } ++ } ++ ++ /* Apple's firmware also appears to be unhappy if the EFI system ++ partition doesn't extend all the way to the start of the disk */ ++ ++ if (number == 1 && raw_part->OSType == EFI_PMBR_OSTYPE_EFI) { ++ raw_part->StartSector = 1; ++ raw_part->SizeInLBA += raw_part->StartingLBA - 1; ++ raw_part->StartingLBA = 1; ++ } else { ++ raw_part->StartHead = 0xfe; ++ raw_part->StartSector = 0xff; ++ raw_part->StartTrack = 0xff; ++ } ++ ++ raw_part->EndHead = 0xfe; ++ raw_part->EndSector = 0xff; ++ raw_part->EndTrack = 0xff; ++} ++ ++static int ++_gptsync (const PedDisk *disk) ++{ ++ void *s0; ++ PedPartition* part; ++ int i; ++ ++ if (!ptt_read_sector (disk->dev, GPT_PMBR_LBA, &s0)) ++ return 0; ++ LegacyMBR_t *pmbr = s0; ++ ++ int ok = 0; ++ ++ memset(&pmbr->PartitionRecord, 0, sizeof(pmbr->PartitionRecord)); ++ pmbr->Signature = PED_CPU_TO_LE16(MSDOS_MBR_SIGNATURE); ++ ++ bool prot = false; /* have we found a protective partition? */ ++ for (i=1; i<=4; i++) { ++ part = ped_disk_get_partition (disk, i); ++ if (!part) ++ continue; ++ ++ fill_raw_part (&pmbr->PartitionRecord [i - 1], part, 0, i); ++ if (pmbr->PartitionRecord[i - 1].OSType == EFI_PMBR_OSTYPE_EFI) ++ prot = true; ++ } ++ ++ if (!prot) { /* create one covering the gpt entries */ ++ uint32_t prot_size; ++ for (i=2; i>=0; i--) ++ pmbr->PartitionRecord[i + 1] = pmbr->PartitionRecord[i]; ++ memset (&pmbr->PartitionRecord[0], 0, sizeof pmbr->PartitionRecord[0]); ++ pmbr->PartitionRecord[0].OSType = EFI_PMBR_OSTYPE_EFI; ++ pmbr->PartitionRecord[0].StartSector = 1; ++ pmbr->PartitionRecord[0].EndHead = 0xfe; ++ pmbr->PartitionRecord[0].EndSector = 0xff; ++ pmbr->PartitionRecord[0].EndTrack = 0xff; ++ pmbr->PartitionRecord[0].StartingLBA = PED_CPU_TO_LE32 (1); ++ if ((disk->dev->length - 1ULL) > 0xFFFFFFFFULL) ++ prot_size = 0xFFFFFFFF; ++ else ++ prot_size = disk->dev->length - 1UL; ++ for (i=1; i<=3; i++) { ++ if (pmbr->PartitionRecord[i].StartingLBA) { ++ uint32_t starting_lba = ++ PED_LE32_TO_CPU (pmbr->PartitionRecord[i].StartingLBA); ++ if (starting_lba - 1 < prot_size) ++ prot_size = starting_lba - 1; ++ } ++ } ++ pmbr->PartitionRecord[0].SizeInLBA = PED_CPU_TO_LE32 (prot_size); ++ } ++ ++ if (!ped_device_write (disk->dev, pmbr, GPT_PMBR_LBA, GPT_PMBR_SECTORS)) ++ goto error; ++ ++ ok = ped_device_sync (disk->dev); ++error: ++ free (s0); ++ return ok; ++} ++ + static int + _generate_header (const PedDisk *disk, int alternate, uint32_t ptes_crc, + GuidPartitionTableHeader_t **gpt_p) +@@ -1201,9 +1590,15 @@ + + ptes_crc = efi_crc32 (ptes, ptes_size); + +- /* Write protective MBR */ +- if (!_write_pmbr (disk->dev)) +- goto error_free_ptes; ++ if (is_apple) { ++ /* Write synced MBR */ ++ if (!_gptsync (disk)) ++ goto error_free_ptes; ++ } else { ++ /* Write protective MBR */ ++ if (!_write_pmbr (disk->dev)) ++ goto error_free_ptes; ++ } + + /* Write PTH and PTEs */ + /* FIXME: Caution: this code is nearly identical to what's just below. */ +@@ -1790,6 +2185,21 @@ + PED_ASSERT (sizeof (GuidPartitionEntry_t) == 128, return); + + ped_disk_type_register (&gpt_disk_type); ++ ++ char *force_gpt_apple = getenv ("PARTED_GPT_APPLE"); ++ if (force_gpt_apple) { ++ if (strcmp (force_gpt_apple, "1") == 0) ++ is_apple = 1; ++ } else { ++ char *manufacturer = dmi_system_manufacturer (); ++ if (manufacturer && ++ (strncasecmp (APPLE_DMI, manufacturer, ++ strlen (APPLE_DMI)) == 0 || ++ strncasecmp (APPLE_DMI_2, manufacturer, ++ strlen (APPLE_DMI_2)) == 0)) ++ is_apple = 1; ++ free (manufacturer); ++ } + } + + void +--- /dev/null ++++ b/tests/t0290-gptsync.sh +@@ -0,0 +1,175 @@ ++#!/bin/sh ++# test GPT -> hybrid MBR syncing for Apple systems ++# http://www.rodsbooks.com/gdisk/hybrid.html ++ ++# Copyright (C) 2012 Canonical Ltd. ++ ++# 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 . ++ ++if test "$VERBOSE" = yes; then ++ set -x ++ parted --version ++fi ++ ++: ${srcdir=.} ++. $srcdir/t-lib.sh ++ ++require_root_ ++require_scsi_debug_module_ ++ ++ss=$sector_size_ ++# must be big enough for a 32MiB partition in order to be big enough for FAT16 ++n_sectors=131072 ++bootcode_size=446 ++mbr_table_size=$((512 - $bootcode_size)) ++ ++dump_mbr_table () { ++ dd if=$dev bs=1 skip=$bootcode_size count=$mbr_table_size 2>/dev/null | od -v -An -tx1 ++} ++ ++# create memory-backed device ++sectors_per_MiB=$((1024 * 1024 / $ss)) ++n_MiB=$((($n_sectors + $sectors_per_MiB - 1) / $sectors_per_MiB)) ++scsi_debug_setup_ dev_size_mb=$n_MiB > dev-name || ++ skip_test_ 'failed to create scsi_debug device' ++dev=$(cat dev-name) ++ ++# force Apple mode ++export PARTED_GPT_APPLE=1 ++ ++# create gpt label ++parted -s $dev mklabel gpt > empty 2>&1 || fail=1 ++compare /dev/null empty || fail=1 ++ ++# print the empty table ++parted -m -s $dev unit s print > t 2>&1 || fail=1 ++sed "s,.*/$dev:,$dev:," t > out || fail=1 ++ ++# check for expected output ++printf "BYT;\n$dev:${n_sectors}s:scsi:$sector_size_:$sector_size_:gpt:Linux scsi_debug;\n" \ ++ > exp || fail=1 ++compare exp out || fail=1 ++ ++# the empty table should have a MBR containing only a protective entry ++dump_mbr_table > out || fail=1 ++cat < exp || fail=1 ++ 00 00 01 00 ee fe ff ff 01 00 00 00 ff ff 01 00 ++ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ++ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ++ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ++ 55 aa ++EOF ++compare exp out || fail=1 ++ ++# create a 32MiB FAT16 EFI System Partition ++parted -s $dev mkpart p1 fat16 2048s 67583s set 1 boot on > empty 2>&1 || fail=1 ++compare /dev/null empty || fail=1 ++mkfs.vfat -F 16 ${dev}1 >/dev/null || skip_ "mkfs.vfat failed" ++ ++# this is represented as a protective partition, but now it only extends as ++# far as the end of the first partition rather than covering the whole disk ++# (matching refit gptsync's strategy); it still starts at sector one ++dump_mbr_table > out || fail=1 ++cat < exp || fail=1 ++ 00 00 01 00 ee fe ff ff 01 00 00 00 ff 07 01 00 ++ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ++ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ++ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ++ 55 aa ++EOF ++compare exp out || fail=1 ++ ++# add a 2MiB ext3 partition ++parted -s $dev mkpart p2 ext3 67584s 71679s > empty 2>&1 || fail=1 ++compare /dev/null empty || fail=1 ++mkfs.ext3 ${dev}2 >/dev/null 2>&1 || skip_ "mkfs.ext3 failed" ++ ++# this should have an MBR representing both partitions; the second partition ++# should be marked bootable ++dump_mbr_table > out || fail=1 ++cat < exp || fail=1 ++ 00 00 01 00 ee fe ff ff 01 00 00 00 ff 07 01 00 ++ 80 fe ff ff 83 fe ff ff 00 08 01 00 00 10 00 00 ++ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ++ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ++ 55 aa ++EOF ++compare exp out || fail=1 ++ ++# add a 1MiB partition with no filesystem ++parted -s $dev mkpart p3 71680s 73727s > empty 2>&1 || fail=1 ++compare /dev/null empty || fail=1 ++ ++# the new partition should be represented as 0xda (Non-FS data) ++dump_mbr_table > out || fail=1 ++cat < exp || fail=1 ++ 00 00 01 00 ee fe ff ff 01 00 00 00 ff 07 01 00 ++ 80 fe ff ff 83 fe ff ff 00 08 01 00 00 10 00 00 ++ 00 fe ff ff da fe ff ff 00 18 01 00 00 08 00 00 ++ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ++ 55 aa ++EOF ++compare exp out || fail=1 ++ ++# add two more 1MiB partitions ++parted -s $dev mkpart p4 73728s 75775s > empty 2>&1 || fail=1 ++parted -s $dev mkpart p5 75776s 77823s > empty 2>&1 || fail=1 ++ ++# only the first four partitions will be represented ++dump_mbr_table > out || fail=1 ++cat < exp || fail=1 ++ 00 00 01 00 ee fe ff ff 01 00 00 00 ff 07 01 00 ++ 80 fe ff ff 83 fe ff ff 00 08 01 00 00 10 00 00 ++ 00 fe ff ff da fe ff ff 00 18 01 00 00 08 00 00 ++ 00 fe ff ff da fe ff ff 00 20 01 00 00 08 00 00 ++ 55 aa ++EOF ++compare exp out || fail=1 ++ ++# convert first partition to a BIOS Boot Partition ++parted -s $dev set 1 boot off set 1 bios_grub on > empty 2>&1 || fail=1 ++compare /dev/null empty || fail=1 ++ ++# this should be represented in the same way as an EFI System Partition ++dump_mbr_table > out || fail=1 ++compare exp out || fail=1 ++ ++# convert first partition to an ordinary FAT partition ++parted -s $dev set 1 bios_grub off > empty 2>&1 || fail=1 ++compare /dev/null empty || fail=1 ++ ++# this should result in a protective partition covering the GPT data up to ++# the start of the first partition, and then representations of the first ++# three partitions ++dump_mbr_table > out || fail=1 ++cat < exp || fail=1 ++ 00 00 01 00 ee fe ff ff 01 00 00 00 ff 07 00 00 ++ 00 fe ff ff 0b fe ff ff 00 08 00 00 00 00 01 00 ++ 80 fe ff ff 83 fe ff ff 00 08 01 00 00 10 00 00 ++ 00 fe ff ff da fe ff ff 00 18 01 00 00 08 00 00 ++ 55 aa ++EOF ++compare exp out || fail=1 ++ ++# convert third partition to a BIOS Boot Partition ++parted -s $dev set 3 bios_grub on > empty 2>&1 || fail=1 ++compare /dev/null empty || fail=1 ++ ++# since this isn't the first partition, it shouldn't become a protective ++# partition or have its starting LBA address set to 1 (and GRUB doesn't care ++# whether it's in the hybrid MBR anyway) ++dump_mbr_table > out || fail=1 ++compare exp out || fail=1 ++ ++Exit $fail +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -15,6 +15,7 @@ + t0220-gpt-msftres.sh \ + t0250-gpt.sh \ + t0280-gpt-corrupt.sh \ ++ t0290-gptsync.sh \ + t0300-dos-on-gpt.sh \ + t0400-loop-clobber-infloop.sh \ + t0500-dup-clobber.sh \ --- parted-2.3.orig/debian/patches/hfs-probe-corrupt.patch +++ parted-2.3/debian/patches/hfs-probe-corrupt.patch @@ -0,0 +1,58 @@ +Description: HFS/HFS+ probe: don't let a corrupt FS evoke failed assertion +Author: Brian C. Lane +Origin: upstream, http://git.debian.org/?p=parted/parted.git;a=commitdiff;h=6bc7e1965078579e9855f851254d67b3d8165784 +Bug-Fedora: http://bugzilla.redhat.com/714758 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/796891 +Forwarded: not-needed +Last-Update: 2012-03-20 + +Index: b/libparted/fs/hfs/probe.c +=================================================================== +--- a/libparted/fs/hfs/probe.c ++++ b/libparted/fs/hfs/probe.c +@@ -83,7 +83,8 @@ + + ((PedSector) PED_BE16_TO_CPU (mdb->total_blocks) + * (PED_BE32_TO_CPU (mdb->block_size) / PED_SECTOR_SIZE_DEFAULT ))); + max = search + (PED_BE32_TO_CPU (mdb->block_size) / PED_SECTOR_SIZE_DEFAULT); +- if (!(geom_ret = ped_geometry_new (geom->dev, geom->start, search + 2))) ++ if ((search < 0) ++ || !(geom_ret = ped_geometry_new (geom->dev, geom->start, search + 2))) + return NULL; + + for (; search < max; search++) { +@@ -142,8 +143,9 @@ + - 2; + search = max - 2 * ( PED_BE32_TO_CPU (vh->block_size) + / PED_SECTOR_SIZE_DEFAULT ) + 2; +- if (!(geom_ret = ped_geometry_new (geom->dev, geom->start, +- search + 2))) ++ if ((search < 0) ++ || !(geom_ret = ped_geometry_new (geom->dev, geom->start, ++ search + 2))) + return NULL; + + for (; search < max; search++) { +@@ -157,8 +159,9 @@ + search = ((PedSector) PED_BE32_TO_CPU (vh->total_blocks) - 1) + * ( PED_BE32_TO_CPU (vh->block_size) / PED_SECTOR_SIZE_DEFAULT ) + - 1; +- if (!ped_geometry_set (geom_ret, geom_ret->start, +- search + 2) ++ if ((search < 0) ++ || !ped_geometry_set (geom_ret, geom_ret->start, ++ search + 2) + || !ped_geometry_read (geom_ret, buf, search, 1) + || vh->signature != PED_CPU_TO_BE16 (HFSP_SIGNATURE)) { + ped_geometry_destroy (geom_ret); +@@ -214,8 +217,9 @@ + * ( PED_BE32_TO_CPU (vh->block_size) / PED_SECTOR_SIZE_DEFAULT ) + - 2; + search = max - ( PED_BE32_TO_CPU (vh->block_size) / PED_SECTOR_SIZE_DEFAULT ); +- if (!(geom_ret = ped_geometry_new (geom->dev, geom->start, +- search + 2))) ++ if ((search < 0) ++ || !(geom_ret = ped_geometry_new (geom->dev, geom->start, ++ search + 2))) + return NULL; + for (; search < max; search++) { + if (!ped_geometry_set (geom_ret, geom_ret->start, --- parted-2.3.orig/debian/patches/hurd-partition-path.patch +++ parted-2.3/debian/patches/hurd-partition-path.patch @@ -0,0 +1,11 @@ +--- a/libparted/arch/gnu.c ++++ b/libparted/arch/gnu.c +@@ -845,7 +845,7 @@ + result = (char*) ped_malloc (result_len); + if (!result) + return NULL; +- snprintf (result, result_len, "%s%d", dev_path, part->num); ++ snprintf (result, result_len, "%ss%d", dev_path, part->num); + return result; + } + --- parted-2.3.orig/debian/patches/hurd-reread.patch +++ parted-2.3/debian/patches/hurd-reread.patch @@ -0,0 +1,118 @@ +--- a/libparted/arch/gnu.c.original 2012-04-22 00:06:18.000000000 +0000 ++++ b/libparted/arch/gnu.c 2012-04-22 02:34:58.000000000 +0000 +@@ -185,7 +185,7 @@ + if (!dev->arch_specific) + goto error_free_path; + +- dev->type = PED_DEVICE_FILE; /* FIXME? */ ++ dev->type = PED_DEVICE_UNKNOWN; /* It's deprecated anyway */ + dev->open_count = 0; + dev->read_only = 0; + dev->external_mode = 0; +@@ -204,11 +204,83 @@ + return NULL; + } + +-static int +-_kernel_reread_part_table (PedDevice* dev) +-{ +- /* XXX: We must wait for partfs to be finished. */ +- return 1; ++/* Ask the kernel and translators to reload the partition table. ++ XXX: Will probably be replaced by some RPC to partfs when it's finished. In ++ the meantime, gnumach's glue layer will pass BLKRRPART to the Linux drivers. ++ */ ++#define BLKRRPART 0x125F ++static int ++_reread_part_table (PedDevice* dev) ++{ ++ struct store *store = GNU_SPECIFIC (dev)->store; ++ int retry_count = 9; ++ int len = strlen (dev->path); ++ char path[len + 3 + 1]; ++ int i; ++ int done = 1; ++ ++ sync (); ++ ++ if(strcmp (store->class->name, "device") == 0) { ++ while (device_set_status (store->port, BLKRRPART, NULL, 0)) { ++ retry_count--; ++ sync (); ++ if (retry_count == 3) ++ sleep (1); /* Pause to allow system to settle */ ++ ++ if (!retry_count) { ++ ped_exception_throw ( ++ PED_EXCEPTION_WARNING, ++ PED_EXCEPTION_IGNORE, ++ _("WARNING: the kernel failed to re-read the " ++ "partition table on %s (%s). As a result, " ++ "it may not reflect all of your changes " ++ "until after reboot."), ++ dev->path, strerror (errno)); ++ return 0; ++ } ++ } ++ } ++ ++ i = 1; ++ while (1) { ++ file_t node; ++ error_t err; ++ ++ /* Throw away all active parted-based translators */ ++ snprintf (path, sizeof (path), "%ss%u", dev->path, i); ++ node = file_name_lookup (path, O_NOTRANS, 0666); ++ if (node == MACH_PORT_NULL) { ++ if (errno == ENOENT) ++ /* Finished looping over them */ ++ break; ++ ++ ped_exception_throw ( ++ PED_EXCEPTION_WARNING, ++ PED_EXCEPTION_IGNORE, ++ _("Warning: unable to open %s (%s). As a " ++ "result, it may not reflect all of your " ++ "changes until after reboot."), ++ path, strerror (errno)); ++ done = 0; ++ } ++ ++ err = file_set_translator (node, 0, FS_TRANS_SET, ++ 0, 0, 0, MACH_PORT_NULL, MACH_MSG_TYPE_COPY_SEND); ++ if (err) { ++ ped_exception_throw ( ++ PED_EXCEPTION_WARNING, ++ PED_EXCEPTION_IGNORE, ++ _("Warning: failed to make translator go away " ++ "on %s (%s). As a result, it may not reflect " ++ "all of your changes until after reboot."), ++ dev->path, strerror (errno)); ++ done = 0; ++ } ++ i++; ++ } ++ ++ return done; + } + + /* Free the memory associated with a PedDevice structure. */ +@@ -355,7 +427,7 @@ + _flush_cache (dev); + + if (dev->dirty && dev->type != PED_DEVICE_FILE) { +- if (_kernel_reread_part_table (dev)) ++ if (_reread_part_table (dev)) + dev->dirty = 0; + } + +@@ -858,7 +930,7 @@ + static int + gnu_disk_commit (PedDisk* disk) + { +- return 1; ++ return _reread_part_table (disk->dev); + } + + static PedDeviceArchOps gnu_dev_ops = { --- parted-2.3.orig/debian/patches/kfreebsd-gnu.patch +++ parted-2.3/debian/patches/kfreebsd-gnu.patch @@ -0,0 +1,1376 @@ +Description: Add GNU/kFreeBSD support +Author: Viktor Vasilev +Author: Robert Millan +Author: Colin Watson +Bug-Debian: http://bugs.debian.org/363381 +Forwarded: no +Last-Update: 2012-11-06 + +Index: b/configure.ac +=================================================================== +--- a/configure.ac ++++ b/configure.ac +@@ -60,6 +60,7 @@ + linux*) OS=linux ;; + gnu*) OS=gnu ;; + beos*) OS=beos ;; ++ freebsd* | kfreebsd*-gnu) OS=freebsd ;; + *) AC_MSG_ERROR([Unknown or unsupported OS "$host_os". Only "linux", "gnu" and "beos" are supported in this version of GNU Parted.]) ;; + esac + AC_SUBST([OS]) +@@ -281,6 +282,7 @@ + #include + #include + ]) ++AC_CHECK_TYPE([loff_t], [long long]) + + AM_ENABLE_SHARED + if test "$OS" = linux && test $ac_cv_sizeof_off_t -lt 8; then +@@ -518,7 +520,7 @@ + http://web.mit.edu/tytso/www/linux/e2fsprogs.html])] + ) + +-AC_CHECK_HEADERS([getopt.h]) ++AC_CHECK_HEADERS([getopt.h endian.h sys/endian.h]) + + dnl required for libparted/llseek.c (TODO: make linux-x86 only) + if test "$OS" = linux; then +@@ -577,7 +579,9 @@ + AC_C_RESTRICT + + dnl Checks for library functions. +-AC_CHECK_FUNCS([sigaction]) ++if test "$OS" != freebsd; then ++ AC_CHECK_FUNCS([sigaction]) ++fi + AC_CHECK_FUNCS([getuid]) + + dnl NOTE: We need to remove the gl_cv_ignore_unused_libraries flag if we +Index: b/libparted/Makefile.am +=================================================================== +--- a/libparted/Makefile.am ++++ b/libparted/Makefile.am +@@ -49,7 +49,8 @@ + EXTRA_libparted_la_SOURCES = arch/linux.c \ + arch/linux.h \ + arch/gnu.c \ +- arch/beos.c ++ arch/beos.c \ ++ arch/freebsd.c + + libparted_la_LIBADD = \ + fs/libfs.la \ +Index: b/libparted/arch/freebsd.c +=================================================================== +--- /dev/null ++++ b/libparted/arch/freebsd.c +@@ -0,0 +1,1254 @@ ++/* ++ libparted - a library for manipulating disk partitions ++ Copyright (C) 1999 - 2009 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA ++*/ ++ ++#include "config.h" ++ ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "../architecture.h" ++ ++#if ENABLE_NLS ++# include ++# define _(String) dgettext (PACKAGE, String) ++#else ++# define _(String) (String) ++#endif /* ENABLE_NLS */ ++ ++#if !defined(__FreeBSD_version) && defined(__FreeBSD_kernel_version) ++#define __FreeBSD_version __FreeBSD_kernel_version ++#endif ++ ++#define FREEBSD_SPECIFIC(dev) ((FreeBSDSpecific*) (dev)->arch_specific) ++ ++typedef struct _FreeBSDSpecific FreeBSDSpecific; ++ ++struct _FreeBSDSpecific { ++ int fd; ++}; ++ ++static char* _device_get_part_path (PedDevice* dev, int num); ++static int _partition_is_mounted_by_path (const char* path); ++ ++static int ++_device_stat (PedDevice* dev, struct stat * dev_stat) ++{ ++ PED_ASSERT (dev != NULL, return 0); ++ PED_ASSERT (!dev->external_mode, return 0); ++ ++ while (1) { ++ if (!stat (dev->path, dev_stat)) { ++ return 1; ++ } else { ++ if (ped_exception_throw ( ++ PED_EXCEPTION_ERROR, ++ PED_EXCEPTION_RETRY_CANCEL, ++ _("Could not stat device %s - %s."), ++ dev->path, ++ strerror (errno)) ++ != PED_EXCEPTION_RETRY) ++ return 0; ++ } ++ } ++} ++ ++static int ++_device_probe_type (PedDevice* dev) ++{ ++ struct stat dev_stat; ++ char *np; ++ ++ if (!_device_stat (dev, &dev_stat)) ++ return 0; ++ ++ if (!S_ISCHR(dev_stat.st_mode)) { ++ dev->type = PED_DEVICE_FILE; ++ return 1; ++ } ++ ++ np = strrchr(dev->path, '/'); ++ if (np == NULL) { ++ dev->type = PED_DEVICE_UNKNOWN; ++ return 0; ++ } ++ np += 1; /* advance past '/' */ ++ ++ if(strncmp(np, "ad", 2) == 0) { ++ dev->type = PED_DEVICE_IDE; ++ } else if (strncmp(np, "da", 2) == 0) { ++ dev->type = PED_DEVICE_SCSI; ++ } else if (strncmp(np, "acd", 2) == 0 || ++ strncmp(np, "cd", 2) == 0) { ++ /* ignore CD-ROM drives */ ++ dev->type = PED_DEVICE_UNKNOWN; ++ return 0; ++ } else { ++ dev->type = PED_DEVICE_UNKNOWN; ++ } ++ ++ return 1; ++} ++ ++static void ++_device_set_sector_size (PedDevice* dev) ++{ ++ FreeBSDSpecific* arch_specific = FREEBSD_SPECIFIC (dev); ++ int sector_size; ++ ++ dev->sector_size = PED_SECTOR_SIZE_DEFAULT; ++ dev->phys_sector_size = PED_SECTOR_SIZE_DEFAULT; ++ ++ PED_ASSERT (dev->open_count, return); ++ ++ if (ioctl (arch_specific->fd, DIOCGSECTORSIZE, §or_size)) { ++ ped_exception_throw ( ++ PED_EXCEPTION_WARNING, ++ PED_EXCEPTION_OK, ++ _("Could not determine sector size for %s: %s.\n" ++ "Using the default sector size (%lld)."), ++ dev->path, strerror (errno), PED_SECTOR_SIZE_DEFAULT); ++ } else { ++ dev->sector_size = (long long)sector_size;; ++ } ++ ++ if (sector_size != PED_SECTOR_SIZE_DEFAULT) { ++ ped_exception_throw ( ++ PED_EXCEPTION_WARNING, ++ PED_EXCEPTION_OK, ++ _("Device %s has a logical sector size of %lld. Not " ++ "all parts of GNU Parted support this at the moment, " ++ "and the working code is HIGHLY EXPERIMENTAL.\n"), ++ dev->path, dev->sector_size); ++ } ++} ++ ++static PedSector ++_device_get_length (PedDevice* dev) ++{ ++ FreeBSDSpecific* arch_specific = FREEBSD_SPECIFIC (dev); ++ off_t bytes = 0; ++ ++ PED_ASSERT (dev->open_count > 0, return 0); ++ PED_ASSERT (dev->sector_size % PED_SECTOR_SIZE_DEFAULT == 0, return 0); ++ ++ if(ioctl(arch_specific->fd, DIOCGMEDIASIZE, &bytes) != 0) { ++ ped_exception_throw ( ++ PED_EXCEPTION_BUG, ++ PED_EXCEPTION_CANCEL, ++ _("Unable to determine the size of %s (%s)."), ++ dev->path, ++ strerror (errno)); ++ return 0; ++ } ++ ++ return bytes / dev->sector_size; ++} ++ ++ ++static int ++_device_probe_geometry (PedDevice* dev) ++{ ++ FreeBSDSpecific* arch_specific = FREEBSD_SPECIFIC (dev); ++ struct stat dev_stat; ++ struct ata_params params; ++ ++ if (!_device_stat (dev, &dev_stat)) ++ return 0; ++ PED_ASSERT (S_ISCHR (dev_stat.st_mode), return 0); ++ ++ _device_set_sector_size (dev); ++ ++ dev->length = _device_get_length (dev); ++ if (!dev->length) ++ return 0; ++ ++ dev->bios_geom.sectors = 63; ++ dev->bios_geom.heads = 255; ++ dev->bios_geom.cylinders ++ = dev->length / (63 * 255); ++ ++ if (ioctl (arch_specific->fd, IOCATAGPARM, ¶ms) != 0) { ++ dev->hw_geom.sectors = params.sectors; ++ dev->hw_geom.heads = params.heads; ++ dev->hw_geom.cylinders = params.cylinders; ++ } else { ++ dev->hw_geom = dev->bios_geom; ++ } ++ ++ return 1; ++} ++ ++static char* ++strip_name(char* str) ++{ ++ int i; ++ int end = 0; ++ ++ for (i = 0; str[i] != 0; i++) { ++ if (!isspace (str[i]) ++ || (isspace (str[i]) && !isspace (str[i+1]) && str[i+1])) { ++ str [end] = str[i]; ++ end++; ++ } ++ } ++ str[end] = 0; ++ return strdup (str); ++} ++ ++static int ++init_ide (PedDevice* dev) ++{ ++ FreeBSDSpecific* arch_specific = FREEBSD_SPECIFIC (dev); ++ struct stat dev_stat; ++ struct ata_params params; ++ PedExceptionOption ex_status; ++ char vendor_buf[64]; ++ ++ if (!_device_stat (dev, &dev_stat)) ++ goto error; ++ ++ if (!ped_device_open (dev)) ++ goto error; ++ ++ if (ioctl (arch_specific->fd, IOCATAGPARM, ¶ms) != 0) { ++ ex_status = ped_exception_throw ( ++ PED_EXCEPTION_WARNING, ++ PED_EXCEPTION_IGNORE_CANCEL, ++ _("Could not get identity of device %s - %s"), ++ dev->path, strerror (errno)); ++ switch (ex_status) { ++ case PED_EXCEPTION_CANCEL: ++ goto error_close_dev; ++ ++ case PED_EXCEPTION_UNHANDLED: ++ ped_exception_catch (); ++ case PED_EXCEPTION_IGNORE: ++ dev->model = strdup(_("Generic IDE")); ++ break; ++ default: ++ PED_ASSERT (0, (void) 0); ++ break; ++ } ++ } else { ++ snprintf(vendor_buf, 64, "%.40s/%.8s", params.model, params.revision); ++ dev->model = strip_name (vendor_buf); ++ } ++ ++ if (!_device_probe_geometry (dev)) ++ goto error_close_dev; ++ ++ ped_device_close (dev); ++ return 1; ++ ++error_close_dev: ++ ped_device_close (dev); ++error: ++ return 0; ++} ++ ++static char * ++_scsi_pass_dev (PedDevice* dev) ++{ ++ union ccb ccb; ++ int fd; ++ char result[64]; ++ ++ if (sscanf (dev->path, "/dev/%2s%u", ccb.cgdl.periph_name, &ccb.cgdl.unit_number) != 2) ++ goto error; ++ ++ if ((fd = open("/dev/xpt0", O_RDWR)) < 0) ++ goto error; ++ ++ ccb.ccb_h.func_code = XPT_GDEVLIST; ++ if (ioctl(fd, CAMGETPASSTHRU, &ccb) != 0) ++ goto error_close_dev; ++ ++ snprintf(result, sizeof(result), "/dev/%s%d", ccb.cgdl.periph_name, ccb.cgdl.unit_number); ++ close(fd); ++ return strdup(result); ++ ++error_close_dev: ++ close(fd); ++error: ++ return NULL; ++} ++ ++static int ++init_scsi (PedDevice* dev) ++{ ++ PedExceptionOption ex_status; ++ struct stat dev_stat; ++ char* pass_dev; ++ int pass_fd; ++ union ccb ccb; ++ ++ if (!_device_stat (dev, &dev_stat)) ++ goto error; ++ ++ if (!ped_device_open (dev)) ++ goto error; ++ ++ pass_dev = _scsi_pass_dev(dev); ++ if (!pass_dev) ++ goto error_close_dev; ++ ++ pass_fd = open(pass_dev, O_RDWR); ++ if (pass_fd < 0) { ++ dev->host = 0; ++ dev->did = 0; ++ if (ped_exception_throw ( ++ PED_EXCEPTION_ERROR, ++ PED_EXCEPTION_IGNORE_CANCEL, ++ _("Error initialising SCSI device %s - %s"), ++ dev->path, strerror (errno)) ++ != PED_EXCEPTION_IGNORE) ++ goto error_close_dev; ++ if (!_device_probe_geometry (dev)) ++ goto error_close_dev; ++ ped_device_close (dev); ++ return 1; ++ } ++ ++ ccb.ccb_h.func_code = XPT_GDEVLIST; ++ if (ioctl(pass_fd, CAMGETPASSTHRU, &ccb) != 0) { ++ ex_status = ped_exception_throw ( ++ PED_EXCEPTION_WARNING, ++ PED_EXCEPTION_IGNORE_CANCEL, ++ _("Could not get ID of devices %s - %s"), ++ dev->path, strerror (errno)); ++ switch (ex_status) { ++ case PED_EXCEPTION_CANCEL: ++ goto error_close_fd_dev; ++ ++ case PED_EXCEPTION_UNHANDLED: ++ ped_exception_catch (); ++ case PED_EXCEPTION_IGNORE: ++ dev->host = 0; ++ dev->did = 0; ++ break; ++ default: ++ PED_ASSERT (0, (void) 0); ++ break; ++ } ++ } ++ ++ dev->host = ccb.ccb_h.target_id; ++ dev->did = ccb.ccb_h.target_lun; ++ ++ ccb.ccb_h.func_code = XPT_GDEV_TYPE; ++ if (ioctl(pass_fd, CAMIOCOMMAND, &ccb) != 0) { ++ ex_status = ped_exception_throw ( ++ PED_EXCEPTION_WARNING, ++ PED_EXCEPTION_IGNORE_CANCEL, ++ _("Could not get identity of device %s - %s"), ++ dev->path, strerror (errno)); ++ switch (ex_status) { ++ case PED_EXCEPTION_CANCEL: ++ goto error_close_fd_dev; ++ ++ case PED_EXCEPTION_UNHANDLED: ++ ped_exception_catch (); ++ case PED_EXCEPTION_IGNORE: ++ dev->model = strdup(_("Generic SCSI")); ++ break; ++ default: ++ PED_ASSERT (0, (void) 0); ++ break; ++ } ++ } else { ++ dev->model = (char*) ped_malloc (8 + 16 + 2); ++ if (!dev->model) ++ goto error_close_fd_dev; ++ sprintf (dev->model, "%.8s %.16s", ccb.cgd.inq_data.vendor, ccb.cgd.inq_data.product); ++ } ++ ++ if (!_device_probe_geometry (dev)) ++ goto error_close_fd_dev; ++ ++ close (pass_fd); ++ ped_device_close (dev); ++ return 1; ++ ++error_close_fd_dev: ++ close (pass_fd); ++error_close_dev: ++ ped_device_close (dev); ++error: ++ return 0; ++} ++ ++static int ++init_file (PedDevice* dev) ++{ ++ struct stat dev_stat; ++ ++ if (!_device_stat (dev, &dev_stat)) ++ goto error; ++ if (!ped_device_open (dev)) ++ goto error; ++ ++ if (S_ISCHR(dev_stat.st_mode)) ++ dev->length = _device_get_length (dev); ++ else ++ dev->length = dev_stat.st_size / 512; ++ if (dev->length <= 0) { ++ ped_exception_throw ( ++ PED_EXCEPTION_ERROR, ++ PED_EXCEPTION_CANCEL, ++ _("The device %s is zero-length, and can't possibly " ++ "store a file system or partition table. Perhaps " ++ "you selected the wrong device?"), ++ dev->path); ++ goto error_close_dev; ++ } ++ ++ ped_device_close (dev); ++ ++ dev->bios_geom.cylinders = dev->length / 4 / 32; ++ dev->bios_geom.heads = 4; ++ dev->bios_geom.sectors = 32; ++ dev->hw_geom = dev->bios_geom; ++ dev->sector_size = PED_SECTOR_SIZE_DEFAULT; ++ dev->phys_sector_size = PED_SECTOR_SIZE_DEFAULT; ++ dev->model = strdup (""); ++ ++ return 1; ++ ++error_close_dev: ++ ped_device_close (dev); ++error: ++ return 0; ++} ++ ++static int ++init_generic (PedDevice* dev, char* model_name) ++{ ++ struct stat dev_stat; ++ PedExceptionOption ex_status; ++ ++ if (!_device_stat (dev, &dev_stat)) ++ goto error; ++ ++ if (!ped_device_open (dev)) ++ goto error; ++ ++ ped_exception_fetch_all (); ++ if (_device_probe_geometry (dev)) { ++ ped_exception_leave_all (); ++ } else { ++ /* hack to allow use of files, for testing */ ++ ped_exception_catch (); ++ ped_exception_leave_all (); ++ ++ ex_status = ped_exception_throw ( ++ PED_EXCEPTION_WARNING, ++ PED_EXCEPTION_IGNORE_CANCEL, ++ _("Unable to determine geometry of " ++ "file/device. You should not use Parted " ++ "unless you REALLY know what you're doing!")); ++ switch (ex_status) { ++ case PED_EXCEPTION_CANCEL: ++ goto error_close_dev; ++ ++ case PED_EXCEPTION_UNHANDLED: ++ ped_exception_catch (); ++ case PED_EXCEPTION_IGNORE: ++ break; ++ default: ++ PED_ASSERT (0, (void) 0); ++ break; ++ } ++ ++ /* what should we stick in here? */ ++ dev->length = dev_stat.st_size / PED_SECTOR_SIZE_DEFAULT; ++ dev->bios_geom.cylinders = dev->length / 4 / 32; ++ dev->bios_geom.heads = 4; ++ dev->bios_geom.sectors = 32; ++ dev->sector_size = PED_SECTOR_SIZE_DEFAULT; ++ dev->phys_sector_size = PED_SECTOR_SIZE_DEFAULT; ++ } ++ ++ dev->model = strdup (model_name); ++ ++ ped_device_close (dev); ++ return 1; ++ ++error_close_dev: ++ ped_device_close (dev); ++error: ++ return 0; ++} ++ ++static PedDevice* ++freebsd_new (const char* path) ++{ ++ PedDevice* dev; ++ ++ PED_ASSERT (path != NULL, return NULL); ++ ++ dev = (PedDevice*) ped_malloc (sizeof (PedDevice)); ++ if (!dev) ++ goto error; ++ ++ dev->path = strdup (path); ++ if (!dev->path) ++ goto error_free_dev; ++ ++ dev->arch_specific ++ = (FreeBSDSpecific*) ped_malloc (sizeof (FreeBSDSpecific)); ++ if (!dev->arch_specific) ++ goto error_free_path; ++ ++ dev->open_count = 0; ++ dev->read_only = 0; ++ dev->external_mode = 0; ++ dev->dirty = 0; ++ dev->boot_dirty = 0; ++ ++ if (!_device_probe_type (dev)) ++ goto error_free_arch_specific; ++ ++ switch (dev->type) { ++ case PED_DEVICE_IDE: ++ if (!init_ide (dev)) ++ goto error_free_arch_specific; ++ break; ++ case PED_DEVICE_SCSI: ++ if (!init_scsi (dev)) ++ goto error_free_arch_specific; ++ break; ++ case PED_DEVICE_FILE: ++ if (!init_file (dev)) ++ goto error_free_arch_specific; ++ break; ++ case PED_DEVICE_UNKNOWN: ++ if (!init_generic (dev, _("Unknown"))) ++ goto error_free_arch_specific; ++ break; ++ ++ default: ++ ped_exception_throw (PED_EXCEPTION_NO_FEATURE, ++ PED_EXCEPTION_CANCEL, ++ _("ped_device_new() Unsupported device type")); ++ goto error_free_arch_specific; ++ } ++ return dev; ++ ++error_free_arch_specific: ++ free (dev->arch_specific); ++error_free_path: ++ free (dev->path); ++error_free_dev: ++ free (dev); ++error: ++ return NULL; ++} ++ ++static void ++freebsd_destroy (PedDevice* dev) ++{ ++ free (dev->arch_specific); ++ free (dev->path); ++ free (dev->model); ++ free (dev); ++} ++ ++static int ++freebsd_is_busy (PedDevice* dev) ++{ ++ int i; ++ char* part_name; ++ ++ if (_partition_is_mounted_by_path (dev->path)) ++ return 1; ++ ++ for (i = 0; i < 32; i++) { ++ int status; ++ ++ part_name = _device_get_part_path (dev, i); ++ if (!part_name) ++ return 1; ++ status = _partition_is_mounted_by_path (part_name); ++ free (part_name); ++ ++ if (status) ++ return 1; ++ } ++ ++ return 0; ++} ++ ++static void ++_flush_cache (PedDevice* dev) ++{ ++ FreeBSDSpecific* arch_specific = FREEBSD_SPECIFIC (dev); ++ ++ if (dev->read_only) ++ return; ++ dev->dirty = 0; ++ ++ if (dev->type == PED_DEVICE_FILE) { ++ if (fsync(arch_specific->fd) != 0) { ++ ped_exception_throw ( ++ PED_EXCEPTION_WARNING, ++ PED_EXCEPTION_OK, ++ _("Could not flush cache of file %s - %s."), ++ dev->path, ++ strerror (errno)); ++ return; ++ } ++ } else { ++ if (ioctl (arch_specific->fd, DIOCGFLUSH) != 0) { ++ ped_exception_throw ( ++ PED_EXCEPTION_WARNING, ++ PED_EXCEPTION_OK, ++ _("Could not flush cache of device %s - %s."), ++ dev->path, ++ strerror (errno)); ++ return; ++ } ++ } ++ ++ return; ++} ++ ++/* By default, kernel of FreeBSD does not allow overwriting MBR */ ++#define GEOM_SYSCTL "kern.geom.debugflags" ++ ++static int ++freebsd_open (PedDevice* dev) ++{ ++ int old_flags, flags; ++ size_t flagssize; ++ FreeBSDSpecific* arch_specific = FREEBSD_SPECIFIC (dev); ++ ++retry: ++ flagssize = sizeof (old_flags); ++ ++ if (sysctlbyname (GEOM_SYSCTL, &old_flags, &flagssize, NULL, 0) != 0) { ++ ped_exception_throw ( ++ PED_EXCEPTION_WARNING, ++ PED_EXCEPTION_OK, ++ _("Unable to get %s sysctl (%s)."), ++ GEOM_SYSCTL, ++ strerror (errno)); ++ } ++ ++ if ((old_flags & 0x10) == 0) { ++ /* "allow foot shooting", see geom(4) */ ++ flags = old_flags | 0x10; ++ ++ if (sysctlbyname (GEOM_SYSCTL, NULL, NULL, &flags, sizeof (int)) != 0) { ++ flags = old_flags; ++ ped_exception_throw ( ++ PED_EXCEPTION_WARNING, ++ PED_EXCEPTION_OK, ++ _("Unable to set %s sysctl (%s)."), ++ GEOM_SYSCTL, ++ strerror (errno)); ++ } ++ } else ++ flags = old_flags; ++ ++ arch_specific->fd = open (dev->path, O_RDWR); ++ ++ if (flags != old_flags) { ++ if (sysctlbyname (GEOM_SYSCTL, NULL, NULL, &old_flags, sizeof (int)) != 0) { ++ ped_exception_throw ( ++ PED_EXCEPTION_WARNING, ++ PED_EXCEPTION_OK, ++ _("Unable to set %s sysctl (%s)."), ++ GEOM_SYSCTL, ++ strerror (errno)); ++ } ++ } ++ ++ if (arch_specific->fd == -1) { ++ char* rw_error_msg = strerror (errno); ++ ++ arch_specific->fd = open (dev->path, O_RDONLY); ++ ++ if (arch_specific->fd == -1) { ++ if (ped_exception_throw ( ++ PED_EXCEPTION_ERROR, ++ PED_EXCEPTION_RETRY_CANCEL, ++ _("Error opening %s: %s"), ++ dev->path, strerror (errno)) ++ != PED_EXCEPTION_RETRY) { ++ return 0; ++ } else { ++ goto retry; ++ } ++ } else { ++ ped_exception_throw ( ++ PED_EXCEPTION_WARNING, ++ PED_EXCEPTION_OK, ++ _("Unable to open %s read-write (%s). %s has " ++ "been opened read-only."), ++ dev->path, rw_error_msg, dev->path); ++ dev->read_only = 1; ++ } ++ } else { ++ dev->read_only = 0; ++ } ++ ++ _flush_cache (dev); ++ ++ return 1; ++} ++ ++static int ++freebsd_refresh_open (PedDevice* dev) ++{ ++ return 1; ++} ++ ++static int ++freebsd_close (PedDevice* dev) ++{ ++ FreeBSDSpecific* arch_specific = FREEBSD_SPECIFIC (dev); ++ ++ if (dev->dirty) ++ _flush_cache (dev); ++ close (arch_specific->fd); ++ return 1; ++} ++ ++static int ++freebsd_refresh_close (PedDevice* dev) ++{ ++ if (dev->dirty) ++ _flush_cache (dev); ++ return 1; ++} ++ ++static int ++_device_seek (const PedDevice* dev, PedSector sector) ++{ ++ FreeBSDSpecific* arch_specific; ++ off_t pos; ++ ++ PED_ASSERT (dev->sector_size % PED_SECTOR_SIZE_DEFAULT == 0, return 0); ++ PED_ASSERT (dev != NULL, return 0); ++ PED_ASSERT (!dev->external_mode, return 0); ++ ++ arch_specific = FREEBSD_SPECIFIC (dev); ++ ++ pos = sector * dev->sector_size; ++ return lseek (arch_specific->fd, pos, SEEK_SET) == pos; ++} ++ ++static int ++freebsd_read (const PedDevice* dev, void* buffer, PedSector start, ++ PedSector count) ++{ ++ FreeBSDSpecific* arch_specific = FREEBSD_SPECIFIC (dev); ++ PedExceptionOption ex_status; ++ void* diobuf = NULL; ++ ++ PED_ASSERT (dev != NULL, return 0); ++ PED_ASSERT (dev->sector_size % PED_SECTOR_SIZE_DEFAULT == 0, return 0); ++ ++ while (1) { ++ if (_device_seek (dev, start)) ++ break; ++ ++ ex_status = ped_exception_throw ( ++ PED_EXCEPTION_ERROR, ++ PED_EXCEPTION_RETRY_IGNORE_CANCEL, ++ _("%s during seek for read on %s"), ++ strerror (errno), dev->path); ++ ++ switch (ex_status) { ++ case PED_EXCEPTION_IGNORE: ++ return 1; ++ ++ case PED_EXCEPTION_RETRY: ++ break; ++ ++ case PED_EXCEPTION_UNHANDLED: ++ ped_exception_catch (); ++ case PED_EXCEPTION_CANCEL: ++ return 0; ++ default: ++ PED_ASSERT (0, (void) 0); ++ break; ++ } ++ } ++ ++ size_t read_length = count * dev->sector_size; ++ if (posix_memalign (&diobuf, dev->sector_size, read_length) != 0) ++ return 0; ++ ++ while (1) { ++ ssize_t status = read (arch_specific->fd, diobuf, read_length); ++ if (status > 0) { ++ memcpy(buffer, diobuf, status); ++ } ++ if (status == (ssize_t) read_length) ++ break; ++ if (status > 0) { ++ read_length -= status; ++ buffer = (char *) buffer + status; ++ continue; ++ } ++ ++ ex_status = ped_exception_throw ( ++ PED_EXCEPTION_ERROR, ++ PED_EXCEPTION_RETRY_IGNORE_CANCEL, ++ _("%s during read on %s"), ++ strerror (errno), ++ dev->path); ++ ++ switch (ex_status) { ++ case PED_EXCEPTION_IGNORE: ++ return 1; ++ ++ case PED_EXCEPTION_RETRY: ++ break; ++ ++ case PED_EXCEPTION_UNHANDLED: ++ ped_exception_catch (); ++ case PED_EXCEPTION_CANCEL: ++ return 0; ++ default: ++ PED_ASSERT (0, (void) 0); ++ break; ++ } ++ } ++ ++ free (diobuf); ++ ++ return 1; ++} ++ ++static int ++freebsd_write (PedDevice* dev, const void* buffer, PedSector start, ++ PedSector count) ++{ ++ FreeBSDSpecific* arch_specific = FREEBSD_SPECIFIC (dev); ++ PedExceptionOption ex_status; ++ void* diobuf; ++ void* diobuf_start; ++ ++ PED_ASSERT(dev->sector_size % PED_SECTOR_SIZE_DEFAULT == 0, return 0); ++ ++ if (dev->read_only) { ++ if (ped_exception_throw ( ++ PED_EXCEPTION_ERROR, ++ PED_EXCEPTION_IGNORE_CANCEL, ++ _("Can't write to %s, because it is opened read-only."), ++ dev->path) ++ != PED_EXCEPTION_IGNORE) ++ return 0; ++ else ++ return 1; ++ } ++ ++ while (1) { ++ if (_device_seek (dev, start)) ++ break; ++ ++ ex_status = ped_exception_throw ( ++ PED_EXCEPTION_ERROR, PED_EXCEPTION_RETRY_IGNORE_CANCEL, ++ _("%s during seek for write on %s"), ++ strerror (errno), dev->path); ++ ++ switch (ex_status) { ++ case PED_EXCEPTION_IGNORE: ++ return 1; ++ ++ case PED_EXCEPTION_RETRY: ++ break; ++ ++ case PED_EXCEPTION_UNHANDLED: ++ ped_exception_catch (); ++ case PED_EXCEPTION_CANCEL: ++ return 0; ++ default: ++ PED_ASSERT (0, (void) 0); ++ break; ++ } ++ } ++ ++#ifdef READ_ONLY ++ printf ("ped_device_write (\"%s\", %p, %d, %d)\n", ++ dev->path, buffer, (int) start, (int) count); ++#else ++ size_t write_length = count * dev->sector_size; ++ dev->dirty = 1; ++ if (posix_memalign(&diobuf, dev->sector_size, write_length) != 0) ++ return 0; ++ memcpy(diobuf, buffer, write_length); ++ diobuf_start = diobuf; ++ while (1) { ++ ssize_t status = write (arch_specific->fd, diobuf, write_length); ++ if (status == count * PED_SECTOR_SIZE_DEFAULT) break; ++ if (status > 0) { ++ write_length -= status; ++ diobuf = (char *) diobuf + status; ++ continue; ++ } ++ ++ ex_status = ped_exception_throw ( ++ PED_EXCEPTION_ERROR, ++ PED_EXCEPTION_RETRY_IGNORE_CANCEL, ++ _("%s during write on %s"), ++ strerror (errno), dev->path); ++ ++ switch (ex_status) { ++ case PED_EXCEPTION_IGNORE: ++ return 1; ++ ++ case PED_EXCEPTION_RETRY: ++ break; ++ ++ case PED_EXCEPTION_UNHANDLED: ++ ped_exception_catch (); ++ case PED_EXCEPTION_CANCEL: ++ return 0; ++ default: ++ PED_ASSERT (0, (void) 0); ++ break; ++ } ++ } ++ free(diobuf_start); ++#endif /* !READ_ONLY */ ++ return 1; ++} ++ ++/* returns the number of sectors that are ok. ++ */ ++static PedSector ++freebsd_check (PedDevice* dev, void* buffer, PedSector start, PedSector count) ++{ ++ FreeBSDSpecific* arch_specific = FREEBSD_SPECIFIC (dev); ++ PedSector done = 0; ++ int status; ++ void* diobuf; ++ ++ if (!_device_seek (dev, start)) ++ return 0; ++ ++ if (posix_memalign(&diobuf, PED_SECTOR_SIZE_DEFAULT, ++ count * PED_SECTOR_SIZE_DEFAULT) != 0) ++ return 0; ++ ++ for (done = 0; done < count; done += status / dev->sector_size) { ++ status = read (arch_specific->fd, diobuf, ++ (size_t) ((count-done) * dev->sector_size)); ++ if (status > 0) ++ memcpy(buffer, diobuf, status); ++ if (status < 0) ++ break; ++ } ++ free(diobuf); ++ ++ return done; ++} ++ ++static int ++_do_fsync (PedDevice* dev) ++{ ++ FreeBSDSpecific* arch_specific = FREEBSD_SPECIFIC (dev); ++ int status; ++ PedExceptionOption ex_status; ++ ++ while (1) { ++ status = fsync (arch_specific->fd); ++ if (status >= 0) break; ++ ++ ex_status = ped_exception_throw ( ++ PED_EXCEPTION_ERROR, ++ PED_EXCEPTION_RETRY_IGNORE_CANCEL, ++ _("%s during write on %s"), ++ strerror (errno), dev->path); ++ ++ switch (ex_status) { ++ case PED_EXCEPTION_IGNORE: ++ return 1; ++ ++ case PED_EXCEPTION_RETRY: ++ break; ++ ++ case PED_EXCEPTION_UNHANDLED: ++ ped_exception_catch (); ++ case PED_EXCEPTION_CANCEL: ++ return 0; ++ default: ++ PED_ASSERT (0, (void) 0); ++ break; ++ } ++ } ++ return 1; ++} ++ ++static int ++freebsd_sync (PedDevice* dev) ++{ ++ PED_ASSERT (dev != NULL, return 0); ++ PED_ASSERT (!dev->external_mode, return 0); ++ ++ if (dev->read_only) ++ return 1; ++ if (!_do_fsync (dev)) ++ return 0; ++ _flush_cache (dev); ++ return 1; ++} ++ ++static int ++freebsd_sync_fast (PedDevice* dev) ++{ ++ PED_ASSERT (dev != NULL, return 0); ++ PED_ASSERT (!dev->external_mode, return 0); ++ ++ if (dev->read_only) ++ return 1; ++ if (!_do_fsync (dev)) ++ return 0; ++ /* no cache flush... */ ++ return 1; ++} ++ ++static int ++_probe_standard_devices () ++{ ++ /* Add standard devices that are not autodetected here. */ ++ return 1; ++} ++ ++static int ++_probe_kern_disks () ++{ ++ size_t listsize; ++ char *disklist, *pdisklist, *psave; ++ ++ if (sysctlbyname("kern.disks", NULL, &listsize, NULL, 0) != 0) { ++ ped_exception_throw ( ++ PED_EXCEPTION_WARNING, ++ PED_EXCEPTION_OK, ++ _("Could not get the list of devices through kern.disks sysctl.")); ++ return 0; ++ } ++ ++ if (listsize == 0) ++ return 0; ++ ++ disklist = ped_malloc(listsize + 1); ++ if (!disklist) ++ return 0; ++ ++ if (sysctlbyname("kern.disks", disklist, &listsize, NULL, 0) != 0) { ++ free(disklist); ++ return 0; ++ } ++ ++ for (pdisklist = disklist ; ; pdisklist = NULL) { ++ char dev_name [256]; ++ char *token; ++ ++ token = strtok_r(pdisklist, " ", &psave); ++ if (token == NULL) ++ break; ++ ++ strncpy (dev_name, _PATH_DEV, sizeof(dev_name)); ++ strncat (dev_name, token, sizeof(dev_name) - strlen(_PATH_DEV) - 1); ++ dev_name[sizeof(dev_name) - 1] = '\0'; ++ _ped_device_probe (dev_name); ++ } ++ ++ free(disklist); ++ return 1; ++} ++ ++static void ++freebsd_probe_all () ++{ ++ _probe_standard_devices (); ++ ++ _probe_kern_disks (); ++} ++ ++static char* ++_device_get_part_path (PedDevice* dev, int num) ++{ ++ int path_len = strlen (dev->path); ++ int result_len = path_len + 16; ++ int is_gpt; ++ char* result; ++ PedDisk* disk; ++ ++ disk = ped_disk_new (dev); ++ if (!disk) ++ return NULL; ++ ++ result = (char*) ped_malloc (result_len); ++ if (!result) ++ return NULL; ++ ++ is_gpt = !strcmp (disk->type->name, "gpt"); ++ ++ ped_disk_destroy (disk); ++ ++ /* append slice number (ad0, partition 1 => ad0s1)*/ ++ snprintf (result, result_len, is_gpt ? "%sp%d" : "%ss%d", dev->path, num); ++ ++ return result; ++} ++ ++static char* ++freebsd_partition_get_path (const PedPartition* part) ++{ ++ return _device_get_part_path (part->disk->dev, part->num); ++} ++ ++static int ++_partition_is_mounted_by_dev (dev_t dev) ++{ ++ struct stat mntdevstat; ++ struct statfs *mntbuf, *statfsp; ++ char *devname; ++ char device[256]; ++ int mntsize, i; ++ ++ mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); ++ for (i = 0; i < mntsize; i++) { ++ statfsp = &mntbuf[i]; ++ devname = statfsp->f_mntfromname; ++ if (*devname != '/') { ++ strcpy(device, _PATH_DEV); ++ strcat(device, devname); ++ strcpy(statfsp->f_mntfromname, device); ++ } ++ if (stat(devname, &mntdevstat) == 0 && ++ mntdevstat.st_rdev == dev) ++ return 1; ++ } ++ ++ return 0; ++} ++ ++static int ++_partition_is_mounted_by_path (const char *path) ++{ ++ struct stat part_stat; ++ if (stat (path, &part_stat) != 0) ++ return 0; ++ if (!S_ISCHR(part_stat.st_mode)) ++ return 0; ++ return _partition_is_mounted_by_dev (part_stat.st_rdev); ++} ++ ++static int ++_partition_is_mounted (const PedPartition *part) ++{ ++ int status; ++ char* part_name; ++ ++ if (!ped_partition_is_active (part)) ++ return 0; ++ part_name = _device_get_part_path (part->disk->dev, part->num); ++ if (!part_name) ++ return 0; ++ status = _partition_is_mounted_by_path (part_name); ++ free (part_name); ++ return status; ++} ++ ++static int ++freebsd_partition_is_busy (const PedPartition* part) ++{ ++ PedPartition* walk; ++ ++ PED_ASSERT (part != NULL, return 0); ++ ++ if (_partition_is_mounted (part)) ++ return 1; ++ if (part->type == PED_PARTITION_EXTENDED) { ++ for (walk = part->part_list; walk; walk = walk->next) { ++ if (freebsd_partition_is_busy (walk)) ++ return 1; ++ } ++ } ++ return 0; ++} ++ ++static int ++_kernel_reread_part_table (PedDevice* dev) ++{ ++ /* The FreeBSD kernel (at least the 7.x series) automatically ++ monitors the partition tables and re-read them if they ++ change. */ ++ return 1; ++} ++ ++static int ++freebsd_disk_commit (PedDisk* disk) ++{ ++ if (disk->dev->type != PED_DEVICE_FILE) ++ return _kernel_reread_part_table (disk->dev); ++ ++ return 1; ++} ++ ++static PedDeviceArchOps freebsd_dev_ops = { ++ _new: freebsd_new, ++ destroy: freebsd_destroy, ++ is_busy: freebsd_is_busy, ++ open: freebsd_open, ++ refresh_open: freebsd_refresh_open, ++ close: freebsd_close, ++ refresh_close: freebsd_refresh_close, ++ read: freebsd_read, ++ write: freebsd_write, ++ check: freebsd_check, ++ sync: freebsd_sync, ++ sync_fast: freebsd_sync_fast, ++ probe_all: freebsd_probe_all ++}; ++ ++PedDiskArchOps freebsd_disk_ops = { ++ partition_get_path: freebsd_partition_get_path, ++ partition_is_busy: freebsd_partition_is_busy, ++ disk_commit: freebsd_disk_commit ++}; ++ ++PedArchitecture ped_freebsd_arch = { ++ dev_ops: &freebsd_dev_ops, ++ disk_ops: &freebsd_disk_ops ++}; +Index: b/libparted/architecture.c +=================================================================== +--- a/libparted/architecture.c ++++ b/libparted/architecture.c +@@ -34,6 +34,9 @@ + #elif defined(__BEOS__) + extern PedArchitecture ped_beos_arch; + const PedArchitecture* arch = &ped_beos_arch; ++#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) ++ extern PedArchitecture ped_freebsd_arch; ++ const PedArchitecture* arch = &ped_freebsd_arch; + #else + extern PedArchitecture ped_gnu_arch; + const PedArchitecture* arch = &ped_gnu_arch; +Index: b/libparted/fs/xfs/platform_defs.h +=================================================================== +--- a/libparted/fs/xfs/platform_defs.h ++++ b/libparted/fs/xfs/platform_defs.h +@@ -37,7 +37,11 @@ + #include + #include + #include +-#include ++#if HAVE_ENDIAN_H ++# include ++#elif HAVE_SYS_ENDIAN_H ++# include ++#endif + #include + #include + #include +Index: b/libparted/labels/bsd.c +=================================================================== +--- a/libparted/labels/bsd.c ++++ b/libparted/labels/bsd.c +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + + #if ENABLE_NLS + # include +Index: b/libparted/labels/sun.c +=================================================================== +--- a/libparted/labels/sun.c ++++ b/libparted/labels/sun.c +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + + #if ENABLE_NLS + # include --- parted-2.3.orig/debian/patches/kfreebsd_lvm.patch +++ parted-2.3/debian/patches/kfreebsd_lvm.patch @@ -0,0 +1,43 @@ +--- a/libparted/arch/freebsd.c ++++ b/libparted/arch/freebsd.c +@@ -1140,6 +1140,31 @@ + return 1; + } + ++static int ++_probe_lvm_volumes () ++{ ++ DIR* lvm_dir; ++ struct dirent* lvm_dent; ++ char buf[PATH_MAX]; ++ struct stat st; ++ ++ lvm_dir = opendir ("/dev/linux_lvm"); ++ if (!lvm_dir) ++ return 0; ++ ++ while ((lvm_dent = readdir (lvm_dir))) { ++ if (strcmp (lvm_dent->d_name, ".") == 0 || strcmp (lvm_dent->d_name, "..") == 0) ++ continue; ++ snprintf (buf, sizeof (buf), "/dev/linux_lvm/%s", lvm_dent->d_name); ++ if (stat (buf, &st) != 0) ++ continue; ++ _ped_device_probe (buf); ++ } ++ closedir (lvm_dir); ++ ++ return 1; ++} ++ + static void + freebsd_probe_all () + { +@@ -1148,6 +1173,8 @@ + _probe_kern_disks (); + + _probe_zfs_volumes (); ++ ++ _probe_lvm_volumes (); + } + + static char* --- parted-2.3.orig/debian/patches/libparted-gpt-copy-flags.patch +++ parted-2.3/debian/patches/libparted-gpt-copy-flags.patch @@ -0,0 +1,28 @@ +From: Brian C. Lane +Subject: libparted: copy flags when duplicating GPT partitions +Origin: upstream, http://git.debian.org/?p=parted/parted.git;a=commitdiff;h=febeedd8d3d +Forwarded: not-needed +Last-Update: 2011-05-15 + +* libparted/labels/gpt.c (gpt_partition_duplicate): Copy flags to new +partition. + +Reported by Chris Murphy in https://bugzilla.redhat.com/747497. + +--- + libparted/labels/gpt.c | 4 +--- + 1 files changed, 1 insertions(+), 3 deletions(-) + +--- a/libparted/labels/gpt.c ++++ b/libparted/labels/gpt.c +@@ -1743,9 +1743,7 @@ + if (!result_data) + goto error_free_part; + +- result_data->type = part_data->type; +- result_data->uuid = part_data->uuid; +- strcpy (result_data->name, part_data->name); ++ *result_data = *part_data; + return result; + + error_free_part: --- parted-2.3.orig/debian/patches/linux-specific-gpt-type.patch +++ parted-2.3/debian/patches/linux-specific-gpt-type.patch @@ -0,0 +1,309 @@ +From e6536360bd4496cee1f1bf2dfb0b11f6bdbbfd4b Mon Sep 17 00:00:00 2001 +From: "Roderick W. Smith" +Date: Sun, 23 Sep 2012 21:29:10 +0200 +Subject: [PATCH] add support for a new Linux-specific GPT partition type code + +* NEWS: Describe the new Linux-specific partition type code +and the new msftres flag that can be used to override this type +code, should it be necessary. +* doc/parted.texi: Describe of the new msftres flag. +* include/parted/disk.in.h [_PedPartitionFlag]: Add +PED_PARTITION_MSFT_DATA. +* libparted/disk.c: Add check for PED_PARTITION_MSFT_DATA, with +return of "msftdata", to ped_partition_flag_get_name() +* libparted/labels/gpt.c (PARTITION_LINUX_DATA_GUID): Define. +[_GPTPartitionData]: New member, "int msftdata". +(_parse_part_entry): Set the msftdata flag if and only if the +PARTITION_BASIC_DATA_GUID type code is in use; +(gpt_partition_new): Use the PARTITION_LINUX_DATA_GUID +type as the default type code +(gpt_partition_set_system): Set the PARTITION_BASIC_DATA_GUID type +code on partitions on which the msftdata flag is set and set +PARTITION_LINUX_DATA_GUID as the type by default. +Clear the msftdata flag in most tests in gpt_partition_set_flag() +(gpt_partition_set_flag): Add test for PED_PARTITION_MSFT_DATA, which +sets msftdata and other flags appropriately +(gpt_partition_get_flag): Add test for the PED_PARTITION_MSFT_DATA +item that returns the status of the msftdata flag +(gpt_partition_is_flag_available): Add test for +PED_PARTITION_MSFT_DATA item to +* tests/t0220-gpt-msftres.sh: Accommodate the fact that now, +partition table listings include "msftdata" for file systems +of type NTFS and FAT*. +For more discussion and justification, see +http://thread.gmane.org/gmane.comp.gnu.parted.bugs/10456 +--- + NEWS | 19 +++++++++++++++++++ + doc/parted.texi | 16 +++++++++++++++- + include/parted/disk.in.h | 5 +++-- + libparted/disk.c | 2 ++ + libparted/labels/gpt.c | 45 ++++++++++++++++++++++++++++++++++++++++++-- + tests/t0220-gpt-msftres.sh | 3 ++- + 6 files changed, 84 insertions(+), 6 deletions(-) + +--- a/NEWS ++++ b/NEWS +@@ -44,6 +44,25 @@ + sector support being "HIGHLY EXPERIMENTAL". It seems to have matured + enough to be usable at least with GPT and MSDOS partition tables. + ++** Changes in behavior ++ ++ Added new Linux-specific partition GUID type code ++ (0FC63DAF-8483-4772-8E79-3D69D8477DE4) for Linux filesystem data on GPT ++ disks. This type code is now assigned as the default partition type code ++ for new partitions holding Linux filesystems. ++ ++ Added new "msftdata" flag to identify partitions holding NTFS or FAT ++ filesystems on GPT disks. This flag corresponds to a GPT type code of ++ EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 ("Microsoft Basic Data"). Since ++ Linux filesystem partitions formerly used this type code, this flag may ++ optionally be set on Linux partitions to make the partition table type ++ codes match former configurations in case the new Linux filesystem type ++ code causes problems with some utility. Note that this flag cannot be ++ removed from NTFS or FAT partitions within parted except by setting a ++ competing flag, such as "boot" (which sets the type code used by EFI ++ System partitions) or "msftres" (which sets the "Microsoft Reserved" type ++ code). ++ + + * Noteworthy changes in release 2.2 (2010-02-26) [stable] + +--- a/doc/parted.texi ++++ b/doc/parted.texi +@@ -1061,6 +1061,20 @@ + For PC98 disk labels, all ext2 partitions must be bootable (this is + enforced by Parted). + ++@item msftdata ++(GPT) - This flag identifies partitions that contain Microsoft filesystems ++(NTFS or FAT). It may optionally be set on Linux filesystems to mimic the ++type of configuration created by parted 3.0 and earlier, in which a ++separate Linux filesystem type code was not available on GPT disks. This ++flag can only be removed within parted by replacing it with a competing ++flag, such as boot or msftres. ++ ++@item msftres ++(GPT) - This flag identifies a "Microsoft Reserved" partition, which is ++used by Windows on GPT disks. Note that this flag should not normally be ++set on Windows filesystem partitions (those that contain NTFS or FAT ++filesystems). ++ + @item lba + (MS-DOS) - this flag can be enabled to tell MS DOS, MS Windows 9x and + MS Windows ME based operating systems to use Linear (LBA) mode. +--- a/libparted/disk.c ++++ b/libparted/disk.c +@@ -2439,6 +2439,8 @@ + return N_("prep"); + case PED_PARTITION_MSFT_RESERVED: + return N_("msftres"); ++ case PED_PARTITION_MSFT_DATA: ++ return N_("msftdata"); + case PED_PARTITION_APPLE_TV_RECOVERY: + return N_("atvrecv"); + case PED_PARTITION_DIAG: +--- a/libparted/labels/gpt.c ++++ b/libparted/labels/gpt.c +@@ -126,6 +126,10 @@ + ((efi_guid_t) { PED_CPU_TO_LE32 (0x0657fd6d), PED_CPU_TO_LE16 (0xa4ab), \ + PED_CPU_TO_LE16 (0x43c4), 0x84, 0xe5, \ + { 0x09, 0x33, 0xc8, 0x4b, 0x4f, 0x4f }}) ++#define PARTITION_LINUX_DATA_GUID \ ++ ((efi_guid_t) { PED_CPU_TO_LE32 (0x0FC63DAF), PED_CPU_TO_LE16 (0x8483), \ ++ PED_CPU_TO_LE16 (0x4772), 0x8E, 0x79, \ ++ { 0x3D, 0x69, 0xD8, 0x47, 0x7D, 0xE4 }}) + #define PARTITION_LVM_GUID \ + ((efi_guid_t) { PED_CPU_TO_LE32 (0xe6d6d379), PED_CPU_TO_LE16 (0xf507), \ + PED_CPU_TO_LE16 (0x44c2), 0xa2, 0x3c, \ +@@ -287,6 +291,7 @@ + int hp_service; + int hidden; + int msftres; ++ int msftdata; + int atvrecv; + int msftrecv; + int legacy_boot; +@@ -1048,6 +1053,7 @@ + gpt_part_data->lvm = gpt_part_data->raid + = gpt_part_data->boot = gpt_part_data->hp_service + = gpt_part_data->hidden = gpt_part_data->msftres ++ = gpt_part_data->msftdata + = gpt_part_data->msftrecv + = gpt_part_data->legacy_boot + = gpt_part_data->bios_grub = gpt_part_data->atvrecv = 0; +@@ -1069,6 +1075,8 @@ + gpt_part_data->hp_service = 1; + else if (!guid_cmp (gpt_part_data->type, PARTITION_MSFT_RESERVED_GUID)) + gpt_part_data->msftres = 1; ++ else if (!guid_cmp (gpt_part_data->type, PARTITION_BASIC_DATA_GUID)) ++ gpt_part_data->msftdata = 1; + else if (!guid_cmp (gpt_part_data->type, PARTITION_MSFT_RECOVERY)) + gpt_part_data->msftrecv = 1; + else if (!guid_cmp (gpt_part_data->type, PARTITION_APPLE_TV_RECOVERY_GUID)) +@@ -1699,7 +1707,7 @@ + if (!gpt_part_data) + goto error_free_part; + +- gpt_part_data->type = PARTITION_BASIC_DATA_GUID; ++ gpt_part_data->type = PARTITION_LINUX_DATA_GUID; + gpt_part_data->lvm = 0; + gpt_part_data->raid = 0; + gpt_part_data->boot = 0; +@@ -1707,6 +1715,7 @@ + gpt_part_data->hp_service = 0; + gpt_part_data->hidden = 0; + gpt_part_data->msftres = 0; ++ gpt_part_data->msftdata = 0; + gpt_part_data->msftrecv = 0; + gpt_part_data->atvrecv = 0; + gpt_part_data->legacy_boot = 0; +@@ -1803,6 +1812,11 @@ + gpt_part_data->type = PARTITION_MSFT_RESERVED_GUID; + return 1; + } ++ if (gpt_part_data->msftdata) ++ { ++ gpt_part_data->type = PARTITION_BASIC_DATA_GUID; ++ return 1; ++ } + if (gpt_part_data->msftrecv) + { + gpt_part_data->type = PARTITION_MSFT_RECOVERY; +@@ -1839,7 +1853,7 @@ + } + } + +- gpt_part_data->type = PARTITION_BASIC_DATA_GUID; ++ gpt_part_data->type = PARTITION_LINUX_DATA_GUID; + return 1; + } + +@@ -1917,6 +1931,7 @@ + = gpt_part_data->bios_grub + = gpt_part_data->hp_service + = gpt_part_data->msftres ++ = gpt_part_data->msftdata + = gpt_part_data->msftrecv + = gpt_part_data->atvrecv = 0; + return gpt_partition_set_system (part, part->fs_type); +@@ -1928,6 +1943,7 @@ + = gpt_part_data->boot + = gpt_part_data->hp_service + = gpt_part_data->msftres ++ = gpt_part_data->msftdata + = gpt_part_data->msftrecv + = gpt_part_data->atvrecv = 0; + return gpt_partition_set_system (part, part->fs_type); +@@ -1939,6 +1955,7 @@ + = gpt_part_data->bios_grub + = gpt_part_data->hp_service + = gpt_part_data->msftres ++ = gpt_part_data->msftdata + = gpt_part_data->msftrecv + = gpt_part_data->atvrecv = 0; + return gpt_partition_set_system (part, part->fs_type); +@@ -1950,6 +1967,7 @@ + = gpt_part_data->bios_grub + = gpt_part_data->hp_service + = gpt_part_data->msftres ++ = gpt_part_data->msftdata + = gpt_part_data->msftrecv + = gpt_part_data->atvrecv = 0; + return gpt_partition_set_system (part, part->fs_type); +@@ -1961,6 +1979,7 @@ + = gpt_part_data->lvm + = gpt_part_data->bios_grub + = gpt_part_data->msftres ++ = gpt_part_data->msftdata + = gpt_part_data->msftrecv + = gpt_part_data->atvrecv = 0; + return gpt_partition_set_system (part, part->fs_type); +@@ -1972,8 +1991,26 @@ + = gpt_part_data->lvm + = gpt_part_data->bios_grub + = gpt_part_data->hp_service ++ = gpt_part_data->msftdata ++ = gpt_part_data->msftrecv ++ = gpt_part_data->atvrecv = 0; ++ return gpt_partition_set_system (part, part->fs_type); ++ case PED_PARTITION_MSFT_DATA: ++ gpt_part_data->msftres = state; ++ if (state) { ++ gpt_part_data->boot ++ = gpt_part_data->raid ++ = gpt_part_data->lvm ++ = gpt_part_data->bios_grub ++ = gpt_part_data->hp_service ++ = gpt_part_data->msftres ++ = gpt_part_data->msftdata + = gpt_part_data->msftrecv + = gpt_part_data->atvrecv = 0; ++ gpt_part_data->msftdata = 1; ++ } else { ++ gpt_part_data->msftdata = 0; ++ } + return gpt_partition_set_system (part, part->fs_type); + case PED_PARTITION_DIAG: + gpt_part_data->msftrecv = state; +@@ -1983,6 +2020,7 @@ + = gpt_part_data->lvm + = gpt_part_data->bios_grub + = gpt_part_data->hp_service ++ = gpt_part_data->msftdata + = gpt_part_data->msftres + = gpt_part_data->atvrecv = 0; + return gpt_partition_set_system (part, part->fs_type); +@@ -1995,6 +2033,7 @@ + = gpt_part_data->bios_grub + = gpt_part_data->hp_service + = gpt_part_data->msftres ++ = gpt_part_data->msftdata + = gpt_part_data->msftrecv = 0; + return gpt_partition_set_system (part, part->fs_type); + case PED_PARTITION_HIDDEN: +@@ -2033,6 +2072,8 @@ + return gpt_part_data->hp_service; + case PED_PARTITION_MSFT_RESERVED: + return gpt_part_data->msftres; ++ case PED_PARTITION_MSFT_DATA: ++ return gpt_part_data->msftdata; + case PED_PARTITION_DIAG: + return gpt_part_data->msftrecv; + case PED_PARTITION_APPLE_TV_RECOVERY: +@@ -2062,6 +2103,7 @@ + case PED_PARTITION_BIOS_GRUB: + case PED_PARTITION_HPSERVICE: + case PED_PARTITION_MSFT_RESERVED: ++ case PED_PARTITION_MSFT_DATA: + case PED_PARTITION_DIAG: + case PED_PARTITION_APPLE_TV_RECOVERY: + case PED_PARTITION_HIDDEN: +--- a/tests/t0220-gpt-msftres.sh ++++ b/tests/t0220-gpt-msftres.sh +@@ -60,7 +60,8 @@ + rm -f out + for type in $fs_types; do + end=$(expr $start + $part_size - 1) +- echo "$i:${start}s:${end}s:${part_size}s::$type:;" >> exp || fail=1 ++ case $type in fat*|NTFS) flag=msftdata;; *) flag=;; esac ++ echo "$i:${start}s:${end}s:${part_size}s::$type:$flag;" >> exp || fail=1 + parted -s $dev mkpart primary $type ${start}s ${end}s >> out 2>&1 || fail=1 + parted -s $dev name $i $type >> out 2>&1 || fail=1 + start=$(expr $end + 1) +--- a/include/parted/disk.h ++++ b/include/parted/disk.h +@@ -70,10 +70,11 @@ + PED_PARTITION_BIOS_GRUB=12, + PED_PARTITION_APPLE_TV_RECOVERY=13, + PED_PARTITION_DIAG=14, +- PED_PARTITION_LEGACY_BOOT=15 ++ PED_PARTITION_LEGACY_BOOT=15, ++ PED_PARTITION_MSFT_DATA=16 + }; + #define PED_PARTITION_FIRST_FLAG PED_PARTITION_BOOT +-#define PED_PARTITION_LAST_FLAG PED_PARTITION_LEGACY_BOOT ++#define PED_PARTITION_LAST_FLAG PED_PARTITION_MSFT_DATA + + enum _PedDiskTypeFeature { + PED_DISK_TYPE_EXTENDED=1, /**< supports extended partitions */ --- parted-2.3.orig/debian/patches/linux-two-component.patch +++ parted-2.3/debian/patches/linux-two-component.patch @@ -0,0 +1,22 @@ +Description: Accommodate two-component Linux version numbers like 3.0 +Origin: upstream, http://git.debian.org/?p=parted/parted.git;a=commitdiff;h=bb4fbe2130cd85727bbaf6c71b2d27b6769aa4aa +Author: Jim Meyering +Bug-Ubuntu: https://bugs.launchpad.net/bugs/796865 +Forwarded: not-needed +Last-Update: 2011-06-15 + +--- a/libparted/arch/linux.c ++++ b/libparted/arch/linux.c +@@ -652,7 +652,11 @@ + + if (uname (&uts)) + return kver = 0; +- if (sscanf (uts.release, "%u.%u.%u", &major, &minor, &teeny) != 3) ++ if (sscanf (uts.release, "%u.%u.%u", &major, &minor, &teeny) == 3) ++ ; /* ok */ ++ else if (sscanf (uts.release, "%u.%u", &major, &minor) == 2) ++ teeny = 0; ++ else + return kver = 0; + + return kver = KERNEL_VERSION (major, minor, teeny); --- parted-2.3.orig/debian/patches/loop-limits.patch +++ parted-2.3/debian/patches/loop-limits.patch @@ -0,0 +1,70 @@ +Description: Remove limits on loop labels + There's no reason to impose any particular limit on loop labels, since they + just represent a single large partition. Sector counts over 2^32 are + needed for large RAID arrays. +Author: Colin Watson +Bug-Debian: http://bugs.debian.org/592679 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/543838 +Forwarded: http://lists.alioth.debian.org/pipermail/parted-devel/2010-August/003725.html +Last-Update: 2010-04-09 + +Index: b/libparted/labels/pt-limit.c +=================================================================== +--- a/libparted/labels/pt-limit.c ++++ b/libparted/labels/pt-limit.c +@@ -120,8 +120,8 @@ + #line 18 "pt-limit.gperf" + {"sun",128ULL*UINT32_MAX,UINT32_MAX}, + {""}, {""}, {""}, {""}, +-#line 22 "pt-limit.gperf" +- {"loop",UINT32_MAX,UINT32_MAX}, ++#line 23 "pt-limit.gperf" ++ {"loop",UINT64_MAX,UINT64_MAX}, + {""}, {""}, {""}, {""}, + #line 10 "pt-limit.gperf" + {"gpt",UINT64_MAX,UINT64_MAX}, +@@ -132,7 +132,7 @@ + #line 8 "pt-limit.gperf" + {"dasd",UINT32_MAX,UINT32_MAX}, + {""}, {""}, {""}, {""}, +-#line 26 "pt-limit.gperf" ++#line 27 "pt-limit.gperf" + {"amiga",UINT32_MAX,UINT32_MAX}, + {""}, {""}, {""}, {""}, + #line 9 "pt-limit.gperf" +@@ -144,7 +144,7 @@ + #line 20 "pt-limit.gperf" + {"bsd",UINT32_MAX,UINT32_MAX}, + {""}, {""}, {""}, {""}, +-#line 23 "pt-limit.gperf" ++#line 24 "pt-limit.gperf" + {"pc98",UINT32_MAX,UINT32_MAX} + }; + +Index: b/libparted/labels/pt-limit.gperf +=================================================================== +--- a/libparted/labels/pt-limit.gperf ++++ b/libparted/labels/pt-limit.gperf +@@ -19,7 +19,8 @@ + # + bsd,UINT32_MAX,UINT32_MAX + # aix,UINT32_MAX,UINT32_MAX +-loop,UINT32_MAX,UINT32_MAX ++# In reality, loop labels have no particular limit. ++loop,UINT64_MAX,UINT64_MAX + pc98,UINT32_MAX,UINT32_MAX + # + # FIXME: not verified. looks like these are cylinder aligned, too +Index: b/tests/t9021-maxima.sh +=================================================================== +--- a/tests/t9021-maxima.sh ++++ b/tests/t9021-maxima.sh +@@ -42,7 +42,7 @@ + max_start=4294967295 + max_len=4294967295 + case $t in +- gpt) max_start=18446744073709551615; max_len=$max_start;; ++ gpt|loop) max_start=18446744073709551615; max_len=$max_start;; + sun) max_start=549755813760;; # 128 * (2^32-1) + esac + --- parted-2.3.orig/debian/patches/loop-partitions.patch +++ parted-2.3/debian/patches/loop-partitions.patch @@ -0,0 +1,192 @@ +From: Phillip Susi +Forwarded: no +Subject: Backport some changes to allow use of partitionable loop devices +Description: Upstream has switched to using the newer sysfs attribute + "ext_range" instead of "range" to read the maximum supported partitions + of a device. This allows loop devices to be partitioned even without + using the kernel max_part argument, as well as support for more than + 16 partitions. Also added new PED_DEVICE_LOOP device type instead of + pretending loop devices are files. + +--- a/libparted/arch/linux.c ++++ b/libparted/arch/linux.c +@@ -574,7 +574,7 @@ + } else if (_is_virtblk_major(dev_major)) { + dev->type = PED_DEVICE_VIRTBLK; + } else if (dev_major == LOOP_MAJOR) { +- dev->type = PED_DEVICE_FILE; ++ dev->type = PED_DEVICE_LOOP; + } else if (dev_major == MD_MAJOR) { + dev->type = PED_DEVICE_MD; + } else { +@@ -1395,6 +1395,11 @@ + goto error_free_arch_specific; + break; + ++ case PED_DEVICE_LOOP: ++ if (!init_generic (dev, _("Loopback device"))) ++ goto error_free_arch_specific; ++ break; ++ + default: + ped_exception_throw (PED_EXCEPTION_NO_FEATURE, + PED_EXCEPTION_CANCEL, +@@ -2388,6 +2393,95 @@ + BLKPG_DEL_PARTITION); + } + ++/* Read the unsigned long long from /sys/block/DEV_BASE/PART_BASE/ENTRY ++ and set *VAL to that value, where DEV_BASE is the last component of path to ++ block device corresponding to PART and PART_BASE is the sysfs name of PART. ++ Upon success, return true. Otherwise, return false. */ ++static bool ++_sysfs_ull_entry_from_part(PedPartition const* part, const char *entry, ++ unsigned long long *val) ++{ ++ char path[128]; ++ char *part_name = linux_partition_get_path(part); ++ if (!part_name) ++ return false; ++ ++ int r = snprintf(path, sizeof(path), "/sys/block/%s/%s/%s", ++ last_component(part->disk->dev->path), ++ last_component(part_name), entry); ++ free(part_name); ++ if (r < 0 || r >= sizeof(path)) ++ return false; ++ ++ FILE *fp = fopen(path, "r"); ++ if (!fp) ++ return false; ++ ++ bool ok = fscanf(fp, "%llu", val) == 1; ++ fclose(fp); ++ ++ return ok; ++} ++ ++ ++/* Get the starting sector and length of a partition PART within a block device ++ Use blkpg if available, then check sysfs and then use HDIO_GETGEO and ++ BLKGETSIZE64 ioctls as fallback. Upon success, return true. Otherwise, ++ return false. */ ++static bool ++_kernel_get_partition_start_and_length(PedPartition const *part, ++ unsigned long long *start, ++ unsigned long long *length) ++{ ++ PED_ASSERT(part, return false); ++ PED_ASSERT(start, return false); ++ PED_ASSERT(length, return false); ++ ++ char *dev_name = linux_partition_get_path (part); ++ if (!dev_name) ++ return false; ++ ++ int ok = _sysfs_ull_entry_from_part (part, "start", start); ++ if (!ok) { ++ struct hd_geometry geom; ++ int dev_fd = open (dev_name, O_RDONLY); ++ if (dev_fd != -1 && ioctl (dev_fd, HDIO_GETGEO, &geom)) { ++ *start = geom.start; ++ ok = true; ++ } else { ++ if (dev_fd != -1) ++ close(dev_fd); ++ free (dev_name); ++ return false; ++ } ++ } ++ *start = (*start * 512) / part->disk->dev->sector_size; ++ ok = _sysfs_ull_entry_from_part (part, "size", length); ++ ++ int fd; ++ if (!ok) { ++ fd = open (dev_name, O_RDONLY); ++ if (fd != -1 && ioctl (fd, BLKGETSIZE64, length)) ++ ok = true; ++ } else { ++ fd = -1; ++ *length *= 512; ++ } ++ *length /= part->disk->dev->sector_size; ++ if (fd != -1) ++ close (fd); ++ ++ if (!ok) ++ ped_exception_throw ( ++ PED_EXCEPTION_BUG, ++ PED_EXCEPTION_CANCEL, ++ _("Unable to determine the start and length of %s."), ++ dev_name); ++ free (dev_name); ++ return ok; ++} ++ ++ + /* + * The number of partitions that a device can have depends on the kernel. + * If we don't find this value in /sys/block/DEV/range, we will use our own +@@ -2482,33 +2576,16 @@ + } + + for (i = 1; i <= lpn; i++) { +- const PedPartition *part = ped_disk_get_partition (disk, i); ++ PedPartition *part = ped_disk_get_partition (disk, i); + if (part) { + if (!ok[i - 1] && errnums[i - 1] == EBUSY) { +- struct hd_geometry geom; +- unsigned long long length = 0; ++ unsigned long long length; ++ unsigned long long start; + /* get start and length of existing partition */ +- char *dev_name = _device_get_part_path (disk->dev, i); +- if (!dev_name) +- goto cleanup; +- int fd = open (dev_name, O_RDONLY); +- if (fd == -1 +- || ioctl (fd, HDIO_GETGEO, &geom) +- || ioctl (fd, BLKGETSIZE64, &length)) { +- ped_exception_throw ( +- PED_EXCEPTION_BUG, +- PED_EXCEPTION_CANCEL, +- _("Unable to determine the size and length of %s."), +- dev_name); +- if (fd != -1) +- close (fd); +- free (dev_name); ++ if (!_kernel_get_partition_start_and_length(part, ++ &start, &length)) + goto cleanup; +- } +- free (dev_name); +- length /= disk->dev->sector_size; +- close (fd); +- if (geom.start == part->geom.start ++ if (start == part->geom.start + && length == part->geom.length) + ok[i - 1] = 1; + /* If the new partition is unchanged and the +--- a/include/parted/device.h ++++ b/include/parted/device.h +@@ -48,7 +48,8 @@ + PED_DEVICE_SDMMC = 14, + PED_DEVICE_VIRTBLK = 15, + PED_DEVICE_AOE = 16, +- PED_DEVICE_MD = 17 ++ PED_DEVICE_MD = 17, ++ PED_DEVICE_LOOP = 18 + } PedDeviceType; + + typedef struct _PedDevice PedDevice; +--- a/parted/parted.c ++++ b/parted/parted.c +@@ -1398,7 +1398,7 @@ + "cpqarray", "file", "ataraid", "i2o", + "ubd", "dasd", "viodasd", "sx8", "dm", + "xvd", "sd/mmc", "virtblk", "aoe", +- "md"}; ++ "md", "loop"}; + char* peek_word; + char* start; + char* end; --- parted-2.3.orig/debian/patches/md-partitions.patch +++ parted-2.3/debian/patches/md-partitions.patch @@ -0,0 +1,41 @@ + + http://anonscm.debian.org/gitweb/?p=parted/parted.git;a=commitdiff;h=ca97da905bd21f2a4371f4717f7c46a936af6b2c + +commit ca97da905bd21f2a4371f4717f7c46a936af6b2c +Author: Petr Uzel +Date: Sat Nov 26 15:45:08 2011 +0100 + + libparted: use ext_range to find out largest possible partition + + Parted uses /sys/block/DEV/range file to find out how many partitions + can the blockdevice hold and uses this number in its algorithm + for informing the kernel about modified partitions. This works + fine for most devices, however, it fails on partitionable MD arrays, + because these have 1 in range file. Using ext_range should be safer + and work for all devices. + + * libparted/arch/linux.c (_device_get_partition_range): Use + /sys/block/DEV/ext_range instead of range sysfs file + + Addresses: http://bugzilla.novell.com/567652 + +--- a/libparted/arch/linux.c ++++ b/libparted/arch/linux.c +@@ -2571,7 +2571,7 @@ + + /* + * The number of partitions that a device can have depends on the kernel. +- * If we don't find this value in /sys/block/DEV/range, we will use our own ++ * If we don't find this value in /sys/block/DEV/ext_range, we will use our own + * value. + */ + static unsigned int +@@ -2585,7 +2585,7 @@ + if (dev->type == PED_DEVICE_DM) + return MAX_NUM_PARTS; + +- r = snprintf(path, sizeof(path), "/sys/block/%s/range", ++ r = snprintf(path, sizeof(path), "/sys/block/%s/ext_range", + last_component(dev->path)); + if (r < 0 || r >= sizeof(path)) + return MAX_NUM_PARTS; --- parted-2.3.orig/debian/patches/preserve-hidden-parts.patch +++ parted-2.3/debian/patches/preserve-hidden-parts.patch @@ -0,0 +1,36 @@ +From: Ben Hutchings +Forwarded: http://lists.gnu.org/archive/html/bug-parted/2008-10/msg00005.html +Bug-Debian: http://bugs.debian.org/491797 +Last-Update: 2010-02-02 +Description: Avoid overwriting empty or hidden partitions + It changes the DOS partition rewriting code to avoid overwriting + empty or hidden primary partitions so long as their entries aren't + reused. This makes fatresize and similar front-ends safe to use in + the presence of hidden partitions. + +Index: b/libparted/labels/dos.c +=================================================================== +--- a/libparted/labels/dos.c ++++ b/libparted/labels/dos.c +@@ -1185,13 +1185,18 @@ + if (!table->mbr_signature) + table->mbr_signature = generate_random_id(); + +- memset (table->partitions, 0, sizeof (table->partitions)); +- table->magic = PED_CPU_TO_LE16 (MSDOS_MAGIC); ++ if (table->magic != PED_CPU_TO_LE16 (MSDOS_MAGIC)) { ++ memset (table->partitions, 0, sizeof (table->partitions)); ++ table->magic = PED_CPU_TO_LE16 (MSDOS_MAGIC); ++ } + + for (i=1; i<=DOS_N_PRI_PARTITIONS; i++) { + part = ped_disk_get_partition (disk, i); +- if (!part) ++ if (!part) { ++ if (table->partitions [i - 1].type != PARTITION_EMPTY) ++ memset (&table->partitions [i - 1], 0, sizeof (DosRawPartition)); + continue; ++ } + + if (!fill_raw_part (&table->partitions [i - 1], part, 0)) + goto write_fail; --- parted-2.3.orig/debian/patches/remove-dev_t-dep.patch +++ parted-2.3/debian/patches/remove-dev_t-dep.patch @@ -0,0 +1,60 @@ +From: Phillip Susi +Description: All partitions on dmraid disks and partition numbers + >= 16 on regular scsi disks were not being detected as in use. + This was because assumptions were being made about the dev node + major/minor numbers and how they relate to the partition number. + These assumptions break entirely on dmraid devices, and on normal + disks with >= 16 partitions. Removed _partition_get_part_dev() + and rewrote _partition_is_mounted() to use + _partition_is_mounted_by_path() instead of _by_dev. +Forwarded: yes +Last-Update: 2011-05-04 + +Index: b/libparted/arch/linux.c +=================================================================== +--- a/libparted/arch/linux.c ++++ b/libparted/arch/linux.c +@@ -2212,19 +2212,6 @@ + return _device_get_part_path (part->disk->dev, part->num); + } + +-static dev_t +-_partition_get_part_dev (const PedPartition* part) +-{ +- struct stat dev_stat; +- int dev_major, dev_minor; +- +- if (stat (part->disk->dev->path, &dev_stat)) +- return (dev_t)0; +- dev_major = major (dev_stat.st_rdev); +- dev_minor = minor (dev_stat.st_rdev); +- return (dev_t)makedev (dev_major, dev_minor + part->num); +-} +- + static int + _mount_table_search (const char* file_name, dev_t dev) + { +@@ -2271,13 +2258,18 @@ + static int + _partition_is_mounted (const PedPartition *part) + { +- dev_t dev; ++ char *part_name; ++ int status; + if (!ped_partition_is_active (part)) + return 0; +- dev = _partition_get_part_dev (part); +- if (!dev) +- return 0; +- return _partition_is_mounted_by_dev (dev); ++ part_name = _device_get_part_path (part->disk->dev, part->num); ++ if (!part_name) ++ return 1; ++ status = _partition_is_mounted_by_path (part_name); ++ free (part_name); ++ if (status) ++ return 1; ++ return 0; + } + + static int --- parted-2.3.orig/debian/patches/series +++ parted-2.3/debian/patches/series @@ -0,0 +1,53 @@ +# Debian specific patches +doc-package.patch + +# For upstream merging +preserve-hidden-parts.patch +update-ext4-code.patch +#unblacklist-md.patch +kfreebsd-gnu.patch +btrfs.patch +loop-limits.patch +freebsd-ufs.patch +zfs.patch +zero-length-devices.patch +freebsd-zvol.patch +freebsd-geli.patch +kfreebsd_lvm.patch +hurd-partition-path.patch +hurd-reread.patch +gnulib.patch +fix-head-size-assertion.patch +dm_p_separator.patch +remove-dev_t-dep.patch +skip-floppy.patch +gptsync.patch +loop-partitions.patch +dmraid.patch +dm-part-sync.patch + +# Backported +sun-revert-disk-flag.patch +sun-raid-type-test-fix.patch +tiny-disk-constraint.patch +dasd-sync.patch +gpt-add-partition-attribute-bits.patch +gpt-add-legacy_boot-partition-flag.patch +libparted-gpt-copy-flags.patch +linux-two-component.patch +md-partitions.patch +gnulib-gets.patch + +udevadm-settle.patch +16-dos-partitions.patch +hfs-probe-corrupt.patch +0001-parted-resizepart-command.patch +0003-libparted-Add-support-for-BLKPG-ioctl-partition-resi.patch +0004-parted-make-_partition_warn_busy-actually-a-warning-.patch +fewer-gpt-entries.patch +avoid-disturbing-partitions.patch +linux-specific-gpt-type.patch + +# Symbols for this ABI (amd64 as reference) +update-abi-symbols.patch + --- parted-2.3.orig/debian/patches/skip-floppy.patch +++ parted-2.3/debian/patches/skip-floppy.patch @@ -0,0 +1,17 @@ +From: Phillip Susi +Forwarded: yes +Subject: Skip floppies when probing all devices +Description: Floppies can't be partitioned anyhow, and some people + have misconfigured bios that thinks there is a floppy when there + actually isn't, and trying to scan it causes hanging. + +--- a/libparted/arch/linux.c ++++ b/libparted/arch/linux.c +@@ -2089,6 +2089,7 @@ + { "dm-", sizeof ("dm-") - 1 }, + { "loop", sizeof ("loop") - 1 }, + { "ram", sizeof ("ram") - 1 }, ++ { "fd", sizeof ("fd") - 1 }, + { 0, 0 }, + }; + --- parted-2.3.orig/debian/patches/sun-raid-type-test-fix.patch +++ parted-2.3/debian/patches/sun-raid-type-test-fix.patch @@ -0,0 +1,33 @@ +From a582ca642f4817dd02e65a3ecc55e951008969b2 Mon Sep 17 00:00:00 2001 +From: Jim Meyering +Date: Sat, 26 Jun 2010 09:22:59 +0200 +Subject: [PATCH] tests: adjust sun-partition-creating test to conform + +* tests/t4000-sun-raid-type.sh: Adjust partition size so the +end falls on a cylinder boundary. +--- + tests/t4000-sun-raid-type.sh | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +Index: b/tests/t4000-sun-raid-type.sh +=================================================================== +--- a/tests/t4000-sun-raid-type.sh ++++ b/tests/t4000-sun-raid-type.sh +@@ -26,7 +26,7 @@ + + N=2000 # number of sectors + dev=sun-disk-file +-exp="BYT;\n---:${N}s:file:$ss:$ss:sun:;\n1:0s:50s:51s" ++exp="BYT;\n---:${N}s:file:$ss:$ss:sun:;\n1:0s:127s:128s" + test_expect_success \ + 'create an empty file as a test disk' \ + 'dd if=/dev/zero of=$dev bs=${ss}c count=$N 2> /dev/null' +@@ -38,7 +38,7 @@ + + test_expect_success \ + 'create a single partition' \ +- 'parted -s $dev unit s mkpart ext2 0s 50s > out 2>&1' ++ 'parted -s $dev unit s mkpart ext2 0s 127s > out 2>&1' + test_expect_success 'check for empty output' 'compare out /dev/null' + + test_expect_success \ --- parted-2.3.orig/debian/patches/sun-revert-disk-flag.patch +++ parted-2.3/debian/patches/sun-revert-disk-flag.patch @@ -0,0 +1,100 @@ +From f51344a1a5f8e703b503d0f20d5bf2ef5f1ce98b Mon Sep 17 00:00:00 2001 +From: Colin Watson +Date: Tue, 15 Jun 2010 19:49:40 +0100 +Subject: [PATCH 2/2] sun: revert "implement disk flag operations" + +This reverts the libparted/labels/sun.c part of +723ea23c5df68cbe67d1f518ef484f4c77f516fa. Sun disk labels do +not appear to be able to handle non-cylinder alignment +(http://bugs.debian.org/579948). +* libparted/labels/sun.c: Revert. +--- + libparted/labels/sun.c | 47 +---------------------------------------------- + 1 files changed, 1 insertions(+), 46 deletions(-) + +Index: b/libparted/labels/sun.c +=================================================================== +--- a/libparted/labels/sun.c ++++ b/libparted/labels/sun.c +@@ -110,7 +110,6 @@ + struct _SunDiskData { + PedSector length; /* This is based on cyl - alt-cyl */ + SunRawLabel raw_label; +- int cylinder_alignment; + }; + + static PedDiskType sun_disk_type; +@@ -192,7 +191,6 @@ + PED_ASSERT (bios_geom->cylinders == (PedSector) (dev->length / cyl_size), + return NULL); + sun_specific->length = ped_round_down_to (dev->length, cyl_size); +- sun_specific->cylinder_alignment = 1; + + label = &sun_specific->raw_label; + memset(label, 0, sizeof(SunRawLabel)); +@@ -259,42 +257,6 @@ + } + + static int +-sun_disk_set_flag (PedDisk *disk, PedDiskFlag flag, int state) +-{ +- SunDiskData *disk_specific = disk->disk_specific; +- switch (flag) { +- case PED_DISK_CYLINDER_ALIGNMENT: +- disk_specific->cylinder_alignment = !!state; +- return 1; +- default: +- return 0; +- } +-} +- +-static int +-sun_disk_get_flag (const PedDisk *disk, PedDiskFlag flag) +-{ +- SunDiskData *disk_specific = disk->disk_specific; +- switch (flag) { +- case PED_DISK_CYLINDER_ALIGNMENT: +- return disk_specific->cylinder_alignment; +- default: +- return 0; +- } +-} +- +-static int +-sun_disk_is_flag_available (const PedDisk *disk, PedDiskFlag flag) +-{ +- switch (flag) { +- case PED_DISK_CYLINDER_ALIGNMENT: +- return 1; +- default: +- return 0; +- } +-} +- +-static int + _check_geometry_sanity (PedDisk* disk, SunRawLabel* label) + { + PedDevice* dev = disk->dev; +@@ -805,10 +767,7 @@ + { + PED_ASSERT (part != NULL, return 0); + +- SunDiskData *disk_specific = part->disk->disk_specific; +- +- if (disk_specific->cylinder_alignment && +- _ped_partition_attempt_align (part, constraint, ++ if (_ped_partition_attempt_align (part, constraint, + _get_strict_constraint (part->disk))) + return 1; + if (_ped_partition_attempt_align (part, constraint, +@@ -922,10 +881,6 @@ + clobber: NULL, + write: NULL_IF_DISCOVER_ONLY (sun_write), + +- disk_set_flag: sun_disk_set_flag, +- disk_get_flag: sun_disk_get_flag, +- disk_is_flag_available: sun_disk_is_flag_available, +- + get_partition_alignment: sun_get_partition_alignment, + + partition_set_name: NULL, --- parted-2.3.orig/debian/patches/tiny-disk-constraint.patch +++ parted-2.3/debian/patches/tiny-disk-constraint.patch @@ -0,0 +1,30 @@ +Description: Fix constraint for very small devices (smaller than 1 cylinder) +Origin: upstream, http://git.debian.org/?p=parted/parted.git;a=commitdiff;h=9f5b0608611eed40ef33be2096f5d482710602e5 +Bug-Debian: http://bugs.debian.org/602568 +Forwarded: not-needed +Author: Jim Meyering +Last-Update: 2010-11-19 + +--- a/libparted/labels/dos.c ++++ b/libparted/labels/dos.c +@@ -1656,13 +1656,13 @@ + dev->length - min_geom->end)) + return NULL; + } else { +- /* Do not assume that length is larger than 1 cylinder's +- worth of sectors. This is useful when testing with +- a memory-mapped "disk" (a la scsi_debug) that is say, +- 2048 sectors long. */ +- if (cylinder_size < dev->length +- && !ped_geometry_init (&start_geom, dev, cylinder_size, +- dev->length - cylinder_size)) ++ /* Use cylinder_size as the starting sector number ++ when the device is large enough to accommodate that. ++ Otherwise, use sector 1. */ ++ PedSector start = (cylinder_size < dev->length ++ ? cylinder_size : 1); ++ if (!ped_geometry_init (&start_geom, dev, start, ++ dev->length - start)) + return NULL; + if (!ped_geometry_init (&end_geom, dev, 0, dev->length)) + return NULL; --- parted-2.3.orig/debian/patches/udevadm-settle.patch +++ parted-2.3/debian/patches/udevadm-settle.patch @@ -0,0 +1,98 @@ +From: Colin Watson +Forwarded: no +Last-Update: 2010-02-22 +Description: udev handling + Run udevadm settle around partition table rereads, to avoid races. + . + This should be replaced by a proper completion-notification mechanism + between the kernel and udev. + +--- a/libparted/arch/linux.c ++++ b/libparted/arch/linux.c +@@ -26,6 +26,7 @@ + #include + #endif + ++#include + #include + #include + #include +@@ -2941,13 +2942,55 @@ + return have_blkpg = kver >= KERNEL_VERSION (2,4,0) ? 1 : 0; + } + ++static int ++_chrooted () ++{ ++ static int cached = -1; ++ struct stat root, init_root; ++ ++ if (cached != -1) ++ return cached; ++ ++ if (stat ("/", &root) || stat ("/proc/1/root", &init_root)) ++ /* We can't tell, but are unlikely to be able to tell in the ++ * future either. ++ */ ++ cached = 0; ++ else if (root.st_dev == init_root.st_dev && ++ root.st_ino == init_root.st_ino) ++ /* / has the same dev/ino as /sbin/init's root, so we're not ++ * in a chroot. ++ */ ++ cached = 0; ++ else ++ /* We must be in a chroot. */ ++ cached = 1; ++ ++ return cached; ++} ++ + /* Return nonzero upon success, 0 if something fails. */ + static int + linux_disk_commit (PedDisk* disk) + { ++ int ret = 1; ++ + if (!_has_partitions (disk)) + return 1; + ++ /* Modern versions of udev may notice the write activity on ++ * partition devices caused by _flush_cache, and may decide to ++ * synthesise some change events as a result. These may in turn run ++ * programs that open partition devices, which will race with us ++ * trying to remove those devices. To avoid this, we need to wait ++ * until udevd has finished processing its event queue. ++ * TODO: for upstream submission, this should check whether udevadm ++ * exists on $PATH. ++ */ ++ if (!_chrooted () && system ("udevadm settle") != 0) { ++ /* ignore failures */ ++ } ++ + if (disk->dev->type != PED_DEVICE_FILE) { + + /* We now require BLKPG support. If this assertion fails, +@@ -2957,10 +3000,20 @@ + assert (_have_blkpg ()); + + if (!_disk_sync_part_table (disk)) +- return 0; ++ ret = 0; + } + +- return 1; ++out: ++ /* Now we wait for udevd to finish creating device nodes based on ++ * the above activity, so that callers can reliably use them. ++ * TODO: for upstream submission, this should check whether udevadm ++ * exists on $PATH. ++ */ ++ if (!_chrooted () && system ("udevadm settle") != 0) { ++ /* ignore failures */ ++ } ++ ++ return ret; + } + + #if USE_BLKID --- parted-2.3.orig/debian/patches/update-abi-symbols.patch +++ parted-2.3/debian/patches/update-abi-symbols.patch @@ -0,0 +1,347 @@ +commit 8c3d75b32a50ae05e7c5a52fbee5c2b30d2f964c +Author: Otavio Salvador +Date: Tue Feb 2 16:40:11 2010 -0200 + + Update ABI symbols + +Index: b/scripts/data/abi/baseline_symbols.txt +=================================================================== +--- a/scripts/data/abi/baseline_symbols.txt ++++ b/scripts/data/abi/baseline_symbols.txt +@@ -1,4 +1,5 @@ + FUNC:__efi_crc32 ++FUNC:__xargmatch_internal + FUNC:_amiga_add_id + FUNC:_amiga_free_ids + FUNC:_amiga_id_in_list +@@ -12,8 +13,21 @@ + FUNC:_ped_partition_attempt_align + FUNC:_ped_partition_free + FUNC:_update_stats +-FUNC:abs_mod + FUNC:amiga_find_part ++FUNC:argmatch ++FUNC:argmatch_invalid ++FUNC:argmatch_to_argument ++FUNC:argmatch_valid ++FUNC:base_len ++FUNC:base_name ++FUNC:clone_quoting_options ++FUNC:close_stdout ++FUNC:close_stdout_set_file_name ++FUNC:close_stdout_set_ignore_EPIPE ++FUNC:close_stream ++FUNC:dir_len ++FUNC:dir_name ++FUNC:emit_bug_reporting_address + FUNC:ext2_bcache_deinit + FUNC:ext2_bcache_dump + FUNC:ext2_bcache_flush +@@ -28,6 +42,7 @@ + FUNC:ext2_commit_metadata + FUNC:ext2_copy_block + FUNC:ext2_destroy_dev_handle ++FUNC:ext2_determine_itoffset + FUNC:ext2_do_inode + FUNC:ext2_find_free_block + FUNC:ext2_find_free_inode +@@ -51,7 +66,6 @@ + FUNC:ext2_write_inode + FUNC:ext2_zero_blocks + FUNC:ext2_zero_inode +-FUNC:extended_euclid + FUNC:fat_alloc + FUNC:fat_alloc_buffers + FUNC:fat_boot_sector_analyse +@@ -164,9 +178,12 @@ + FUNC:fat_write_sync_fragment + FUNC:fat_write_sync_fragments + FUNC:findit ++FUNC:freea ++FUNC:gen_tempname + FUNC:geom_dal_create + FUNC:geom_dal_free + FUNC:geom_dal_reopen ++FUNC:get_quoting_style + FUNC:hfs_and_wrapper_probe + FUNC:hfs_btree_search + FUNC:hfs_file_close +@@ -205,7 +222,11 @@ + FUNC:hfsplus_read_bad_blocks + FUNC:hfsplus_update_vh + FUNC:hfsx_probe +-FUNC:mac_alloc ++FUNC:last_component ++FUNC:locale_charset ++FUNC:mdir_name ++FUNC:mmalloca ++FUNC:parse_long_options + FUNC:ped_alignment_align_down + FUNC:ped_alignment_align_nearest + FUNC:ped_alignment_align_up +@@ -234,6 +255,7 @@ + FUNC:ped_debug + FUNC:ped_debug_set_handler + FUNC:ped_device_begin_external_access ++FUNC:ped_device_cache_remove + FUNC:ped_device_check + FUNC:ped_device_close + FUNC:ped_device_destroy +@@ -241,7 +263,11 @@ + FUNC:ped_device_free_all + FUNC:ped_device_get + FUNC:ped_device_get_constraint ++FUNC:ped_device_get_minimal_aligned_constraint ++FUNC:ped_device_get_minimum_alignment + FUNC:ped_device_get_next ++FUNC:ped_device_get_optimal_aligned_constraint ++FUNC:ped_device_get_optimum_alignment + FUNC:ped_device_is_busy + FUNC:ped_device_open + FUNC:ped_device_probe_all +@@ -250,6 +276,8 @@ + FUNC:ped_device_sync_fast + FUNC:ped_device_write + FUNC:ped_disk_add_partition ++FUNC:ped_disk_aix_done ++FUNC:ped_disk_aix_init + FUNC:ped_disk_amiga_done + FUNC:ped_disk_amiga_init + FUNC:ped_disk_bsd_done +@@ -266,18 +294,27 @@ + FUNC:ped_disk_dvh_done + FUNC:ped_disk_dvh_init + FUNC:ped_disk_extended_partition ++FUNC:ped_disk_flag_get_by_name ++FUNC:ped_disk_flag_get_name ++FUNC:ped_disk_flag_next ++FUNC:ped_disk_get_flag + FUNC:ped_disk_get_last_partition_num + FUNC:ped_disk_get_max_partition_geometry + FUNC:ped_disk_get_max_primary_partition_count ++FUNC:ped_disk_get_max_supported_partition_count + FUNC:ped_disk_get_partition ++FUNC:ped_disk_get_partition_alignment + FUNC:ped_disk_get_partition_by_sector + FUNC:ped_disk_get_primary_partition_count + FUNC:ped_disk_gpt_done + FUNC:ped_disk_gpt_init ++FUNC:ped_disk_is_flag_available + FUNC:ped_disk_loop_done + FUNC:ped_disk_loop_init + FUNC:ped_disk_mac_done + FUNC:ped_disk_mac_init ++FUNC:ped_disk_max_partition_length ++FUNC:ped_disk_max_partition_start_sector + FUNC:ped_disk_maximize_partition + FUNC:ped_disk_minimize_extended_partition + FUNC:ped_disk_msdos_done +@@ -290,6 +327,7 @@ + FUNC:ped_disk_print + FUNC:ped_disk_probe + FUNC:ped_disk_remove_partition ++FUNC:ped_disk_set_flag + FUNC:ped_disk_set_partition_geom + FUNC:ped_disk_sun_done + FUNC:ped_disk_sun_init +@@ -298,18 +336,22 @@ + FUNC:ped_disk_type_get_next + FUNC:ped_disk_type_register + FUNC:ped_disk_type_unregister +-FUNC:ped_div_round_to_nearest +-FUNC:ped_div_round_up + FUNC:ped_exception_catch + FUNC:ped_exception_fetch_all ++FUNC:ped_exception_get_handler + FUNC:ped_exception_get_option_string + FUNC:ped_exception_get_type_string + FUNC:ped_exception_leave_all + FUNC:ped_exception_rethrow + FUNC:ped_exception_set_handler + FUNC:ped_exception_throw ++FUNC:ped_file_system_alias_get_next ++FUNC:ped_file_system_alias_register ++FUNC:ped_file_system_alias_unregister + FUNC:ped_file_system_amiga_done + FUNC:ped_file_system_amiga_init ++FUNC:ped_file_system_btrfs_done ++FUNC:ped_file_system_btrfs_init + FUNC:ped_file_system_check + FUNC:ped_file_system_clobber + FUNC:ped_file_system_close +@@ -344,6 +386,8 @@ + FUNC:ped_file_system_ufs_init + FUNC:ped_file_system_xfs_done + FUNC:ped_file_system_xfs_init ++FUNC:ped_file_system_zfs_done ++FUNC:ped_file_system_zfs_init + FUNC:ped_geometry_check + FUNC:ped_geometry_destroy + FUNC:ped_geometry_duplicate +@@ -352,6 +396,7 @@ + FUNC:ped_geometry_map + FUNC:ped_geometry_new + FUNC:ped_geometry_read ++FUNC:ped_geometry_read_alloc + FUNC:ped_geometry_set + FUNC:ped_geometry_set_end + FUNC:ped_geometry_set_start +@@ -376,13 +421,11 @@ + FUNC:ped_partition_is_busy + FUNC:ped_partition_is_flag_available + FUNC:ped_partition_new +-FUNC:ped_partition_print + FUNC:ped_partition_set_flag + FUNC:ped_partition_set_name + FUNC:ped_partition_set_system + FUNC:ped_partition_type_get_name + FUNC:ped_realloc +-FUNC:ped_register_disk_type + FUNC:ped_round_down_to + FUNC:ped_round_to_nearest + FUNC:ped_round_up_to +@@ -406,45 +449,112 @@ + FUNC:ped_unit_parse + FUNC:ped_unit_parse_custom + FUNC:ped_unit_set_default +-FUNC:ped_unregister_disk_type +-FUNC:raw_part_parse ++FUNC:ptt_clear_sectors ++FUNC:ptt_partition_max_length ++FUNC:ptt_partition_max_start_len ++FUNC:ptt_partition_max_start_sector ++FUNC:ptt_read_sector ++FUNC:ptt_read_sectors ++FUNC:ptt_write_sector ++FUNC:quote ++FUNC:quote_n ++FUNC:quotearg ++FUNC:quotearg_alloc ++FUNC:quotearg_alloc_mem ++FUNC:quotearg_buffer ++FUNC:quotearg_char ++FUNC:quotearg_char_mem ++FUNC:quotearg_colon ++FUNC:quotearg_colon_mem ++FUNC:quotearg_custom ++FUNC:quotearg_custom_mem ++FUNC:quotearg_free ++FUNC:quotearg_mem ++FUNC:quotearg_n ++FUNC:quotearg_n_custom ++FUNC:quotearg_n_custom_mem ++FUNC:quotearg_n_mem ++FUNC:quotearg_n_style ++FUNC:quotearg_n_style_mem ++FUNC:quotearg_style ++FUNC:quotearg_style_mem ++FUNC:rpl_re_compile_fastmap ++FUNC:rpl_re_compile_pattern ++FUNC:rpl_re_match ++FUNC:rpl_re_match_2 ++FUNC:rpl_re_search ++FUNC:rpl_re_search_2 ++FUNC:rpl_re_set_registers ++FUNC:rpl_re_set_syntax ++FUNC:rpl_regcomp ++FUNC:rpl_regerror ++FUNC:rpl_regexec ++FUNC:rpl_regfree ++FUNC:safe_read ++FUNC:set_char_quoting ++FUNC:set_custom_quoting ++FUNC:set_program_name ++FUNC:set_quoting_flags ++FUNC:set_quoting_style ++FUNC:strip_trailing_slashes ++FUNC:version_etc ++FUNC:version_etc_ar ++FUNC:version_etc_arn ++FUNC:version_etc_va ++FUNC:x2realloc ++FUNC:xalloc_die ++FUNC:xcalloc ++FUNC:xmalloc ++FUNC:xmemdup ++FUNC:xrealloc ++FUNC:xstrdup ++FUNC:xstrndup ++FUNC:xstrtol ++FUNC:xstrtol_fatal ++FUNC:xstrtoul ++FUNC:xzalloc + NOTYPE:__bss_start + NOTYPE:_edata + NOTYPE:_end +-OBJECT:12:linux_disk_ops +-OBJECT:16:_affs0_type +-OBJECT:16:_affs1_type +-OBJECT:16:_affs2_type +-OBJECT:16:_affs3_type +-OBJECT:16:_affs4_type +-OBJECT:16:_affs5_type +-OBJECT:16:_affs6_type +-OBJECT:16:_affs7_type +-OBJECT:16:_amufs0_type +-OBJECT:16:_amufs1_type +-OBJECT:16:_amufs2_type +-OBJECT:16:_amufs3_type +-OBJECT:16:_amufs4_type +-OBJECT:16:_amufs5_type +-OBJECT:16:_amufs_type +-OBJECT:16:_apfs1_type +-OBJECT:16:_apfs2_type +-OBJECT:16:_asfs_type +-OBJECT:16:fat16_type +-OBJECT:16:fat32_type +-OBJECT:1:fat16 +-OBJECT:24:ops +-OBJECT:324:xfsstats ++OBJECT:16:ped_linux_arch ++OBJECT:24:linux_disk_ops ++OBJECT:32:_affs0_type ++OBJECT:32:_affs1_type ++OBJECT:32:_affs2_type ++OBJECT:32:_affs3_type ++OBJECT:32:_affs4_type ++OBJECT:32:_affs5_type ++OBJECT:32:_affs6_type ++OBJECT:32:_affs7_type ++OBJECT:32:_amufs0_type ++OBJECT:32:_amufs1_type ++OBJECT:32:_amufs2_type ++OBJECT:32:_amufs3_type ++OBJECT:32:_amufs4_type ++OBJECT:32:_amufs5_type ++OBJECT:32:_amufs_type ++OBJECT:32:_apfs1_type ++OBJECT:32:_apfs2_type ++OBJECT:32:_asfs_type ++OBJECT:32:fat16_type ++OBJECT:32:fat32_type ++OBJECT:32:quoting_style_vals ++OBJECT:47:version_etc_copyright ++OBJECT:48:ops ++OBJECT:4:exit_failure + OBJECT:4:ext2_buffer_cache_pool_size + OBJECT:4:ext2_hash_bits + OBJECT:4:ext2_relocator_pool_size +-OBJECT:4:hfs_block + OBJECT:4:hfs_block_count +-OBJECT:4:hfsp_block + OBJECT:4:hfsp_block_count +-OBJECT:4:ped_alignment_any +-OBJECT:4:ped_alignment_none +-OBJECT:4:ped_architecture + OBJECT:4:ped_exception ++OBJECT:72:quoting_style_args + OBJECT:8:_bitmap +-OBJECT:8:ped_linux_arch ++OBJECT:8:argmatch_die ++OBJECT:8:hfs_block ++OBJECT:8:hfsp_block ++OBJECT:8:ped_alignment_any ++OBJECT:8:ped_alignment_none ++OBJECT:8:ped_architecture ++OBJECT:8:program_name ++OBJECT:8:rpl_re_syntax_options --- parted-2.3.orig/debian/patches/update-ext4-code.patch +++ parted-2.3/debian/patches/update-ext4-code.patch @@ -0,0 +1,336 @@ +From: Colin Watson +Forwarded: http://lists.alioth.debian.org/pipermail/parted-devel/2009-January/002503.html +Bug: http://parted.alioth.debian.org/cgi-bin/trac.cgi/ticket/188 +Last-Update: 2009-01-05 +Description: Improve ext4 code + +Index: b/libparted/fs/ext2/ext2.c +=================================================================== +--- a/libparted/fs/ext2/ext2.c ++++ b/libparted/fs/ext2/ext2.c +@@ -185,8 +185,8 @@ + + fs->gd[group].bg_free_blocks_count = PED_CPU_TO_LE16 + (EXT2_GROUP_FREE_BLOCKS_COUNT(fs->gd[group]) + diff); +- fs->sb.s_free_blocks_count = PED_CPU_TO_LE32 +- (EXT2_SUPER_FREE_BLOCKS_COUNT(fs->sb) + diff); ++ ext2_super_free_blocks_count_set(&fs->sb, ++ EXT2_SUPER_FREE_BLOCKS_COUNT(fs->sb) + diff); + fs->metadirty |= EXT2_META_SB | EXT2_META_GD; + } + return 1; +@@ -606,7 +606,7 @@ + if (wmeta == EXT2_META_CLEAN) + return 1; + +- fs->sb.s_r_blocks_count = PED_CPU_TO_LE32 ( ++ ext2_super_r_blocks_count_set(&fs->sb, + fs->r_frac * (loff_t)EXT2_SUPER_BLOCKS_COUNT(fs->sb) + / 100); + +@@ -722,7 +722,8 @@ + EXT2_FEATURE_COMPAT_HAS_DIR_INDEX)) || + (EXT2_SUPER_FEATURE_INCOMPAT(fs->sb) + & ~(EXT2_FEATURE_INCOMPAT_FILETYPE | +- EXT3_FEATURE_INCOMPAT_RECOVER)) || ++ EXT3_FEATURE_INCOMPAT_RECOVER | ++ EXT4_FEATURE_INCOMPAT_64BIT)) || + (EXT2_SUPER_FEATURE_RO_COMPAT(fs->sb) + & ~(EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER | + EXT2_FEATURE_RO_COMPAT_LARGE_FILE))) +Index: b/libparted/fs/ext2/ext2_fs.h +=================================================================== +--- a/libparted/fs/ext2/ext2_fs.h ++++ b/libparted/fs/ext2/ext2_fs.h +@@ -176,9 +176,9 @@ + struct ext2_super_block + { + uint32_t s_inodes_count; /* Inodes count */ +- uint32_t s_blocks_count; /* Blocks count */ +- uint32_t s_r_blocks_count; /* Reserved blocks count */ +- uint32_t s_free_blocks_count; /* Free blocks count */ ++ uint32_t s_blocks_count_lo; /* Blocks count */ ++ uint32_t s_r_blocks_count_lo; /* Reserved blocks count */ ++ uint32_t s_free_blocks_count_lo; /* Free blocks count */ + uint32_t s_free_inodes_count; /* Free inodes count */ + uint32_t s_first_data_block; /* First Data Block */ + uint32_t s_log_block_size; /* Block size */ +@@ -237,10 +237,38 @@ + uint32_t s_journal_inum; /* inode number of journal file */ + uint32_t s_journal_dev; /* device number of journal file */ + uint32_t s_last_orphan; /* start of list of inodes to delete */ ++ uint32_t s_hash_seed[4]; /* HTREE hash seed */ ++ uint8_t s_def_hash_version; /* Default hash version to use */ ++ uint8_t s_reserved_char_pad; ++ uint16_t s_desc_size; /* size of group descriptor */ ++ uint32_t s_default_mount_opts; ++ uint32_t s_first_meta_bg; /* First metablock block group */ ++ uint32_t s_mkfs_time; /* When the filesystem was created */ ++ uint32_t s_jnl_blocks[17]; /* Backup of the journal inode */ ++ /* 64bit support valid if EXT4_FEATURE_INCOMPAT_64BIT */ ++ uint32_t s_blocks_count_hi; /* Blocks count */ ++ uint32_t s_r_blocks_count_hi; /* Reserved blocks count */ ++ uint32_t s_free_blocks_count_hi; /* Free blocks count */ ++ uint16_t s_min_extra_isize; /* All inodes have at least # bytes */ ++ uint16_t s_want_extra_isize; /* New inodes should reserve # bytes */ ++ uint32_t s_flags; /* Miscellaneous flags */ ++ uint16_t s_raid_stride; /* RAID stride */ ++ uint16_t s_mmp_interval; /* # seconds to wait in MMP checking */ ++ uint64_t s_mmp_block; /* Block for multi-mount protection */ ++ uint32_t s_raid_stripe_width; /* blocks on all data disks (N*stride) */ ++ uint8_t s_log_groups_per_flex; /* FLEX_BG group size */ ++ uint8_t s_reserved_char_pad2; ++ uint16_t s_reserved_pad; + +- uint32_t s_reserved[197]; /* Padding to the end of the block */ ++ uint32_t s_reserved[162]; /* Padding to the end of the block */ + }; + ++#define EXT2_SUPER_FEATURE_COMPAT(sb) (PED_LE32_TO_CPU((sb).s_feature_compat)) ++#define EXT2_SUPER_FEATURE_INCOMPAT(sb) \ ++ (PED_LE32_TO_CPU((sb).s_feature_incompat)) ++#define EXT2_SUPER_FEATURE_RO_COMPAT(sb) \ ++ (PED_LE32_TO_CPU((sb).s_feature_ro_compat)) ++ + #define EXT2_DIRENT_INODE(dir_ent) (PED_LE32_TO_CPU((dir_ent).inode)) + #define EXT2_DIRENT_REC_LEN(dir_ent) (PED_LE16_TO_CPU((dir_ent).rec_len)) + #define EXT2_DIRENT_NAME_LEN(dir_ent) ((dir_ent).name_len) +@@ -273,10 +301,45 @@ + #define EXT2_INODE_BLOCK(inode, blk) (PED_LE32_TO_CPU((inode).i_block[blk])) + + #define EXT2_SUPER_INODES_COUNT(sb) (PED_LE32_TO_CPU((sb).s_inodes_count)) +-#define EXT2_SUPER_BLOCKS_COUNT(sb) (PED_LE32_TO_CPU((sb).s_blocks_count)) +-#define EXT2_SUPER_R_BLOCKS_COUNT(sb) (PED_LE32_TO_CPU((sb).s_r_blocks_count)) ++ ++#define EXT2_SUPER_BLOCKS_COUNT(sb) \ ++ ((EXT2_SUPER_FEATURE_INCOMPAT((sb)) & EXT4_FEATURE_INCOMPAT_64BIT) \ ++ ? (((uint64_t) PED_LE32_TO_CPU((sb).s_blocks_count_hi) << 32) \ ++ | PED_LE32_TO_CPU((sb).s_blocks_count_lo)) \ ++ : PED_LE32_TO_CPU((sb).s_blocks_count_lo)) ++#define EXT2_SUPER_R_BLOCKS_COUNT(sb) \ ++ ((EXT2_SUPER_FEATURE_INCOMPAT((sb)) & EXT4_FEATURE_INCOMPAT_64BIT) \ ++ ? (((uint64_t) PED_LE32_TO_CPU((sb).s_r_blocks_count_hi) << 32) \ ++ | PED_LE32_TO_CPU((sb).s_r_blocks_count_lo)) \ ++ : PED_LE32_TO_CPU((sb).s_r_blocks_count_lo)) ++ + #define EXT2_SUPER_FREE_BLOCKS_COUNT(sb) \ +- (PED_LE32_TO_CPU((sb).s_free_blocks_count)) ++ ((EXT2_SUPER_FEATURE_INCOMPAT((sb)) & EXT4_FEATURE_INCOMPAT_64BIT) \ ++ ? (((uint64_t) PED_LE32_TO_CPU((sb).s_free_blocks_count_hi) << 32) \ ++ | PED_LE32_TO_CPU((sb).s_free_blocks_count_lo)) \ ++ : PED_LE32_TO_CPU((sb).s_free_blocks_count_lo)) ++ ++static inline void ext2_super_blocks_count_set(struct ext2_super_block *sb, uint64_t blk) ++{ ++ sb->s_blocks_count_lo = PED_CPU_TO_LE32((uint32_t) blk); ++ if (EXT2_SUPER_FEATURE_INCOMPAT(*sb) & EXT4_FEATURE_INCOMPAT_64BIT) ++ sb->s_blocks_count_hi = PED_CPU_TO_LE32(blk >> 32); ++} ++ ++static inline void ext2_super_free_blocks_count_set(struct ext2_super_block *sb, uint64_t blk) ++{ ++ sb->s_free_blocks_count_lo = PED_CPU_TO_LE32((uint32_t) blk); ++ if (EXT2_SUPER_FEATURE_INCOMPAT(*sb) & EXT4_FEATURE_INCOMPAT_64BIT) ++ sb->s_free_blocks_count_hi = PED_CPU_TO_LE32(blk >> 32); ++} ++ ++static inline void ext2_super_r_blocks_count_set(struct ext2_super_block *sb, uint64_t blk) ++{ ++ sb->s_r_blocks_count_lo = PED_CPU_TO_LE32((uint32_t) blk); ++ if (EXT2_SUPER_FEATURE_INCOMPAT(*sb) & EXT4_FEATURE_INCOMPAT_64BIT) ++ sb->s_r_blocks_count_hi = PED_CPU_TO_LE32(blk >> 32); ++} ++ + #define EXT2_SUPER_FREE_INODES_COUNT(sb) \ + (PED_LE32_TO_CPU((sb).s_free_inodes_count)) + #define EXT2_SUPER_FIRST_DATA_BLOCK(sb) \ +@@ -310,11 +373,6 @@ + #define EXT2_SUPER_FIRST_INO(sb) (PED_LE32_TO_CPU((sb).s_first_ino)) + #define EXT2_SUPER_INODE_SIZE(sb) (PED_LE16_TO_CPU((sb).s_inode_size)) + #define EXT2_SUPER_BLOCK_GROUP_NR(sb) (PED_LE16_TO_CPU((sb).s_block_group_nr)) +-#define EXT2_SUPER_FEATURE_COMPAT(sb) (PED_LE32_TO_CPU((sb).s_feature_compat)) +-#define EXT2_SUPER_FEATURE_INCOMPAT(sb) \ +- (PED_LE32_TO_CPU((sb).s_feature_incompat)) +-#define EXT2_SUPER_FEATURE_RO_COMPAT(sb) \ +- (PED_LE32_TO_CPU((sb).s_feature_ro_compat)) + #define EXT2_SUPER_UUID(sb) ((sb).s_uuid) + #define EXT2_SUPER_VOLUME_NAME(sb) ((sb).s_volume_name) + #define EXT2_SUPER_LAST_MOUNTED(sb) ((sb).s_last_mounted) +Index: b/libparted/fs/ext2/ext2_mkfs.c +=================================================================== +--- a/libparted/fs/ext2/ext2_mkfs.c ++++ b/libparted/fs/ext2/ext2_mkfs.c +@@ -240,7 +240,7 @@ + gd[i].bg_reserved[1] = 0; + gd[i].bg_reserved[2] = 0; + +- sb->s_free_blocks_count = PED_CPU_TO_LE32 ( ++ ext2_super_free_blocks_count_set(sb, + EXT2_SUPER_FREE_BLOCKS_COUNT(*sb) + + EXT2_GROUP_FREE_BLOCKS_COUNT(gd[i])); + } +@@ -425,14 +425,14 @@ + memset(sb, 0, 1024); + + sb->s_inodes_count = PED_CPU_TO_LE32(numgroups * inodes_per_group); +- sb->s_blocks_count = PED_CPU_TO_LE32(numblocks); +- sb->s_r_blocks_count = PED_CPU_TO_LE32(((uint64_t)numblocks ++ ext2_super_blocks_count_set(sb, numblocks); ++ ext2_super_r_blocks_count_set(sb, ((uint64_t)numblocks + * reserved_block_percentage) / 100); + + /* hack: this get's inc'd as we go through each group in + * ext2_mkfs_write_meta() + */ +- sb->s_free_blocks_count = 0; ++ ext2_super_free_blocks_count_set(sb, 0); + sb->s_free_inodes_count = PED_CPU_TO_LE32 (numgroups + * inodes_per_group); + sb->s_first_data_block = PED_CPU_TO_LE32(first_block); +Index: a/libparted/fs/ext2/ext2_resize.c +=================================================================== +--- a/libparted/fs/ext2/ext2_resize.c ++++ a/libparted/fs/ext2/ext2_resize.c +@@ -105,9 +105,9 @@ + fs->sb.s_inodes_count = PED_CPU_TO_LE32( + EXT2_SUPER_INODES_COUNT(fs->sb) + + EXT2_SUPER_INODES_PER_GROUP(fs->sb)); +- fs->sb.s_blocks_count = PED_CPU_TO_LE32( ++ ext2_super_blocks_count_set(&fs->sb, + EXT2_SUPER_BLOCKS_COUNT(fs->sb) + groupsize); +- fs->sb.s_free_blocks_count = PED_CPU_TO_LE32( ++ ext2_super_free_blocks_count_set(&fs->sb, + EXT2_SUPER_FREE_BLOCKS_COUNT(fs->sb) + groupsize - admin); + fs->sb.s_free_inodes_count = PED_CPU_TO_LE32( + EXT2_SUPER_FREE_INODES_COUNT(fs->sb) +@@ -304,9 +304,9 @@ + fs->sb.s_inodes_count = PED_CPU_TO_LE32( + EXT2_SUPER_INODES_COUNT(fs->sb) + - EXT2_SUPER_INODES_PER_GROUP(fs->sb)); +- fs->sb.s_blocks_count = PED_CPU_TO_LE32( ++ ext2_super_blocks_count_set(&fs->sb, + EXT2_SUPER_BLOCKS_COUNT(fs->sb) - groupsize); +- fs->sb.s_free_blocks_count = PED_CPU_TO_LE32( ++ ext2_super_free_blocks_count_set(&fs->sb, + EXT2_SUPER_FREE_BLOCKS_COUNT(fs->sb) - (groupsize - admin)); + fs->sb.s_free_inodes_count = PED_CPU_TO_LE32( + EXT2_SUPER_FREE_INODES_COUNT(fs->sb) +@@ -358,7 +358,7 @@ + for (i=gblocks;isb.s_blocks_count = PED_CPU_TO_LE32( ++ ext2_super_blocks_count_set(&fs->sb, + EXT2_SUPER_BLOCKS_COUNT(fs->sb) + newsize - gblocks); + fs->metadirty |= EXT2_META_SB; + +@@ -433,9 +433,9 @@ + } + + i = gblocks - newsize; +- fs->sb.s_blocks_count = PED_CPU_TO_LE32( ++ ext2_super_blocks_count_set(&fs->sb, + EXT2_SUPER_BLOCKS_COUNT(fs->sb) - i); +- fs->sb.s_free_blocks_count = PED_CPU_TO_LE32( ++ ext2_super_free_blocks_count_set(&fs->sb, + EXT2_SUPER_FREE_BLOCKS_COUNT(fs->sb) - i); + fs->gd[group].bg_free_blocks_count = PED_CPU_TO_LE16( + EXT2_GROUP_FREE_BLOCKS_COUNT(fs->gd[group]) - i); +@@ -685,6 +685,14 @@ + fs->metadirty |= EXT2_META_SB; + } + ++ if (EXT2_SUPER_FEATURE_INCOMPAT(fs->sb) ++ & EXT4_FEATURE_INCOMPAT_EXTENTS) { ++ ped_exception_throw ( ++ PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL, ++ _("Parted cannot resize ext4 file systems yet.")); ++ return 0; ++ } ++ + if (!ext2_determine_itoffset(fs) && ped_exception_throw ( + PED_EXCEPTION_WARNING, + PED_EXCEPTION_OK_CANCEL, +Index: b/libparted/fs/ext2/interface.c +=================================================================== +--- a/libparted/fs/ext2/interface.c ++++ b/libparted/fs/ext2/interface.c +@@ -28,6 +28,7 @@ + + static PedFileSystemType _ext2_type; + static PedFileSystemType _ext3_type; ++static PedFileSystemType _ext4_type; + + struct ext2_dev_handle* ext2_make_dev_handle_from_parted_geometry(PedGeometry* geom); + +@@ -51,29 +52,25 @@ + + is_ext3 = (EXT2_SUPER_FEATURE_COMPAT (*sb) + & EXT3_FEATURE_COMPAT_HAS_JOURNAL) != 0; +- if (is_ext3) { +- is_ext4 = ((EXT2_SUPER_FEATURE_RO_COMPAT (*sb) +- & EXT4_FEATURE_RO_COMPAT_HUGE_FILE) +- || (EXT2_SUPER_FEATURE_RO_COMPAT (*sb) +- & EXT4_FEATURE_RO_COMPAT_GDT_CSUM) +- || (EXT2_SUPER_FEATURE_RO_COMPAT (*sb) +- & EXT4_FEATURE_RO_COMPAT_DIR_NLINK) +- || (EXT2_SUPER_FEATURE_INCOMPAT (*sb) +- & EXT4_FEATURE_INCOMPAT_EXTENTS) +- || (EXT2_SUPER_FEATURE_INCOMPAT (*sb) +- & EXT4_FEATURE_INCOMPAT_64BIT) +- || (EXT2_SUPER_FEATURE_INCOMPAT (*sb) +- & EXT4_FEATURE_INCOMPAT_FLEX_BG)); +- if (is_ext4) +- is_ext3 = 0; +- } ++ is_ext4 = ((EXT2_SUPER_FEATURE_RO_COMPAT (*sb) ++ & EXT4_FEATURE_RO_COMPAT_HUGE_FILE) ++ || (EXT2_SUPER_FEATURE_RO_COMPAT (*sb) ++ & EXT4_FEATURE_RO_COMPAT_GDT_CSUM) ++ || (EXT2_SUPER_FEATURE_RO_COMPAT (*sb) ++ & EXT4_FEATURE_RO_COMPAT_DIR_NLINK) ++ || (EXT2_SUPER_FEATURE_INCOMPAT (*sb) ++ & EXT4_FEATURE_INCOMPAT_EXTENTS) ++ || (EXT2_SUPER_FEATURE_INCOMPAT (*sb) ++ & EXT4_FEATURE_INCOMPAT_64BIT) ++ || (EXT2_SUPER_FEATURE_INCOMPAT (*sb) ++ & EXT4_FEATURE_INCOMPAT_FLEX_BG)); + free (sb); + + if (expect_ext_ver == 2 && (is_ext3 || is_ext4)) + return NULL; +- if (expect_ext_ver == 3 && !is_ext3) ++ if (expect_ext_ver == 3 && (!is_ext3 || is_ext4)) + return NULL; +- else if (expect_ext_ver == 4 && !is_ext4) ++ if (expect_ext_ver == 4 && !is_ext4) + return NULL; + + if (version > 0 && group_nr > 0) { +@@ -366,6 +363,18 @@ + + static PedFileSystemOps _ext4_ops = { + probe: _ext4_probe, ++#ifndef DISCOVER_ONLY ++ clobber: _ext2_clobber, ++ open: _ext2_open, ++ create: NULL, ++ close: _ext2_close, ++ check: _ext2_check, ++ resize: _ext2_resize, ++ copy: NULL, ++ get_create_constraint: _ext2_get_create_constraint, ++ get_copy_constraint: NULL, ++ get_resize_constraint: _ext2_get_resize_constraint ++#else /* !DISCOVER_ONLY */ + clobber: NULL, + open: NULL, + create: NULL, +@@ -376,6 +385,7 @@ + get_create_constraint: NULL, + get_copy_constraint: NULL, + get_resize_constraint: NULL ++#endif /* !DISCOVER_ONLY */ + }; + + #define EXT23_BLOCK_SIZES ((int[6]){512, 1024, 2048, 4096, 8192, 0}) --- parted-2.3.orig/debian/patches/zero-length-devices.patch +++ parted-2.3/debian/patches/zero-length-devices.patch @@ -0,0 +1,28 @@ +Description: Ignore zero-length devices + There seems no point in complaining about these. The problem with throwing + an exception is that it's difficult for partitioners such as partman to + programmatically distinguish between this kind of thing and some more + serious error that actually merits letting the user know. +Bug-Debian: http://bugs.debian.org/602533 +Forwarded: http://lists.gnu.org/archive/html/bug-parted/2010-11/msg00011.html +Author: Colin Watson +Reviewed-by: Otavio Salvador +Last-Update: 2010-11-19 + +Index: b/libparted/arch/linux.c +=================================================================== +--- a/libparted/arch/linux.c ++++ b/libparted/arch/linux.c +@@ -1180,6 +1180,12 @@ + if (_device_probe_geometry (dev)) { + ped_exception_leave_all (); + } else { ++ if (!_device_get_length (dev)) { ++ ped_exception_catch (); ++ ped_exception_leave_all (); ++ goto error_close_dev; ++ } ++ + /* hack to allow use of files, for testing */ + ped_exception_catch (); + ped_exception_leave_all (); --- parted-2.3.orig/debian/patches/zfs.patch +++ parted-2.3/debian/patches/zfs.patch @@ -0,0 +1,190 @@ +diff -Nurp a/configure.ac b/configure.ac +--- a/configure.ac 2010-08-31 12:42:08.000000000 +0200 ++++ b/configure.ac 2010-08-31 12:45:00.000000000 +0200 +@@ -639,6 +639,7 @@ libparted/fs/ntfs/Makefile + libparted/fs/reiserfs/Makefile + libparted/fs/ufs/Makefile + libparted/fs/xfs/Makefile ++libparted/fs/zfs/Makefile + libparted/tests/Makefile + libparted.pc + parted/Makefile +diff -Nurp a/libparted/fs/Makefile.am b/libparted/fs/Makefile.am +--- a/libparted/fs/Makefile.am 2010-08-31 12:42:08.000000000 +0200 ++++ b/libparted/fs/Makefile.am 2010-08-31 12:43:24.000000000 +0200 +@@ -4,7 +4,7 @@ + # + # This file may be modified and/or distributed without restriction. + +-SUBDIRS = amiga ext2 ufs fat ntfs hfs linux_swap xfs jfs reiserfs btrfs # bfs ++SUBDIRS = amiga ext2 ufs fat ntfs hfs linux_swap xfs jfs reiserfs btrfs zfs # bfs + + partedincludedir = -I$(top_srcdir)/include + noinst_LTLIBRARIES = libfs.la +@@ -25,7 +25,8 @@ libfs_la_LIBADD = $(UUID_LIBS) \ + xfs/libxfs.la \ + jfs/libjfs.la \ + reiserfs/libreiserfs.la \ +- btrfs/libbtrfs.la ++ btrfs/libbtrfs.la \ ++ zfs/libzfs.la + # bfs/libbfs.la + + libfs_la_SOURCES = +diff -Nurp a/libparted/fs/zfs/Makefile.am b/libparted/fs/zfs/Makefile.am +--- a/libparted/fs/zfs/Makefile.am 1970-01-01 01:00:00.000000000 +0100 ++++ b/libparted/fs/zfs/Makefile.am 2010-08-31 12:42:50.000000000 +0200 +@@ -0,0 +1,8 @@ ++partedincludedir = -I$(top_srcdir)/include ++ ++noinst_LTLIBRARIES = libzfs.la ++libzfs_la_SOURCES = zfs.c ++ ++INCLUDES = $(partedincludedir) $(INTLINCS) ++ ++MAINTAINERCLEANFILES = Makefile.in +diff -Nurp a/libparted/fs/zfs/zfs.c b/libparted/fs/zfs/zfs.c +--- a/libparted/fs/zfs/zfs.c 1970-01-01 01:00:00.000000000 +0100 ++++ b/libparted/fs/zfs/zfs.c 2010-08-31 12:42:50.000000000 +0200 +@@ -0,0 +1,106 @@ ++/* ++ libparted - a library for manipulating disk partitions ++ Copyright (C) 2000, 2007, 2009-2010 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 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 . ++*/ ++ ++#include ++ ++#include ++#include ++ ++#if ENABLE_NLS ++# include ++# define _(String) dgettext (PACKAGE, String) ++#else ++# define _(String) (String) ++#endif /* ENABLE_NLS */ ++ ++#include ++ ++#define ZFS_BLOCK_SIZES ((int[2]){512, 0}) ++ ++#define ZFS_SIGNATURE 0x00bab10c ++ ++struct zfs_uberblock ++{ ++ uint64_t signature; ++ uint64_t version; ++}; ++ ++static PedGeometry* ++zfs_probe (PedGeometry* geom) ++{ ++ uint8_t buf[512]; ++ struct zfs_uberblock *uber = (void *) buf; ++ ++ if (!ped_geometry_read (geom, buf, 256, 1)) ++ return 0; ++ ++ if ((le64toh (uber->signature) == ZFS_SIGNATURE ++ || be64toh (uber->signature) == ZFS_SIGNATURE) ++ && uber->version != 0) ++ return ped_geometry_new (geom->dev, geom->start, geom->length); ++ else ++ return NULL; ++} ++ ++#ifndef DISCOVER_ONLY ++static int ++zfs_clobber (PedGeometry* geom) ++{ ++ char buf[512]; ++ ++ memset (buf, 0, 512); ++ return ped_geometry_write (geom, buf, 256, 1); ++} ++#endif /* !DISCOVER_ONLY */ ++ ++static PedFileSystemOps zfs_ops = { ++ probe: zfs_probe, ++#ifndef DISCOVER_ONLY ++ clobber: zfs_clobber, ++#else ++ clobber: NULL, ++#endif ++ open: NULL, ++ create: NULL, ++ close: NULL, ++ check: NULL, ++ copy: NULL, ++ resize: NULL, ++ get_create_constraint: NULL, ++ get_resize_constraint: NULL, ++ get_copy_constraint: NULL ++}; ++ ++static PedFileSystemType zfs_type = { ++ next: NULL, ++ ops: &zfs_ops, ++ name: "zfs", ++ block_sizes: ZFS_BLOCK_SIZES ++}; ++ ++void ++ped_file_system_zfs_init () ++{ ++ ped_file_system_type_register (&zfs_type); ++} ++ ++void ++ped_file_system_zfs_done () ++{ ++ ped_file_system_type_unregister (&zfs_type); ++} +diff -Nurp a/libparted/libparted.c b/libparted/libparted.c +--- a/libparted/libparted.c 2010-08-31 12:42:08.000000000 +0200 ++++ b/libparted/libparted.c 2010-08-31 12:44:20.000000000 +0200 +@@ -110,6 +110,7 @@ extern void ped_file_system_hfs_init (vo + extern void ped_file_system_fat_init (void); + extern void ped_file_system_ext2_init (void); + extern void ped_file_system_btrfs_init (void); ++extern void ped_file_system_zfs_init (void); + + static void + init_file_system_types () +@@ -125,6 +126,7 @@ init_file_system_types () + ped_file_system_fat_init (); + ped_file_system_ext2_init (); + ped_file_system_btrfs_init (); ++ ped_file_system_zfs_init (); + } + #endif /* ENABLE_FS */ + +@@ -191,6 +193,7 @@ extern void ped_file_system_reiserfs_don + extern void ped_file_system_ufs_done (void); + extern void ped_file_system_xfs_done (void); + extern void ped_file_system_btrfs_done (void); ++extern void ped_file_system_zfs_done (void); + extern void ped_file_system_amiga_done (void); + + static void +@@ -206,6 +209,7 @@ done_file_system_types () + ped_file_system_ufs_done (); + ped_file_system_xfs_done (); + ped_file_system_btrfs_done (); ++ ped_file_system_zfs_done (); + ped_file_system_amiga_done (); + } + #endif /* ENABLE_FS */ --- parted-2.3.orig/debian/rules +++ parted-2.3/debian/rules @@ -0,0 +1,426 @@ +#!/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.50 2003/02/19 11:13:18 timshel Exp $ +# +# Copyright (C) 1999, 2000, 2001, 2002 Timshel Knoll +# Licensed under the terms of the GNU General Public License +# +# Based (a long time ago) 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 has to be exported to make some magic below work. +export DH_OPTIONS + +# The version of the debian package, used in naming the udeb +DEBPKGVER = $(shell dpkg-parsechangelog | sed -n -e '/^Version: /{s///;p;q;}') + +# Append the upstream version to non-lib package names? This is useful when +# building packages of the development versions of parted (eg. to build a +# parted1.5 package) +# BINPKGVER = $(DEBPKGVER:-%=) + +# The first version of the package to build with the current LIBSONAME +# This should be changed to the current version when LIBSONAME is changed ... +DEPVER = 2.2-1 + +# 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 = 0 + +# 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 = BINPKGVER DEPVER LIBSONAME DEB_HOST_MULTIARCH + +# 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$(LIBSONAME)debian1.files \ + debian/libparted$(LIBSONAME)debian1.lintian-overrides \ + debian/libparted$(LIBSONAME)-dev.files \ + debian/libparted$(LIBSONAME)-i18n.files \ + +ifneq (, $(BINPKGVER)) +GENFILES += debian/parted$(BINPKGVER).files \ + debian/parted$(BINPKGVER)-doc.files \ + debian/parted$(BINPKGVER)-doc.docs \ + debian/parted$(BINPKGVER)-doc.postinst \ + debian/parted$(BINPKGVER)-doc.prerm +endif + +ifeq (, $(DEB_BUILD_ARCH)) +DEB_BUILD_ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH) +endif + +ifeq (, $(DEB_BUILD_ARCH_OS)) +DEB_BUILD_ARCH_OS = $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS) +endif + +ifeq (, $(DEB_BUILD_GNU_TYPE)) +DEB_BUILD_GNU_TYPE = $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +endif + +ifeq (, $(DEB_HOST_ARCH)) +DEB_HOST_ARCH = $(shell dpkg-architecture -qDEB_HOST_ARCH) +endif + +ifeq (, $(DEB_HOST_GNU_TYPE)) +DEB_HOST_GNU_TYPE = $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +endif + +ifeq (, $(DEB_BUILD_GNU_SYSTEM)) +DEB_BUILD_GNU_SYSTEM = $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM) +endif + +ifeq (, $(DEB_HOST_MULTIARCH)) +DEB_HOST_MULTIARCH = $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) +endif + +ifeq (, $(ARCH)) +ARCH = $(DEB_BUILD_ARCH) +endif + +CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS) +CFLAGS := $(shell dpkg-buildflags --get CFLAGS) +UDEB_CFLAGS := $(patsubst -O2,-Os,$(CFLAGS)) +LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) +buildflags := CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" +udeb_buildflags := CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(UDEB_CFLAGS)" \ + LDFLAGS="$(LDFLAGS)" + +# Tell automake to produce verbose build logs. +export V := 1 + +# This is a workaround for a m68k compiler bug ... +ifeq (m68k, $(DEB_BUILD_ARCH)) + CONFFLAGS += --disable-Werror +endif +ifeq (s390, $(DEB_BUILD_ARCH)) + CONFFLAGS += --disable-Werror +endif +ifeq (gnu, $(DEB_BUILD_GNU_SYSTEM)) + CONFFLAGS += --disable-Werror +endif + +# Cell partition tables get misdetected for pc98; we don't need pc98 support +# on powerpc +ifeq (powerpc, $(DEB_HOST_ARCH)) + CONFFLAGS += --disable-pc98 +endif + +# Workaround/fix bug #442308 +CFLAGS += -fgnu89-inline +UDEB_CFLAGS += -fgnu89-inline + +# Enable device-mapper only on Linux +ifeq (linux, $(DEB_BUILD_ARCH_OS)) + CONFDEVMAPPER = --enable-device-mapper +else + CONFDEVMAPPER = --disable-device-mapper +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$(LIBSONAME)debian1.%: debian/libparted.% + cp $< $@ + +debian/libparted$(LIBSONAME)%: debian/libparted% + cp $< $@ + +debian/parted$(BINPKGVER)%: debian/parted% + cp $< $@ + +# by default, do something sane ... +default: echo-vars + +echo-vars: + @echo "Try: debian/rules [configure|build|install|binary|binary-arch|binary-indep|clean]" + @echo "CPPFLAGS: $(CPPFLAGS)" + @echo "CFLAGS: $(CFLAGS)" + @echo "LDFLAGS: $(LDFLAGS)" + @echo "DEB_BUILD_ARCH: $(DEB_BUILD_ARCH)" + @echo "DEB_BUILD_GNU_TYPE: $(DEB_BUILD_GNU_TYPE)" + @echo "DEB_HOST_GNU_TYPE: $(DEB_HOST_GNU_TYPE)" + @echo "LIBSONAME: $(LIBSONAME)" + @echo "BINPKGVER: $(BINPKGVER)" + @echo "GENFILES: $(GENFILES)" + @echo "SUBSTLIST: $(SUBSTLIST)" + +packaging-files: $(GENFILES) + touch $@ + +debian/stamp-autoreconf: debian/stamp-patched + dh_autoreconf + touch $@ + +build-deb/config.status: debian/stamp-autoreconf + dh_testdir + [ -d build-deb ] || mkdir build-deb + +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-deb && $(buildflags) ../configure --prefix=/usr \ + --sbindir=/sbin --mandir=\$${prefix}/share/man \ + --infodir=\$${prefix}/share/info --enable-shared \ + --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \ + $(CONFDEVMAPPER) \ + $(CONFFLAGS) + touch $@ + +build-udeb/config.status: debian/stamp-autoreconf + dh_testdir + [ -d build-udeb ] || mkdir build-udeb + + cd build-udeb && $(udeb_buildflags) ac_cv_header_execinfo_h=no ../configure --prefix=/usr \ + --sbindir=/sbin --libdir=/lib --mandir=\$${prefix}/share/man \ + --infodir=\$${prefix}/share/info --enable-shared --disable-static \ + --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \ + --without-readline $(CONFDEVMAPPER) \ + $(CONFFLAGS) + touch $@ + +build-dbg/config.status: debian/stamp-autoreconf + dh_testdir + [ -d build-dbg ] || mkdir build-dbg + +# Add here commands to configure the package. + cd build-dbg && $(buildflags) ../configure --prefix=/usr \ + --enable-mtrace --disable-shared $(CONFFLAGS) \ + --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \ + $(CONFDEVMAPPER) + + touch $@ + +build build-arch: build-deb build-udeb build-dbg +build-indep: build-deb + +build-deb: build-deb/build-stamp +build-deb/build-stamp: build-deb/config.status + dh_testdir + + $(MAKE) -C build-deb + +# By now just use ABI detection on amd64 machines. + if [ $(DEB_BUILD_ARCH) = "amd64" ]; then \ + $(MAKE) -C build-deb check-abi; \ + fi + + touch $@ + +build-udeb: build-udeb/build-stamp +build-udeb/build-stamp: build-udeb/config.status + dh_testdir + +# Only build binaries + $(MAKE) -C build-udeb/lib + $(MAKE) -C build-udeb/libparted + $(MAKE) -C build-udeb/parted + + touch $@ + +build-dbg: build-dbg/build-stamp +build-dbg/build-stamp: build-dbg/config.status + 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/lib + $(MAKE) -C build-dbg/libparted + + touch $@ + +clean: unpatch packaging-files + dh_testdir + dh_testroot + +# Add here commands to clean up after the build process + rm -rf packaging-files + rm -rf install install-deb install-udeb install-dbg + rm -rf build build-deb build-udeb build-dbg + +# Remove all debian/libparted*.* except for libparted.*, +# libparted-dev.*, and libparted-i18n.* + @for file in debian/libparted*; do \ + file="`basename $$file`"; \ + case "$$file" in \ + libparted.*|libparted-dev.*|libparted-i18n.*) \ + ;; \ + *) \ + echo "rm -rf \"debian/$$file\""; \ + rm -rf "debian/$$file" ;; \ + esac; \ + done + + dh_autoreconf_clean + rm -f debian/stamp-autoreconf + dh_clean + +install: install-deb install-udeb install-dbg + touch $@ + +install-deb: DH_OPTIONS=-Nparted$(BINPKGVER)-udeb -Nlibparted$(LIBSONAME)-udeb -Nlibparted$(LIBSONAME)debian1-dbg +install-deb: build-deb packaging-files + dh_testdir + dh_testroot + dh_prep + dh_installdirs + + $(MAKE) -C build-deb 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/$(DEB_HOST_MULTIARCH)/libparted.so.x.x.x rather than +# being relative & pointing to the current directory + @(cd debian/tmp/usr/lib; \ + SONAME=`ls libparted.so.$(LIBSONAME).*.* | \ + 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, set DEPVER to the current" \ + "version of the" >&2; \ + echo " *** package that you are building." >&2; \ + exit 1; \ + fi; \ + ln -sf /lib/$(DEB_HOST_MULTIARCH)/`readlink libparted.so` \ + libparted.so) + + exit +# Make sure the shared libs are in /lib (otherwise there's no point +# installing the executable to /sbin ...) :-) + mkdir -p debian/tmp/lib/$(DEB_HOST_MULTIARCH) + mv debian/tmp/usr/lib/*.so.* debian/tmp/lib/$(DEB_HOST_MULTIARCH) + rm -f debian/tmp/usr/lib/*.la + + 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 + touch $@ + +install-udeb: DH_OPTIONS=-pparted$(BINPKGVER)-udeb -plibparted$(LIBSONAME)-udeb +install-udeb: LIBPARTED_UDEB=$(shell dh_listpackages | grep -E '^libparted$(LIBSONAME)-udeb$$') +install-udeb: PARTED_UDEB=$(shell dh_listpackages | grep -E '^parted$(BINPKGVER)-udeb$$') +install-udeb: build-udeb + dh_testdir + dh_testroot + dh_prep + dh_installdirs + + [ -z "$(LIBPARTED_UDEB)" ] || \ + $(MAKE) -C build-udeb/libparted install \ + DESTDIR=$(CURDIR)/debian/libparted$(LIBSONAME)-udeb + + [ -z "$(LIBPARTED_UDEB)" ] || \ + rm -f debian/libparted$(LIBSONAME)-udeb/lib/libparted.so \ + debian/libparted$(LIBSONAME)-udeb/lib/libparted.la + + [ -z "$(PARTED_UDEB)" ] || $(MAKE) -C build-udeb/parted install \ + DESTDIR=$(CURDIR)/debian/parted$(BINPKGVER)-udeb + touch $@ + +install-dbg: DH_OPTIONS=-plibparted$(LIBSONAME)debian1-dbg +install-dbg: build-dbg + dh_testdir + dh_testroot + dh_prep -plibparted$(LIBSONAME)debian1-dbg + + install -D -m644 build-dbg/libparted/.libs/libparted.a \ + debian/libparted$(LIBSONAME)debian1-dbg/usr/lib/libparted_g.a + touch $@ + +# 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_installdocs + dh_installchangelogs + dh_installexamples + dh_installmenu + dh_installcron + dh_installman + dh_installinfo + dh_lintian + dh_strip + dh_link + dh_compress + dh_fixperms + dh_makeshlibs -V'libparted$(LIBSONAME)debian1 (>= $(DEPVER))' \ + --add-udeb=$(shell dh_listpackages | grep -E '^libparted$(LIBSONAME)-udeb$$') + dh_shlibdeps -Llibparted$(LIBSONAME)debian1 \ + -l/debian/libparted$(LIBSONAME)debian1/lib + dh_installdeb + 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-deb install-deb +# (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$(LIBSONAME)debian1-dbg" binary-common + $(MAKE) -f debian/rules binary-libparted$(LIBSONAME)debian1-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: binary-arch binary-indep + +include /usr/share/quilt/quilt.make + +.PHONY: build-deb build-udeb build-dbg build +.PHONY: install-deb install-udeb install-dbg install +.PHONY: binary-indep binary-arch binary +.PHONY: binary-arch binary-indep binary-%-dbg binary +.PHONY: packaging-files clean --- parted-2.3.orig/debian/watch +++ parted-2.3/debian/watch @@ -0,0 +1,3 @@ +version=3 + +http://ftp.gnu.org/gnu/parted/parted-(.*)\.tar\.(?:gz|xz)