6

Majority of Linux distributions available to install these days are distributed in the form of single ISO file which conforms to both El Torito standard and contains a bootloader so that ISO image can be copied using dd both to the CD and an USB stick and be understood by BIOS/EFI. However, there are systems such as NOOBS for Raspberry Pi and others mainly for embedded devices which are not distributed as an ISO file but as a set of files that can be copied to an external storage such as SD card directly using a normal cp command right away. For example, the following files are distributed in NOOBS:

BUILD-DATA
INSTRUCTIONS-README.txt
RECOVERY_FILES_DO_NOT_EDIT
bootcode.bin
defaults
os
recovery.cmdline
recovery.elf
recovery.img
recovery.rfs
recovery7.img
riscos-boot.bin

This looks like a more convenient way for an end user because it does not require usage of dd and therefore does not result in wiping all data on an external storage. Why are not all Linux distributions distributed as such instead of ISO file? A set of files can be archived so it's not a problem distributing a single file vs many files.

  • Don't use ISO. It is an old, mostly anachronistic format. If you want to distribute an fs image, distribute an fs image. ISO sucks. – mikeserv Jul 19 '15 at 16:59
  • @mikeserv: This not me who uses ISO. Recently I built a new computer and had to install Linux on it (Slackware is my choice). I read up a bit on El Torito and how BIOS/EFI works. This is when this question came to my mind. – user1042840 Jul 19 '15 at 17:02
  • Yes. The nonsense most distros do w/ their El Torito EFI image is stupid. It's just a hacky attempt at large-scale compatibility. There are some clues here about how to get to the root of that crap anyway. – mikeserv Jul 19 '15 at 17:07
  • @mikeserv it's a convenient container just in case you never published an OS image yourself -- and the ISO contents can be eligible for simply dumping them elsewhere either. :) – Michael Shigorin Jan 12 '20 at 09:59

1 Answers1

5

The main requirement for files provided by a distribution is that they allow users to boot a computer using the distribution (either as a live system or an installation system, or both).

On PCs, it's commonly understood that to allow booting a single image on as many systems as possible, the best approach is a combined El Torito/EFI image; this can be written to a CD or a USB key and supports booting on BIOS-based systems as well as EFI-based systems. (There are a number of caveats though, see the Debian wiki page on UEFI.) So distributions highlight this option, even though it's not the only one available; other possibilities are booting over the network using PXE, or booting a kernel directly via EFI. Many distributions provide the necessary files to do this; in theory, copying these files to the appropriate EFI directory on a USB key should just work (for Debian).

On Raspberry Pi-style embedded systems, providing a bootable system typically means providing the contents of an SD card as you mention.

For both SD cards and USB images it is possible to copy the distribution's files to an existing medium without overwriting it. In the case of BIOS-based PCs this is more complex than just copying the files, since the USB key needs to have a bootloader installed to it as well; that's why distributions tend to provide an image with instructions for completely overwriting a USB key. If you dig around though you'll generally find instructions for extracting the required files from the downloaded image and installing them manually to a USB key without overwriting anything. (See here for Debian.)

So in summary:

  • distribution installation files are provided in the form most suitable for each target device, with the largest possible target population;
  • for both SD cards and USB keys it is possible to set up a bootable device without overwriting the contents completely (assuming enough free space).
Stephen Kitt
  • 434,908
  • 1
    No. It doesn't need a bootloader. Almost every single computer sold today comes with its own bootloader. – mikeserv Jul 19 '15 at 17:12
  • Most distributions target older computers as well as the latest and greatest though... And explaining how to boot to an EFI shell and load things manually is a bit harder than a USB key with syslinux. – Stephen Kitt Jul 19 '15 at 17:15
  • You don't need to boot an EFI shell. And it really isn't harder - it just happens. And anyway, EFI has been the firmware of choice for every manufacturer for some 5 years or so at least. – mikeserv Jul 19 '15 at 17:16
  • @mikeserv: Almost every single computer sold today comes with its own bootloader - really? Does it mean that BIOS/EFI could just run Linux w/o GRUB/(E)LILO? – user1042840 Jul 19 '15 at 17:17
  • @user1042840 - no. It means EFI could. Not BIOS. see this for a start. – mikeserv Jul 19 '15 at 17:22
  • @mikeserv I've updated my answer, I hope it's better... As for BIOS, you're right! But even EFI systems get it wrong; some for instance only recognise El Torito on external drives, not GPT :-(. – Stephen Kitt Jul 19 '15 at 18:45
  • Comments are not for extended discussion; this conversation has been moved to chat. – terdon Jul 19 '15 at 18:46
  • @StephenKitt: you probably didn't move to chat so I will ask this question here again: yous said that On PCs, it's commonly understood that to allow booting a single image on as many systems as possible, the best approach is a combined El Torito/EFI image - what do you mean by "EFI Image"? An (unnecessary) bootloader? – user1042840 Jul 19 '15 at 19:10
  • @user1042840 - no it's actually another fs image on El Torito - it's how it works. I pointed you to a link which shows how and where to find it in the comments on your question. – mikeserv Jul 19 '15 at 19:11
  • 1
    @StephenKitt: On Raspberry Pi-style embedded systems, providing a bootable system typically means providing the contents of an SD card as you mention. - is this because Raspberry Pi's firmware just knows what to do with these files, i.e. it can load a kernel without using an extra bootloader saved to SD Card similarly to how EFI works these days? – user1042840 Jul 19 '15 at 19:45
  • 1
    @user1042840 Raspberry Pis look for a file named bootcode.bin and use that to boot; you'll see one of the files in NOOBS matches this. – Stephen Kitt Jul 19 '15 at 20:32
  • @StephenKitt: right, I read about how bootup process looks on Rpi. But can you confirm that my thinking is correct - Rpi just knows what to do with these files, the same as EFI? – user1042840 Jul 19 '15 at 20:56
  • @mikeserv you seem to mess up bootloader and bootmanager -- I've got a real bootloader within my Elbrus 801-PC's firmware, it loads kernel and initrd directly; please spend some time reading http://www.rodsbooks.com/efi-bootloaders/ so you don't misinform others. Regarding ISO vs EFI, I find this rant highly informative (and amusing since I didn't have to figure it out myself): http://mjg59.dreamwidth.org/4957.html – Michael Shigorin Jan 12 '20 at 10:03