Re: HOWTO Create a Debian mirror using only CDs

2003-02-20 Par sujet Erik Rossen
On Thu, Feb 20, 2003 at 07:39:02AM +0100, Linux Leman Digest wrote:
 On Tue, Feb 18, 2003 at 06:57:05PM +0100, Erik Rossen wrote:
 
  Why are the original package lists from the CDs even necessary?  Each .deb has
  enough info in its control file to rebuild the Packages lists and frankly I
  don't care how the .debs are organised, as long as they can be found
  afterwards.
 
 They are not. For example, my Debian CD update generation script:
 
 [ ... ]
 
 if [ $? = 0 ]; then
# Generating the Packages.gz file
(cd $DEST_PACKAGES  dpkg-scanpackages . /dev/null | gzip -9 
 Packages.gz)
 
mkisofs -A $LABEL -r -o $OUTPUT_FILE $TMP_DIR || fail mkisofs
md5sum $OUTPUT_FILE  $OUTPUT_FILE.md5sum || fail md5sum
rm -rf $TMP_DIR
 else
rm -rf $TEMPDIR
exit 1
 fi

OK, that seems to answer the question of whether or not apt-move is
really necessary, but there seems to be a mis-comprehension of my
problem by both you and Fred.

I already knew about dpkg-scanpackages (it gets called when one does
apt-move packages) for rebuilding the Packages file.  It worked fine
for me already and I have been able to using my mirror for normal
apt-get operations.

The problem comes when trying to do an install on a completely new
machine.  debootstrap seems to choke when it cannot find a valid Release
file in each major subsection (main, contrib, non-free) of the mirror
and it refuses to use the mirror for the install.  I can use it
afterwards, but NOT for the initial install.

My question is *not* how do I make the Packages file?, but how do I
make the Release files?  At the limit I can write a little shell script
to call md5sum on all of the Packages files and build something like
dists/stable/Release:

Origin: Debian
Label: Debian
Suite: stable
Version: 3.0
Codename: woody
Date: Fri, 19 Jul 2002 19:03:33 UTC
Architectures: alpha arm hppa i386 ia64 m68k mips mipsel powerpc s390 sparc
Components: main contrib non-free
Description: Debian 3.0 Released 20th July 2002
MD5Sum:
 678eab2d1d603992726f697765dadf33 3208 main/disks-alpha/current/md5sum.txt
 678eab2d1d603992726f697765dadf33 3208 
main/disks-alpha/3.0.23-2002-05-21/md5sum.txt
 002a42ea167a6eede449472e086c0d4a  6240918 main/binary-alpha/Packages
 1815a1f31a9d5613622f49cab5407e7c  1700336 main/binary-alpha/Packages.gz
 e061181295feeeabcd2df379e95aa349   94 main/binary-alpha/Release
 036d9f86a89a86f5b1db46b963e1c1e2 1774 main/disks-arm/current/md5sum.txt
 036d9f86a89a86f5b1db46b963e1c1e2 1774 
main/disks-arm/3.0.23-2002-05-21/md5sum.txt
 aa6e9dd49434eb152673511ca6c0  6141671 main/binary-arm/Packages
 be6d465f85178d97341779ff3ca6718b  1682660 main/binary-arm/Packages.gz
 37dc7628af7ce694c0009be246178406   92 main/binary-arm/Release

...etc, but I do not want to do it if there is already a well-used
Debian tool for this job.  It seems to me that the ftpmaster would have
such a tool, no?  If so, where is it?

 For autoinstalling machines, you could look into FAI: they may have some
 instructions for setting up mirrors.

OK, I will take a look.

 If you install from one CD, you usually don't need the base.tar.gz
 and other things on the mirror.

True, but it is nice to not have to depend on having access to a CDROM
drive like, for example, when I installed Debian on my Sony Vaio
notebook that has neither a CDROM nor a floppy drive.  I was able to do
that (and redo and redo and redo...) because I had a local mirror set up
using apt-proxy that downloads and caches Release files and everything
else.  Very, very, convenient.


-- 
Erik Rossen  ^OpenPGP key: 2935D0B9
[EMAIL PROTECTED]  /e\   Use GnuPG, see the
http://people.linux-gull.ch/rossen  ---black helicopters.
--
http://www-internal.alphanet.ch/linux-leman/ avant de poser
une question. Ouais, pour se désabonner aussi.



Re: HOWTO Create a Debian mirror using only CDs

2003-02-20 Par sujet Frederic Schutz
Le Thu, 20 Feb 2003 21:53:47 +0100, tu as ecrit :

The problem comes when trying to do an install on a completely new
machine.  debootstrap seems to choke when it cannot find a valid Release
file in each major subsection (main, contrib, non-free) of the mirror
and it refuses to use the mirror for the install.  I can use it
afterwards, but NOT for the initial install.

My question is *not* how do I make the Packages file?, but how do I
make the Release files?  At the limit I can write a little shell script

The only information I have is this howto:
http://www.isotton.com/debian/docs/repository-howto/repository-howto.html

It explain how to create manually a release file for the subdir, but not
how to create the master Release file. So I guess a shell script is the
way to go.

...etc, but I do not want to do it if there is already a well-used
Debian tool for this job.  It seems to me that the ftpmaster would have
such a tool, no?  If so, where is it?

