[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Loopback.cfg (and multi bootloader) support



Hello,

I have finally thought that it was worth to push my latest changes to debian-next. I think that they are not ready to be pushed to proper branches but I no longer need to hide them into my local repository.

Feel free to move them to a new tmp-branch if you think that they are doing more harm being in debian-next than not being there. Well, this is my first push to debian-next and I seem a little nervous :).

  * About the commits

  ** Multibootloader ( d515ae56842f9420ff4c629eac18904f7beef2e8 )

  --bootloader is transformed into --bootloaders.
  E.g. --bootloaders=grub-pc,syslinux

The first bootloader in --bootloader (primary bootloader) is the one which will be used to build the final iso / usb.

The main purpose of multibootloader is to enable the loopback.cfg support which you could think about the first bootloader which does not need to be exclusive. I mean in the old model you could not have syslinux and grub-pc at the same time. They were mutually exclusive. Now they are not. And well, loopback.cfg bootloader, which it's actually not a bootloader but just a file does not avoid other bootloaders to work properly.

  ** Loopback.cfg ( b6771e736022d31b0cb53c552a0f7a42a1028a09 )

    Loopback cfg support.

    Development details
    --------------------

*** This patch has been based originally on: binary_grub2 . It has been improved thanks to some binary_syslinux bits.

    *** This patch ensures that binary_loopback_cfg needs is run
    before binary_syslinux is run.
    The reason is that it reuses some code from binary_syslinux to avoid
    problems when binary_syslinux renames the kernel filenames.

    *** This patch already supports CPU detection

*** I haven't tested all the possible scenarios for the script (with the latest version). When amd64 and 486 Gnu/Linux flavours is used and the bootloader is syslinux it works ok.

    *** I have not implemented a disable switch for not generating it.
    Usually you always want loopback.cfg to be there.

    *** Compared to binary_grub2 script I have removed the installation
    entries because I did not see any of them in binary_syslinux.

    How to test
    -----------

These are some steps to easily test if Looback cfg support is working ok.

    0) We assume you have generated an iso
    1) Make sure you have a partition that Grub understands. Plain ext4 or
    vfat should do it.
    2) Create directory: /boot/boot-isos/
3) Put the iso file into that directory making sure it has an ISO or iso
    extension.
    4) Setup your computer to boot from cdrom and use: Super Grub2 Disk
    2.00s2 (Hybrid version recommended)
    5) Choose Boot manually...
    6) Choose Bootable ISOs (in /boot- ... )
    7) Choose (the detected) GRUB Loopback Config
    (hdN,msodsN)/boot/boot-ios/name-of-the.iso
8) You will be presented your loopback.cfg. Choose anyone of the entries
    (unless it does not match your cpu architecture of course).
    9) You should boot into your Debian Live without problems (thanks to
    findiso boot parametre).

    If you ever wanted to test from your grub2 installation instead from
    Super Grub2 Disk check: http://www.supergrubdisk.org/wiki/Loopback.cfg
    for an example.


  * Concerns about the commits

** Multibootloader. OLDIFS use makes IFS to be reset to "" instead to it being unset.
    Either we need to detect if old IFS was unset to unset it
    or we need a proper way of setting it as a local variable.
    Even more IFS it's not currently used in
    Check_package (which it's called from: binary_hdd).
we should have a clean way of resetting/unsetting IFS when calling Check_package.

The other approach it's to explicitly define IFS with its default value in the places inside live-build code where we implicitly suppose that it's going to have
    its default value.

** Loopback.cfg. In the future when syslinux will support long filenames we won't need the hack about syslinux begin primary bootloader or not.

** Documentation about LB_BOOTLOADERS . I don't know where's the best place to explain that when you have: --bootloaders="grub-pc,syslinux" then grub-pc is the primary bootloader because it's the first one in the list. That bootloaders need to be separated by commas and so on.

** Multibootloader. As syslinux renames kernel filenames then --bootloaders="grub-pc,syslinux" should not work. You will get a grub menu but it won't be bootable because of not finding those kernel files.

I'm waiting for dba opinion but I think we can leave it as a known bug till we decide if we fix by syslinux supporting long filenames or with the workaround that I used on loopback.cfg.

  ** Translation. That documentation would need translations in the future.

** Debian Live specifics. I have tried to adapt my code to the way is done in Debian Live code but surely it can be improved.

Feedback is welcome!


adrian15
--
Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/


Reply to: