Commit Graph

6 Commits

Author SHA1 Message Date
Thomas Petazzoni
7080eef9b8 fs/iso9660: support building a real iso9660 filesystem
Until now, the iso9660 filesystem handling only supported using an
initrd/initramfs to store the root filesystem, which is very different
from what we do with the other filesystems.

This commit changes the iso9660 logic to also allow using directly an
iso9660 filesystem to store the root filesystem. A new option,
BR2_TARGET_ROOTFS_ISO9660_INITRD, is created to tell the iso9660 that
we want to use an initrd and not directly the root filesystem in
iso9660 format. This option defaults to 'y' to preserve the existing
behavior.

After this commit, we therefore have three possibilities:

 * BR2_TARGET_ROOTFS_ISO9660=y, with BR2_TARGET_ROOTFS_INITRAMFS and
   BR2_TARGET_ROOTFS_ISO9660_INITRD disabled. In this case, the
   iso9660 filesystem is directly the contents of the root filesystem
   (since is possible thanks to the Rockridge extensions that were
   already enabled using the -R option of genisoimage). Obviously, it
   means that the root filesystem is read-only.

 * BR2_TARGET_ROOTFS_ISO9660=y and BR2_TARGET_ROOTFS_INITRAMFS=y (the
   value of BR2_TARGET_ROOTFS_ISO9660_INITRD doesn't matter). In this
   case, the root filesystem is already linked into the kernel image
   itself, as an initramfs. So the iso9660 filesystem doesn't contain
   the root filesystem as is, but just the bootloader and the kernel
   image.

 * BR2_TARGET_ROOTFS_ISO9660=y, BR2_TARGET_ROOTFS_ISO9660_INITRD=y and
   BR2_TARGET_ROOTFS_INITRAMFS disabled. In this case, a separate
   initrd is used. The iso9660 filesystem only contains the
   bootloader, the kernel and the initrd.

In order to support the first case out of the box, root=/dev/sr0 is
added on the kernel command line in the example Grub configuration
file, so that the kernel knows where the root filesystem is
located. This argument is ignored when initrd/initramfs are used.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-06-14 23:21:10 +02:00
Thomas Petazzoni
168cce0496 fs/iso9660: prepare cleaner kernel/initrd path handling
The iso9660.mk modifies the menu.lst file from Grub to set the correct
initrd/kernel image locations. However, with the upcoming support of
other bootloaders for iso9660 filesystems, we need to modify a bit
this logic.

Instead of relying on the specific details of the grub menu.lst
syntax, we introduce the __KERNEL_PATH__ and __INITRD_PATH__ magic
keywords, which iso9660.mk will replace by the appropriate
values. They can therefore be used where needed in grub menu.lst, and
in similar configuration files of other bootloaders, as will be
supported in the following commits.

Also, in order to be consistent with the soon to be introduced support
for having the root filesystem itself as iso9660, this commit changes
the installation location of the initrd and kernel. Instead of being
/initrd and /kernel, they become /boot/initrd and
/boot/$(LINUX_IMAGE_NAME).

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Samuel Martin <s.martin49@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-06-14 23:18:53 +02:00
Thomas Petazzoni
61db081ca1 fs/iso9660: change the location of the splash image
In order to simplify the introduction of the support for using ISO9660
as the real root filesystem, this commit changes the location of the
grub splash image. This makes it match where the splash image is
located in $(TARGET_DIR), so that regardless of whether the
initrd/initramfs solution or the real iso9660 filesystem solution are
used, the splash image is installed at the same location.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Samuel Martin <s.martin49@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-06-14 23:18:37 +02:00
Thomas Petazzoni
13d7c78394 fs/iso9660: add Grub splashscreen support
When Grub is built with splashscreen support, copy the splashscreen
image to the ISO9660 filesystem. Otherwise, disable the splashscreen
in the grub menu.lst file.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2013-12-31 00:05:17 +01:00
Thomas Petazzoni
b49c231cab fs/iso9660: put the Buildroot boot entry first in Grub menu.lst
The ISO9660-specific Grub menu.lst contains two entries: one entry to
chainload the bootloader available in the first hard drive, and
another entry to boot the Buildroot system.

However, it defaults to booting the first entry, i.e chainloading
what's on the first hard drive. For a Buildroot generated system, this
is quite odd: we're not even booting the system built by Buildroot.

So, switch the two entries, and put the Buildroot boot entry first.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2013-12-29 12:17:27 +01:00
Thomas Petazzoni
0585241505 Move all filesystem generation code to fs/
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2010-04-09 11:04:36 +02:00