[PATCH] system: images: Add comment how to enlarge visionfive2 root partition.

  • Done
  • quality assurance status badge
Details
2 participants
  • Florian Pelz
  • Zheng Junjie
Owner
unassigned
Submitted by
Florian Pelz
Severity
normal

Debbugs page

Florian Pelz wrote 8 months ago
(address . guix-patches@gnu.org)(name . Florian Pelz)(address . pelzflorian@pelzflorian.de)
8b8be3032e77e3b0ad1a224aa819663f2fcfe9fb.1720102754.git.pelzflorian@pelzflorian.de
fdisk as documented upstream does *not* work and breaks boot on 4 microSD
cards that I tried.

* gnu/system/images/visionfive2.scm: Add comment.
[visionfive2-barebones-os]<packages>: Add `parted'.
Remove not generally useful `cloud-utils', 'neofetch' packages.

Change-Id: Ibcb6fd70e3ecc194187c4e882e983740349960cc
---
gnu/system/images/visionfive2.scm | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)

Toggle diff (56 lines)
diff --git a/gnu/system/images/visionfive2.scm b/gnu/system/images/visionfive2.scm
index 26f70afbc1..731fd8fa47 100644
--- a/gnu/system/images/visionfive2.scm
+++ b/gnu/system/images/visionfive2.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2024 Zheng Junjie <873216071@qq.com>
+;;; Copyright © 2024 Florian Pelz <pelzflorian@pelzflorian.de>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -19,19 +20,13 @@
(define-module (gnu system images visionfive2)
#:use-module (gnu bootloader)
#:use-module (gnu bootloader u-boot)
- #:use-module (gnu services dbus)
- #:use-module (gnu services dns)
- #:use-module (gnu services avahi)
- #:use-module (gnu services shepherd)
#:use-module (gnu services ssh)
#:use-module (gnu services networking)
#:use-module (gnu image)
- #:use-module (gnu packages linux)
#:use-module (guix packages)
+ #:use-module (gnu packages disk)
#:use-module (gnu packages ssh)
- #:use-module (gnu packages guile-xyz)
- #:use-module (gnu packages admin)
#:use-module (gnu services)
#:use-module (gnu services base)
#:use-module (gnu services networking)
@@ -54,6 +49,10 @@ (define-module (gnu system images visionfive2)
;;; uboot> setenv fdtfile starfive/jh7110-starfive-visionfive-2-v1.3b.dtb
;;; uboot> saveenv
;;;
+;;; Use parted and resize2fs to enlarge the root partition. While StarFive
+;;; recommends using fdisk and not parted in their Quick Start Guide, for
+;;; this Guix System image, this would give us an unbootable state.
+;;;
;;; Code:
(define visionfive2-barebones-os
@@ -71,7 +70,7 @@ (define visionfive2-barebones-os
%base-file-systems))
(kernel-arguments (list "earlycon" "clk_ignore_unused"))
(firmware '())
- (packages (append (list cloud-utils neofetch) %base-packages))
+ (packages (append (list parted) %base-packages))
(services
(append (list (service openssh-service-type
(openssh-configuration

base-commit: 3979812d4923e980f0069ad99332e2df7c033769
--
2.45.2
pelzflorian wrote 8 months ago
Re: [PATCH] system: images: Add comment how to enlarge visionfive2 root partition.
(name . Zheng Junjie)(address . zhengjunjie@iscas.ac.cn)(address . 71940@debbugs.gnu.org)
47ea-6686bb80-77-4b04d800@255028780
Hello Zheng, I meant to put you in Cc on this what you think here, but
it appears `mumi send-email' swallowed the --cc option I tried to use.

Thank you for adding useable visionfive2 support.

Regards,
Florian
 
Attachment: file
Zheng Junjie wrote 8 months ago
Re: [bug#71940] [PATCH] system: images: Add comment how to enlarge visionfive2 root partition.
(name . Florian Pelz)(address . pelzflorian@pelzflorian.de)(address . 71940@debbugs.gnu.org)
87msmxw4bl.fsf@iscas.ac.cn
Florian Pelz <pelzflorian@pelzflorian.de> writes:

Toggle quote (62 lines)
> fdisk as documented upstream does *not* work and breaks boot on 4 microSD
> cards that I tried.
>
> * gnu/system/images/visionfive2.scm: Add comment.
> [visionfive2-barebones-os]<packages>: Add `parted'.
> Remove not generally useful `cloud-utils', 'neofetch' packages.
>
> Change-Id: Ibcb6fd70e3ecc194187c4e882e983740349960cc
> ---
> gnu/system/images/visionfive2.scm | 15 +++++++--------
> 1 file changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/gnu/system/images/visionfive2.scm b/gnu/system/images/visionfive2.scm
> index 26f70afbc1..731fd8fa47 100644
> --- a/gnu/system/images/visionfive2.scm
> +++ b/gnu/system/images/visionfive2.scm
> @@ -1,5 +1,6 @@
> ;;; GNU Guix --- Functional package management for GNU
> ;;; Copyright © 2024 Zheng Junjie <873216071@qq.com>
> +;;; Copyright © 2024 Florian Pelz <pelzflorian@pelzflorian.de>
> ;;;
> ;;; This file is part of GNU Guix.
> ;;;
> @@ -19,19 +20,13 @@
> (define-module (gnu system images visionfive2)
> #:use-module (gnu bootloader)
> #:use-module (gnu bootloader u-boot)
> - #:use-module (gnu services dbus)
> - #:use-module (gnu services dns)
> - #:use-module (gnu services avahi)
> - #:use-module (gnu services shepherd)
> #:use-module (gnu services ssh)
> #:use-module (gnu services networking)
> #:use-module (gnu image)
> - #:use-module (gnu packages linux)
> #:use-module (guix packages)
>
> + #:use-module (gnu packages disk)
> #:use-module (gnu packages ssh)
> - #:use-module (gnu packages guile-xyz)
> - #:use-module (gnu packages admin)
> #:use-module (gnu services)
> #:use-module (gnu services base)
> #:use-module (gnu services networking)
> @@ -54,6 +49,10 @@ (define-module (gnu system images visionfive2)
> ;;; uboot> setenv fdtfile starfive/jh7110-starfive-visionfive-2-v1.3b.dtb
> ;;; uboot> saveenv
> ;;;
> +;;; Use parted and resize2fs to enlarge the root partition. While StarFive
> +;;; recommends using fdisk and not parted in their Quick Start Guide, for
> +;;; this Guix System image, this would give us an unbootable state.
> +;;;
> ;;; Code:
>
> (define visionfive2-barebones-os
> @@ -71,7 +70,7 @@ (define visionfive2-barebones-os
> %base-file-systems))
> (kernel-arguments (list "earlycon" "clk_ignore_unused"))
> (firmware '())
> - (packages (append (list cloud-utils neofetch) %base-packages))
> + (packages (append (list parted) %base-packages))

i think cloud-utils's "growpart" command is more safe tool.
just use `growpart /dev/mmcblk0 3` and `resize2fs /dev/mmcblk0p3`


Toggle quote (5 lines)
> (services
> (append (list (service openssh-service-type
> (openssh-configuration
>
> base-commit: 3979812d4923e980f0069ad99332e2df7c033769
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEfr6klGDOXiwIdX/bO1qpk+Gi3/AFAmaGwx4ACgkQO1qpk+Gi
3/AO8Q//XERJoquqnQS9TfnaLQgmZX9oeUSq/5gG2WEfP2Fs942cdDA1BS0XypbS
Bq1MyBZ4aL0zY6wKcYy6jnRR2lVudi8EP+WnO7n/AqX8fV0KeGTUvPkpVqsEjYTW
bvpDRZVc0zpzJwwFXKKgUupJAAKEY+JdfBl9ZDukUIivz5akzEAK5TMZmFA60QoB
EZW+0cINV4dMDeakpk/erGtowNrV+tWYwK4IBwC2fMWqXfBxp3fohT7icX+RgVi0
AlPUsRalMEepO6ufE8k9UeWPGdS5li+v2F70LiUe/0Q7pEt6V2KmhIGcmwEs9esh
oxbcJBviwaTRIAGNBJoaPwx8MbFTWbzJ15lwDK3zpWOJ+/nNVZinM7d1jgJC9DNq
krqSmJiar189n4IesNKiUQgU02G/qydPS55v6WLH37AYs/BgJwAg69iUcJtJY7Yx
zUkt1YouDZUapCOsHvvQ08jjEsUAdX0h8P7l8JD1MGSTmHOU+GsGWaYbEOCGV3py
YX05ClW6mA6O7sDxzxnkC99EYUWyC0WqEAOlbnV9v3hbwPE94zmvGhi0qwzQrz7R
rIq+JjhtfmUW5oQdvsj3hJM+1UfWD7hWQSGJSjInOFLVENWJse7mwztQbCLMoZ+r
CIQK3IJ3XccBVbpc0HfKIR/srtd9Crhhi6cG46q5YCAg38aaF68=
=AjaV
-----END PGP SIGNATURE-----

pelzflorian wrote 8 months ago
Re: [bug#71940] [PATCH] system: images: Add comment how to enlarge visionfive2 root partition.
(name . Zheng Junjie)(address . zhengjunjie@iscas.ac.cn)(address . 71940@debbugs.gnu.org)
47ea-66871e00-7f-4b04d800@255028912
Ahh I had not understood that you had added cloud-utils for the purpose of growpart.

As it seems growpart is a wrapper around sfdisk, I’m not sure if it will work for my microSD card, but if I understand correctly, it has worked for yours.

fdisk had failed on old and my new microSD card.  But that microSD flew away, I lost it and cannot test growpart now.

I will try with another newly bought microSD card soon and report back.

Regards,
Florian
 
Attachment: file
pelzflorian wrote 8 months ago
(name . Zheng Junjie)(address . zhengjunjie@iscas.ac.cn)(address . 71940-done@debbugs.gnu.org)
47ea-668a5a00-95-4b04d800@255064684
Hello Zheng, you are right: growpart indeed can properly enlarge my again newly bought, identical microSD card.  However this time, fdisk works too as described in upstream’s Quick Start Guide.  It appears the newly bought first microSD and the old microSD cards were somehow faulty as well.

Perhaps we could add a warning of faulty microSD cards, but actually this is not just about visionfive2.

We could add a comment to visionfive2.scm to use growpart, but I believe fdisk is not at fault, fdisk could be used just as well.  parted worked better than fdisk by chance.

We could remove unused modules from visionfive2.scm like in the patch, as reported by

$ guix shell guile-next
[env]$ guild compile -Wunused-module gnu/system/images/visionfive2.scm

but visionfive2.scm is not the only file in images with unused modules.

I just close this patch now.

Regards,
Florian
 
Attachment: file
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 71940@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 71940
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help