SOLVED - Running other distro ISO's Debian Buster Live USB

If it doesn't relate to Debian, but you still want to share it, please do it here

Re: SOLVED - Running other distro ISO's Debian Buster Live U

Postby kkman007 » 2020-08-24 01:51

The link was the steps I used. If you think its spam I am happy to delete it. Just let me know. I can just copy the text. Your assumtion is incorrect.
The only reason I repeated my requet was because I thought it was usful.

PS. I have received no direct help from anyone on this forum for me to use on "my artical". The closest was help from Head_on_a_Stick which showed me how he built his live iso using live-build, which I am not using.

On second thought I will remove the link.

Your suggestion is false, but if after reading this thread, that was your conclusion. Then I am sorry for giving such an impression.
Last edited by kkman007 on 2020-08-24 02:14, edited 1 time in total.
kkman007
 
Posts: 20
Joined: 2020-08-09 19:53
Location: London

Re: Running other distro ISO's from Debian Buster Live USB (

Postby cuckooflew » 2020-08-24 01:54

Well, that is your choice, no one said you must remove it , it looks like you copied pasted most of it here any way, .. I did get a screen shot of the post, just in case you decided to edit it, ... Some people might be interested, but the topic stays in off topic, and the repeated requests for moving it hopefully stop.

Dai_trying wrote:You do realise that images for live buster LXDE already exist dont you? along with other desktops too

https://cdimage.debian.org/debian-cd/cu ... bt-hybrid/

Yes, and those are the most reliable, coming from a reliable source.
I use the netinstall image, for a smaller sized base, and then build on it, when I have it the way I want it to be, with a few tools I use, I make a live usb device.
Last edited by cuckooflew on 2020-08-24 02:04, edited 2 times in total.
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!
cuckooflew
 
Posts: 683
Joined: 2018-05-10 19:34
Location: Some where out west

Re: SOLVED - Running other distro ISO's Debian Buster Live U

Postby kkman007 » 2020-08-24 01:55

This was the write up I did about the steps I used to create the Live USB. Hope it of use to someone.

