#########################################################################################################################
Introducing Debian Stretch/Buster + Linux-Live Kit + Aufs patched Generic Kernel
About- This is my attempt at making a Debian based Live distro that is able to be persistent off usb or hard drive, installable to hard drive in "frugal" mode or full install to hard drive or play live in either default or toram mode with/without persistence and without mounting or changing any hard drive partitions, etc.
General Info:
The newest is the 042019 iso's, and the 042019 MultiDistro as well.
##Install to USB/USB-HDD or frugal install to HDD-
You can use /boot/bootinst.bat (windows) or /boot/bootinst.sh (linux) to install to usb but you must edit them for paths. Or use a utility like Unetbootin, available through sboui, or do it manually as I'll show you here-
You must be booted from a slackware/debian/ubuntu system or livecd/usb to do this, preferably a Debian based distro.
In whatever linux system you're in, mount the Stretch/Buster iso anywhere you want, copy the files/folders to your usb or hard drive for frugal mode (straight hard drive install explained below), then install syslinux (fat32), extlinux (usb/usb-hdd), or grub (usb-hdd/hdd), then reboot and boot from new Stretch/Buster.
Frugal install means it runs as a livecd/usb with or without persistence, such as Slax, etc. You can install it in a already installed system such as Linux or Windows without touching, changing or harming the other systems.
In frugal mode you can boot from any fat32/ntfs or ext2/3/4 filesystem on usb/usb-hdd or hdd.
Examples:
Manual frugal install to fat32 or ext2/3/4 usb/usb-hdd/hdd
First mount your usb as root or if you have permission as your user, then mount the Stretch/Buster iso, then copy the contents of iso to usb/usb-hdd/hdd, then install the bootloader (syslinux/extlinux/grub/lilo), then reboot into your new system.
In this example, your usb/usb-hdd or hdd partition you're going to install StretchRC2 to is /dev/sda1, please note in your system your usb may be sdb1, sdc1, etc. Please use fdisk -l as root in terminal to find out device name for your usb/hdd partition/drive.
You may edit the below text and copy/paste it into terminal for ease. example supposes your mounting the burned DVD or iso on hard drive, that iso was downloaded to /home/live/Downloads.
As root, in terminal, for DVD mounted from file manager in debian as /dev/sr0, may be /dev/cdrom in others.
mkdir /mnt/usb
mkdir /mnt/iso
mount -o loop /dev/sr0 /mnt/iso
mount /dev/sda1 /mnt/usb
cp -r /mnt/iso/* /mnt/usb
from downloaded iso
mkdir /mnt/usb
mkdir /mnt/iso
mount -o loop /home/live/Downloads/StretchRC2-x86_64.iso /mnt/iso
mount /dev/sda1 /mnt/usb
cp -r /mnt/iso/* /mnt/usb
After it finishes copying install syslinux, extlinux, or grub
For fat32 usb/usb-hdd
syslinux -s /dev/sda1
For ext2, ext3 or ext4 usb/usb-hdd
extlinux -i /mnt/usb
If install grub2 to usb/usb-hdd/hdd
grub-install /dev/sda
grub-mkconfig -grub-mkconfig -o /boot/grub/grub.cfg
or you may have to do
update-grub
* Make sure your boot flag is set also, use Gparted to do this or in console.
If you already have a Linux bootloader installed just edit your syslinux.cfg/grub.cfg for Stretch/Buster, see /boot/syslinux.cfg
##Full Install to Hard Drive or USB-HDD- using Grub2
*You need to be booted from a Stretch or Buster dvd/usb frugal install to do this!
A manual full install is relatively easy too.
In short- we're gonna do a full install to a hard drive partition from usb/hdd/dvd live session and the resulting install will function exactly as a full Debian install to hard drive.
First, in this example we're booting from cd/dvd or usb/hdd premounted at /run/initramfs/memory/data (which is where the StretchRC2 or Buster folder is).
Now, we're gonna decompress the StretchRC2/Stretch.sb from a squashfs file into the partition using sb2dir, this will populate the partition with the folders bin, etc, home, lib, lib64, opt, root, sbin, usr, and var. Then we're gonna make the other empty folders for a linux system.
mkdir /mnt/sda1
mount /dev/sda1 /mnt/sda1
cd /mnt/usb/StretchRC2
sb2dir Stretch.sb /mnt/sda1
After it finishes do
cd /mnt/sda1
mkdir boot
mkdir dev
mkdir media
mkdir mnt
mkdir proc
mkdir run
mkdir srv
mkdir sys
mkdir tmp
Now you gotta reinstall your kernel and do update-initramfs to make a initrd for the partition you're installing to.
Use synpatic to reinstall the kernel then do update-initramfs.
In this example I'm reinstalling the StretchRC2 kernel 4.9.0-8-amd64.
Now copy the contents of /boot to your hdd partition you're installing to-
cp -r /boot/* /mnt/sda1/boot
Now make a grub folder in /mnt/sda1/boot
mkdir -p /mnt/sda1/boot/grub
Now do blkid as root in terminal to find out UUID of sda1 which in this example is 2359cd84-dc34-4386-a3ba-f441e7fce7bc.
Now edit /etc/fstab using nano or a gui app like Leafpad.
Fstab should look like this
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda6 during installation
UUID=2359cd84-dc34-4386-a3ba-f441e7fce7bc / ext4 errors=remount-ro 0 1
# swap was on /dev/sda8 during installation
/dev/sda8 none swap sw 0 0
/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0
Now we have to make a initrd for the live kernel to boot, using the update-initramfs command.
just copy/paste this into terminal, adjust for drive and kernel
update-initramfs -k 4.9.0-8-amd64 -c -u -b /mnt/sda1/boot
Now make symbolic links for kernel and initrd in /
cd /mnt/sda1
ln -s boot/vmlinuz-4.9.0-8-amd64 vmlinuz
ln -s boot/initrd.img-4.9.0-8-amd64 initrd.img
Now install grub to /dev/sda
If installing Grub
grub-install /dev/sda
grub-mkconfig -grub-mkconfig -o /mnt/sda1/boot/grub/grub.cfg
or
update-grub
Now reboot into your new system!
Remastering-
You can remaster this distro anytime using the live kit found in /root/Tomas-M-linux-live-d27460d or /root/linux-live-2.1
Edit the configs inside notably build and config for your distro name, etc.
You can do it from persistent/non-persistent live session or hard drive install. You must have a aufs-patched kernel.
as root
cd Tomas-M-linux-live-d27460d
./build
or cd linux-live-2.1
./build
Have fun!