all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Fredrik Salomonsson <plattfot@posteo.net>
To: Christine Lemmer-Webber <cwebber@dustycloud.org>
Cc: help-guix@gnu.org
Subject: Re: Guix on the MNT Reform
Date: Mon, 06 Sep 2021 19:37:28 +0000	[thread overview]
Message-ID: <875yvdh4w7.fsf@posteo.net> (raw)
In-Reply-To: <87h7exd41b.fsf@dustycloud.org>

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


  reply	other threads:[~2021-09-06 19:37 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875yvdh4w7.fsf@posteo.net \
    --to=plattfot@posteo.net \
    --cc=cwebber@dustycloud.org \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.