[SOLVED] To install in the internal EMMC a general boot loader of "high level"

Discussion in 'UDOO X86' started by stecolumna, Aug 23, 2017.

  1. stecolumna

    stecolumna UDOOer

    Joined:
    May 20, 2016
    Messages:
    159
    Likes Received:
    38
    I want to recup the situation experimentations:
    I have successfully installed 5 OS in my UdooX86 Ultra all with X:

    M2: first partition Debian 9.1
    M2: third partition Fedora 26
    SATA SSD: first partition FreeBSD 12.0
    SATA SSD: third partition Slackware 14.2
    SATA SSD: fourth partition Ubuntu 17.04

    Slackware and Fedora support 3 monitors with 3 different workspace
    FreeBSD (kernel rebuilded with GIT clone drm-next), Debian and Ubuntu actually support only 2 monitors but I think that this is a software and not hardware problem.

    I have also installed FreeBSD 12.0 in MicroSD 64GB formatted in GPT and boot separately with FreeBSD BTX boot loader without problems.

    I can boot 4 OS from GRUB of Debian or Fedora in M2 or from GRUB of Ubuntu in SATA SSD.
    If I use boot0cfg in SATA SSD I can boot also with FreeBSD BTX boot loader in the SATA SSD but I can't access to the other 2 OS in the same disk.
    I have also installed the FreeBSD GRUB in SATA SSD but I can't find the good commands to boot.
    I have understood that FreeBSD BTX boot loader and GRUB can't coexist.

    Then I have had a new idea: to use the internal EMMC to install a general boot loader of "high level" (obviously after the boot manager of the UdooX86).

    Now I ask you: do you know a good boot manager able to recognize all this 5 OS installation and write itself the code to activate every single OS to boot ?
    The Debian or Ubuntu or Fedora GRUB they are either capable to do this EXECPT for FreeBSD. I have to use the "famigerate" 40_custom that is a hieroglyph for me. It work fine only in a very old PC of my father but I haven't find the good command for 40_custom to boot the FreeBSD installation on the MBR legacy mode SATA SSD.

    If my idea to install in the internal EMMC a general boot loader able to boot ALL 5 OS is good can you help me to identify which boot loader I have to choose ?

    Thanks in advance
     
  2. LDighera

    LDighera UDOOer

    Joined:
    Jan 13, 2014
    Messages:
    206
    Likes Received:
    36
    Have you looked into U-Boot?
     
    stecolumna likes this.
  3. stecolumna

    stecolumna UDOOer

    Joined:
    May 20, 2016
    Messages:
    159
    Likes Received:
    38
    Dear LDighera
    I was reading about either SYSLINUX / EXTLINUX and U-Boot but I think that U-Boot it's better for EMMC, too.

    I will study this bootloader to understand how to install it in the EMMC.

    Thank you very much
     
  4. sirrab

    sirrab UDOOer

    Joined:
    Jul 26, 2014
    Messages:
    264
    Likes Received:
    32
    why?
    I guess my question is "why"? Why do you need so many OS options on 1 computer? Are you a developer?
     
  5. stecolumna

    stecolumna UDOOer

    Joined:
    May 20, 2016
    Messages:
    159
    Likes Received:
    38
    Dear sirrab

    I'm a Confirmed Researcher and Adjunct Professor of Art History at Sapienza University of Rome involved in Museum Robotics following the study of professor Corrado Maltese and I really think that UdooX86 is not a SBC but a JSBC (my definition is: Jewelry Single Board Computer) because it's the first time produced an interesting "hybrid" that have some "hidden" functionality, or better, functionality that you discover only if you use it. Then it's important make all "stress test" to discover what the computer can do.
    For example I have an HP workstation with Pentium i7, 12 GB RAM, 2TB HD and NVIDIA GeForce GTX 550 Ti, very good computer but I could only connect 2 monitors, instead udoox86 can activate three monitors.
    I have tested the software and verified that FreeBSD, Debian and Ubuntu natively have problems with third monitor instead Slackware and Fedora work correctly also with the third monitor. Then I need to test all the software to discover the various potentiality of UdooX86 really usable because you know that an hardware need of software to be used of course.
    There is a specific reason I'm so interested in FreeBSD: infact FreeBSD is the unique Unix class OS of the 5 that I'm using to test the UdooX86 and I want to offer to my students the results of interoperability of an Unix software with hybrid hardware JSBC UdooX86 Ultra.
    As a final consideration I can say that I can not risk not being able to access my operating systems while developing a project so it is crucial to have a professional, reliable and independent boot system that does not work "in favor" of an operating system at the expense of others.

    Thanks for your interest in my research.
     
    Last edited: Aug 24, 2017
  6. jj_0

    jj_0 New Member

    Joined:
    Apr 5, 2017
    Messages:
    7
    Likes Received:
    6
    Out of curiosity I've installed FreeBSD 12 in EFI mode on a separate SATA SSD to test booting it from GRUB2 from my Ubuntu 17.04 install on the EMMC. I couldn't get it to work by using the kfreebsd GRUB command as described here and here, probably due to my lack of understanding the drive and partition naming convention used by FreeBSD. However I was able to get it to load by using the following custom menu in GRUB2, which basically loads and executes the EFI boot executable from the FreeBSD EFI partition:

    menuentry "FreeBSD 12"{
    search --no-floppy --fs-uuid --set=root <UUID of EFI partition>
    chainloader /efi/boot/bootx64.efi
    boot
    }

    The <UUID of EFI partition> should be replaced by the UUID of the EFI FAT partition of the disk that FreeBSD boots from. If you have multiple OS's installed on that disk (which you have) they each should either have their own EFI partitions or have separate EFI boot executables on the same EFI partition, allowing you to so you can create similar menu entries for each OS. I didn't test the following but this should also work for OS's booting from EFI partitions on different disks as the search command should find the right partition from the UUID. You do need to figure out which EFi executable is used to boot the OS, but for Linux OS's that use GRUB you can also chainload their grub.cfg files instead:

    menuentry "Ubuntu 17.04"{
    search --no-floppy --fs-uuid --set=root <UUID of Ubuntu root partition>
    set prefix=($root)'boot/grub'
    configfile $prefix/grub.cfg
    }

    It's probably easiest to add these menu entries to an existing GRUB2 install (Debian or FreeBSD or Ubuntu). You could even install grub-customizer and then you don't have to worry about 40_custom etc but you can just add the menu entries (just the commands, not the menuentry "xxxx"{ and }) and let grub-customizer worry about the config files.
    Another way is to copy e.g. the Ubuntu EFI directory on the EFI partition to a new one and repurpose it by manually editing the grub.cfg file that's in that directory. There you can add menuentry sections for each OS. However I think this would still show up as ubuntu in the EFI Boot manager so that would be a little bit confusing.

    I hope this provides some inspiration and let me just say I applaud your efforts to try as many OS's as possible ;)
     
    bpr and stecolumna like this.
  7. stecolumna

    stecolumna UDOOer

    Joined:
    May 20, 2016
    Messages:
    159
    Likes Received:
    38
    Dear jj_0

    Your post and Your advice has been very useful to me.
    I did not know the grub_customizer software that solved my problem by writing a custom 40_custom file (sorry for the repetition).

    I have used this "how_to" install grub_customizer: https://wiki.ubuntu-it.org/AmministrazioneSistema/GrubCustomizer

    Then I have started grub_customizer in Ubuntu 17.04 and I have add a customized entry choosing my HD and partition and grub_customizer wrote my file 40_custom with this commands:

    <code>
    menuentry "FreeBSD 12 su disco SATA SSD ada1"{
    set root='(hd3,1)'
    search --no-floppy --fs-uuid --set 59973312d114fdd9
    drivemap -s (hd0) ${root}
    chainloader +1
    }
    </code>

    And after I have only used update-grub by root shell and rebooted.

    Now I can finally boot my FreeBSD 12.00 installation on secondary SATA SSD disk of my UdooX86 Ultra !

    Thank you very very very much for the help and for the welcome encouragement !
     
    jj_0 and bpr like this.
  8. jj_0

    jj_0 New Member

    Joined:
    Apr 5, 2017
    Messages:
    7
    Likes Received:
    6
    Thanks :)

    I've been reading up on GRUB2 commands now. Looking at your menuentry, you can probably remove the set root='(hd3,1)' as the search command without --set sets the root variable to the found disk/partition.
    But your example doesn't work for me as the drivemap command isn't found. I think this is only available in legacy/MBR mode, are you booting in legacy/MBR mode or EFI mode?
     
  9. stecolumna

    stecolumna UDOOer

    Joined:
    May 20, 2016
    Messages:
    159
    Likes Received:
    38
    Dear jj_0

    Yes: since this was the first attempt I wanted to start from the most classic and simple solution, that is MBR legay.

    Thanks again for you help.
     

Share This Page