The tools used by the ftpmasters are still dark magic. You can find them
at http://cvs.debian.org/dak/?cvsroot=dak, but do not expect much
documentation. Documenting and packaging these tools is a long standing
item on Debian todo list (http://www.debian.org/devel/todo/) -- I guess
it'll be easier to write a new script rather than understanding how
everything works.

Frédéric
--
http://www-internal.alphanet.ch/linux-leman/ avant de poser
une question. Ouais, pour se désabonner aussi.



Re: HOWTO Create a Debian mirror using only CDs

2003-02-19 Par sujet Marc SCHAEFER
On Tue, Feb 18, 2003 at 06:57:05PM +0100, Erik Rossen wrote:

 Why are the original package lists from the CDs even necessary?  Each .deb has
 enough info in its control file to rebuild the Packages lists and frankly I
 don't care how the .debs are organised, as long as they can be found
 afterwards.

They are not. For example, my Debian CD update generation script:

[ ... ]

if [ $? = 0 ]; then
   # Generating the Packages.gz file
   (cd $DEST_PACKAGES  dpkg-scanpackages . /dev/null | gzip -9 
Packages.gz)

   mkisofs -A $LABEL -r -o $OUTPUT_FILE $TMP_DIR || fail mkisofs
   md5sum $OUTPUT_FILE  $OUTPUT_FILE.md5sum || fail md5sum
   rm -rf $TMP_DIR
else
   rm -rf $TEMPDIR
   exit 1
fi

Beware that the Path is '.' because paths on CD-ROM are hardcoded.
On a HTTP server you may need to put mirror/ or whatever is appropriate
for you.

BTW: I have always done my Debian deb repository by copying the pools,
 then starting a rsync to get the rest.

An alternative can be to put all *.deb into one single directory
(ala-Red Hat) and then run the above scanpackages.

For autoinstalling machines, you could look into FAI: they may have some
instructions for setting up mirrors.

If you install from one CD, you usually don't need the base.tar.gz
and other things on the mirror.

--
http://www-internal.alphanet.ch/linux-leman/ avant de poser
une question. Ouais, pour se désabonner aussi.



HOWTO Create a Debian mirror using only CDs

2003-02-18 Par sujet Erik Rossen
I use the following procedure to construct a static Debian mirror from
6 Debian CDs, but there is still a problem that prevents the mirror from
being used for doing complete network-only installs - no Release files with
checksums are built.

What is the proper Debian way of building the Release files?


HOWTO Create a Debian mirror using only CDs

SCENARIO: You need to build a http/ftp/nfs mirror of Debian in order that
several workers can quickly install a bunch of different machines
simultaneously.  You have a local network, but no Internet connectivity (not
even an analog modem), and only a complete Debian Official CD set as a source
of .debs.


BEGIN

Run apt-cdrom for each CD of your set:

apt-cdrom add


Install the necessary packages for building and running the mirror:

apt-get install apt-move apache


Create a directory on the server for the Debian mirror:

mkdir -p /mirrors/debian/dists
ln -s /mirrors/debian /var/www/debian


Set Apache to serve the mirror directory (i.e. set up a Directory spec for it
in /etc/apache/httpd.conf), reload Apache, and test by browsing
http://localhost/debian


Edit /etc/apt-move.conf:

Insert each complete CD specification in the variable APTSITES like this:

APTSITES=CDSPEC1
CDSPEC2
...
CDSPEC7

Where CDSPEC1 is:

Debian%20GNU_Linux%203.0%20r0%20%5fWoody%5f%20-%20Official%20i386%20Binary-1%20(20020718)
if the corresponding entry in /etc/apt/sources.list is:
deb cdrom:[Debian GNU/Linux 3.0 r0 _Woody_ - Official i386 Binary-1 
(20020718)]/ unstable contrib main non-US/contrib non-US/main

Set DIST=woody


Import the package list information from the CDs (found in /var/lib/apt/lists):

apt-move get


For each CD, import the .deb files into the mirror:

[INSERT CD]
mount /cdrom
apt-move movefile `find /cdrom -name '*.deb'`
[WAIT A REALLY LONG TIME]
umount /cdrom
[EJECT CD]


Rebuild the package lists on the mirror:

apt-move packages

END


OPTIONAL:  Copy base.tgz and all of the boot floppies into the mirror directory too.


ADDITIONAL QUESTIONS:

Is there no simpler way of doing this???

What if I want to use apt-move to mirror several distribs?  Do I make a
seperate config file for each?

Why are the original package lists from the CDs even necessary?  Each .deb has
enough info in its control file to rebuild the Packages lists and frankly I
don't care how the .debs are organised, as long as they can be found
afterwards.

Surely others have needed to do this task.  Did I miss a HOWTO or a package?
Am I really using the correct tools?

-- 
Erik Rossen  ^OpenPGP key: 2935D0B9
[EMAIL PROTECTED]  /e\   Use GnuPG, see the
http://people.linux-gull.ch/rossen  ---black helicopters.
--
http://www-internal.alphanet.ch/linux-leman/ avant de poser
une question. Ouais, pour se désabonner aussi.



Re: HOWTO Create a Debian mirror using only CDs

2003-02-18 Par sujet Frederic Schutz
Le Tue, 18 Feb 2003 18:57:05 +0100, tu as ecrit :

Why are the original package lists from the CDs even necessary?  Each .deb has
enough info in its control file to rebuild the Packages lists and frankly I
don't care how the .debs are organised, as long as they can be found
afterwards.

Est-ce que tu as essayé dpkg-scanpackages ?

NAME
   dpkg-scanpackages - create Packages files

SYNOPSIS
   dpkg-scanpackages  binarydir  overridefile  [pathprefix] 
   Packages

DESCRIPTION
   dpkg-scanpackages sorts through a tree  of  Debian  binary
   packages  and  creates a Packages file, used by dselect(8)
   to tell the user what packages are available for installa­
   tion.  These Packages files are the same as those found on
   Debian archive sites and CD-ROMs.   You  might  use  dpkg-
   scanpackages yourself if making a directory of local pack­
   ages to install on a cluster of machines.

Fred.
--
http://www-internal.alphanet.ch/linux-leman/ avant de poser
une question. Ouais, pour se désabonner aussi.