From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 4FvoIXRRNmHBzQAAgWs5BA (envelope-from ) for ; Mon, 06 Sep 2021 19:35:48 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id KJJ4HXRRNmExUwAAB5/wlQ (envelope-from ) for ; Mon, 06 Sep 2021 17:35:48 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C50501C86D for ; Mon, 6 Sep 2021 19:35:47 +0200 (CEST) Received: from localhost ([::1]:36062 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNI81-0000Fc-Q7 for larch@yhetil.org; Mon, 06 Sep 2021 13:09:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNI7r-0000Dj-6h for help-guix@gnu.org; Mon, 06 Sep 2021 13:09:43 -0400 Received: from dustycloud.org ([50.116.34.160]:58544) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNI7o-0007xN-Nf for help-guix@gnu.org; Mon, 06 Sep 2021 13:09:42 -0400 Received: from twig (localhost [127.0.0.1]) by dustycloud.org (Postfix) with ESMTPS id C64AA2661B; Mon, 6 Sep 2021 13:09:36 -0400 (EDT) References: <87ftcaqxer.fsf@dustycloud.org> <874kbogf1h.fsf@dustycloud.org> <877dgjd441.fsf@d2.com> <87mtordcqq.fsf@dustycloud.org> User-agent: mu4e 1.6.2; emacs 27.2 From: Christine Lemmer-Webber Subject: Re: Guix on the MNT Reform Date: Mon, 06 Sep 2021 13:07:43 -0400 In-reply-to: <87mtordcqq.fsf@dustycloud.org> Message-ID: <87h7exd41b.fsf@dustycloud.org> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=50.116.34.160; envelope-from=cwebber@dustycloud.org; helo=dustycloud.org X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, MISSING_HEADERS=1.021, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: help-guix@gnu.org Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1630949747; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=j74mX5Lp1K0ZeoEq0Bup0khX6SaqWz25VD3OW7P5otI=; b=AqEICaWzz4AEGERIIjrhKo1M/kihx6UHgn0GbG1V0ohkpzfjrw76TtH0wToSkKXyeQuPXc VYgCKjxbcjcrZBkgOe9IGpCGucqpsf6BFzXcVtCk0UEgp8pXZlayw9eSK225T3Z9SnqmyW cJ9oKkfltfmIwlJ3zoCT1Fwg35KleiUlRu3Yai9CmJ3Y7Jo3TM453qvCWtMAnbPHJFB4/l Lktz+rgvD/Cd04gN4xvEWG4bKg/XFYtHmC8rAQPU+FAPS9arTYL4n/o1oCRKSHFOfon2si hYTf2xLVVfcs6jbzpZkqeVQxKa9OF9jmNc5qzxM39jgN8jQ39Y4zoWiwVEZONA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630949747; a=rsa-sha256; cv=none; b=rs2O/lUdqe/WHCMio5ibFyLii01RjlnXU6+sUf85I97R2nzDmqrjB9SwKvtkZQzdx1eiCC 37k1EpSKIAtVmrZBZE7eb8JDhR4emND2ODwEDVRV1Xnw/g1Zx7rw3sE1h8wz68PREQKhEF rFjE1H9xE04UwcdRAZy2u1J6GHrK68E7mAKHKvQiTo041JAcqazQKaNYu2H7gPGK9i98/n 0VvlZL7JCuok7guyHdgGDM7xTzRnYI6As+orjD8jWW7BG1qC5aWD7QFidXVxAUZcLwo8+G 0FC/c8fKQ5UlhIaKLNfnpyYvY9PtxeptWSyHdiao96RINdsdFvlS1DDGC0Miwg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Spam-Score: 4.38 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: C50501C86D X-Spam-Score: 4.38 X-Migadu-Scanner: scn1.migadu.com X-TUID: hNmkFq2WQ3zP Christine Lemmer-Webber 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 \n"); ^~~~~~~ scripts/basic/fixdep.c:130:2: warning: incompatible implicit declaration of built-in function 'fprintf' scripts/basic/fixdep.c:130:2: note: include '' 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 \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 '' 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 '' 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 '' 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 '' 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 '' 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 '' 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 '' 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 '' 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 '' 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 '' 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 '' 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 '' 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 '' 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 '' 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 '' 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 '' 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 '' 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 '' 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 '' 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 '' 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