diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2020-03-23 13:48:21 +0100 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2020-03-24 10:21:06 +0100 |
commit | 08a4e3fe6c0ab00ef4296bfcd035147a4d4a9d88 (patch) | |
tree | 5858d70afe5db3195ef88101c7a44b8bb647237e | |
parent | 1cbdcc2c0d3be0daec67718d886dfa9eac50a5ee (diff) | |
download | openfirmware-08a4e3fe6c0ab00ef4296bfcd035147a4d4a9d88.tar.gz |
olpc: turn on olpc-compat? if alternate? is inspected on boot
The OLPC OS on XO-4 (be it in secured mode, or on unsecured laptop booted
from an USB flash stick) executes the alternate? word to find out if it
shall boot the Android kernel or whatever it is.
While probably quite half-hearded, that seems to be the only way to tell if
we're running OLPC OS, that probably has a 3.5-based kernel that needs a
compatibility device tree.
The other distros that are potentially going to ship newer kernels have
no need to call alternate? in their boot paths.
-rw-r--r-- | cpu/x86/pc/olpc/gui.fth | 4 | ||||
-rw-r--r-- | cpu/x86/pc/olpc/security.fth | 13 |
2 files changed, 12 insertions, 5 deletions
diff --git a/cpu/x86/pc/olpc/gui.fth b/cpu/x86/pc/olpc/gui.fth index f454fe67..bcd36e46 100644 --- a/cpu/x86/pc/olpc/gui.fth +++ b/cpu/x86/pc/olpc/gui.fth @@ -474,10 +474,10 @@ d# 1200 d# 26 - value bar-x-last ; [then] -0 value alternate? +0 value load-alternate? : show-dot ( -- ) next-dot-xy to icon-xy next-dot-xy d# 16 0 d+ to next-dot-xy ( ) - alternate? if " yellowdot" else " lightdot" then show-icon + load-alternate? if " yellowdot" else " lightdot" then show-icon ; : show-dev-icon ( devname$ -- ) diff --git a/cpu/x86/pc/olpc/security.fth b/cpu/x86/pc/olpc/security.fth index fbd9b3b0..70eb3820 100644 --- a/cpu/x86/pc/olpc/security.fth +++ b/cpu/x86/pc/olpc/security.fth @@ -757,12 +757,19 @@ d# 8192 constant /sec-line-max ; : set-alternate ( -- ) - button-o game-key? if true to alternate? exit then + button-o game-key? if true to load-alternate? exit then h# 82 cmos@ [char] A = if [char] N h# 82 cmos! - true to alternate? exit + true to load-alternate? exit then - false to alternate? + false to load-alternate? +; + +: alternate? ( -- flag ) + \ If the boot path inspects the alternate flag we assume it's not + \ going to load a very new kernel. + [ifdef] olpc-compat 1 to olpc-compat? [then] + load-alternate? ; \ secure-load-ramdisk is called during the process of preparing an |