Page MenuHomeFreeBSD

Improvements to growfs rc script
ClosedPublic

Authored by scottl on Aug 17 2021, 4:51 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 6, 10:31 PM
Unknown Object (File)
Wed, Apr 3, 10:24 PM
Unknown Object (File)
Mar 7 2024, 11:45 PM
Unknown Object (File)
Feb 12 2024, 11:58 AM
Unknown Object (File)
Jan 14 2024, 12:06 PM
Unknown Object (File)
Dec 22 2023, 11:58 PM
Unknown Object (File)
Dec 21 2023, 11:24 PM
Unknown Object (File)
Dec 12 2023, 1:28 AM
Subscribers
None

Details

Summary

Authored by Luiz at Netgate

  1. Fix the growfs rc script to cope with diskid labels.
  2. Fix a warning in growfs. gpart commit is supposed to be called on disk device.
  3. Silence a gpart commit warning in growfs.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

scottl created this revision.
This revision is now accepted and ready to land.Aug 17 2021, 5:15 PM
brd retitled this revision from Improvements to grows rc script to Improvements to growfs rc script.Aug 17 2021, 5:43 PM

I've read through this a few times, and am still not clear why this is an improvement, so the commit message should include that information as well. It appears to be something to do with labels or other root names with '/' in them.
Also next time, please use the arc tools, or create the context diff with -U999999 to get the full context for the review. Without it, it's hard to review changes since the larger context isn't available.

libexec/rc/rc.d/growfs
57

"while read x1 _type _dev rest" above would obviate the need for his awkward construct here.

58

${1} is a bit unclear from context. I'd recommend a local variable set at the top of this function to hold its value and give it some additional semantic meaning"

86

This quoting is awkard and error-prone.

I'd suggest (glabel status | awk -v rootdev=$rootdev '{index(rootdev, $1) { print $3; }) instead since that's clearer and avoids the quoting and unquoting to get the variable substituted.

I'm not sure what you're asking for at first that's not included in the summary

I'm not sure what you're asking for at first that's not included in the summary

Sorry, just saw the subject line and got confused. The summery is good.