GNU bug report logs -
#31416
[PATCH 0/4] Generalize bootloader installer selection.
Previous Next
Full log
Message #11 received at 31416 <at> debbugs.gnu.org (full text, mbox):
* gnu/bootloader/u-boot.scm (install-u-boot): Automatically select the correct
installer.
---
gnu/bootloader/u-boot.scm | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm
index bc8f98f32..e0941c961 100644
--- a/gnu/bootloader/u-boot.scm
+++ b/gnu/bootloader/u-boot.scm
@@ -41,7 +41,24 @@
(define install-u-boot
#~(lambda (bootloader device mount-point)
(if bootloader
- (error "Failed to install U-Boot"))))
+ (let* ((config-file-name (string-append bootloader "/libexec/.config"))
+ (soc (call-with-input-file config-file-name
+ (let loop ((line (read-line port)))
+ (if (not (eof-object? line))
+ (let ((match
+ (string-match
+ "^CONFIG_SYS_SOC=\"([^\"]*)\""
+ line)))
+ (if match
+ (match:substring match 1)
+ (loop (read-line port))))
+ #f)))))
+ (match soc
+ ("am33xx" (install-beaglebone-black-u-boot bootloader device mount-point))
+ ("mx6" (install-imx-u-boot bootloader device mount-point))
+ ("sunxi" (install-allwinner-u-boot bootloader device mount-point))
+ (_ (error "Failed to install U-Boot (no installation method found)"
+ soc)))))))
(define install-beaglebone-black-u-boot
;; http://wiki.beyondlogic.org/index.php?title=BeagleBoneBlack_Upgrading_uBoot
This bug report was last modified 1 year and 324 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.