Warning: this is an htmlized version!
The original is here, and
the conversion rules are here.
#######
#
# E-scripts and notes about making livecds and cdds
#
# 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/livecd.e>
#           or at <http://angg.twu.net/e/livecd.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/>.
#
#######




# «.debian-cdd-packages»  (to "debian-cdd-packages")
# «.cloop»		(to "cloop")
# «.translucency»	(to "translucency")
# «.ovlfs»		(to "ovlfs")
# «.linux-live»		(to "linux-live")
# «.apt-get-autoclean»	(to "apt-get-autoclean")
# «.var-www-vcarchives»	(to "var-www-vcarchives")
# «.debootstrap»	(to "debootstrap")

# «.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")







#####
#
# fazendo os meus próprios cdds
# 2004aug25
#
#####

# «debian-cdd-packages»  (to ".debian-cdd-packages")
#*
acse cdd
#*

# (find-status   "cdd-common")
# (find-vldifile "cdd-common.list")
# (find-udfile   "cdd-common/")
# (find-status   "cdd-dev")
# (find-vldifile "cdd-dev.list")
# (find-udfile   "cdd-dev/")
# (find-status   "cdd-doc")
# (find-vldifile "cdd-doc.list")
# (find-udfile   "cdd-doc/")

apti cdd-common cdd-dev cdd-doc

knoppix

http://www.knoppix.net/docs/index.php/KnoppixRemasteringHowto
http://www.math.concordia.ab.ca/docs/custom-gnoppix.php

# (find-fline "/usr/share/doc/cdd-doc/debian-cdd.en.txt.gz")

# (find-fline "/usr/share/lintian/overrides/cdd-common")
# (find-fline "/usr/share/cdd/menu/cdd-menu")
# (find-fline "/usr/share/cdd/unixgroups/cdd-actions")
# (find-fline "/usr/share/cdd/cdd-update-menus")
# (find-fline "/usr/share/cdd/cdd-actions")
# (find-fline "/usr/share/cdd/cdd-utils")
# (find-udfile "cdd-common/README.CDD")
# (find-udfile "cdd-common/README.Debian")
# (find-udfile "cdd-common/copyright")
# (find-udfile "cdd-common/changelog.gz")
# (find-udfile "cdd-common/NEWS.Debian.gz")
# (find-man "8 cdd-update-usermenus")
# (find-man "8 cdd-user")
# (find-man "8 get-group-users")
# (find-man "8 cdd-role")
# (find-man "8 cdd-update-menus")
# (find-fline "/usr/sbin/cdd-user")
# (find-fline "/usr/sbin/cdd-role")
# (find-fline "/usr/sbin/cdd-update-menus")
# (find-fline "/usr/sbin/cdd-update-usermenus")
# (find-fline "/usr/lib/menu/cdd-menu")
# (find-fline "/etc/cdd/cdd.conf")




#####
#
# the cloop kernel patch
# 2004aug27
#
#####

# «cloop»  (to ".cloop")
apti cloop-src cloop-utils

# (find-status   "cloop-utils")
# (find-vldifile "cloop-utils.list")
# (find-udfile   "cloop-utils/")
# (find-udfile   "cloop-utils/README")
# (find-udfile   "cloop-utils/README.Debian")
# (find-status   "module-assistant")
# (find-vldifile "module-assistant.list")
# (find-udfile   "module-assistant/")
# (find-man "1 create_compressed_fs")
# (find-man "1 extract_compressed_fs")
# (find-man "8 module-assistant")

# (find-status   "cloop-src")
# (find-vldifile "cloop-src.list")
# (find-udfile   "cloop-src/")
# (find-udfile   "cloop-src/README.Debian")
# (find-fline "/usr/src/cloop.tar.gz")
# (code-c-d "cloop" "~/usrc/modules/cloop/")
# (find-cloopfile "")
# (find-cloopfile "Makefile")

# (find-man "make-kpkg")
# (find-man "make-kpkg" "--added-modules foo")
# (find-man "make-kpkg" "    modules\n")
#*
mkdir -p ~/usrc/modules/
rm -Rv   ~/usrc/modules/cloop/
tar -C   ~/usrc/ -xvzf /usr/src/cloop.tar.gz
cd       ~/usrc/modules/cloop/

cd ~/bigsrc/kernel-source-2.4.26/
MODULE_LOC=~/usrc/modules \
  make-kpkg --rootcmd fakeroot modules_image	|& tee omkmimg

#*
sudo dpkg -i ~/bigsrc/cloop-module-2.4.26_2.01.4-2+10.00.Custom_i386.deb

#*
# (find-k24file "omkmimg")
# (find-status   "cloop-module-2.4.26")
# (find-vldifile "cloop-module-2.4.26.list")
# (find-udfile   "cloop-module-2.4.26/")

cd /lib/modules/2.4.26/kernel/drivers/block/
sudo insmod cloop.o

#*
# (find-man "8 depmod")

