It's a type of Planche
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

debootstrap_chroot_live.sh 3.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #!/usr/bin/env bash
  2. # Additional details from
  3. # https://www.opengeeks.me/2015/04/build-your-hybrid-debian-distro-with-xorriso/
  4. # https://wiki.archlinux.org/index.php/Chroot
  5. # Install required packages
  6. apt install debootstrap squashfs-tools syslinux isolinux syslinux-common xorriso
  7. # Make a working dir and a chroot dir
  8. mkdir -p livebuild/chroot
  9. # Bootstrap Debian into chroot
  10. cd livebuild
  11. debootstrap --arch=amd64 testing chroot
  12. # Mount filesystemd and chroot
  13. mount -t proc /proc chroot/proc/
  14. mount --rbind /sys chroot/sys/
  15. mount --rbind /dev chroot/dev/
  16. mount --rbind /run chroot/run/
  17. chroot chroot /bin/bash
  18. # Install and configure live system the way you like
  19. echo "DebianLive" > /etc/hostname
  20. echo -e '127.0.0.1\tlocalhost' > /etc/hosts
  21. echo -e '127.0.1.1\tDebianLive' >> /etc/hosts
  22. echo '' >> /etc/hosts
  23. echo -e '::1\t\tlocalhost ip6-localhost ip6-loopback' >> /etc/hosts
  24. echo -e 'ff02::1\t\tip6-allnodes' >> /etc/hosts
  25. echo -e 'ff02::2\t\tip6-allrouters' >> /etc/hosts
  26. apt install linux-image-amd64 linux-headers-amd64 firmware-* memtest86+ live-boot debian-installer-launcher debootstrap apt-file aria2 bash-completion ntfs-3g btrfs-progs btrfs-compsize btrfs-heatmap btrfsmaintenance build-essential ccache checkinstall chrony cifs-utils cmake command-not-found cryptsetup curl deb-multimedia-keyring dosfstools duperemove e2fsprogs ethtool fail2ban fuse git xfsprogs nano vim man less testdisk wireguard zfs-dkms grub-efi-amd64 grub-pc-bin haveged hwinfo iftop iotop iptables iputils-ping jq localepurge locales lsb-base lshw lz4 net-tools nfs-common network-manager* nodm openconnect pigz python python-pip python-dev python3 python3-pip python3-dev rsync screen smartmontools sudo sshpass strace tcpdump terminology tlp tp-smapi-dkms tshark ttf-mscorefonts-installer wget wireshark xz-utils zlib1g zstd zfs-initramfs chntpw cmospwd lsof dnsutils xfce4* imagemagick spellutils wamerican-insane xsensors zip unzip rar unar p7zip mdadm udftools udisks2* ffmpeg vlc* fancontrol paprefs pasystray pavumeter pavucontrol-qt i2c-tools f2fs-tools nilfs-tools reiserfsprogs libdvdcss2 libdvdread4
  27. apt autoremove --purge
  28. apt clean
  29. apt autoclean
  30. rm -rf /tmp/*
  31. # Exit from chroot
  32. exit
  33. # Unmount chrooted environment
  34. umount --recursive chroot
  35. # Start building ISO
  36. mkdir -p image/{live,isolinux}
  37. cp chroot/boot/vmlinuz* image/live/vmlinuz
  38. cp chroot/boot/initrd* image/live/initrd
  39. cp chroot/boot/memtest86+.bin image/live/memtest86+.bin
  40. cp chroot/boot/memtest86+_multiboot.bin image/live/memtest86+_multiboot.bin
  41. cp /usr/lib/ISOLINUX/isolinux.bin image/isolinux/
  42. cp /usr/lib/syslinux/modules/bios/* image/isolinux/
  43. echo > image/isolinux/isolinux.cfg << EOF
  44. UI menu.c32
  45. prompt 0 menu title Debian Live
  46. timeout 30
  47. label Debian Live menu label ^Debian Live menu default kernel /live/vmlinuz append initrd=/live/initrd boot=live
  48. label hdt menu label ^Hardware Detection Tool (HDT) kernel hdt.c32 text help HDT displays low-level information about the systems hardware. endtext
  49. label Memtest86+ menu label ^Memory Failure Detection (memtest86+)
  50. /live/memtest86+.bin
  51. label Memtest86+ (multiboot) menu label ^Memory Failure Detection (memtest86+) /live/memtest86+_multiboot.bin
  52. EOF
  53. # Make squashfs
  54. mksquashfs chroot/ image/live/filesystem.squashfs -e boot
  55. # Create hybrid ISO
  56. 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 debianlive.iso image