Hi,

I would like to share my thoughts regarding how I'd like to restructure
and improve our bootloader setup infrastructure.

Present
~~~~~~~

We have 2 image types - EFI and MBR. EFI images use the gummiboot
bootloader, and MBR images use the extlinux bootloader. These are 2
completely different boot-loader types with incompatible configuration
file formats.

I keep in mind that in the future we may want to change one of them, or
remove, or add a 3rd one, say grub2.

This is when we need to deal with boot-loader configuration.

1. MIC creates an image, it needs to install the boot-loader and
configure it.
2. The kernel RPM needs to
   a) add kernel to the bootloader configuration files when kernel RPM
      is installed (%post RPM spec section).
   b) remove kernel from the bootloader configuration when a kernel RPM
      is removed (%postun RPM spec section).
3. It is not implemented yet, but we'd like to have the system-installer
   program which would install Tizen IVI OS from a USB stick to an
   internal (or any other) disk. System-installer needs to install the
   boot-loader and configure it.


At the moment we have 2 git projects: setup-efi-ivi and setup-mbr-ivi.
They result in 2 RPMs: setup-efi-ivi.rpm and setup-mbr-ivi.rpm.

1. setup-efi-ivi.rpm contents:
  a). setup-efi-ivi - a script to install EFI bootloader (currently
      gummiboot) and create working bootloader configuration for all
      the currently installed kernels.
  b). setup-gummiboot-conf - change gummiboot configuration (e.g., add
      a kernel, etc).

2. setup-mbr-ivi.rpm contents:
  a). setup-mbr-ivi - a script to install MBR bootloader (currently
      extlinux) and create working bootloader configuration for all
      the currently installed kernels.
  b). setup-extlinux-conf - change extlinux configuration (e.g., add
      a kernel, remove a kernel, etc).

At the moment the scripts do not have enough functionality.


Future
~~~~~~

This is how I want to change it. First of all, have a single source
project called 'setup-boot-ivi'. This single source project will provide
the following 3 binary packages:

1. setup-efi-ivi - EFI-specific stuff
2. setup-mbr-ivi - MBR-specific stuff
3. setup-boot-ivi - common stuff

Then:

1. setup-efi-ivi.rpm contents:
  a. setup-efi-ivi - the same script as we have now, but improved
  b. setup-gummiboot-conf - the same script as we have now, but more
                            functionality.
  c. setup-efi-conf - just a symlink to setup-gummiboot-conf

2. setup-mbr-ivi.rpm contents:
  a. setup-mbr-ivi - the same script as we have now, but improved
  b. setup-extlinux-conf - the same script as we have now, but more
                           functionality.
  c. setup-mbr-conf - just a symlink to setup-extlinux-conf

3. setup-boot-ivi contents:
  a. setup-boot-ivi - automatically detect the system type and run
                      either setup-efi-ivi or setup-mbr-ivi
  b. setup-kernel-ivi - add or remove a kernel to/from the
                        bootloader configuration


Use
~~~

1. MIC will just run 'setup-boot-ivi' from all KS files.

2. In kernel's %post we'll run 'setup-kernel --add' which will add
   the newly installed kernel to the bootloader configuration files.

3. Similarly, in kernel's %postun we'll run 'setup-kernel --remove'
   which will remove the kernel from the bootloader configuration files.

4. If someone mistakingly screws the boot-loader configuration file,
   he/she can always run 'setup-kernel --add' manually and re-create the
   default bootloader configuration for a given kernel.


Internals
~~~~~~~~~

1. setup-gummiboot-conf and setup-extlinux-conf will be generic and 
IVI-independent, they'll just parse and modify the bootloader
configuration file.

2. setup-efi-ivi will install the EFI bootloader itself plus run
setup-kernel-ivi to add the kernel to bootloader's configuration file

3. setup-mbr-ivi does the same, but for the MBR case.

4. setup-boot-ivi is a simple wrapper which checks what is the system we
deal with and either calls setup-efi-ivi or setup-mbr-ivi.

5. setup-kernel-ivi also detects the system type (MBR or EFI) and
adds/removes the kernel from the bootloader configuration file by
either calling setup-efi-conf or setup-mbr-conf.

All scripts are shell scripts. I would better use python, but I do not
want to add an early boot component which requires python. And shell
should be enough.

How does this sound?

Suggestions?

Thanks!

-- 
Best Regards,
Artem Bityutskiy

_______________________________________________
IVI mailing list
[email protected]
https://lists.tizen.org/listinfo/ivi

Reply via email to