Skip to content

Instantly share code, notes, and snippets.

@jeffscrum
Forked from ravecat/debootstrap.md
Last active January 14, 2024 15:44
Show Gist options
  • Save jeffscrum/f854d45ea10e0c3f14839fd1c00f919f to your computer and use it in GitHub Desktop.
Save jeffscrum/f854d45ea10e0c3f14839fd1c00f919f to your computer and use it in GitHub Desktop.

Revisions

  1. jeffscrum revised this gist Jan 14, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -75,7 +75,7 @@ The CD/DVD image is set up using ISOLINUX. Start by creating a new directory, bi
    ```
    Next, an isolinux config file is created:
    ```bash
    cat <<'EOF' > binary/isolinux/isolinux.cfg
    # cat <<'EOF' > binary/isolinux/isolinux.cfg

    ui menu.c32
    prompt 0
  2. jeffscrum revised this gist Jan 14, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ Step 1 – Installing the necessary software
    These are the software packages you need to install on your Debian system:

    ```bash
    apt-get install xorriso live-build syslinux squashfs-tools
    apt-get install xorriso live-build syslinux squashfs-tools isolinux
    ```
    Step 2 – Create a basic filesystem

  3. jeffscrum revised this gist Jan 14, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -41,7 +41,7 @@ In chroot you need to bring in a Linux kernel and the necessary livecd packages.
    ```
    Add hostname to hosts file
    ```bash
    cat > /etc/hosts << EOF
    (live):/ $ cat > /etc/hosts << EOF
    127.0.0.1 localhost
    127.0.1.1 $(cat /etc/hostname)
  4. jeffscrum revised this gist Jan 3, 2024. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -21,8 +21,7 @@ The new filesystem was created in ~/livework/chroot directory. It is time to chr
    Step 3 – chroot
    ```bash
    # cd ~/livework
    # chroot chroot
    # LANG=C.UTF-8 chroot /mnt/debinst /bin/bash
    # LANG=C.UTF-8 chroot chroot /bin/bash
    # mount none -t proc /proc && \
    mount none -t sysfs /sys && \
    mount none -t devpts /dev/pts
  5. jeffscrum revised this gist Jan 3, 2024. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -22,6 +22,7 @@ Step 3 – chroot
    ```bash
    # cd ~/livework
    # chroot chroot
    # LANG=C.UTF-8 chroot /mnt/debinst /bin/bash
    # mount none -t proc /proc && \
    mount none -t sysfs /sys && \
    mount none -t devpts /dev/pts
  6. jeffscrum revised this gist Jan 3, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -13,7 +13,7 @@ Start by creating a new work directory, and bring in a basic Debian filesystem u

    ```bash
    # mkdir ~/livework && cd ~/livework
    # debootstrap --arch=amd64 --variant=minbase bullseye chroot http://deb.debian.org/debian
    # debootstrap --arch=amd64 bullseye chroot http://deb.debian.org/debian
    ```
    The new filesystem was created in ~/livework/chroot directory. It is time to chroot into the new filesystem and finish the installation.

  7. jeffscrum revised this gist Jan 3, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -13,7 +13,7 @@ Start by creating a new work directory, and bring in a basic Debian filesystem u

    ```bash
    # mkdir ~/livework && cd ~/livework
    # debootstrap --arch=amd64 --variant=minbase bullseye chroot
    # debootstrap --arch=amd64 --variant=minbase bullseye chroot http://deb.debian.org/debian
    ```
    The new filesystem was created in ~/livework/chroot directory. It is time to chroot into the new filesystem and finish the installation.

  8. jeffscrum revised this gist Jan 3, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -35,7 +35,7 @@ In chroot you need to bring in a Linux kernel and the necessary livecd packages.
    (live):/ $ apt-get install dialog dbus
    (live):/ $ dbus-uuidgen > /var/lib/dbus/machine-id
    (live):/ $ apt-get install linux-image-amd64 live-boot
    (live):/ $ apt-get install vim ssh wget curl net-tools iputils-ping isc-dhcp-client less binutils parted
    (live):/ $ apt-get install vim ssh wget curl net-tools iputils-ping isc-dhcp-client less binutils parted fdisk
    (live):/ $ echo "liveCD" > /etc/hostname
    (live):/ $ passwd
    ```
  9. jeffscrum revised this gist Jan 3, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -35,7 +35,7 @@ In chroot you need to bring in a Linux kernel and the necessary livecd packages.
    (live):/ $ apt-get install dialog dbus
    (live):/ $ dbus-uuidgen > /var/lib/dbus/machine-id
    (live):/ $ apt-get install linux-image-amd64 live-boot
    (live):/ $ apt-get install vim ssh wget curl net-tools iputils-ping isc-dhcp-client less binutils
    (live):/ $ apt-get install vim ssh wget curl net-tools iputils-ping isc-dhcp-client less binutils parted
    (live):/ $ echo "liveCD" > /etc/hostname
    (live):/ $ passwd
    ```
  10. jeffscrum revised this gist Jan 3, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -105,7 +105,7 @@ I use GNU xorriso to build the final iso image. It creates an isohybrid image th
    -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 livecd.iso binary
    -boot-info-table -o bullseye-livecd.iso binary
    ```

    Conclusion
  11. jeffscrum revised this gist Jan 3, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -105,7 +105,7 @@ I use GNU xorriso to build the final iso image. It creates an isohybrid image th
    -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
    -boot-info-table -o livecd.iso binary
    ```

    Conclusion
  12. jeffscrum revised this gist Jan 3, 2024. 1 changed file with 4 additions and 42 deletions.
    46 changes: 4 additions & 42 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -35,7 +35,7 @@ In chroot you need to bring in a Linux kernel and the necessary livecd packages.
    (live):/ $ apt-get install dialog dbus
    (live):/ $ dbus-uuidgen > /var/lib/dbus/machine-id
    (live):/ $ apt-get install linux-image-amd64 live-boot
    (live):/ $ apt-get install vim man-db ssh wget curl net-tools iputils-ping isc-dhcp-client less binutils
    (live):/ $ apt-get install vim ssh wget curl net-tools iputils-ping isc-dhcp-client less binutils
    (live):/ $ echo "liveCD" > /etc/hostname
    (live):/ $ passwd
    ```
    @@ -52,10 +52,10 @@ ff02::2 ip6-allrouters
    EOF
    ```

    This is a very basic Debian system. On top of it you can install packages such as vim and ssh (apt-get install vim ssh), a desktop environment (apt-get install lxde), a web browser (apt-get install iceweasel) etc. When you are done, cleanup apt caches and exit chroot.
    This is a very basic Debian system. On top of it you can install packages such as desktop environment (apt-get install lxde), a web browser (apt-get install iceweasel) etc. When you are done, cleanup apt caches and exit chroot.
    ```bash
    (live):/ $ apt-get clean && apt-get autoclean && apt-get autoremove
    (live):/ $ rm /var/lib/dbus/machine-id && rm -rf /tmp/* && rm ~/.bash_history
    (live):/ $ rm /var/lib/dbus/machine-id && rm -rf /tmp/*
    (live):/ $ umount /proc /sys /dev/pts
    (live):/ $ exit
    ```
    @@ -107,48 +107,10 @@ I use GNU xorriso to build the final iso image. It creates an isohybrid image th
    isolinux/boot.cat -no-emul-boot -boot-load-size 4 \
    -boot-info-table -o remaster.iso binary
    ```
    To quickly test the image use qemu (apt-get install qemu).

    ```bash
    # qemu-system-x86_64 remaster.iso
    LiveCD boot menu in qemu
    LiveCD boot menu in qemu
    ```
    Transferring the iso image to USB stick

    As mentioned above, isohybrid images can be transferred to USB using dd command. To find out what device handles your USB stick you can use hwinfo (apt-get install hwinfo):

    ```bash
    # hwinfo --disk --short
    disk:
    /dev/sda HDT722525DLAT80
    /dev/sdb WDC WD800JB-00FM
    /dev/sdc Generic USB SD Reader
    /dev/sdd Generic USB CF Reader
    /dev/sde Generic USB SM Reader
    /dev/sdf Generic USB MS Reader
    /dev/sdg Lexar USB Flash Drive

    # dd if=remaster.iso of=/dev/sdg
    ```
    Reboot your computer from the USB stick and you’ll be up and running in no time.

    LiveCD running in qemu
    LiveCD running in qemu

    A few words about persistence

    All iso images build using Debian’s live-boot package have the capability to autodetect a writable storage data area. This data will persist across multiple boot sessions on the same computer. To enable this feature, create a storage file named live-rw with a valid ext2 filesystem and place it on an existing hard drive partition on the computer you are booting:
    ```bash
    # dd if=/dev/zero of=live-rw bs=100MB count=1
    # /sbin/mkfs.ext2 -F live-rw
    # mv live-rw /.
    ```
    In my case I’ve moved live-rw file on my Debian Linux partition. You can also put it on a NTFS partition, at boot time the software will find it and mount it.

    Conclusion

    The iso image in this example has a size of 92MB. It is a basic Debian system as created by debootstrap, with only the necessary livecd executables. From here it will grow as more packages are added and the image is personalized.
    The iso image in this example has a size of 203MB. It is a basic Debian system as created by debootstrap, with only the necessary livecd executables. From here it will grow as more packages are added and the image is personalized.

    I have decided to document my steps in case anyone might find them useful. Please let me know if you run into problems, or if you have any questions or suggestions. I use these steps to build small network appliances, servers, and rescue disks, nothing important. I’ve never went as far as to build a full distribution.

  13. jeffscrum revised this gist Jan 3, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -35,7 +35,7 @@ In chroot you need to bring in a Linux kernel and the necessary livecd packages.
    (live):/ $ apt-get install dialog dbus
    (live):/ $ dbus-uuidgen > /var/lib/dbus/machine-id
    (live):/ $ apt-get install linux-image-amd64 live-boot
    (live):/ $ apt-get install vim man-db ssh wget curl net-tools iputils-ping isc-dhcp-client less
    (live):/ $ apt-get install vim man-db ssh wget curl net-tools iputils-ping isc-dhcp-client less binutils
    (live):/ $ echo "liveCD" > /etc/hostname
    (live):/ $ passwd
    ```
  14. jeffscrum revised this gist Jan 3, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -55,7 +55,7 @@ EOF
    This is a very basic Debian system. On top of it you can install packages such as vim and ssh (apt-get install vim ssh), a desktop environment (apt-get install lxde), a web browser (apt-get install iceweasel) etc. When you are done, cleanup apt caches and exit chroot.
    ```bash
    (live):/ $ apt-get clean && apt-get autoclean && apt-get autoremove
    (live):/ $ rm /var/lib/dbus/machine-id && rm -rf /tmp/* && ~/.bash_history
    (live):/ $ rm /var/lib/dbus/machine-id && rm -rf /tmp/* && rm ~/.bash_history
    (live):/ $ umount /proc /sys /dev/pts
    (live):/ $ exit
    ```
  15. jeffscrum revised this gist Jan 3, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -35,7 +35,7 @@ In chroot you need to bring in a Linux kernel and the necessary livecd packages.
    (live):/ $ apt-get install dialog dbus
    (live):/ $ dbus-uuidgen > /var/lib/dbus/machine-id
    (live):/ $ apt-get install linux-image-amd64 live-boot
    (live):/ $ apt-get install vim man-db ssh wget curl net-tools isc-dhcp-client less
    (live):/ $ apt-get install vim man-db ssh wget curl net-tools iputils-ping isc-dhcp-client less
    (live):/ $ echo "liveCD" > /etc/hostname
    (live):/ $ passwd
    ```
  16. jeffscrum revised this gist Jan 3, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -35,7 +35,7 @@ In chroot you need to bring in a Linux kernel and the necessary livecd packages.
    (live):/ $ apt-get install dialog dbus
    (live):/ $ dbus-uuidgen > /var/lib/dbus/machine-id
    (live):/ $ apt-get install linux-image-amd64 live-boot
    (live):/ $ apt-get install vim man-db ssh wget curl net-tools isc-dhcp-client
    (live):/ $ apt-get install vim man-db ssh wget curl net-tools isc-dhcp-client less
    (live):/ $ echo "liveCD" > /etc/hostname
    (live):/ $ passwd
    ```
  17. jeffscrum revised this gist Jan 3, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -35,7 +35,7 @@ In chroot you need to bring in a Linux kernel and the necessary livecd packages.
    (live):/ $ apt-get install dialog dbus
    (live):/ $ dbus-uuidgen > /var/lib/dbus/machine-id
    (live):/ $ apt-get install linux-image-amd64 live-boot
    (live):/ $ apt-get install man-db ssh wget curl net-tools isc-dhcp-client
    (live):/ $ apt-get install vim man-db ssh wget curl net-tools isc-dhcp-client
    (live):/ $ echo "liveCD" > /etc/hostname
    (live):/ $ passwd
    ```
  18. jeffscrum revised this gist Jan 3, 2024. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -69,9 +69,9 @@ The CD/DVD image is set up using ISOLINUX. Start by creating a new directory, bi
    # cp chroot/boot/vmlinuz-*-amd64 binary/live/vmlinuz
    # cp chroot/boot/initrd.img-*-amd64 binary/live/initrd
    # mksquashfs chroot binary/live/filesystem.squashfs -comp xz -e boot
    # cp /usr/lib/ISOLINUX/isolinux.bin binary/isolinux/
    # cp /usr/lib/syslinux/modules/bios/* binary/isolinux/
    # touch binary/isolinux/DEBIAN_IMAGE
    # cp /usr/lib/ISOLINUX/isolinux.bin binary/isolinux/.
    # cp /usr/lib/syslinux/modules/bios/* binary/isolinux/.
    # touch binary/isolinux/DEBIAN_IMAGE
    ```
    Next, an isolinux config file is created:
    ```bash
  19. jeffscrum revised this gist Jan 3, 2024. 1 changed file with 14 additions and 1 deletion.
    15 changes: 14 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -36,9 +36,22 @@ In chroot you need to bring in a Linux kernel and the necessary livecd packages.
    (live):/ $ dbus-uuidgen > /var/lib/dbus/machine-id
    (live):/ $ apt-get install linux-image-amd64 live-boot
    (live):/ $ apt-get install man-db ssh wget curl net-tools isc-dhcp-client
    (live):/ $ echo "custom-live" > /etc/hostname
    (live):/ $ echo "liveCD" > /etc/hostname
    (live):/ $ passwd
    ```
    Add hostname to hosts file
    ```bash
    cat > /etc/hosts << EOF
    127.0.0.1 localhost
    127.0.1.1 $(cat /etc/hostname)
    # The following lines are desirable for IPv6 capable hosts
    ::1 localhost ip6-localhost ip6-loopback
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    EOF
    ```

    This is a very basic Debian system. On top of it you can install packages such as vim and ssh (apt-get install vim ssh), a desktop environment (apt-get install lxde), a web browser (apt-get install iceweasel) etc. When you are done, cleanup apt caches and exit chroot.
    ```bash
    (live):/ $ apt-get clean && apt-get autoclean && apt-get autoremove
  20. jeffscrum revised this gist Jan 3, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -35,7 +35,7 @@ In chroot you need to bring in a Linux kernel and the necessary livecd packages.
    (live):/ $ apt-get install dialog dbus
    (live):/ $ dbus-uuidgen > /var/lib/dbus/machine-id
    (live):/ $ apt-get install linux-image-amd64 live-boot
    (live):/ $ apt-get install man vi ssh wget curl net-tools isc-dhcp-client
    (live):/ $ apt-get install man-db ssh wget curl net-tools isc-dhcp-client
    (live):/ $ echo "custom-live" > /etc/hostname
    (live):/ $ passwd
    ```
  21. jeffscrum revised this gist Jan 3, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -35,7 +35,7 @@ In chroot you need to bring in a Linux kernel and the necessary livecd packages.
    (live):/ $ apt-get install dialog dbus
    (live):/ $ dbus-uuidgen > /var/lib/dbus/machine-id
    (live):/ $ apt-get install linux-image-amd64 live-boot
    (live):/ $ apt-get install vim ssh wget curl net-tools isc-dhcp-client
    (live):/ $ apt-get install man vi ssh wget curl net-tools isc-dhcp-client
    (live):/ $ echo "custom-live" > /etc/hostname
    (live):/ $ passwd
    ```
  22. jeffscrum revised this gist Jan 3, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -35,7 +35,7 @@ In chroot you need to bring in a Linux kernel and the necessary livecd packages.
    (live):/ $ apt-get install dialog dbus
    (live):/ $ dbus-uuidgen > /var/lib/dbus/machine-id
    (live):/ $ apt-get install linux-image-amd64 live-boot
    (live):/ $ apt-get install vim ssh wget curl net-tools
    (live):/ $ apt-get install vim ssh wget curl net-tools isc-dhcp-client
    (live):/ $ echo "custom-live" > /etc/hostname
    (live):/ $ passwd
    ```
  23. jeffscrum revised this gist Jan 3, 2024. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -22,9 +22,9 @@ Step 3 – chroot
    ```bash
    # cd ~/livework
    # chroot chroot
    # mount none -t proc /proc
    # mount none -t sysfs /sys
    # mount none -t devpts /dev/pts
    # mount none -t proc /proc && \
    mount none -t sysfs /sys && \
    mount none -t devpts /dev/pts
    # export LC_ALL=C
    # export PS1="\e[01;31m(live):\W \$ \e[00m"
    ```
  24. jeffscrum revised this gist Jan 3, 2024. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -58,6 +58,7 @@ The CD/DVD image is set up using ISOLINUX. Start by creating a new directory, bi
    # mksquashfs chroot binary/live/filesystem.squashfs -comp xz -e boot
    # cp /usr/lib/ISOLINUX/isolinux.bin binary/isolinux/
    # cp /usr/lib/syslinux/modules/bios/* binary/isolinux/
    # touch binary/isolinux/DEBIAN_IMAGE
    ```
    Next, an isolinux config file is created:
    ```bash
  25. jeffscrum revised this gist Jan 3, 2024. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -61,7 +61,8 @@ The CD/DVD image is set up using ISOLINUX. Start by creating a new directory, bi
    ```
    Next, an isolinux config file is created:
    ```bash
    # cat binary/isolinux/isolinux.cfg
    cat <<'EOF' > binary/isolinux/isolinux.cfg
    ui menu.c32
    prompt 0
    menu title Boot Menu
    @@ -78,6 +79,7 @@ label live-amd64-failsafe
    append initrd=/live/initrd boot=live persistence config memtest noapic noapm nodma nomce nolapic nomodeset nosmp nosplash vga=normal
    endtext
    EOF
    ```
    Step 5 – Building the iso image

  26. jeffscrum revised this gist Jan 3, 2024. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -53,11 +53,11 @@ The CD/DVD image is set up using ISOLINUX. Start by creating a new directory, bi
    ```bash
    # cd ~/livework
    # mkdir -p binary/live && mkdir -p binary/isolinux
    # cp chroot/boot/vmlinuz-5.10.0-26-amd64 binary/live/vmlinuz
    # cp chroot/boot/initrd.img-5.10.0-26-amd64 binary/live/initrd
    # cp chroot/boot/vmlinuz-*-amd64 binary/live/vmlinuz
    # cp chroot/boot/initrd.img-*-amd64 binary/live/initrd
    # mksquashfs chroot binary/live/filesystem.squashfs -comp xz -e boot
    # cp /usr/lib/ISOLINUX/isolinux.bin binary/isolinux/.
    # cp /usr/lib/syslinux/modules/bios/{ldlinux.c32,menu.c32,libutil.c32,libcom32.c32} binary/isolinux/.
    # cp /usr/lib/ISOLINUX/isolinux.bin binary/isolinux/
    # cp /usr/lib/syslinux/modules/bios/* binary/isolinux/
    ```
    Next, an isolinux config file is created:
    ```bash
  27. jeffscrum revised this gist Jan 3, 2024. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -53,8 +53,8 @@ The CD/DVD image is set up using ISOLINUX. Start by creating a new directory, bi
    ```bash
    # cd ~/livework
    # mkdir -p binary/live && mkdir -p binary/isolinux
    # cp chroot/boot/vmlinuz-6.1.0-15-amd64 binary/live/vmlinuz
    # cp chroot/boot/initrd.img-6.1.0-15-amd64 binary/live/initrd
    # cp chroot/boot/vmlinuz-5.10.0-26-amd64 binary/live/vmlinuz
    # cp chroot/boot/initrd.img-5.10.0-26-amd64 binary/live/initrd
    # mksquashfs chroot binary/live/filesystem.squashfs -comp xz -e boot
    # cp /usr/lib/ISOLINUX/isolinux.bin binary/isolinux/.
    # cp /usr/lib/syslinux/modules/bios/{ldlinux.c32,menu.c32,libutil.c32,libcom32.c32} binary/isolinux/.
  28. jeffscrum revised this gist Jan 3, 2024. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -41,8 +41,8 @@ In chroot you need to bring in a Linux kernel and the necessary livecd packages.
    ```
    This is a very basic Debian system. On top of it you can install packages such as vim and ssh (apt-get install vim ssh), a desktop environment (apt-get install lxde), a web browser (apt-get install iceweasel) etc. When you are done, cleanup apt caches and exit chroot.
    ```bash
    (live):/ $ apt-get clean
    (live):/ $ rm /var/lib/dbus/machine-id && rm -rf /tmp/*
    (live):/ $ apt-get clean && apt-get autoclean && apt-get autoremove
    (live):/ $ rm /var/lib/dbus/machine-id && rm -rf /tmp/* && ~/.bash_history
    (live):/ $ umount /proc /sys /dev/pts
    (live):/ $ exit
    ```
  29. jeffscrum revised this gist Jan 3, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -35,7 +35,7 @@ In chroot you need to bring in a Linux kernel and the necessary livecd packages.
    (live):/ $ apt-get install dialog dbus
    (live):/ $ dbus-uuidgen > /var/lib/dbus/machine-id
    (live):/ $ apt-get install linux-image-amd64 live-boot
    (live):/ $ apt-get install vim ssh
    (live):/ $ apt-get install vim ssh wget curl net-tools
    (live):/ $ echo "custom-live" > /etc/hostname
    (live):/ $ passwd
    ```
  30. jeffscrum revised this gist Jan 3, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -25,7 +25,6 @@ Step 3 – 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"
    ```
    @@ -36,6 +35,7 @@ In chroot you need to bring in a Linux kernel and the necessary livecd packages.
    (live):/ $ apt-get install dialog dbus
    (live):/ $ dbus-uuidgen > /var/lib/dbus/machine-id
    (live):/ $ apt-get install linux-image-amd64 live-boot
    (live):/ $ apt-get install vim ssh
    (live):/ $ echo "custom-live" > /etc/hostname
    (live):/ $ passwd
    ```