Table of Contents

Multiboot usb key with 32 and 64bits debian installers and debian live

Preparing the usb key

cfdisk /dev/sdb
mkfs.vfat /dev/sdb1
mount /dev/sdb1 /media/usb0
grub-install --no-floppy --root-directory=/media/usb0 /dev/sdb
menuentry "debian-installer-i386" {
  linux /boot/vmlinuz_i386 vga=788 -- quiet
  initrd /boot/initrd_i386.gz
}

menuentry "debian-installer-i386 expert" {
  linux /boot/vmlinuz_i386 priority=low vga=788 --
  initrd /boot/initrd_i386.gz
} 

menuentry "debian-installer-amd64" {
  linux /boot/vmlinuz_amd64 vga=788 -- quiet
  initrd /boot/initrd_amd64.gz
} 

menuentry "debian-installer-amd64 expert" {
  linux /boot/vmlinuz_amd64 priority=low vga=788 --
  initrd /boot/initrd_amd64.gz
}

menuentry "live amd64" {
  linux /boot/live_amd64/vmlinuz boot=live live-media-path=/boot/live_amd64 persistent-path=/persistent/amd64/ live-config persistent
  initrd /boot/live_amd64/initrd.img
}

menuentry "live i386" {
  linux /boot/live_i386/vmlinuz boot=live live-media-path=/boot/live_i386 persistent-path=/persistent/i386/ live-config persistent
  initrd /boot/live_i386/initrd.img
}

Debian installer

Debian live

mkdir /media/usb0/persistent
mkdir /media/usb0/persistent/amd64
mkdir /media/usb0/persistent/i386
mkdir /media/usb0/boot/live_amd64
mkdir /media/usb0/boot/live_i386

Generate the debian live image

mkdir /tmp/d-l
mkdir /tmp/d-l/amd64
cd /tmp/d-l/amd64
sudo lh clean --binary
sudo lh config -b usb-hdd -a amd64 -d sid
sudo lh build
SNAP_COW=$(echo "${SNAP_RESYNC_STRING}" | sed -e 's|^/root\([^:.]*\).*$|'"${DEF_SNAP_COW}"'\1|')
SNAP_COW=$(echo "${SNAP_RESYNC_STRING}" | sed -e 's|^/cow\([^:.]*\).*$|'"${DEF_SNAP_COW}"'\1|')
sudo lh clean --binary
sudo lh binary
mount -o loop,offset=512 binary.img /mnt
cd /mnt/live
cp * /media/usb0/boot/live_amd64
mkdir /tmp/initrd_amd64
cp /mnt/live/initrd.img /tmp/initrd_amd64/initrd.img.gz
cd /tmp/initrd_amd64
gunzip initrd.img.gz
cpio -ivmd -F initrd.img
rm initrd.img
${snap_type}SNAP="/cow${snap_mount#$rootmnt}":${snapdev}:${snapfile}" >> /etc/live.conf # for resync on reboot/halt
${snap_type}SNAP="/cow${snap_mount#$rootmnt}":${snapdev}:${snapfile}" >> ${rootmnt}/etc/live.conf # for resync on reboot/halt
snapdata=$(find_files "${PERSISTENT_PATH}${snap_label}.squashfs  ${PERSISTENT_PATH}${snap_label}.cpio.gz ${PERSISTENT_PATH}${snap_label}.ext2  ${PERSISTENT_PATH}${snap_label}.ext3 ${PERSISTENT_PATH}${snap_label}.ext4 ${PERSISTENT_PATH}${snap_label}.jffs2")
snapdata=$(find_files "${PERSISTENT_PATH}/${snap_label}.squashfs  ${PERSISTENT_PATH}/${snap_label}.cpio.gz ${PERSISTENT_PATH}/${snap_label}.ext2  ${PERSISTENT_PATH}/${snap_label}.ext3 ${PERSISTENT_PATH}/${snap_label}.ext4 ${PERSISTENT_PATH}/${snap_label}.jffs2")
find .| cpio -o -H newc | gzip -9 > ../initrd.img
cp ../initrd.img /media/usb0/boot/live_amd64

Debian Live (February 2013)

mkdir /tmp/live_amd64
cd /tmp/live_amd64
lb config -a amd64 -d sid --mirror-bootstrap http://mirrors.ucr.ac.cr/debian/ --mirror-binary http://mirrors.ucr.ac.cr/debian/ --archive-areas "main contrib non-free"

In directory config/package-lists, create file called base.list and add the following to it:

lvm2
testdisk
dmsetup
cryptsetup
cryptmount
gdisk
emacs
mc
joe
gddrescue
magicrescue
wipe
ntfs-3g
partimage
sshfs
firmware-linux-nonfree
firmware-linux