Page MenuHomeFreeBSD

nanobsd: Use gpart and create code image before full disk image
ClosedPublic

Authored by imp on Jul 7 2021, 9:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 19, 5:05 PM
Unknown Object (File)
Mar 14 2024, 3:50 PM
Unknown Object (File)
Mar 8 2024, 12:05 AM
Unknown Object (File)
Feb 23 2024, 12:32 PM
Unknown Object (File)
Dec 22 2023, 11:02 PM
Unknown Object (File)
Dec 20 2023, 11:19 PM
Unknown Object (File)
Dec 14 2023, 6:35 PM
Unknown Object (File)
Dec 1 2023, 10:25 AM

Details

Summary

The attached patch brings two main changes to the nanobsd script:
1- gpart is used instead of fdisk;
2- the code image is created first, and then used to ``assemble'' the

full disk image.

The patch was first proposed on the freebsd-embedded list:
http://lists.freebsd.org/pipermail/freebsd-embedded/2012-June/001580.html
and is currently under discussion:
http://lists.freebsd.org/pipermail/freebsd-embedded/2014-January/002216.html

Another effect is that the -f option ("suppress code slice extraction")
now imples the -i option ("suppress disk image build").

Patch hand applied to new since stable/11 legacy.sh by imp@

Test Plan

Note: This needs to be tested. I wanted to get the forward-ported patch into someplace public.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 40381
Build 37270: arc lint + arc unit

Event Timeline

imp requested review of this revision.Jul 7 2021, 9:59 PM
imp created this revision.
imp added a reviewer: phk.
tools/tools/nanobsd/defaults.sh
165

Don't know if it makes sense to derive them from NANO_ROOT/NANO_ALTROOT and NANO_SLICE_ROOT/NANO_SLICE_ALTROOT to prevent foot-shootings:

NANO_PARTITION_ROOT="${NANO_ROOT##$NANO_SLICE_ROOT}"
NANO_PARTITION_ALTROOT="${NANO_ALTROOT##$NANO_SLICE_ALTROOT}"
tools/tools/nanobsd/legacy.sh
105

I have tested this change building an "embedded" aarch64 NanoBSD image. As the first email warns, this breaks when building the code slice: dd: no value specified for seek, I had to use NANO_LOG instead of NANO_OBJ here.

imp marked an inline comment as done.Jul 8 2021, 2:57 AM
imp added inline comments.
tools/tools/nanobsd/defaults.sh
165

I don't think this makes sense because these variables are set later and also set in config files.

tools/tools/nanobsd/legacy.sh
105

Yes. That's needed.

184

And this should be NANO_LOG too.

Hello all,

I would be glad to help if I could, but I only have access to stable/11 systems at the moment and I cannot apply @imp 's patch because there is no file legacy.sh

I am also totally new to Phabricator, so please be patient ;-)

Feel free to contact me if you think I can be of any help.

imp marked an inline comment as done.Jul 8 2021, 3:52 PM

I would be glad to help if I could, but I only have access to stable/11 systems at the moment and I cannot apply @imp 's patch because there is no file legacy.sh

Yes. I split that out after stable/11 branch. The original bug has older patches.

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=186030

I didn't really change it much, other than what was noted here.

This revision was not accepted when it landed; it landed in state Needs Review.Jul 15 2021, 10:16 PM
This revision was automatically updated to reflect the committed changes.