Building a livecd with Debian Live


Micah R Ledbetter

<micah@micahrl.com>

http://younix.us

More details about my particular customizations at http://younix.us/soc/creating-a-linux-livecd/.

wtf would you want to do that

Debian Live overview

Real documentation is at http://live.debian.net/ - this is just an overview.

  1. # mkdir livecd; cd livecd
  2. # lb config
  3. # lb build

This results in a directory tree like this:

# ls -1F
auto/
binary/
binary-hybrid.iso
binary.list
binary.packages
build.log
cache/
chroot/
chroot.packages.install
chroot.packages.live
config/

Debian Live configuration

And the config directory is where you'll spend most of your time:

# ls -1F config
archives/
binary
binary_debian-installer/
binary_debian-installer-includes/
binary_grub/
binary_rootfs/
binary_syslinux/
bootstrap
chroot
chroot_apt/
chroot_local-patches/
common
hooks/
includes/
includes.binary/
includes.chroot/
package-lists/
packages/
packages.binary/
packages.chroot/
preseed/
source
task-lists/
templates/

Customization

Customization: custom CA certificate

Customization: add a user

I have a users.chroot hook that does this for me.

password='$6$Ww6QA/nwY$7ngMEfWsOMoApkBXY1itmxQWDSFYjZpgIR1tl8M1xiBHOGHtiy1TxkTxcZVC1tw6lz4QrDMwwgUn9llxYAtkK/'
groupadd --gid 999 jessica
groupadd --gid 998 basicallyroot
umask 077

useradd --home-dir /home/jessica \
    --create-home \
    --skel /etc/skel-jessica \
    --shell /bin/bash \
    --uid 999 \
    --no-user-group \
    --gid 999 \
    --groups sudo,basicallyroot \
    --password "$password" \
    jessica

chmod 700 ~jessica

su jessica -c 'cd ~; umask 077; git clone https://younix.us/cgit/cgit.cgi/dhd.git/ .dhd'
su jessica -c 'git config remote.origin.url mrled@h.younix.us:~/opt/rcs/dhd.git'

echo "%basicallyroot   ALL=NOPASSWD: ALL" > /etc/sudoers.d/basicallyroot
chmod 440 /etc/sudoers.d/basicallyroot

Customization: third party APT repositories

Customization: backdoors and reverse connections

Remote access behind a firewall.

The end

Thanks! <3