balug-debian_chroot_install_split

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



To: BALUG talk <balug-talk@balug.org>
From: "Karsten M. Self" <kmself@ix.netcom.com>
Subject: cat on binaries, split, and debian chroot installs
Date: Sat, 30 Mar 2002 14:21:05 -0800


on Sat, Mar 30, 2002, Matthew Vickers (mvickers@quispiam.com) wrote:
> On Sat, 2002-03-30 at 12:16, Karsten M. Self wrote:
> > on Mon, Mar 25, 2002, Paul Larkin (larkin@jps.net) wrote:
> > > Thank you for (a useful) reply,  Mr. Ahmed.  Where can I read how to
> > > combine binaries into one big binary?  Or do I just use "append" ( "
> > > >" ) ?  Thank you.
> >
> >    $ cat <file list or wildcard>   > target
> >
> > E.g.:
> >
> >    $ cat foo* > bar
> >
> > ...will catenate all files foo001 foo002 foo003 into a file named 'bar'.
> >
> > Lexical naming of files will assist this process markedly -- check your
> > wildcard expansion order and that it is what you expect it to be.

> Please let me know me if I am wrong but doesnt cat only work with ASCII
> files ?

No.  Though likely a common perception.

Very easily tested as well:

    $ mkdir /tmp/foo
    $ cp /usr/bin/top /tmp/foo
    $ cd /tmp/foo
    $ split -b 100 top top-
    $ rm top
    $ cat top-* > top
    $ chmod +x top
    $ ./top

o ...you're running 'top' from /tmp/foo, where you'd just split it into a
gazillion pieces, and glued it back together again.



Split's very handy, say, when you need to transfer a Debian
base2_2.tar.gz image file (the base filesystem for an install) to a
system which has only floppy access:

    # Source system
    $ split -b 1440K base2_2.tar.gz base-
    < much copying of bits to floppy and from floppy >

    # Target system (booted from Tom's Root Boot, of course):
    $ cat base-* > base2_2.tar.gz
    $ zcat < base2_2.tar.gz | tar xvf
    # (TRB tar doesn't have 'z' switch.)

o ...which is one of the early steps in doing a Debian install chrooted.
Let's assume you've mounted the system as /mnt/debinst under TRB
Next step:

   $ rm base2_2.tar.gz base-*
   $ chroot . bin/bash
   $ dpgk-reconfigure base-config
   $ tzconfig

At this point, edit /etc/resolv.conf and /etc/network/interfaces to
provide you with the appropriate networking support (I haven't found the
automatic triggers for this yet, they're either part of the install or
lurk elsewhere).  For present, I'm assuming TRB supports your networking
configuration.

Edit /etc/apt/sources.list to point to a good set of sources.

   $ apt-get update && echo y | apt-get dist-upgrade
   $ apt-get install aptitude

o ...at this point follow with package selection.  I'd rev from 'stable'
to 'testing' or 'unstable' *first*, as you'll spare yourself some
repetitive downloading, if you plan to do use a non-stable release.

I schlepped a package listing from an existing system to aid in the
process, but had problems getting apt-get to reflect its directives:

   # Old system:
   $ dpkg --get-selections > packages
   $ vi packages   # trim to suite

   # New system, after transferring 'packages' file:
   $ dpgk --set-selections < packages
  
o ...at this point, apt-get upgrade or dist-upgrade *didn't* fetch the
stuff I'd listed in the package list.  Odd.

  $ apt-get dselect-upgrade

o ...*did* do most of the trick, though.


===






  


To: BALUG talk <balug-talk@balug.org>
From: Jeffrey Siegal <jbs@quiotix.com>
Subject: Re: cat on binaries, split, and debian chroot
Date: Sat, 30 Mar 2002 14:25:20 -0800

"Karsten M. Self" wrote:
>     $ mkdir /tmp/foo
>     $ cp /usr/bin/top /tmp/foo
>     $ cd /tmp/foo
>     $ split -b 100 top top-
>     $ rm top
>     $ cat top-* > top
>     $ chmod +x top
>     $ ./top

A better choice for the last command would be "cmp /usr/bin/top top"

===

the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu