Bug 250496 - net/cloud-init: fix mounting local cloud-init
Summary: net/cloud-init: fix mounting local cloud-init
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Alexey Dokuchaev
Depends on:
Reported: 2020-10-21 00:14 UTC by Brad Davis
Modified: 2020-11-02 18:55 UTC (History)
3 users (show)

See Also:
andrey: maintainer-feedback+

patch (1.41 KB, patch)
2020-10-21 00:14 UTC, Brad Davis
no flags Details | Diff
patch (3.30 KB, patch)
2020-10-29 00:37 UTC, Andrey Fesenko
andrey: maintainer-approval+
Details | Diff
patch (2.88 KB, patch)
2020-10-29 10:44 UTC, Andrey Fesenko
no flags Details | Diff
patch (3.14 KB, patch)
2020-10-29 12:50 UTC, Andrey Fesenko
andrey: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brad Davis freebsd_committer 2020-10-21 00:14:21 UTC
Created attachment 218934 [details]

Feel free to submit upstream if you have signed the CLA. I do not want to sign it.
Comment 1 Andrey Fesenko 2020-10-29 00:36:55 UTC
Upstream bug https://bugs.launchpad.net/cloud-init/+bug/1901958

And I'm find bug parsing newfs option
if fs have trim: (-t) or MAC multilabel: (-l) flag, resize FS fail.

 2020-10-28 17:15:07,015 - handlers.py[DEBUG]: finish: init-network/config-resizefs: FAIL: running config-resizefs with frequency always
  File "/usr/local/lib/python3.7/site-packages/cloudinit/config/cc_resizefs.py", line 114, in _can_skip_resize_ufs
    optlist, _args = getopt.getopt(newfs_cmd[1:], opt_value)
  File "/usr/local/lib/python3.7/getopt.py", line 95, in getopt
    opts, args = do_shorts(opts, args[0][1:], shortopts, args[1:])
  File "/usr/local/lib/python3.7/getopt.py", line 195, in do_shorts
    if short_has_arg(opt, shortopts):
  File "/usr/local/lib/python3.7/getopt.py", line 211, in short_has_arg
    raise GetoptError(_('option -%s not recognized') % opt, opt)
 getopt.GetoptError: option -t not recognized

And fix #Bug250437 (delet dependency py-six) upstream drop this 20.2 https://github.com/number5/cloud-init/commit/b9ff0dc950558ecd2a8469eded26bd6ae4082771
Comment 2 Andrey Fesenko 2020-10-29 00:37:38 UTC
Created attachment 219185 [details]
Comment 3 Mina Galić 2020-10-29 06:45:34 UTC
I'm not sure this portion of your patch makes sense, because the criteria is coming from outside the function

-    elif criteria == "TYPE=vfat":
+    elif criteria == "TYPE=msdosfs":

so vfat is the clue, and then we go looking for msdos or msdosfs

n.b.: i have signed a CLA, and submitted 75% of the recent FreeBSD patches to cloud-init: https://github.com/canonical/cloud-init/pulls?q=is%3Apr+author%3Aigalic
Comment 4 Andrey Fesenko 2020-10-29 10:44:53 UTC
Created attachment 219195 [details]

Delete criteria section
Comment 5 Andrey Fesenko 2020-10-29 12:50:10 UTC
Created attachment 219199 [details]

sync upstream https://github.com/canonical/cloud-init/pull/637
Fix mounting of vfat

regenerate makepatch
Comment 6 commit-hook freebsd_committer 2020-10-30 09:59:25 UTC
A commit references this bug:

Author: danfe
Date: Fri Oct 30 09:58:48 UTC 2020
New revision: 553676
URL: https://svnweb.freebsd.org/changeset/ports/553676

  - Amend the list of recognized newfs(8) options
  - Fix mounting of VFAT which FreeBSD calls "msdos[fs]"
  - GC `devel/py-six' dependency, unused since v20.2

  PR:	250496

Comment 7 Alexey Dokuchaev freebsd_committer 2020-10-30 11:21:38 UTC
Committed as ports r553676, thank you all.
Comment 8 Brad Davis freebsd_committer 2020-11-02 18:55:53 UTC
Thank you all!