> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On
> Behalf Of Artem Bityutskiy
> Sent: Monday, December 16, 2013 2:00 PM
> To: [email protected]
> Subject: setup packages
> 
> 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.
I think this is a key 'feature' to keep in mind when you restructure the 
bootloader setup infrastrucutre, let's make it as easy as possible to add *any* 
kind of different bootloader.

> 
> 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.
Out of curiosity, how do you detect that?
> 
> 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?
This sounds very good to me!

Cheers,
Geoffroy 

Intel Corporation NV/SA
Kings Square, Veldkant 31
2550 Kontich
RPM (Bruxelles) 0415.497.718. 
Citibank, Brussels, account 570/1031255/09

This e-mail and any attachments may contain confidential material for the sole 
use of the intended recipient(s). Any review or distribution by others is 
strictly prohibited. If you are not the intended recipient, please contact the 
sender and delete all copies.

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

Reply via email to