rm -Rv /tmp/block/
mkdir  /tmp/block/
cp -iv /lib/modules/2.4.26/kernel/drivers/block/* /tmp/block/
cd     /tmp/block/
depmod -e -n * |& tee o

# (find-fline "/tmp/block/o")

#*
make  modules_install






#####
#
# the translucency kernel patch
# 2004aug28
#
#####

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

# (find-fline "/sbin/mount.translucency")
# (find-fline "/usr/share/doc/translucency-source/README")
# (find-fline "/usr/share/doc/translucency-source/README.Debian")
# (find-fline "/usr/share/doc/translucency-source/changelog.Debian.gz")
# (find-fline "/usr/share/doc/translucency-source/copyright")
# (find-fline "/usr/share/doc/translucency-source/kernel.txt")
# (find-fline "/usr/share/doc/translucency-source/pros_and_cons")
# (find-fline "/usr/share/doc/translucency-source/todo.txt")
# (find-fline "/usr/share/doc/translucency-source/troubleshooting.txt")
# (find-fline "/usr/share/modass/overrides")
# (find-fline "/usr/share/modass/overrides/translucency-source")
# (find-fline "/usr/src/translucency.tar.bz2")
# (find-man "8 mount.translucency")
# (find-man "8 translucency")




#####
#
# linux-live
# 2004aug28
#
#####

# «linux-live»  (to ".linux-live")
# http://www.linux-live.org/
# http://www.linux-live.org/dl/linux-live-4.2.1.tar.gz
#*
rm -fRv ~/usrc/linux-live-4.2.1/
tar -C ~/usrc/ -xvzf $S/http/www.linux-live.org/dl/linux-live-4.2.1.tar.gz
cd     ~/usrc/linux-live-4.2.1/

#*
# (code-c-d "linuxlive" "~/usrc/linux-live-4.2.1/")
# (find-linuxlivefile "")




#####
#
# the ovlfs kernel patch
# 2004aug28
#
#####

# «ovlfs»  (to ".ovlfs")
# http://umn.dl.sourceforge.net/sourceforge/ovlfs/ovlfs-2.0.1.tgz
#*
rm -fRv ~/usrc/ovlfs-2.0.1/
tar -C ~/usrc/ \
  -xvzf $S/http/umn.dl.sourceforge.net/sourceforge/ovlfs/ovlfs-2.0.1.tgz
cd     ~/usrc/ovlfs-2.0.1/

#*
# (code-c-d "ovlfs" "~/usrc/ovlfs-2.0.1/")
# (find-ovlfsfile "")
# (find-ovlfsfile "doc/")





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

# «apt-get-autoclean»  (to ".apt-get-autoclean")
# (find-man "8 apt-get" "   autoclean")
# (find-man "8 apt-get" "-s, --simulate")
#*
sudo apt-get update
sudo apt-get upgrade
#*
cd /var/cache/apt/archives/
du -c				|& tee /tmp/odu0
sudo apt-get -s -V autoclean	|& tee /tmp/oagac
sort /tmp/oagac > /tmp/oagacs
cat /tmp/odu0
du -c
#*
cd /var/cache/apt/archives/
du -c				|& tee /tmp/odu0
sudo apt-get -V autoclean	|& tee /tmp/oagac | sort > /tmp/oagacs
du -c				|& tee /tmp/odu1
cat /tmp/odu0

#*

# (find-fline "/var/cache/apt/archives/")
# (find-fline "/tmp/oaacs")





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

# «var-www-vcarchives»  (to ".var-www-vcarchives")
# (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 (I don't know how to use it yet):
# (find-fline "/usr/bin/apt-ftparchive")

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

#*
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/
mkdir -p       dists/sarge/main/binary-i386/

# dpkg-scanpackages debs /dev/null \
#   | tee        dists/sarge/main/binary-i386/Packages \
#   | gzip -c9 > dists/sarge/main/binary-i386/Packages.gz

# apt-ftparchive is much faster than dpkg-scanpackages...
# (find-man "1 apt-ftparchive")
# (find-man "1 apt-ftparchive" "\n       packages\n")
#
apt-ftparchive packages debs \
  | tee        dists/sarge/main/binary-i386/Packages-a \
  | gzip -c9 > dists/sarge/main/binary-i386/Packages-a.gz

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

       apt-ftparchive [-hvdsq] [--md5] [--delink] [--readonly] [--contents]
                      [-o=config string] [-c=file]
                      {packages path... [override [pathprefix]] |
                      sources path... [override [pathprefix]] | contents path
                      | release path | generate config-file section... |
                      clean config-file}





# Now do it seriously
#*
mkdir       /tmp/cdd/
sudo umount /tmp/cdd/
sudo mount -o loop /hdb2/CDs/debian-br-cdd/sarge-i386-1.raw /tmp/cdd

#*
sudo dselect update
#*
# (find-angg "LUA/debs.lua")
grep-status --show-field=Package,Version --field=Status ' installed' \
  > /tmp/installed-debs

( ls /var/cache/apt/archives/*.deb
  find /tmp/cdd/ -name '*.deb' | sort
  ls /hdb2/CDs/cdd-extra/*.deb
)  > /tmp/.debs

lua50 ~/LUA/debs.lua /tmp/installed-debs /tmp/.debs \
  | sort > /tmp/currentdebs

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

#*
sudo rm -Rv    /var/www/vcarchives/
sudo mkdir     /var/www/vcarchives/
sudo chmod 777 /var/www/vcarchives/
#*
rm -Rfv /var/www/vcarchives/debs
rm -Rfv /var/www/vcarchives/dists
cd      /var/www/vcarchives/
mkdir    debs
mkdir -p dists/sarge/main/binary-i386/
#*
cd      /var/www/vcarchives/
for i in $(grep -v '#' /tmp/currentdebs); do
  cp -il $i debs/ || cp -i $i debs/
done

cd /var/www/vcarchives/debs/
ls *.deb | lua50 -e '
  for str in io.lines() do
    newstr, n = string.gsub(str, "[0-9]%%3a", "")
    if n>0 then print("mv -v " .. str .. " " .. newstr) end
  end
' | sh

cd /var/www/vcarchives/
dpkg-scanpackages debs /dev/null \
  | tee        dists/sarge/main/binary-i386/Packages \
  | gzip -c9 > dists/sarge/main/binary-i386/Packages.gz

#*
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 sub-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-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")
#*
rm -Rv /sarge-root

#*
mkdir  /sarge-root
mount  /dev/hdb5 /sarge-root
rm -Rv /sarge-root/*
rm -Rv /sarge-root/.*

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

#*
# Pack the things that were downloaded by http
# (find-fline "/sarge-root/")
# (find-fline "/sarge-root/var/lib/apt/lists/")
# (find-fline "/sarge-root/var/cache/apt/archives/")
cd /sarge-root/
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 /sarge-root2
mkdir  /sarge-root2
cd     /sarge-root2
tar -C /sarge-root2 -xvf /tmp/sarge-debs.tar
# download the whole system:
debootstrap sid /sarge-root2 http://ftp.br.debian.org/debian/

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

#*
# (find-man "8 debootstrap" "apt-setup")
sudo mount -t proc sarge-root-proc /sarge-root/proc
eeg -f <(<<'%%%'
EDITOR=nano apt-setup
nano /etc/apt/sources.list
# deselect/apti?
%%%
) sudo chroot /sarge-root /bin/bash

#*


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 /sarge-root/proc proc none 0 0" >> /etc/fstab
mount proc-sid /sarge-root/proc -t proc
cp /etc/hosts /sarge-root/etc/hosts
chroot /sarge-root /bin/bash

#*
# (find-fline "/etc/fstab")
echo "proc-sid /sarge-root2/proc proc none 0 0" >> /etc/fstab
mount proc-sid /sarge-root2/proc -t proc
cp /etc/hosts /sarge-root/etc/hosts
chroot /sarge-root /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 /sarge-root " \
        "/sbin/getty 38400 tty8"  >> /etc/inittab
[ define a login tty that will use this system ]
 main # init q
[ reload init ]






#####
#
# deboostrap on /sarge-root
# 2004sep13
#
#####

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

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

#*
rm -Rv /sarge-root/*
rm -Rv /sarge-root/.*

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

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

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

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

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

#*




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

#*
# «adduser-edrx»  (to ".adduser-edrx")
# «chsh-edrx»  (to ".chsh-edrx")
# (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 /sarge-root/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 /sarge-root/tmp/

#*
# «export-snarf.tgz»  (to ".export-snarf.tgz")
cd ~/snarf/
tar -cvzf /sarge-root/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 > /sarge-root/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 "/sarge-root/etc/kernel-img.conf")
chroot /sarge-root /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 /sarge-root/proc proc none 0 0" >> /etc/fstab


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

SARGESHROOT=(sudo chroot /sarge-root /bin/sh)
SARGESHEDRX=(sudo chroot /sarge-root /usr/bin/sudo -u edrx /bin/sh)
SARGEZSHROOT=(sudo chroot /sarge-root /home/edrx/run-zsh)
SARGEZSHEDRX=(sudo chroot /sarge-root /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=/sarge-root
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

#*


NOT_TO_RAMCD (NOT_TO_RAM v NOT_TO_CD) =  . . . . . . . . . . . . . 0
RAM_ALL (etc v home v root v NOT_TO_RAM v NOT_TO_CD) = . . . . . . 10564
Needed RAM (RAM_ALL - NOT_TO_RAMCD) =  . . . . . . . . . . . . . . 10564
90 % of RAM  = . . . . . . . . . . . . . . . . . . . . . . . . . . 7372
--- WARNING ---
Not enough RAM (Needed RAM > 90 % of RAM)



CONFIG_ISO9660_FS=y seems not to be configured in /sarge-root/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 /sarge-root
du -c /sarge-root/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














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