Warning: this is an htmlized version!
The original is here, and
the conversion rules are here.
#######
#
# E-scripts and notes about Debian package repositories
#
# Note 1: use the eev command (defined in eev.el) and the
# ee alias (in my .zshrc) to execute parts of this file.
# Executing this file as a whole makes no sense.
# An introduction to eev can be found here:
#
#   (find-eev-quick-intro)
#   http://angg.twu.net/eev-intros/find-eev-quick-intro.html
#
# Note 2: be VERY careful and make sure you understand what
# you're doing.
#
# Note 3: If you use a shell other than zsh things like |&
# and the for loops may not work.
#
# Note 4: I always run as root.
#
# Note 5: some parts are too old and don't work anymore. Some
# never worked.
#
# Note 6: the definitions for the find-xxxfile commands are on my
# .emacs.
#
# Note 7: if you see a strange command check my .zshrc -- it may
# be defined there as a function or an alias.
#
# Note 8: the sections without dates are always older than the
# sections with dates.
#
# This file is at <http://angg.twu.net/e/debrepository.e>
#           or at <http://angg.twu.net/e/debrepository.e.html>.
#        See also <http://angg.twu.net/emacs.html>,
#                 <http://angg.twu.net/.emacs[.html]>,
#                 <http://angg.twu.net/.zshrc[.html]>,
#                 <http://angg.twu.net/escripts.html>,
#             and <http://angg.twu.net/>.
#
#######




# «.apt-get-autoclean»	(to "apt-get-autoclean")
# «.var-www-vcarchives-0»  (to "var-www-vcarchives-0")
# «.var-www-vcarchives»	(to "var-www-vcarchives")
# «.debootstrap»	(to "debootstrap")
# «.debootstrap-2018»	(to "debootstrap-2018")
# «.debootstrap-quick»	(to "debootstrap-quick")
# «.adduser-edrx»	(to "adduser-edrx")
# «.chsh-edrx»		(to "chsh-edrx")
# «.sudoers»		(to "sudoers")
# «.export-edrx.tgz»	(to "export-edrx.tgz")
# «.export-snarf.tgz»	(to "export-snarf.tgz")
# «.unpack-edrx-and-snarf»  (to "unpack-edrx-and-snarf")
# «.fstab»		(to "fstab")
# «.kernel-image»	(to "kernel-image")
# «.rootstrap»		(to "rootstrap")
# «.bootcd»		(to "bootcd")

# «.apt-cacher»		(to "apt-cacher")
# «.apt-cache-iso»	(to "apt-cache-iso")
# «.apt-ftparchive»	(to "apt-ftparchive")



  (find-inkscape "~/IMAGES/debrep-ideas.svg")
  (find-eimage0  "~/IMAGES/debrep-ideas.jpg" 2 0)




#####
#
# apt-get autoclean
# 2004sep07
#
#####

# «apt-get-autoclean»  (to ".apt-get-autoclean")
# (find-apthowtofile "apt-howto.en.txt.gz" "apt-get autoclean")
# (find-man "8 apt-get" "   autoclean")
# (find-man "8 apt-get" "   autoclean" "APT::Clean-Installed")
# (find-man "8 apt-get" "   autoclean" "-o Foo::Bar=bar")
# (find-man "5 apt.conf")
# (find-man "8 apt-config")
# (find-man "5 apt_preferences")

# (find-udfile "apt/")
# (find-udfile "apt/examples/")
# (find-udfile "apt/examples/apt.conf")
# (find-udfile "apt/examples/configure-index.gz")
# (find-udfile "apt/examples/configure-index.gz" "Clean-Installed")
# (find-man "8 apt-get" "/etc/apt/apt.conf")
# (find-fline "/etc/apt/")
# (find-fline "/etc/apt/apt.conf")
# (find-fline "/etc/apt/apt.conf.d/")

# (find-man "8 apt-get" "   autoclean")
# (find-man "8 apt-get" "   autoclean" "APT::Clean-Installed")
# (find-man "8 apt-get" "-s, --simulate")
# (find-man "8 apt-get" "-V, --verbose-versions")
# (find-man "8 apt-get" "-o Foo::Bar=bar")
# (find-udfile "apt/examples/")
# (find-udfile "apt/examples/configure-index.gz" "Clean-Installed")
# (find-udfile "apt/examples/configure-index.gz" "\nDebug")

# (find-fline "/var/cache/apt/archives/")
# (find-dpkg-l)
#*
cd /var/cache/apt/archives/
sudo apt-get -s -V -o APT::Clean-Installed=false autoclean

#*
# Pure weirdness - autoclean makes no mention of removing some debs in
# the archive that are obviously obsolete.

# I'm not sure if "=false" is the right syntax.




#####
#
# dpkg-scanpackages and /var/www/vcarchives/
# 2004sep07
#
#####

# «var-www-vcarchives-0»  (to ".var-www-vcarchives-0")
# (find-apthowtofile "apt-howto.en.txt.gz")
# (find-apthowtofile "apt-howto.en.txt.gz" "dpkg-scanpackages")
# (find-man "1 dpkg-scanpackages")

# An alternative to dpkg-scanpackages:
# (find-man "1 apt-ftparchive")

# An exercise: a fake repository with the debs from /var/cache/apt/archives/
# http://127.0.0.1/vcarchives/

