Unpacking kernel source and RPMs

So now we've got the kernel source and the RPMs as specified at the end of the previous section, and we want to use them. The out-of-the-box alien fails unpacking the novfs RPMs with Unpacking of 'novell-xtier-xplat-3.1.6-12.i586.rpm' failed at /usr/share/perl5/Alien/Package/Rpm.pm line 155., because of . So we need to modify /usr/share/perl5/Alien/Package/Rpm.pm first, adding lzma -d into every pipe between rpm2cpio and cpio:

<snip>
$this->do("rpm2cpio ".$this->filename." | lzma -d 1| (cd $workdir; cpio --extract --make-directories --no-absolute-filenames --preserve-modification\
-time) 2>&1")
        or die "Unpacking of '".$this->filename."' failed";

# cpio does not necessarily store all parent directories in an
# archive, and so some directories, if it has to make them and has
# no permission info, will come out with some random permissions.
# Find those directories and make them mode 755, which is more
# reasonable.
my %seenfiles;
open (RPMLIST, "rpm2cpio ".$this->filename." | lzma -d 2| cpio -it --quiet |")
<snip>
      

1

lzma Added to this pipe to handle RPMs that use it. RPMs without lzma will not properly be unpacked any more.

2

lzma Needed in this pipe as well.

[Note]Note

Note that this kind of hack is extremely bad style: it breaks rpm2cpio w.r.t. non-lzma RPMs, and it corrupts the rpm package. It would be better to copy the file to the /usr/local hierarchy, rename it, and then apply the hack. But we are not going to use this system other than for the novfs experiment, and so the nice version is left as a trivial exercise to the reader.

Procedure 65.  Unpacking kernel and package RPMs

  1. Unpacking the kernel:

    For the kernel, we are only interested in a small subdirectory, so we use rpm2cpio directly, which is faster than alien:

    mkdir ~/novfs-hack/wd
    cd !$
    mkdir kernel-source-2.6.27.19
    cd !$
    rpm2cpio ../sources/kernel-source-2.6.27.19-3.2.1.i586.rpm | lzma -d | cpio -idmv

  2. Unpacking the novfs RPM packages

    ( for p in $(ls -1 *.rpm) ; do dir=$(basename $p .rpm) ; mkdir $dir ; pushd $dir ; fakeroot alien --to-deb -cgk ../$p ; popd ; done ) 2>&1 |grep -v "cannot open Pubkeys" |grep -v "To install rpm packages on Debian"|grep -v "NOKEY, key ID"
    ~/novfs-hack/novfs-rpms/nici-2.7.4-6.i586 ~/novfs-hack/novfs-rpms
    Directories nici-2.7.4 and nici-2.7.4.orig prepared.
    ~/novfs-hack/novfs-rpms
    ~/novfs-hack/novfs-rpms/novell-client-2.0.0-29.i586 ~/novfs-hack/novfs-rpms
    Directories novell-client-2.0.0 and novell-client-2.0.0.orig prepared.
    ~/novfs-hack/novfs-rpms
    ~/novfs-hack/novfs-rpms/novell-client-script-2.0.0-32.i586 ~/novfs-hack/novfs-rpms
    Directories novell-client-script-2.0.0 and novell-client-script-2.0.0.orig prepared.
    ~/novfs-hack/novfs-rpms
    ~/novfs-hack/novfs-rpms/novell-filesystem-0.0.1-21.i586 ~/novfs-hack/novfs-rpms
    Directories novell-filesystem-0.0.1 and novell-filesystem-0.0.1.orig prepared.
    ~/novfs-hack/novfs-rpms
    ~/novfs-hack/novfs-rpms/novell-nmasclient-3.4.0-21.i586 ~/novfs-hack/novfs-rpms
    Directories novell-nmasclient-3.4.0 and novell-nmasclient-3.4.0.orig prepared.
    ~/novfs-hack/novfs-rpms
    ~/novfs-hack/novfs-rpms/novell-novfsd-3.0.0-14.i586 ~/novfs-hack/novfs-rpms
    Directories novell-novfsd-3.0.0 and novell-novfsd-3.0.0.orig prepared.
    ~/novfs-hack/novfs-rpms
    ~/novfs-hack/novfs-rpms/novell-qtgui-3.0.b508-17.i586 ~/novfs-hack/novfs-rpms
    Directories novell-qtgui-3.0.b508 and novell-qtgui-3.0.b508.orig prepared.
    ~/novfs-hack/novfs-rpms
    ~/novfs-hack/novfs-rpms/novell-ui-base-3.0.b508-5.i586 ~/novfs-hack/novfs-rpms
    Directories novell-ui-base-3.0.b508 and novell-ui-base-3.0.b508.orig prepared.
    ~/novfs-hack/novfs-rpms
    ~/novfs-hack/novfs-rpms/novell-xplatlib-1.0.3-39.i586 ~/novfs-hack/novfs-rpms
    Directories novell-xplatlib-1.0.3 and novell-xplatlib-1.0.3.orig prepared.
    ~/novfs-hack/novfs-rpms
    ~/novfs-hack/novfs-rpms/novell-xtier-base-3.1.6-12.i586 ~/novfs-hack/novfs-rpms
    Directories novell-xtier-base-3.1.6 and novell-xtier-base-3.1.6.orig prepared.
    ~/novfs-hack/novfs-rpms
    ~/novfs-hack/novfs-rpms/novell-xtier-core-3.1.6-12.i586 ~/novfs-hack/novfs-rpms
    Directories novell-xtier-core-3.1.6 and novell-xtier-core-3.1.6.orig prepared.
    ~/novfs-hack/novfs-rpms
    ~/novfs-hack/novfs-rpms/novell-xtier-xplat-3.1.6-12.i586 ~/novfs-hack/novfs-rpms
    Directories novell-xtier-xplat-3.1.6 and novell-xtier-xplat-3.1.6.orig prepared.
    ~/novfs-hack/novfs-rpms