Bug 186030 - [nanobsd] [patch] Use gpart instead of fdisk, and create code image before full disk image
Summary: [nanobsd] [patch] Use gpart instead of fdisk, and create code image before fu...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: Warner Losh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-23 11:20 UTC by Arrigo Marchiori
Modified: 2021-07-21 16:19 UTC (History)
0 users

See Also:


Attachments
file.diff (6.36 KB, patch)
2014-01-23 11:20 UTC, Arrigo Marchiori
no flags Details | Diff
Patch adapted to current nanobsd.sh from 10-STABLE (6.78 KB, patch)
2015-10-02 15:24 UTC, Arrigo Marchiori
no flags Details | Diff
Patch adapted to the nanobsd script from current 11-STABLE (7.12 KB, patch)
2020-08-26 23:06 UTC, Arrigo Marchiori
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arrigo Marchiori 2014-01-23 11:20:00 UTC
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").

Fix: Patch attached with submission follows:
Comment 1 Warner Losh freebsd_committer freebsd_triage 2014-03-14 04:59:04 UTC
Responsible Changed
From-To: freebsd-bugs->imp

I'll take it.
Comment 2 Arrigo Marchiori 2015-10-02 15:24:27 UTC
Created attachment 161646 [details]
Patch adapted to current nanobsd.sh from 10-STABLE

Since the first patch, nanobsd.sh has changed a bit.
Some dd invocations now have the parameter 'conv=sparse'.
I am not 100% sure I got it correctly; please help me review that.
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2018-05-28 19:42:48 UTC
batch change:

For bugs that match the following
-  Status Is In progress 
AND
- Untouched since 2018-01-01.
AND
- Affects Base System OR Documentation

DO:

Reset to open status.


Note:
I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.
Comment 4 Arrigo Marchiori 2020-08-26 23:06:15 UTC
Created attachment 217561 [details]
Patch adapted to the nanobsd script from current 11-STABLE

This patch can be applied to 11-STABLE sources.
Comment 5 Warner Losh freebsd_committer freebsd_triage 2021-07-07 21:59:40 UTC
Sorry for the delay...

https://reviews.freebsd.org/D31102
Comment 6 commit-hook freebsd_committer freebsd_triage 2021-07-15 22:16:32 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=587c054bea0f652fdbd86baf5807f21c904ac2ad

commit 587c054bea0f652fdbd86baf5807f21c904ac2ad
Author:     Arrigo Marchiori <ardovm@yahoo.it>
AuthorDate: 2021-07-15 22:06:51 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2021-07-15 22:15:01 +0000

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

    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").

    imp@ applied Patch by hand to new legacy.sh, plus tweaked for NANO_LOG vs
    NANO_OBJ confusion in original.

    PR:                     186030
    Reviewed by:            imp@
    Differential Revision:  https://reviews.freebsd.org/D31102

 tools/tools/nanobsd/defaults.sh |   4 +-
 tools/tools/nanobsd/legacy.sh   | 132 ++++++++++++++++++++++++++--------------
 tools/tools/nanobsd/nanobsd.sh  |  17 ++++--
 3 files changed, 103 insertions(+), 50 deletions(-)
Comment 7 Warner Losh freebsd_committer freebsd_triage 2021-07-16 02:31:04 UTC
in my MFC queue, closing.
Comment 8 Arrigo Marchiori 2021-07-16 07:17:18 UTC
Thank you!
Comment 9 commit-hook freebsd_committer freebsd_triage 2021-07-21 16:14:27 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=50b2e5d608d2d8876af2a8d4e5c4e60867f9ad96

commit 50b2e5d608d2d8876af2a8d4e5c4e60867f9ad96
Author:     Arrigo Marchiori <ardovm@yahoo.it>
AuthorDate: 2021-07-15 22:06:51 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2021-07-21 16:13:11 +0000

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

    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").

    imp@ applied Patch by hand to new legacy.sh, plus tweaked for NANO_LOG vs
    NANO_OBJ confusion in original.

    PR:                     186030
    Reviewed by:            imp@
    Differential Revision:  https://reviews.freebsd.org/D31102

    (cherry picked from commit 587c054bea0f652fdbd86baf5807f21c904ac2ad)

 tools/tools/nanobsd/defaults.sh |   4 +-
 tools/tools/nanobsd/legacy.sh   | 132 ++++++++++++++++++++++++++--------------
 tools/tools/nanobsd/nanobsd.sh  |  17 ++++--
 3 files changed, 103 insertions(+), 50 deletions(-)
Comment 10 commit-hook freebsd_committer freebsd_triage 2021-07-21 16:19:33 UTC
A commit in branch stable/12 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=e1b5efda31c36df69af31e822c4967fba8ad2b50

commit e1b5efda31c36df69af31e822c4967fba8ad2b50
Author:     Arrigo Marchiori <ardovm@yahoo.it>
AuthorDate: 2021-07-15 22:06:51 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2021-07-21 16:16:32 +0000

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

    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").

    imp@ applied Patch by hand to new legacy.sh, plus tweaked for NANO_LOG vs
    NANO_OBJ confusion in original.

    PR:                     186030
    Reviewed by:            imp@
    Differential Revision:  https://reviews.freebsd.org/D31102

    (cherry picked from commit 587c054bea0f652fdbd86baf5807f21c904ac2ad)

 tools/tools/nanobsd/defaults.sh |   4 +-
 tools/tools/nanobsd/legacy.sh   | 132 ++++++++++++++++++++++++++--------------
 tools/tools/nanobsd/nanobsd.sh  |  17 ++++--
 3 files changed, 103 insertions(+), 50 deletions(-)