↑ Top
Kaai24
dev studios
| Sign in | DE EN

Build a custom Debian live system

from within an other Debian

Preparations

sudo -i

apt-get install xorriso live-build syslinux squashfs-tools isolinux

mkdir chroot && mkdir -p binary/live && mkdir -p binary/isolinux

Configuration

chroot chroot
mount none -t proc /proc
mount none -t sysfs /sys
mount none -t devpts /dev/pts
export HOME=/root
export LC_ALL=C
export PS1="\e[01;31m(live):\W \$ \e[00m"

apt-get install dialog dbus
dbus-uuidgen > /var/lib/dbus/machine-id
apt-get install linux-image-amd64 live-boot

At this point you can install all the software you need and do all tinkering you want eg. upgrade it to Ilux. Here are some recommended packages. If you want to prepare the /home/* folders put all content into /etc/skel.

You should change the /etc/hostname.

Clean up

apt-get clean
rm /var/lib/dbus/machine-id && rm -rf /tmp/*
umount /proc /sys /dev/pts
exit

Build the filesystem

mksquashfs chroot binary/live/filesystem.squashfs -comp xz -e boot -noappend

Bootmanager

cp chroot/boot/vmlinuz-* binary/live/vmlinuz
cp chroot/boot/initrd.img-* binary/live/initrd
cp /usr/lib/ISOLINUX/isolinux.bin binary/isolinux/.
cp /usr/share/live/build/bootloaders/isolinux/ldlinux.c32 binary/isolinux/.
cp /usr/lib/syslinux/modules/bios/menu.c32 binary/isolinux/.

nano binary/isolinux/isolinux.cfg

ui menu.c32
prompt 0
menu title Boot Menu
timeout 100
label live-amd64
menu label ^Live (amd64)
menu default
linux /live/vmlinuz
append initrd=/live/initrd boot=live persistence
label live-amd64-failsafe
menu label ^Live (amd64 failsafe)
linux /live/vmlinuz
append initrd=/live/initrd boot=live persistence config memtest noapic noapm nodma nomce n
endtext

If your done create an ISO image

xorriso -as mkisofs -r -J -joliet-long -l -cache-inodes -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \
-partition_offset 16 -A "Debian Live" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 \
-boot-info-table -o remaster.iso binary

Start and test the created system now as virtual machine or burn a disc. Setup everything as you like and copy the /home folder to an external drive.

Shutdown the system and copy the contents of the /home folder from the external drive to chroot/etc/skel. Rebuild the filesystem, create a new ISO and test it again. Everything should be preconfigured this time.

You can repeat the steps configuration, clean up and rebuild the filesystem as often as you need

(Edited 08-08-19)

Comments

Kaai
Content is work in progress