Lets start by installing the needed packages
sudo apt install gdisk grub-efi grub-efi-amd64-bin grub-pc-bin -y
Before we continue, we need a way to find the USB mounting point. The best way I have found is to run the following command, twice. Once when the USB device is not plugged in and then again when the device has been plugged in. You should be able to see the additional device.
sudo lsblk -all
In my case I saw “sda” followed by its parititions EG: “sda1”.
So, lets create a bash variable which will point to our USB device, this is done by prefixing “/dev/” to our device mapping we found above.
mountpoint=/dev/sda
The next step is somtimes needed to ensure the USB device is clean for creating the partitions needed.
sudo dd if=/dev/zero of=$mountpoint seek=1 count=12204
This basically distroys the start of the device removing any partition information which ensures things work without weired effects.
Next we run the following command to zap or clean the device.
sudo sgdisk — zap-all $mountpoint
At this point we need to remove and reinsert the device. We do this to get the system to reload/clear any old partition information it loaded before about the device.
Lets just check that the device name is still the same by checking the path still exists
ls $mountpoint
If we see now errors, then we continue, otherwise we need to run the “lsblk” command again to find the new path and change the “mountpoint” variable to point to the new path. This is very unlikely but better safe than sorry :-)
We run the clear “sgdisk” command again and hopfully we will see a nice confirmation that it had no problems clearing the device.
sudo sgdisk — zap-all $mountpoint
The above steps have resulted in a nice clean USB ready to work with.
Now we can create the partition structure we will be using
sudo sgdisk — clear \
— new 1::+1M — typecode=1:ef02 — change-name=1:’BIOS boot partition’ \
— new 2::+100M — typecode=2:ef00 — change-name=2:’EFI System’ \
— new 3::-0 — typecode=3:8300 — change-name=3:’SplashOSLive’ \
$mountpoint
The first partition is our BIOS boot partition used for legacy boot. The second will hold the GRUB and EFI settings to allow UEFI boot. The last partition is where we will copy any systems we wish to boot to.
The EFI partitions needs a FAT filesystem, whilst the data partition can be any. As I want to boot a linux system, I will use ext2 filesystem. So lets format the partitions.
sudo mkfs.fat -F32 ${mountpoint}2
sudo mkfs.ext2 -F -L “SplashOSLive” ${mountpoint}3
Now lets mount the EFI partition, make it writtable and create the file structure.
mkdir sda2
sudo mount -t vfat ${mountpoint}2 sda2 -o rw,umask=0000
sudo chmod -R 777 sda2/
sudo mkdir -p sda2/EFI/BOOT
The mount allows us write access to the EFI drive, the chmod grants full access to the partition and we create a directy “/EFI/BOOT” to hold our grub configuration.
We are ready to install grub to make our USB bootable. We will start by installing the UEFI bootloader.
sudo grub-install — modules=”fat iso9660 part_gpt part_msdos normal boot linux configfile loopback chain efifwsetup efi_gop efi_uga ls search search_label search_fs_uuid search_fs_file gfxterm gfxterm_background gfxterm_menu test all_video loadenv exfat ext2 ntfs btrfs hfsplus udf” sda2/ — removable — boot-directory=sda2 — efi-directory=sda2 — uefi-secure-boot
The important part above is the “modules” section which allows us to define grub modules which will be included in the installation. The list should be enough for most use cases. If you have a grup.cfg file yourself you can check which modules you need by looking for lines starting with “insmod”. EG: “insmod part_gpt”.
Now lets finish the grub installation process by installing legacy grub.
sudo grub-install — target=i386-pc — boot-directory=sda2/EFI/BOOT/ $mountpoint
All that is left is to create our grub config files, copy any distro files we will use and delete a few “unwanted” files.
The default path UEFI boot loader looks for a config file to use is “/boot/grub” so lets create it.
mkdir sda2/boot
mv sda2/grub sda2/boot/grub
Lets create a sample grub.cfg file for it to use.
cat > sda2/boot/grub/grub.cfg <<EOL
set timeout=20
default=0
menuentry “UEFI Secure Boot Bootloader” {
search — set=root — file /grubefi.cfg
configfile /grub.cfg
}
EOL
Lets do the same and create a grub.cfg for the legacy boot loader, this time we will put it in “/EFI/BOOT/grub/grub.cfg”
cat > sda2/EFI/BOOT/grub/grub.cfg <<EOL
set timeout=20
default=0
menuentry “Legacy Bootloader” {
search — set=root — file /grubbios.cfg
configfile /grub.cfg
}
EOL
We could stop here and just add our own menu entries here, but since this drive is EFI and will be hidden, it will make it difficult to make changes later. Thats why we will create our own config file on the data partition “SplashOSLive”.
We need to mount our data partition for the next step.
mkdir sda3
sudo mount ${mountpoint}3 sda3
sudo chmod -R 777 sda3
Lets create our grub.cfg file.
cat > sda3/grub.cfg <<EOL
loadfont unicode
insmod all_video
insmod part_msdos
insmod part_gpt
insmod fat
insmod ntfs
insmod ntfscomp
set gfxmode=800x600x32
set gfxpayload=keep
set gfxterm_font=unicode
terminal_output gfxterm
set timeout=20
default=1
menuentry “SplashOS Live Bootloader” {
echo “SplashOS Live Bootloader”
}
menuentry “ Live Boot To RAM from USB” {
search — no-floppy — set=root — file /area2/vmlinuz
linux /area2/vmlinuz toram=filesystem.squashfs quiet splash boot=live live-media-path=/area2/
initrd /area2/initrd.img
}
menuentry “ Boot Lubuntu ISO” {
set isofile=”/ubuntu/lubuntu.iso”
search — no-floppy — set=root — file $isofile
loopback loop $isofile
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noeject
initrd (loop)/casper/initrd
}
EOL
The above grub.cfg has two menus, we will only go through the steps to run SplashOS Live. If you want to try the “Lubuntu” menu you need to download the latest Lubuntu.iso from Ubuntu and create a folder called “ubuntu” and copy the ISO to it (Please note this does not work with Secure Boot enabled). UPDATE: Please check the end of the artical for a method to boot using Secure Boot.
For your reference SplashOS can be any Debian Buster 10.5 flavor, you just need to extract the initrd, vmlinuz and filesystem.squashfs files.
You can also create your own, which as I mentioned I will be happy to show in another artical, if there is interest.
So in my case I copy my system to the USB
mkdir sda3/area2
sudo cp /boot/initrd* sda3/area2/initrd.img
sudo cp /boot/vmlinuz* sda3/area2/vmlinuz
sudo cp /lib/live/mount/medium/filesystem.squashfs sda3/area2/filesystem.squashfs
The above will take time ( if your not using USB 3 device a lot longer ).
There are a number of files which where automatically created, which if left cause problems, so lets delete them. They are for EFI “fallback”, which because of our build steps, are NOT required.
rm sda2/EFI/BOOT/grub.cfg
rm sda2/EFI/BOOT/BOOTX64.CSV
rm sda2/EFI/BOOT/fbx64.efi
Lastly, lets clear up our mounts and directories created
sudo umount sda2
sudo umount sda3
sudo rm -rf sda2
sudo rm -rf sda3
kkman007
 
Posts: 20
Joined: 2020-08-09 19:53
Location: London

Re: SOLVED - Running other distro ISO's Debian Buster Live U

Postby cuckooflew » 2020-08-24 02:09

Thank you for sharing these, some people do find them interesting.

Incidently, if you browsed the forum a little , you will see there is a board for
Docs, Howtos, Tips & Tricks
Share your own howto's etc. Not for support questions!

http://forums.debian.net/viewforum.php?f=16
That is the more appropriate board ,if you want to share your "how to", or tips, but look through it , there may all ready be some others on the same subject.
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!
cuckooflew
 
Posts: 683
Joined: 2018-05-10 19:34
Location: Some where out west

Re: SOLVED - Running other distro ISO's Debian Buster Live U

Postby Head_on_a_Stick » 2020-08-24 08:54

@OP: please use code tags when posting terminal output, it greatly improves the readability.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12770
Joined: 2014-06-01 17:46
Location: /dev/chair

Previous

Return to Offtopic

Who is online

Users browsing this forum: No registered users and 7 guests

fashionable