Subject: [bug#64068] [PATCH] gnu: Add u-boot-lichee-rv-dock.

From: Vagrant Cascadian <[email-masked]>
Date: Sat, 01 Jul 2023 19:54:41 -0700

On 2023-06-17, Z572 wrote:
> Vagrant Cascadian <[email-masked]> writes:
>> On 2023-06-14, Z572 wrote:
>> This also reminds me that u-boot is falling a little behind (there is
>> 2023.01, 2023.04 and soon 2023.07)... and while I would not want to block
>> adding support for this board, I would be curious if it still works with
>> newer u-boot versions...
>
> for now is not upstreamed.

Ah, I missed that!

Since it is not from the upstream version, it should also specify the
version to match the version it is based on, even though it happens to
match right now (e.g. 2022.10)... Otherwise, once the u-boot it inherits
from is updated, I think it will list the package with the wrong
version...

>>> +(define-public u-boot-lichee-rv-dock
>> ...
>>> +                  (search-patches
>>> +                   "u-boot-lichee-rv-dock-disable-openssl.patch")
>>> +                  ;;; rebase from %u-boot-allow-disabling-openssl-patch
>>> +                  (filter (negate (cut string-contains <> "openssl"))
>>> +                          (origin-patches (package-source base)))))
>>
>> This seems a little tricky and possibly error-prone if another patch
>> with openssl in the name is included at a later time, it could break
>> this package. I almost wonder if it wouldn't be better to merge the
>> functionality of the two patches disabling openssl than applying a
>> board-specific patch?
>
> this new patch is modified from the original patch, because original
> patch can't apply to smaeul/u-boot.
>
> I attach a new patch.

Got it, thanks!

Once u-boot updates to 2023.07 or later, there will likely be more patch
conflicts... not sure of the best way to handle that...

>> I have not had a chance to test that this package builds; I presume you
>> have tested that it actually boots?
>
> yes, u-boot can boot, but cann't boot guix system, i guess because
> initrd is too big(even though the board has 1GB of RAM), initrd.cpio is 60M. so i send this patch first,
> and try "remove initrd" or "make initrd small" in future .
> (I'm not familiar with u-boot)

Hrm. Mixed feelings about getting it into guix at this point... with it
being a non-upstream fork and it cannot actually boot guix yet.

A few more comments:

> From: Z572 <[email-masked]>
> Date: Sat, 17 Jun 2023 22:19:34 +0800
> Subject: [PATCH] gnu: Add u-boot-lichee-rv-dock.
> 
> * gnu/packages/bootloaders.scm (u-boot-lichee-rv-dock): New variable.
> * gnu/packages/patches/u-boot-lichee-rv-dock-disable-openssl.patch: New file.
> * gnu/local.mk(dist_patch_DATA): register it.
...
> diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
> index a9685a9ef9..bd89280f1b 100644
> --- a/gnu/packages/bootloaders.scm
> +++ b/gnu/packages/bootloaders.scm
> @@ -18,6 +18,7 @@
>  ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <[email-masked]>
>  ;;; Copyright © 2021 Stefan <[email-masked]>
>  ;;; Copyright © 2022 Maxim Cournoyer <[email-masked]>
> +;;; Cournoyer © 2023 Zheng Junjie <[email-masked]>

I suspect you want "Copyright" not "Cournoyer" :)

> diff --git a/gnu/packages/patches/u-boot-lichee-rv-dock-disable-openssl.patch b/gnu/packages/patches/u-boot-lichee-rv-dock-disable-openssl.patch
> new file mode 100644
> index 0000000000..f8e22d2c57
> --- /dev/null
> +++ b/gnu/packages/patches/u-boot-lichee-rv-dock-disable-openssl.patch
> @@ -0,0 +1,216 @@
> +From b2dff4fe9d1a53bbe3565435e190db19e7d6f4e7 Mon Sep 17 00:00:00 2001
> +From: Z572 <[email-masked]>
> +Date: Mon, 8 May 2023 18:00:55 +0800
> +Subject: [PATCH] remove openssl

If this is a rewrite of the removing openssl patch already in guix, it
should probably credit the original patch author...

live well,
  vagrant