#*
sudo rm -Rv    /var/www/vcarchives/
sudo mkdir     /var/www/vcarchives/
sudo chmod 777 /var/www/vcarchives/
#*
cd /var/www/vcarchives/
mkdir     debs
# cp -ilv /var/cache/apt/archives/*.deb debs/
  cp -isv /var/cache/apt/archives/*.deb debs/
mkdir -p       dists/sarge/main/binary-i386/

apt-ftparchive packages debs \
  | tee        dists/sarge/main/binary-i386/Packages \
  | gzip -c9 > dists/sarge/main/binary-i386/Packages.gz

#*
# (find-fline "/var/www/vcarchives/dists/sarge/main/binary-i386/")
# http://localhost/vcarchives/dists/sarge/main/binary-i386/
# http://localhost/vcarchives/debs/



#####
#
# a repository in /var/www/vcarchives/ with the packages currently installed
# 2004dec27
#
#####

# «var-www-vcarchives»  (to ".var-www-vcarchives")
#*
# Prepare the lists of installed and available debs
#
find /big/debian/pool/        -type f -and -name '*.deb' > /tmp/obigdebiandebs
find /var/cache/apt/archives/ -type f -and -name '*.deb' > /tmp/ovcaadebs
find $S/                      -type f -and -name '*.deb' > /tmp/osnarfdebs
find ~/usrc/ ~/bigsrc/        -type f -and -name '*.deb' \
                                           -maxdepth 2   > /tmp/ohomedebs
grep-status -s Package,Version -F Status ' installed'    > /tmp/oinstalleddebs

#*
# Prepare the script that will copy the debs (it will use "cp -s"s)
# (find-angg "LUA/debs2.lua")
#
~/LUA/debs2.lua \
  -i /tmp/oinstalleddebs \
  -d /tmp/obigdebiandebs \
  -d /tmp/ovcaadebs \
  -d /tmp/osnarfdebs \
  -d /tmp/ohomedebs \
  -cp 'cp -s' \
  -nf '# Not found:' \
  |& tee /tmp/ocp

# (find-fline "/tmp/")
# (find-fline "/tmp/ocp")

#*
# Remove and recreate /var/www/vcarchives/
#
sudo rm -Rv    /var/www/vcarchives/
sudo mkdir     /var/www/vcarchives/
sudo chmod 777 /var/www/vcarchives/

#*
# Make the directory with the debs and make the copies
# (find-fline "/tmp/ocp")
#
mkdir /var/www/vcarchives/debs/
cd    /var/www/vcarchives/debs/
source /tmp/ocp

#*
# Create the files "Packages" and "Packages.gz"
#
cd    /var/www/vcarchives/
mkdir -p       dists/sarge/main/binary-i386/

# This command takes 30s in my machine, all the rest is very quick
apt-ftparchive packages debs \
  | tee        dists/sarge/main/binary-i386/Packages \
  | gzip -c9 > dists/sarge/main/binary-i386/Packages.gz

#*
# Create the "Release" files
#
cd /var/www/vcarchives/dists/sarge/
cat > main/binary-i386/Release <<'%%%'
Archive: sarge
Component: main
Origin: Debian
Label: Debian
Architecture: i386
%%%

# (find-fline "/usr/bin/apt-move" "exec > Release")
# (find-fline "/usr/bin/apt-move" "get_checksum()")
# (find-node "(libc)Table of Output Conversions")
# (find-fline "/tmp/cdd/dists/sarge/Release")
# (find-fline "/var/www/vcarchives/dists/sarge/Release")

cd /var/www/vcarchives/dists/sarge/
(
echo Origin: Debian
echo Label: Debian
echo Suite: testing
echo Codename: sarge
echo Date: $(TZ=UTC date '+%a, %d %b %Y %T %Z')
echo Architectures: i386
echo Components: main
echo Description: Persephone mini-Sarge
echo MD5Sum:
for l in main/binary-i386/{Release,Packages.gz,Packages}; do
  printf ' %32s %8d %s\n' \
    $(md5sum $l | cut -d ' ' -f 1) $(stat -c %s $l) $l
done
) | tee Release

#*
# (find-fline "/var/lib/apt/lists/")

deb http://127.0.0.1/vcarchives sarge main

# (find-man "dpkg-scanpackages")
# (find-status   "dpkg-dev")
# (find-vldifile "dpkg-dev.list")
# (find-udfile   "dpkg-dev/")





#####
#
# debootstrap
# 2004sep04
#
#####

# «debootstrap»  (to ".debootstrap")
# (find-status   "debootstrap")
# (find-vldifile "debootstrap.list")
# (find-udfile   "debootstrap/")
# (find-man "8 debootstrap")
# (find-udfile "debootstrap/README.Debian")
# (find-fline "/usr/lib/debootstrap/")
# (find-fline "/usr/lib/debootstrap/functions")
# (find-fline "/usr/lib/debootstrap/pkgdetails")
# (find-fline "/usr/lib/debootstrap/scripts/")
# (find-fline "/usr/lib/debootstrap/scripts/sarge")
# (find-fline "/usr/lib/debootstrap/scripts/sarge" "Fake start-stop-daemon")
# (find-fline "/usr/lib/debootstrap/scripts/sarge.buildd")
# (find-fline "/usr/sbin/debootstrap")

# (find-man "8 debootstrap")
#*
# umount /guest
rm -Rv /guest

#*
mkdir  /guest
# mount  /dev/hdb5 /guest
rm -Rv /guest/*
# rm -Rv /guest/.*

#*
# Installation using debootstrap and http
cd /
mkdir /guest
debootstrap sarge /guest http://127.0.0.1/vcarchives/

#*
# Pack the things that were downloaded by http
# (find-fline "/guest/")
# (find-fline "/guest/var/lib/apt/lists/")
# (find-fline "/guest/var/cache/apt/archives/")
cd /guest/
tar -cvf /tmp/sarge-debs.tar \
  var/lib/apt/lists/ \
  var/cache/apt/archives/

#*
# (find-bashnode "Shell Parameter Expansion" "`${PARAMETER#WORD}'")
# (find-bashnode "Shell Parameter Expansion" "`${PARAMETER%WORD}'")
# (find-fline "/usr/sbin/debootstrap" "if [ \"$UNPACK_TARBALL\" ]; then")
# (find-fline "/usr/lib/debootstrap/functions")
rm -Rv /guest2
mkdir  /guest2
cd     /guest2
tar -C /guest2 -xvf /tmp/sarge-debs.tar
# download the whole system:
debootstrap sid /guest2 http://ftp.br.debian.org/debian/

#*
# Check that the two directories have the same files:
cd /guest/;  (sudo find) | sort > /tmp/ofind
cd /guest2/; (sudo find) | sort > /tmp/ofind2
diff /tmp/ofind /tmp/ofind2

#*
# (find-man "8 debootstrap" "apt-setup")
# Choose "edit sources list by hand"
# deb http://127.0.0.1/vcarchives sarge main

sudo mount -t proc guest-proc /guest/proc
eeg -f <(<<'%%%'
EDITOR=nano apt-setup
nano /etc/apt/sources.list
# deselect/apti?
%%%
) sudo chroot /guest /bin/bash

#*

makeLedrxtgz
cp ~/TH/L/edrx.tgz /guest/tmp/
# cp ~/TH/L/edrx.tgz /guest/home/

eeg -f <(<<'%%%'
EDITOR=nano apt-setup
nano /etc/apt/sources.list
# deselect/apti?
%%%





#####
#
# debootstrap-2018
# 2018mai15
#
#####

# «debootstrap-2018» (to ".debootstrap-2018")
# https://wiki.debian.org/Debootstrap
# https://wiki.debian.org/Multistrap




#####
#
# 2004dec24
#
#####

(eebg-channel-xterm
 "guest" (split-string "sudo chroot /guest /bin/bash"))

prep-guest-mount
prep-guest-umount

# (find-fline "/boot/grub/")
# (find-fline "/sudo:root@localhost:/etc/fstab")



* (eechannel-xterm "A")
* (eechannel "A")

umount /guest/proc/
sudo mount -t proc guest-proc /guest/proc

sudo chroot /guest /bin/bash
EDITOR=nano apt-setup
# put this in /etc/apt/sources.list non-interactively:
deb http://127.0.0.1/vcarchives sarge main

apt-get -y install emacs21 zsh lua50 less sudo

rm -Rv /tmp/edrx/

mkdir /tmp/edrx/
cd    /tmp/edrx/
tar -xvzf ../edrx.tgz
ln -s .zshrc.local.cdd .zshrc.local
./run-zsh
# alias apti='apt-get -y install'
# unalias apti
function apti () { apt-get -y install $* }
prep-apti-all


Faltam: mouse (difícil)
configuração de rede (hostname)

a parte que tem que ser feita fora do chroot é bem pequena, acho que
só mounts e umounts, rms, e um copy do edrx.tgz

instalação do grub?

nmap




apt-get install emacs21 zsh lua50 less sudo
apt-get install erc w3m-el
apt-get install expect ssh
apt-get install emacs21-el elisp-manual emacs-lisp-intro
apt-get install dict dictd dict-gcide dict-wn dict-jargon
apt-get install zgv
apt-get install dict-freedict-eng-por
apt-get install build-essential

apt-get install gpm
gpmconfig
# (find-file "/etc/gpm.conf")
# repeat_type=raw

apt-get remove xdm gdm
# now kill X by hand, then:
/etc/init.d/gpm restart

apt-get install fvwm




#*
echo "proc-sid /guest/proc proc none 0 0" >> /etc/fstab
mount proc-sid /guest/proc -t proc
cp /etc/hosts /guest/etc/hosts
chroot /guest /bin/bash

#*
# (find-fline "/etc/fstab")
echo "proc-sid /guest2/proc proc none 0 0" >> /etc/fstab
mount proc-sid /guest2/proc -t proc
cp /etc/hosts /guest/etc/hosts
chroot /guest /bin/bash

#*
# set-up /etc/apt/sources.list:
apt-setup
# point the source to unstable:
vi /etc/apt/sources.list
chroot # dselect
[ you may use aptitude, install mc and vim ... ]

 main # echo "8:23:respawn:/usr/sbin/chroot /guest " \
        "/sbin/getty 38400 tty8"  >> /etc/inittab
[ define a login tty that will use this system ]
 main # init q
[ reload init ]






#####
#
# deboostrap on /guest
# 2004sep13
#
#####

# «debootstrap-quick»  (to ".debootstrap-quick")
#*
umount /guest/proc
umount /guest
rm -Rv /guest

#*
mkdir /guest
mount /dev/hdb5 /guest
mkdir /guest/proc/
mount -t proc sarge-proc /guest/proc

#*
rm -Rv /guest/*
rm -Rv /guest/.*

#*
# Installation using debootstrap and http
cd /
mkdir /guest
echo "mini-sarge for livecds" > /guest/.id
debootstrap sarge /guest http://127.0.0.1/vcarchives/
(cd /guest/etc/apt/; mv -v sources.list sources.list.orig)

#*
# (find-fline "/guest/etc/apt/")
# (find-fline "/guest/etc/apt/sources.list")

cat > /guest/etc/apt/sources.list <<'%%%'
# (find-es "livecd" "debootstrap-quick")
deb http://127.0.0.1/vcarchives sarge main
%%%

#*
sudo chroot /guest \
  /usr/bin/apt-get update
sudo chroot /guest \
  /usr/bin/apt-get install emacs21 zsh lua50 less sudo

#*
# (find-man "dpkg-reconfigure")
sudo chroot /guest \
  dpkg-reconfigure --all

#*




#####
#
# create a user edrx and give him full sudo permissions
# 2004sep13
#
#####

#*
# «adduser-edrx»  (to ".adduser-edrx")
# «chsh-edrx»  (to ".chsh-edrx")
# New way (2011nov27):
#   (find-efunction 'find-adduser-links)
#   (find-es "sudo" "sudo")

# (find-man "adduser")
# (find-man "chsh")

cat > $EEG <<'%%%'
# adduser asks 8 questions:
#   passwd/passwd/fullname/
#   room#/workphone/homephone/other/ (4 blank lines)
#   correct?
adduser edrx
edrx
edrx
Eduardo Ochs




y
chsh -s /usr/bin/zsh edrx
exit
%%%
eeg $SARGESHROOT

#*
# «sudoers»  (to ".sudoers")
# (find-es "cdd" "sudo")
# (find-sh "sudo cat            /etc/sudoers")
# (find-sh "sudo cat /guest/etc/sudoers")

cat > $EEG <<'%%%%'
echo >> /etc/sudoers
cat  >> /etc/sudoers <<'%%'
# Edrx:
# (find-es "livecd" "sudo")
User_Alias    FULLTIMERS = edrx
FULLTIMERS    ALL = NOPASSWD: ALL
%%
exit
%%%%
eeg $SARGESHROOT

#*



#####
#
# export edrx.tgz and snarf.tgz
# 2004sep13
#
#####

#*
# «export-edrx.tgz»  (to ".export-edrx.tgz")
makeLedrxtgz
cp -v ~/TH/L/edrx.tgz /guest/tmp/

#*
# «export-snarf.tgz»  (to ".export-snarf.tgz")
cd ~/snarf/
tar -cvzf /guest/tmp/snarf.tgz $(
cat ~/.psne.carry \
  | lua50 -e '
      for li in io.lines() do
        print((string.gsub(li, "^([a-z]+)://", "%1/")))
      end 
    '
)
#*
# «unpack-edrx-and-snarf»  (to ".unpack-edrx-and-snarf")
cat > $EEG <<'%%%'
whoami
tar -C /home/edrx -xvzf /tmp/edrx.tgz
mkdir  /home/edrx/snarf/
tar -C /home/edrx/snarf/ -xvzf /tmp/snarf.tgz
exec ~edrx/run-zsh
cd
prep-home-cdd

exit
%%%
eeg $SARGESHEDRX

#*
# «fstab»  (to ".fstab")
# If we don't do this then the mkinitrd in kernel-image-xxx.postinst will fail.
# (find-fline "/usr/sbin/mkinitrd")
# (find-fline "/usr/sbin/mkinitrd" "Cannot determine root device")
# (find-node "(bashref)Bash Conditional Expressions" "`-z STRING'")
# (find-fline "/etc/fstab")

cat > /guest/etc/fstab <<'%%%'
# /etc/fstab: static file system information.
# (find-es "livecd" "fstab")
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
/dev/hdb5       /               ext2    defaults,errors=remount-ro 0 1
/dev/hdd        /media/cdrom0   iso9660 ro,user,noauto  0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0
%%%

#*
# «kernel-image»  (to ".kernel-image")
# (find-fline            "/etc/kernel-img.conf")
# (find-fline "/guest/etc/kernel-img.conf")
chroot /guest /usr/bin/apt-get install kernel-image-2.4.26-1-386

#*
cat > $EEG <<'%%%'
A=(
  emacs21 zsh lua50 less sudo
#  erc w3m-el
  expect ssh
#  emacs21-el elisp-manual emacs-lisp-intro
#  dict dictd dict-gcide dict-wn dict-jargon
#  zgv
#  dict-freedict-eng-por
  build-essential
)
apti $A
exit
%%%
eeg $SARGEZSHEDRX

#*







# (find-sh "dpkg -l")


echo "proc-sid /guest/proc proc none 0 0" >> /etc/fstab


# /usr/sbin/mkinitrd: Cannot determine root device

SARGESHROOT=(sudo chroot /guest /bin/sh)
SARGESHEDRX=(sudo chroot /guest /usr/bin/sudo -u edrx /bin/sh)
SARGEZSHROOT=(sudo chroot /guest /home/edrx/run-zsh)
SARGEZSHEDRX=(sudo chroot /guest /usr/bin/sudo -u edrx /home/edrx/run-zsh)

$SARGESHROOT
$SARGESHEDRX
$SARGEZSHROOT
$SARGEZSHEDRX

#*


# (find-sh "dpkg --get-selections")


  # Audio
  aumix bplay mpg321 vorbis-tools xmms

  # CDDs and livecds
  apache apt-show-version apt-utils bootcd cdd-common cdd-dev cdd-doc
  cdebootstrap cdrecord debianutils debootstrap deborphan discover1
  fakeroot grep-dctrl grub grub-doc build-essential madison-lite tasksel

  # Console
  console-tools gpm zgv

  # Dict
  dict dict-freedict-eng-por dict-gcide dict-jargon dict-wn dictd

  # Docs
  apt-howto-en bash-doc debconf-doc doc-linux-text glibc-doc manpages
  manpages-dev

  # Emacs
  elisp-manual emacs-lisp-intro emacs21-el gnuserv post-el w3m w3m-el

  # Html
  html2text lynx tidy tidy-doc unhtml

  # Lua
  liblua50 liblua50-dev liblualib50 liblualib50-dev libreadline4-dev
  lua50 lua50-doc

  # Mail
  fetchmail grepmail mutt

  # Postscript and dvi
  a2ps gs gv tetex-base tetex-bin

  # Tcl/Tk/Expect
  expect expectk tcl8.4 tcl8.4-doc tk8.4 tk8.4-doc

  # X
  fvwm inkscape gimp tkdiff x-window-system xnest xzoom

  # (Misc)
  cdparanoia gawk gnupg lsof screen ssh strace sudo unzip wget
  zsh zsh-doc





















#####
#
# rootstrap
# 2004sep09
#
#####

# «rootstrap»  (to ".rootstrap")
# (find-status   "rootstrap")
# (find-vldifile "rootstrap.list")
# (find-udfile   "rootstrap/")

# (find-man "1 rootstrap")
# (find-fline "/usr/bin/rootstrap")
# (find-fline "/usr/lib/rootstrap/builder")
# (find-fline "/usr/lib/rootstrap/modules/uml")
# (find-fline "/usr/lib/rootstrap/modules/mkisofs")
# (find-fline "/usr/lib/rootstrap/modules/docpurge")
# (find-fline "/usr/lib/rootstrap/modules/tasksel")
# (find-fline "/usr/lib/rootstrap/modules/mkfs")
# (find-fline "/usr/lib/rootstrap/modules/base-config")
# (find-fline "/usr/lib/rootstrap/modules/mount")
# (find-fline "/usr/lib/rootstrap/modules/network")
# (find-fline "/usr/lib/rootstrap/modules/localepurge")
# (find-fline "/usr/lib/rootstrap/modules/umount")
# (find-fline "/usr/lib/rootstrap/modules/debian")
# (find-fline "/etc/rootstrap/workdir")
# (find-fline "/etc/rootstrap/dhclient-script")
# (find-fline "/etc/rootstrap/rootstrap.conf")
# (find-fline "/etc/rootstrap/modules")



# (find-status   "cdebootstrap")
# (find-vldifile "cdebootstrap.list")
# (find-udfile   "cdebootstrap/")





#####
#
# bootcd
# 2004sep16
#
#####

# «bootcd»  (to ".bootcd")
# (find-status   "bootcd")
# (find-vldifile "bootcd.list")
# (find-udfile   "bootcd/")

# (find-fline "/etc/bootcd/bootcdwrite.conf")
# (find-fline "/usr/bin/bootcdwrite")
# (find-fline "/usr/share/bootcd/S12bootcdram.sh")
# (find-fline "/usr/share/bootcd/S13bootcdflop.sh")
# (find-fline "/usr/share/bootcd/bootcd-check.lib")
# (find-fline "/usr/share/bootcd/bootcd-ia64.lib")
# (find-fline "/usr/share/bootcd/bootcd-run.lib")
# (find-fline "/usr/share/bootcd/bootcd2disk")
# (find-fline "/usr/share/bootcd/bootcd2disk.conf")
# (find-fline "/usr/share/bootcd/bootcdflopcp")
# (find-fline "/usr/share/bootcd/default.txt")
# (find-fline "/usr/share/doc/bootcd/ChangeLog.gz")
# (find-fline "/usr/share/doc/bootcd/FAQ.gz")
# (find-fline "/usr/share/doc/bootcd/README.Debian")
# (find-fline "/usr/share/doc/bootcd/changelog.gz")
# (find-fline "/usr/share/doc/bootcd/copyright")
# (find-man "1 bootcd")
# (find-man "1 bootcd2disk")
# (find-man "1 bootcdflopcp")
# (find-man "1 bootcdwrite")
# (find-man "5 bootcd2disk.conf")

#*
# (find-fline "/etc/bootcd/bootcdwrite.conf")
cp -v /etc/bootcd/bootcdwrite.conf /tmp/
cat >> /tmp/bootcdwrite.conf <<'%%%'
SRCDISK=/guest
KERNEL=$SRCDISK/boot/vmlinuz-2.4.19
KERNEL=$SRCDISK/boot/vmlinuz-2.4.26-1-386
DISABLE_CRON="$SRCDISK/etc/cron.daily/find $SRCDISK/etc/cron.daily/standard $SRCDISK/etc/cron.daily/security"
ISO_ONLY="yes"
BLANKING="no"
CLEAN_VAR="no"
%%%

# (find-man "1 bootcdwrite" "-c <config directory>")
# (find-fline "/usr/bin/bootcdwrite")
# (find-fline "/var/log/bootcdwrite.log")
# (find-fline "/usr/share/bootcd/bootcd-check.lib" "/var will be cleaned")
bootcdwrite -c /tmp

#*
# (find-man "1 dd")
# (find-man "8 mkswap")
dd bs=1M count=512 if=/dev/zero of=/tmp/swapfile
chmod 600 /tmp/swapfile
mkswap    /tmp/swapfile
swapon    /tmp/swapfile
cat /proc/swaps

#*



CONFIG_ISO9660_FS=y seems not to be configured in /guest/boot/vmlinuz-2.4.26-1-386



dd if=/dev/zero of=$SWAP bs=1024 count=65536


SWAP=/hdc6/tmp/swap1
#SWAP=/swap1

cat /proc/swaps
swapon $SWAP
cat /proc/swaps

du -c /guest
du -c /guest/var/cache/apt/archives
du -c /var/spool/bootcd



# (find-status   "initrd-tools")
# (find-vldifile "initrd-tools.list")
# (find-udfile   "initrd-tools/")
# (find-status   "mkinitrd-cd")
# (find-vldifile "mkinitrd-cd.list")
# (find-udfile   "mkinitrd-cd/")

# (find-fline "/etc/default/initrd-tools.sh")
# (find-fline "/etc/init.d/initrd-tools.sh")
# (find-fline "/etc/mkinitrd/mkinitrd.conf")
# (find-fline "/etc/mkinitrd/modules")
# (find-fline "/usr/sbin/mkinitrd")
# (find-fline "/usr/share/doc/initrd-tools")
# (find-fline "/usr/share/doc/initrd-tools/NEWS.Debian.gz")
# (find-fline "/usr/share/doc/initrd-tools/changelog.gz")
# (find-fline "/usr/share/doc/initrd-tools/copyright")
# (find-fline "/usr/share/initrd-tools")
# (find-fline "/usr/share/initrd-tools/echo")
# (find-fline "/usr/share/initrd-tools/init")
# (find-fline "/usr/share/initrd-tools/linuxrc")
# (find-fline "/usr/share/initrd-tools/scripts")
# (find-fline "/usr/share/initrd-tools/version")
# (find-man "5 mkinitrd.conf")
# (find-man "8 mkinitrd")

# (find-status   "cramfsprogs")
# (find-vldifile "cramfsprogs.list")
# (find-udfile   "cramfsprogs/")

# (find-fline "/usr/sbin/cramfsck")
# (find-fline "/usr/sbin/mkcramfs")
# (find-man "8 mkcramfs")
# (find-fline "/usr/share/doc/cramfsprogs/README")
# (find-fline "/usr/share/doc/cramfsprogs/copyright")
# (find-fline "/usr/share/doc/cramfsprogs/NOTES.gz")
# (find-fline "/usr/share/doc/cramfsprogs/changelog.Debian.gz")


file -L /initrd.img


# (find-fline "/usr/include/linux/initrd.h")

# (find-man "4 initrd")





http://debian-br-cdd.alioth.debian.org/debian/

bt> Toda vez q inicio meu pc tenho que configurar o pppoeconf
echo ppp >> /etc/modules

# (find-efunction 'repeat-complex-command)



# (find-man "8 mkzftree")
# (find-status   "mkisofs")
# (find-vldifile "mkisofs.list")
# (find-udfile   "mkisofs/")
# (find-man "1 dirsplit" "mp3/Collections/Rock")
# (find-fline "/usr/bin/dirsplit")

# (find-man "8 mkisofs")

# (find-k24file "")
# (find-k24file "fs/isofs/")
# (find-k24file "fs/isofs/compress.c")



#####
#
# debconf pre-seeding
# 2004sep18
#
#####

# (find-status   "debconf")
# (find-vldifile "debconf.list")
# (find-udfile   "debconf/")
# (find-status   "debconf-utils")
# (find-vldifile "debconf-utils.list")
# (find-udfile   "debconf-utils/")

# (find-man "1 debconf-get-selections")
# (find-man "1 debconf-getlang")
# (find-man "1 debconf-loadtemplate")
# (find-man "1 debconf-mergetemplate")
# (find-fline "/usr/bin/debconf-get-selections")
# (find-fline "/usr/bin/debconf-getlang")
# (find-fline "/usr/bin/debconf-loadtemplate")
# (find-fline "/usr/bin/debconf-mergetemplate")

# (find-man "1 debconf-copydb")
# (find-man "1 debconf-set-selections")
# (find-man "1 debconf-set-selections" "can be used to pre-seed")
# (find-man "1 debconf-show")
# (find-fline "/usr/bin/debconf")
# (find-fline "/usr/bin/debconf-communicate")
# (find-fline "/usr/bin/debconf-set-selections")
# (find-fline "/usr/bin/debconf-show")
# (find-fline "/usr/lib/python2.3/site-packages/debconf.py")
# (find-fline "/usr/sbin/dpkg-preconfigure")
# (find-fline "/usr/sbin/dpkg-reconfigure")



#####
#
# debconf-show
# 2004dec02
#
#####

# (find-sh "sudo debconf-show --listdbs")
# (find-sh "sudo debconf-show --listowners | sort")
# (find-sh "debconf-show --listowners --db=configdb  | sort")
# (find-sh "debconf-show --listowners --db=config    | sort")
# (find-sh "debconf-show --listowners --db=passwords")

debconf-show --listdbs
debconf-show --listowners | sort
debconf-show --listowners --db=configdb  | sort
debconf-show --listowners --db=config    | sort
debconf-show --listowners --db=passwords

debconf-show d-i
debconf-show d-i --db=configdb
debconf-show d-i --db=config
debconf-show drupal --db=passwords

# (find-fline "/etc/debconf.conf")
# (find-fline "/var/cache/debconf/config.dat")
# (find-fline "/var/cache/debconf/templates.dat")
# (find-fline "/var/cache/debconf/passwords.dat")

# (find-fline "/var/cache/debconf/config.dat" "exim4/dc_eximconfig_configtype")
# (find-fline "/var/cache/debconf/templates.dat"    "dc_eximconfig_configtype")




#####
#
# dvalois's presentation on livecds (using bootcd)
# 2004sep18
#
#####

#*
# http://dvalois.net/downloads/livecd.tar.bz2
rm -Rv /tmp/Apresenta_CD_Live/
tar -C /tmp/ -xvjf $S/http/dvalois.net/downloads/livecd.tar.bz2
cd     /tmp/Apresenta_CD_Live/

#*
cd /tmp/Apresenta_CD_Live/
openoffice cdlive.sxi &

#*

# Slide 2
Sarge
debootstrap -arch i386 woody /usr/local/chroot-sarge

# Slide 3
Sarge
chroot   /usr/local/chroot-sarge

# Slide 4
# Instalar Pacotes, configurar e testar
# Montar /proc
mount /proc proc -t proc
#
# Configurar sources.list de acordo com woody, sarge ou sid
mcedit  /etc/apt/sources.list
#
# Instalar o que quiser...
apt-get  install  x-window-system-core   gnome-core   gdm   gdm-themes  
#
# Instalar bootcd e bootcd-dvdplus no chroot 
chroot   /usr/local/chroot-sid

# Slide 5
# Montar /proc
mount /proc proc -t proc
#
# Configurar sources.list de acordo com woody, sarge ou sid
mcedit  /etc/apt/sources.list
#
# Instalar o que quiser...
apt-get  install  x-window-system-core   gnome-core   gdm   gdm-themes  
#
# Instalar bootcd e bootcd-dvdplus no chroot 
apt-get  install  bootcd bootcd-dvdplus
#
# Sair do chroot 
umount /proc ; exit

# Slide 6
# Instalar fora do chroot (no seu sistema habitual)
apt-get  install  bootcd bootcd-dvdplus
#
# Configurar bootcdwrite.cnf
mcedit  /etc/bootcd/bootcdwrite.cnf

# Slide 7
# Define o ponto inicial de onde a imagem será montada
# Exemplo, para montar um bootcd do seu sistema use:
# SCRDISK=/
SRCDISK=/usr/local/chroot-sid
#
# Define o kernel que será utilizado:
#
KERNEL=$SRCDISK/boot/vmlinuz-2.6.7

# Slide 8
# Duas 'ramdisks' (ram1 e ram2) serão criadas, para conter os seguintes diretórios:
#   ram1: /dev/ /etc /home /root /tmp
#   ram2: /var
#
# Ambas tendo o mesmo tamanho e definido em RAMDISK_SIZE
#
# Exemplo: Se você deseja gastar 16Mb com 'ramdisks', use:
RAMDISK_SIZE=8192

# Slide 9
TYP=CD

# Slide 10
CDSCSI=0,0,0

# Slide 11
CDSPEED=8

# Slide 12
# Você pode especificar um ou mais dispositivos de CD para
#  inicialização. A primeira entrada será considerada como 
# padrão. Os demais deverão ser  informados como opções de
# 'boot' pelo usuário. Veja DISPLAY.
# CDDEV="/dev/hdc /dev/hda /dev/hdb /dev/hdc /dev/hdd "
#
CDDEV="/dev/hdc /dev/hda /dev/hdb /dev/hdc /dev/hdd /dev/sr0 /dev/scd0 /dev/scd1"

# Slide 13
# BLANKING=yes|no|auto
#
# Se você for regravar um CD ou DVD, você deve especificar
# BLANKING=yes. Se BLANKING=auto for especificado o
#  bootcdwrite irá sempre tentar apagar o CD, porém irá ignorar
#  todos os erros durante o processo.
#
BLANKING=no

# Slide 14
# Texto para ser exibido durante o boot (veja a documentação do
#  syslinux).  Esta opção não é suportada em plataformas HPPA
# (HP PA-RISC). Exemplo: (de onde você pode colocar
#  'display.txt').
# DISPLAY="$SRCDISK/usr/share/bootcd/display.txt"
# Este é um texto padrão que exibe as opções de inicialização
# /dev/hda, /dev/hdb, /dev/hdc, /dev/hdd, /dev/scd0 and /dev/scd1:
# DISPLAY="/usr/share/bootcd/default.txt"
#
DISPLAY="/usr/share/bootcd/default.txt"

# Slide 15
# Se você não tem um gravador de CD e deseja apenas criar uma
#  imagem ISO então use ISO_ONLY="yes" e defina, também,
#  BLANKING="no" neste arquivo.
#
ISO_ONLY="yes"

# Slide 16
# DO_CHECK=yes|no
# Verificar a ocorrência de possíveis problemas pode levar um
#  bom tempo,mas é recomendável fazê-lo.
# 
DO_CHECK=yes

# Slide 17
# Se você precisar incluir opções de boot para o kernel como
#  "root=..." e  "ramdisk_size=...", veja maiores detalhes em
#  "append" em lilo.conf(5).
# Exemplo:
# APPEND=\\\"aha1542=0x230 console=ttyS0,9600n8\\\"
#
APPEND=""

# Slide 18
# Se SCRDISK não couber em um CD você pode decidir que
# diretórios de SCRDISK não serão incluídas no CD.
# Exemplo de como excluir /home/user1 e /home/user2
# NOT_TO_CD="$SRCDISK/home/user1$SRCDISK/home/user2"
# Exemplo2:
# NOT_TO_CD="$SRCDISK/home/bs/download $SRCDISK/home/bs/vmware"
#
NOT_TO_CD=""

# Slide 19
# Quanto você inicializa do CD, alguns arquivos serão copiados 
# para a RAM. Aqui você decide, o que NÃO ficará em RAM.
# Os diretórios /etc /var /dev /tmp /home e /root deverão estar em
# RAM pois é preciso gravar neles. Nos CDs estes diretórios ficarão # com nomes diferentes  (/etc/ro, /var.ro, ...) portanto você nunca
#  deverá usar estes nomes # em NOT_TO_RAM!!!.  Os arquivos 
# que  você excluir em  NOT_TO_RAM, serão copiados para o CD e
#  você terá um link simbólico apontando para eles no sistema de
#  arquivo em RAM..Exemplo: Se você deseja excluir /home/s/bigfile e /home/bs/bigdir/;  NOT_TO_RAM="$SRCDISK/home/bs/bigfile $SRCDISK/home/bs/bigdir"
#
NOT_TO_RAM=""

# Slide 20
# SSHOSTKEY=yes|no
# Se você for usar SSH sera útil ter um único SSH HOSTKEY para
# cada CD. Eles serão gerados durante a gravação com
#  SSHHOSTKEY=yes.
#
SSHHOSTKEY=yes

# Espaço disponível para o log e a imagem de disco
#
ERRLOG=/var/log/bootcdwrite.log
VAR=/var/spool/bootcd 

# Slide 21
# Se CLEAN_VAR=yes então alguns arquivos de 'cache' em /var 
#  serão apagados antes de /var ser copiado para o CD de boot. Isto # irá minimizar a necessidade  de espaço no CD. Atualmente 
# apenas o seguinte comando será executado: apt-get clean
# Você pode desligar esta opção com CLEAN_VAR=no
#
CLEAN_VAR=yes

# Slide 22
# FASTBOOT=yes|no
#
# Se FASTBOOT=yes então imagens adcionais da ramdisk será 
# criadas pelo bootcdwrite e copiados no CD. Isto permite uma 
# inicialização mais rápida, mas precisará de
# um espaço extra no CD.
#
# Padrão:
# FASTBOOT=yes
#
FASTBOOT=yes

# Slide 23
# ISOLINUX=auto|yes|no
# Veja /usr/doc/syslinux/isolinux.doc.gz. 
# Se for uma versão mais recente do syslinux então isolinux poderá
# ser usado ao invés dele e ISOLINUX=auto será tratado como # ISOLINUX=yes.
#
# Se você deseja permanecer usando syslinux entãi use 
# ISOLINUX=no.  Padrão: ISOLINUX=auto
#
ISOLINUX=auto

# Slide 24
# SYSLINUX_SAVE=yes|no
# Esta opção só será considerada se o isolinux não estiver sendo
#  utilizado. Se SYSLINUX_SAVE=yes então o syslinux será
#  chamado com a opção "-s".
# A página do manual do syslinux diz: '(...) isto instala a "segura,
#  lenta e estúpida" versão do syslinux (...)'. Em versões mais novas
#  a opção "-s" é sempre usada. Agora você pode alterá-la.
#
# Padrão:
SYSLINUX_SAVE=yes

# Slide 25
# ARCH=auto|HPPA|X86|ia64
# You can create bootcd for HP PA-RISC too. It is possible to let
# bootcdwrite detect your architecture with ARCH=auto.
# To use ARCH=HPPA the debian package bootcd-hppa must be
#  installed..Default: ARCH=auto
ARCH=auto

# Slide 26
# COMPRESS=<yes|no|auto>
# Se você precisa usar a compressão transparente em CDs (via
#  ISO9660 Rock Ridge) coloque COMPRESS=yes. Senão, use
#  COMPRESS=no. Se desejar que o bootcdwrite verifique se você
#  precisa ou não de compressão por use COMPRESS=auto.
#
# Se você definir COMPRESS=auto o bootcdwrite tentará verificar,
# se você tem todos os programas necessários instalados. Neste
#  caso você deve definir DO_CHECK=yes se você for usar
#  COMPRESS=auto.
COMPRESS="auto"

# Slide 27
# Copie o seu kernel, config e system.map
cp /boot/System.map-2.6.7   /usr/local/chroot-sid/boot/System.map-2.6.7
cp /boot/config-2.6.7  /usr/local/chroot-sid/boot/config-2.6.7
cp /boot/vmlinuz-2.6.7  /usr/local/chroot-sid/boot/vmlinuz-2.6.7

# Slide 28
# Execute o bootcdwrite como root
su -
******
bootcdwrite

# Slide 29

# Slide 30
# Executando bootcdwrite

# Slide 31
# Gravando a iso
cdrecord  dev=/dev/hdc  -speed=8  -v  -driveropts=burnfree  -data  /var/spool/bootcd/cdimage.iso





#####
#
# apt-cacher
# 2011nov27
#
#####

# «apt-cacher»  (to ".apt-cacher")
# (find-es "apt-cacher")
# (find-angg ".emacs" "apt-cacher")
# http://www.packtpub.com/article/create-local-ubuntu-repository-using-apt-mirror-apt-cacher

# (find-status   "apt-cacher")
# (find-vldifile "apt-cacher.list")
# (find-udfile   "apt-cacher/")
# (find-debpkg-links "apt-cacher")
# (find-vldifile "apt-cacher.templates" "method for starting")
# (find-fline "/usr/share/apt-cacher/apt-cacher-import.pl")
# (find-man "8 apt-cacher")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
sudo chmod -v 777 /etc/apt/apt.conf.d/
ls -lAF /etc/apt/apt.conf.d/
cat     /etc/apt/apt.conf.d/90apt-proxy.conf

SERVER=lakhesys

cat  >> /etc/apt/apt.conf.d/90apt-proxy.conf <<%%%
# --new stuff--
# (find-es "debrepository" "apt-cacher")
# http://$SERVER:3142/
Acquire::http::proxy=http://$SERVER:3142
%%%

# (find-fline "/etc/apt/apt.conf.d/90apt-proxy.conf")

ls -lAF /etc/apt/apt.conf.d/
ls -l   /etc/apt/apt.conf.d/90apt-proxy.conf
cat     /etc/apt/apt.conf.d/90apt-proxy.conf







# http://127.0.0.1:3142/
# http://127.0.0.1:3142/apt-cacher/
# Says:
#   Edit /etc/apt/apt.conf to include the configuration
#   Acquire::http::proxy=http://lakhesys:3142

# (find-sh0 "sudo chmod -v 777 /etc/apt/apt.conf.d/")

# (find-fline "$ASROOT/etc/default/" "apt-cacher")
# (fline "/sudo::/etc/default/" "apt-cacher")
# (find-fline "/etc/default/apt-cacher")
# (find-fline "/etc/init.d/apt-cacher")
# (find-fline "/etc/apt-cacher/apt-cacher.conf")
# (find-fline "/var/cache/apt-cacher/")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
sudo /etc/init.d/apt-cacher stop
sudo /etc/init.d/apt-cacher start
sudo /etc/init.d/apt-cacher restart
ps ax

# (find-fline "/etc/apt/" "apt.conf")
# (find-fline "/etc/apt/apt.conf.d/")
# (find-RRfile "etc/apt/apt.conf.d/")
# (find-fline "/etc/apt/apt.conf.d/90apt-proxy.conf")
# (find-RRfile "etc/apt/apt.conf.d/90apt-proxy.conf")

# (find-fline "$RR/etc/apt/")
# (find-lugaorfile "etc/apt/apt.conf.d/90apt-proxy.conf")

# (find-angg ".emacs" "varda")
# (find-fline        "/etc/apt/apt.conf.d/")
# (find-fline        "/etc/apt/apt.conf.d/90apt-proxy.conf")
# (find-fline "/sudo::/etc/apt/apt.conf.d/")
# (find-fline "/sudo::/etc/apt/apt.conf.d/90apt-proxy.conf")
# (find-fline     "$RR/etc/apt/apt.conf.d/")
# (find-fline     "$RR/etc/apt/apt.conf.d/90apt-proxy.conf")
# (find-fline     "$RR/etc/apt/sources.list")
#   # (find-es "debrepository" "apt-cacher")
#   Acquire::http::Proxy "http://repository-cache:3142";

# (find-fline "/var/log/apt-cacher/")

* (eepitch-varda)
* (eepitch-kill)
* (eepitch-varda)
sudo apt-get install icont
sudo apt-get install figlet
sudo apt-get install bison-doc
sudo apt-get update
sudo apt-get install robotfindskitten

* (eepitch-varda)
* (eepitch-kill)
* (eepitch-varda)
sudo apt-get update
sudo apt-get                      install linux-image-2.6.38-bpo.2-686
sudo apt-get -t squeeze-backports install linux-image-2.6.38-bpo.2-686
sudo apt-get install sun-java6-jre sun-java6-plugin

# (find-fline "$VR/etc/hosts")





#####
#
# apt-cacher: caching an ISO image
# 2011nov30
#
#####

# «apt-cache-iso»  (to ".apt-cache-iso")
# (find-fline "/etc/apt/sources.list")
# deb http://reef:8080/squeeze1/ squeeze main contrib
# http://reef:8080/
# http://reef:8080/squeeze1/
# http://reef:8080/squeeze1/dists/
# http://reef:8080/squeeze1/dists/squeeze/

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-file-links "/sda7/torrents/")

sudo umount /tmp/squeeze1/
mkdir       /tmp/squeeze1/
sudo mount -o ro,loop /sda7/torrents/debian-6.0.3-i386-DVD-1.iso /tmp/squeeze1/
rm -v               ~/usrc/varwww/squeeze1
ln -s /tmp/squeeze1 ~/usrc/varwww/squeeze1

# (find-aptcacherfile "packages/")




#####
#
# apt-ftparchive
# 2012mar05
#
#####

# «apt-ftparchive»  (to ".apt-ftparchive")
# (find-esgrep "grep -nH -e apt-ftparchive *.e")
# (find-es "apt" "apt-deb-src")
# (find-man "1 apt-ftparchive")
# (find-man "1 apt-sortpkgs")
# (find-man "1 apt-extracttemplates")
# (find-status   "apt-utils")
# (find-vldifile "apt-utils.list")
# (find-udfile   "apt-utils/")
# (find-sh "apt-ftparchive -h")

# http://stackoverflow.com/questions/111756/web-interface-tool-for-debian-repository
# http://stackoverflow.com/questions/9422469/how-to-create-an-offline-repository-for-debian-non-free-solved
# http://wiki.debian.org/HowToSetupADebianRepository





#  Local Variables:
#  coding:               utf-8-unix
#  End: