Subject: [alpine-devel] Aarch64 bootloader

From: Alba Pompeo <[email-masked]>
Date: Wed, 21 Dec 2016 10:06:34 -0200

The Alpine Aarch64 image need a different bootloader to work.
Alpine's default is Syslinux but it doesn't support aarch64.
What are the options for the specific architecture (aarch64)?
I see GRUB2 supports it, but it's an awful and bloated bootloader.
Doesn't fit Alpine.

I have no experience with Das U-Boot but it seems to support Aarch64.
https://github.com/u-boot/u-boot/blob/master/doc/README.arm64

Or can just wait for Syslinux to port it?
http://www.syslinux.org/archives/2016-August/025340.html

Any other options?

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Michael Davies <[email-masked]>
Date: Thu, 22 Dec 2016 00:01:04 +1100

Hi,

Sadly I don't think syslinux aarch64 is going anywhere in the near 
future. The code is really messy with quite a lot of platform-specific 
asm. I've been making do with native UEFI booting on my aarch64 system. 
U-boot is probably the best option.

Regards,
Michael

---

---

From: Cág <[email-masked]>
Date: Wed, 21 Dec 2016 14:13:15 +0000

> https://github.com/u-boot/u-boot/blob/master/doc/README.arm64

U-Boot is pretty much the default bootloader in embedded systems,
and if Alpine would have the package for amd64, I'd use it
instead of syslinux on my box. It is small and simple, and
I think it fits Alpine even better.

Cág

---

---

From: Timo Teras <[email-masked]>
Date: Thu, 22 Dec 2016 08:39:10 +0200

Hi,

On Wed, 21 Dec 2016 10:06:34 -0200

> https://github.com/u-boot/u-boot/blob/master/doc/README.arm64

Yes, u-boot is used as native ROM bootloader on some aarch64 platforms.
Though, seems UEFI for aarch64 is not supported. Which is required on
some platforms.

> http://www.syslinux.org/archives/2016-August/025340.html

Not really. Efilinux is limited, and gummiboot is discontinued.

We have grub2 in testing. I also tested that grub-efi boot mode works
on x86_64. Clandmeter tested it to work on aarch64. This might be an
option to use for the time being for UEFI boot.

Syslinux would be nice, but as said it's unlikely to support aarch64
for a while.

Currently we use:
- syslinux for x86/x86_64
- rpi native on raspberry pi (arm)
- u-boot on all other arm

We probably should add:
- u-boot for aarch64 boards we want/need to support
- UEFI boot possibly using grub2

So this is more diverse than wanted. The good thing in u-boot is that
it can read syslinux.cfg files and they can share the boot config.

Or do we have any other options for UEFI boot?

/Timo

---

---

From: Alba Pompeo <[email-masked]>
Date: Mon, 2 Jan 2017 12:29:38 -0200

I did some counting.

SYSLINUX
========
-----------------------------------------------------------------------------------
Language                         files          blank        comment
        code
-----------------------------------------------------------------------------------
C                                  731          25328          35531
      142385
C/C++ Header                       445           7954          15848
       43594
HTML                                 3           3540             11
        7902
Assembly                            55           1048           2300
        5268
Pascal                              30            609             20
        4825
make                                59            920            945
        2596
Perl                                22            318            351
        1575
xBase Header                         7            308            844
        1212
Python                               1             34              6
         267
Bourne Shell                         7             40             17
         183
Lua                                  2             21              5
         170
CSS                                  2             18              0
         105
Bourne Again Shell                   2             22             20
          79
XML                                  1              0              0
          39
Windows Resource File                1              2              0
          24
-----------------------------------------------------------------------------------
SUM:                              1368          40162          55898
      210224
-----------------------------------------------------------------------------------

U-BOOT
======
--------------------------------------------------------------------------------
Language                      files          blank        comment           code
--------------------------------------------------------------------------------
C                              3817         170112         236909         852193
C/C++ Header                   3600          71859         118800         498002
Assembly                        279           7530          14630          31028
Python                           95           3694           7710          10479
Perl                              6           1405           1117           8020
make                            942           2160           6642           7851
Bourne Shell                     29            360            556           1847
C++                               1            209             57           1532
yacc                              1            104             25            604
NAnt script                       1             90              0            359
lex                               1             40             12            311
YAML                              1             12             25            279
Markdown                          1             80              0            278
Bourne Again Shell                1             32             24            103
DOS Batch                         2              8              0             94
CSS                               2             22             11             84
Kermit                            3              4             20             83
Tcl/Tk                            1              5              7             28
sed                               2              1             29             24
INI                               1              2              0              9
XSLT                              1              0              1              9
--------------------------------------------------------------------------------
SUM:                           8787         257729         386575        1413217
--------------------------------------------------------------------------------

GRUB2
=====
---------------------------------------------------------------------------------------
Language                             files          blank
comment           code
---------------------------------------------------------------------------------------
C                                      827          39895
31816         234238
C/C++ Header                           470           8076
15359          40827
m4                                     113           1056
1176          15380
Assembly                               166           3149
6584          10209
TeX                                      1            699
2824           5436
Windows Module Definition                3            622
21           3365
make                                     8            619
365           2090
Bourne Shell                            10            109
417           1448
Python                                   3            168
212           1373
sed                                     10             20
1            423
lex                                      1             54
34            305
yacc                                     1             44
44            268
diff                                     4             24
117            143
C++                                      1              8
17             80
awk                                      1              6
16             76
Lisp                                     1              3
0             50
---------------------------------------------------------------------------------------
SUM:                                  1620          54552
59003         315711
---------------------------------------------------------------------------------------

GUMMIBOOT
=========
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
C                                9            900            303           4196
make                             1             34             25            144
m4                               2             27             10            131
XML                              1             23             13            101
C/C++ Header                     6             38             90             83
Bourne Shell                     2             12             18             49
-------------------------------------------------------------------------------
SUM:                            21           1034            459           4704
-------------------------------------------------------------------------------

LILO
====
--------------------------------------------------------------------------------
Language                      files          blank        comment           code
--------------------------------------------------------------------------------
C                                19           1702            558          11821
Assembly                         21           1683           2627           9178
HTML                             34            131             67           5701
TeX                               8            550            394           3238
C/C++ Header                     22            532            787           1379
Perl                              4            262            356           1295
Bourne Again Shell                1             87             34            578
make                              9            176            128            556
Bourne Shell                     10             70            142            303
CSS                               2              9              4            280
--------------------------------------------------------------------------------
SUM:                            130           5202           5097          34329
--------------------------------------------------------------------------------

ELILO
=====
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
C                               46           2746           3715          10905
C/C++ Header                    35            792           1643           2969
Assembly                         5             89            407            430
make                             8            111            213            184
-------------------------------------------------------------------------------
SUM:                            94           3738           5978          14488
-------------------------------------------------------------------------------

---

---

From: Alba Pompeo <[email-masked]>
Date: Mon, 2 Jan 2017 12:35:04 -0200

Better formatting. http://sprunge.us/JINJ

I think (E)LILO and GUMMIBOOT should be used where possible.
Platforms that don't support it could use SYSLINUX.
For platforms that don't support any of those, GRUB2.
And U-BOOT just as last resort.

I always heard GRUB2 was an abomination and superhuge, but it's "just"
150% the size of SYSLINUX.
People could say that because they looked at the source code and it's
really bad?
I'm just doing some counting......

---

---

From: Timo Teras <[email-masked]>
Date: Mon, 2 Jan 2017 16:51:05 +0200

On Mon, 2 Jan 2017 12:35:04 -0200

> I think (E)LILO and GUMMIBOOT should be used where possible.

Gummiboot [1] and ELILO [2] are abandoned and should not be used.

> I'm just doing some counting......

Comparing just lines of code is not accurate. For example in case of
u-boot it contains hardware level support for gazillion of CPUs and
peripherals. Only fraction of that is compiled based on the
configuration.

I do not have strong opinion on GRUB2/SYSLINUX. I should probably look
at the code form one... :)

Cheers,
Timo

[1] https://en.wikipedia.org/wiki/Gummiboot_(software)
[2] https://sourceforge.net/projects/elilo/

---

---

From: Alba Pompeo <[email-masked]>
Date: Mon, 2 Jan 2017 13:36:57 -0200

You're right.
I'll wait to see what you discover after you study the source code more deeply.
Thanks!

OpenWrt has a page on bootloaders.
https://wiki.openwrt.org/doc/techref/bootloader

---

---

From: Alba Pompeo <[email-masked]>
Date: Mon, 2 Jan 2017 13:38:02 -0200

Found an interesting one. Qi.

Qi is a lightweight replacement for the uBoot bootloader with
everything that doesn't assist "loading" and "booting" Linux stripped
out.
https://github.com/radekp/qi

---

---

From: Cág <[email-masked]>
Date: Mon, 02 Jan 2017 15:47:53 +0000

> Better formatting. http://sprunge.us/JINJ

This is interesting.

> I'm just doing some counting......

GRUB2 is huge because it tries to do more than a bootloader should.
"GRUB2 is the Eclipse of bootloaders". Also configuring it is painful
and I never figured it out, using front-ends to solve problems.
On the other hand, SYSLINUX is configured with one text file
with sane syntax.

LOC don't matter here. "If it sucks, it sucks".

Cág

---