1

Topic: How to apply fedora patches to parted-1.9.0

Following is a list of steps I used to create a patched version of parted-1.9.0 using the fedora source code package parted-1.9.0-14.fc12.src.rpm.

Note that these steps were performed on Karmic Koala ubuntu 9.10, which is a non-rpm based GNU/Linux distribution.

1)  Download the source code from fedora:  parted-1.9.0-14.fc12.src.rpm.
     Click on the RPMs src download link in the following page:
     http://koji.fedoraproject.org/koji/buil … dID=129982

2)  Create a directory to hold the contents of the src.rpm.

mkdir parted-1.9.0-14

3)  Extract the contents of parted-1.9.0-14.fc12.src.rpm into the newly
     created parted-1.9.0-14 directory.

     Note:  If you are using a non-rpm based GNU/Linux distribution, you might
     need to install the rpm package.  The following command should work with
     Debian based distributions (like ubuntu):

     

sudo apt-get install rpm

  3a) Change into the newly created directory:

cd parted-1.9.0-14

  3b) Assuming the parted-1.9.0-14.fc12.src.rpm file is stored in the directory above (../):

rpm2cpio ../parted-1.9.0-14.fc12.src.rpm | cpio -dimv

4)  Extract the non-patched parted-1.9.0 source code:

     Note:  If you haven't worked with "xz" compression before, you will need
     to install the "xz-utils" package.  The following command should work with
     Debian based distributions (like ubuntu):

sudo aptitude install xz-utils

     Use the tar command to extract the source code:

tar -xvJf parted-1.9.0.tar.xz

5)  Change into the newly extracted source code directory and
     apply the patches with the following commands:

cd parted-1.9.0
patch -p1 -b < ../parted-1.9.0-appletv-support.patch
patch -p1 -b < ../parted-1.9.0-extended-mbr.patch
patch -p1 -b < ../parted-1.9.0-noheaders.patch
patch -p1 -b < ../parted-1.9.0-pop-push-error.patch
patch -p1 -b < ../parted-1.9.0-no-cylinder-align.patch
patch -p1 -b < ../parted-1.9.0-remove-struct-elem.patch
patch -p1 -b < ../parted-1.9.0-move-function-declarations.patch
patch -p1 -b < ../parted-1.9.0-dasd-duplicate.patch
patch -p1 -b < ../parted-1.9.0-new-duplicate.patch
patch -p1 -b < ../parted-1.9.0-handle-dup-error.patch
patch -p1 -b < ../parted-1.9.0-swap-flag.patch
patch -p1 -b < ../parted-1.9.0-volkeysize.patch
patch -p1 -b < ../parted-1.9.0-no-BLKPG.patch
patch -p1 -b < ../parted-1.9.0-commit-without-close.patch
patch -p1 -b < ../parted-1.9.0-dont-touch-part-nodes.patch

You should now have a patched version of the source code for parted-1.9.0.  smile

6)  Now you should be able to perform the usual configure, make, make install steps.

In my situation, I used the following commands:

cd parted-1.9.0
./configure --without-readline --disable-device-mapper
make
sudo make install

This will install parted in the default /usr/local directories.  You can use the option "--prefix=/usr" with the configure command if you wish to install into the /usr directories instead.


If anyone knows a simpler way to perform these steps on a non-rpm based distribution, then please post these instructions for all to learn.  smile