[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

How to cross install initial packages


several people asked me in the past how deb packages can be installed on a
non-functional hurd system (non-functional w.r.t. to dpkg). I encourage
everyone to keep asking me when things are unclear. To make it easier for us
all, I summarized the steps how I installed libc6 today. I also include a
little script that "replaces" dpkg for this purpose, it is pmd, poor man's
dpkg ;)

Matthew, can you cross-check this with your documentation?


This is a step-by-step manual how to bootstrap a Debian GNU/Hurd
installation. This is part 1, covering the installation of the libc6

o   Make a ext2fs partition owned by hurd, mount it under /gnu (this is
    covered elsewhere).
o   cd /gnu
o   ln -s . usr

The following steps prepare dpkg's expected directory tree.
o   install -d var/lib/dpkg/{info,updates}
o   touch var/lib/dpkg/{available,status}

Now install libc6-dev. It contains a "preinst" script, which makes the
procedure cumbersome.
o   dpkg -x /path/to/hurd/packages/libc6-dev*.deb .
o   dpkg -e /path/to/hurd/packages/libc6-dev*.deb var/lib/dpkg/info
o   mv var/lib/dpkg/info/preinst var/lib/dpkg/info/libc6-dev.preinst
o   cat var/lib/dpkg/info/control >> var/lib/dpkg/status
o   echo >> var/lib/dpkg/status
o   rm var/lib/dpkg/info/control
o   Edit var/lib/dpkg/status, remove Architecture line and add:

    "Status: hold ok installed" (without the quotes)

o   dpkg-deb -c /path/to/hurd/packages/libc6-dev*.deb
      | colrm 1 48                                             # <- works also for tabs
      | perl -e 'while (<>) {s/\/$//; s/ -> .*$//; print $_;}'
      > var/lib/dpkg/info/libc6-dev.list
    (this builds a list of files for dpkg)

Test your installation:
o   dpkg --root=/gnu -s libc6-dev
o   dpkg --root=/gnu -S libc6-dev
o   dpkg --root=/gnu -L libc6-dev
o   dpkg --root=/gnu -l

I wrote a script that does most of the work (see the end of this message).
Use it in the following way:

o   save the script in /gnu and "chmod +x deb_install"
o   cd /gnu
o   ./deb_install <package name> <filename of deb file>
o   An example follows.

Now let's continue with libc6 and other packages:
o   ./deb_install libc6 /path/to/libc6_*.deb
o   Edit var/lib/dpkg/status, as above.
o   This is all you have to do if you use the script.

o   ./deb_install locales /path/to/locales_*.deb
o   Edit var/lib/dpkg/status, as above.

o   ./deb_install timezones /path/to/timezones_*.deb
o   Edit var/lib/dpkg/status, as above.
o   Make your timezone correct, for example:
    echo "Europe/Berlin" > etc/timezone
    You can also use "tzconfig" from the hurd as soon as you have a shell et al.

That's all. Relax. More follows later.

Improve the script, and post the improvements to me or the list.

# deb_install, poor man's dpkg.

dpkg -x $2 .
dpkg -e $2 var/lib/dpkg/info
if [ -e var/lib/dpkg/info/preinst ] ; then
 mv var/lib/dpkg/info/preinst var/lib/dpkg/info/$1.preinst ;
if [ -e var/lib/dpkg/info/postinst ] ; then
 mv var/lib/dpkg/info/postinst var/lib/dpkg/info/$1.postinst ;
if [ -e var/lib/dpkg/info/prerm ] ; then
 mv var/lib/dpkg/info/prerm var/lib/dpkg/info/$1.prerm ;
if [ -e var/lib/dpkg/info/postrm ] ; then
 mv var/lib/dpkg/info/postrm var/lib/dpkg/info/$1.postrm ;
if [ -e var/lib/dpkg/info/shlibs ] ; then
 mv var/lib/dpkg/info/shlibs var/lib/dpkg/info/$1.shlibs ;
cat var/lib/dpkg/info/control >> var/lib/dpkg/status
echo >> var/lib/dpkg/status
rm var/lib/dpkg/info/control
dpkg-deb -c $2 | colrm 1 48 | perl -e 'while (<>) {$_ = "/".$_; s/\/$//; s/ -> .*$//; print $_;}' > var/lib/dpkg/info/$1.list

"Rhubarb is no Egyptian god."        Debian GNU/Linux        finger brinkmd@ 
Marcus Brinkmann                   http://www.debian.org    master.debian.org
Marcus.Brinkmann@ruhr-uni-bochum.de                        for public  PGP Key
http://homepage.ruhr-uni-bochum.de/Marcus.Brinkmann/       PGP Key ID 36E7CD09

Reply to: