growpart fails when kernel release has trailing characters

Bug #1881014 reported by ov2k
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-utils
Fix Released
Undecided
Unassigned

Bug Description

The kernel release reported by uname -r is not always purely numeric (e.g., 5.4.0-31-generic). The kver_to_num() function in growpart assumes the release component is purely numeric.

When the kernel release is 4.19.97+, the following error is reported:

/usr/bin/growpart: 506: /usr/bin/growpart: arithmetic expression: expecting primary: "4*1000*1000+19*1000+97+"

Stripping trailing characters should be sufficient. Patch attached.

Revision history for this message
ov2k (ov2k) wrote :
Paride Legovini (paride)
Changed in cloud-utils:
status: New → Triaged
Revision history for this message
Paride Legovini (paride) wrote :
Revision history for this message
Dan Watkins (oddbloke) wrote :

I'm guessing Paride intended to paste https://github.com/canonical/cloud-utils/pull/2 here.

Changed in cloud-utils:
status: Triaged → In Progress
assignee: nobody → Paride Legovini (paride)
Paride Legovini (paride)
Changed in cloud-utils:
status: In Progress → Fix Committed
Revision history for this message
Paride Legovini (paride) wrote :

Fix Released in: 0.31-22-g37d4e32a-0ubuntu1 (Groovy).

Changed in cloud-utils:
status: Fix Committed → Fix Released
assignee: Paride Legovini (paride) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.