Debootstrap?
Tested on
- Ubuntu Dapper (6.06LTS) with kernel 2.6.15-28-386 and debootstrap 0.3.3.3;
- Ubuntu Feisty (7.04) with kernel 2.6.20-16-generic and debootstrap 0.3.3.3.
# Why chroot: to be always in a clean Etch (on Mandriva, RedHat, etc...)
# build a debian Etch chroot
debootstrap etch /etch-chroot http://ftp.fr.debian.org/debian
# make some changes on /etch-chroot/root/.bashrc and tar /etch-chroot to keep a
clean chroot under the hand
# ***** first try *****
mount --bind /dev /etch-chroot/dev
mount --bind /proc /etch-chroot/proc
# chroot in
chroot /etch-chroot /bin/bash
echo 'deb http://www.backports.org/debian etch-backports main' >>
/etc/apt/sources.list
apt-get update
# some erros are reported
# W: GPG error: http://www.backports.org etch-backports Release: The
following signatures couldn't be verified because the public key is not
available: NO_PUBKEY EA8E8B2116BA136C
# W: You may want to run apt-get update to correct these problems
apt-get install -t etch-backports live-helper
# dependances (cdebootstrap, etc...) are installed
cd / && lh_config
cd debian-live
lh_build
# out of chroot with ctrl-d
# the iso image is tested with qemu
qemu -cdrom /etch-chroot/debian-live/binary.iso -no-kqemu
# the iso image is ok... back in the chroot
chroot /etch-chroot /bin/bash
nano config/binary
LIVE_BINARY_IMAGES="usb-hdd"
lh_clean binary
lh_binary
# script ends with error
# Can't open /proc/13688/fd/3: No such file or directory
# Cannot initialize 'S:'
# Bad target s:ldlinux.sys
# syslinux: failed to create ldlinux.sys
# this first try installs live-helper_1.0~a19-1 wich fails with usb-hdd images
# this first try fails with or without /dev and /proc mounted
# ***** second try *****
# restart with a clean chroot (tgz)
# started with live-helper_1.0~a13, the project is now on live-helper_1.0~a19
# with live-helper_1.0~a16, the image is double-sized! squashfs problem?
# from live-helper_1.0~a17 to 19, scripts ends with previous error (cf. first
try)
# so live-helper_1.0~a15 is used
cp downloaded/live-helper_1.0~a15-1_all.deb /etch-chroot/root
# chroot in
chroot /etch-chroot /bin/bash
apt-get install debootstrap
dpkg -i /root/live-helper_1.0~a15-1_all.deb
cd / && lh_config
cd debian-live
# the iso image is ok...
nano config/binary
LIVE_BINARY_IMAGES="usb-hdd"
lh_build
# out of chroot with ctrl-d
# the image is tested with qemu
qemu -hda /etch-chroot/debian-live/binary.img -no-kqemu
# the image is ok... back in the chroot and customisation...
chroot /etch-chroot /bin/bash
cd /debian-live
# cycle start
lh_clean binary
nano config/binary
LIVE_BOOT_APPEND="quiet keyb=fr locale=fr nopersistent
ip=eth0,169.254.254.254,255.255.255.0,169.254.254.1"
LIVE_NET_SERVER="169.254.254.254"
nano config/chroot
LIVE_INTERACTIVE="enabled"
nano config/chroot_local-packageslists/mylist
# hardware
lshw
# disk
fdisk
partimage
testdisk
dosfstools
grub
...
ln -s config/chroot_local-packageslists/mylist
lh_chroot --force
# in the interactive shell
# all changes are listed bellow in next section
# remove some services (cron, openbsd-inetd)...
apt-get clean
...
rm chroot/root/.bash_history
lh_binary
# restart this cycle as needed...
# cycle stop
# ***** here is live system changes (made in interactive shell) *****
nano ~/.bashrc (set colors, aliases and mount function)
nano /etc/skel/.bashrc (idem)
mount() { [ "$1" = "" ] && /bin/mount || /bin/mount -o ro,noexec,nodev
"$@"; }
update-rc.d -f mountnfs.sh remove
update-rc.d -f mountnfs-bootclean.sh remove
update-rc.d -f checkfs.sh remove
update-rc.d -f cron remove
update-rc.d -f openbsd-inetd remove
mkdir /media/tmp1 /media/tmp2 /media/tmp3
ln -s /media/tmp1 /mnt/tmp1
ln -s /media/tmp2 /mnt/tmp2
ln -s /media/tmp3 /mnt/tmp3
nano /etc/vim/vimrc
syntax on
Reply to: