Page MenuHomeFreeBSD

nanobsd: Add gpt support
Needs ReviewPublic

Authored by senguptaangshuman17_gmail.com on Wed, Aug 19, 10:21 AM.
Tags
None
Referenced Files
F168434520: D58964.id185108.diff
Fri, Aug 28, 8:02 AM
F168393551: D58964.id185004.diff
Thu, Aug 27, 11:59 PM
F168393023: D58964.id184958.diff
Thu, Aug 27, 11:52 PM
F168374106: D58964.diff
Thu, Aug 27, 8:31 PM
F168373821: D58964.diff
Thu, Aug 27, 8:29 PM
F168371833: D58964.diff
Thu, Aug 27, 8:13 PM
F168351956: D58964.id184839.diff
Thu, Aug 27, 6:04 PM
F168329732: D58964.id185108.diff
Thu, Aug 27, 3:50 PM
Subscribers

Details

Summary

Introduce gpt.sh as the default GPT partitioned plan with dual BIOS and UEFI boot support, dynamic partition sizing and labeled root, altroot, cfg and data partitions.

Move legacy-only helpers and configuration variables (such as NANO_MD_BACKING, NANO_IMAGE_MBRONLY, FlashDevice, UsbDevice, and legacy slice population helpers) from defaults.sh into legacy.sh.

Bump the default NANO_RAM_TMPVARSIZE since pkgbase requires significantly more space in /var/db/pkg. Leave the legacy plan default unchanged.

Move change_password, save_cfg and save_sshkeys from root/bin to usr/local/sbin under defaults/Files, which is on the default PATH.

Set NANO_DRIVE from NANO_LABEL instead of hard coding vtbd0, and clean up tgt_dir2symlink() and make_boot_partition().

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 76127
Build 73010: arc lint + arc unit

Event Timeline

tools/tools/nanobsd/FlashDevice.sub
39 ↗(On Diff #184329)

Please submit all non-functional, style(9)-related changes in a single revision (D58931).

tools/tools/nanobsd/defaults.sh
1579

This function gets replaced by strtobytes() in D58969. Please unify, and introduce in a separate commit, as this is a legacy-breaking change.

Include NANO_ALIGN in initial calculate_partitioning implementation

Clean up recovery ESP and simplify make_esp_partition

tools/tools/nanobsd/gpt.sh
2

I think this file should be renamed to ufs.sh, when adding support for ZFS, this becomes evident. I can show you a draft of what I have for ZFS in our next meeting.

tools/tools/nanobsd/gpt.sh
2

I think this file should be renamed to ufs.sh, when adding support for ZFS, this becomes evident. I can show you a draft of what I have for ZFS in our next meeting.

Ok sure, so should I update the name of this file to ufs.sh?

Address review comments: normalize all 5 XXXJL comments to # XXX:

Clean up merge conflict markers in defaults.sh

Please see: https://github.com/Coderangshu/freebsd-src/pull/60, which contains a WIP of NanoBSD using ZFS (the ZFS part is not really relevant at the moment, it was just an experiment). It illustrates that the file gpt.sh should actually be named ufs.sh and that common functions inherent to a GPT partitioning scheme belong in defaults.sh, leaving filesystem-specific functions inside their respective files (ufs.sh, zfs.sh, cd9660.sh, msdos.sh, i.e., anything that makefs(8) supports).

Update makefs options with -DxZ and metalog existence check