Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1014662: cloud-initramfs-growroot: Initramfs hook does not include `flock` command

98 views
Skip to first unread message

undef

unread,
Jul 9, 2022, 9:30:03 PM7/9/22
to

Package: cloud-initramfs-growroot
Version: 0.18.debian8
Severity: important
Tags: upstream
X-Debbugs-Cc: deb...@undef.tools

Dear Maintainer,

As part of the standard Mobian install proceedure, we use
cloud-initramfs-growroot to expand the root partition on the device.
Recent installs have been failing to resize with the following (debug)
output:
```
+ growpart /dev/mmcblk0 2
+ out='failed [flock:127] flock -x 9
/sbin/growpart: line 714: flock: not found
FAILED: Error while obtaining exclusive lock on /dev/mmcblk0'
+ echo 'GROWROOT: WARNING: resize failed: failed [flock:127] flock -x 9
/sbin/growpart: line 714: flock: not found
FAILED: Error while obtaining exclusive lock on /dev/mmcblk0'
GROWROOT: WARNING: resize failed: failed [flock:127] flock -x 9
/sbin/growpart: line 714: flock: not found
FAILED: Error while obtaining exclusive lock on /dev/mmcblk0
+ udevadm settle --timeout 30
```

I believe this issue is solved upstream where the hook has been
re-written
(https://git.launchpad.net/cloud-initramfs-tools/tree/growroot/hooks/growroot#n12).

Without updating to the latest upstream version, simply adding
`copy_exec /bin/flock /bin` to the growroot hook also solves the issue.

Thank you for your consideration.


-- System Information:
Debian Release: bookworm/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: arm64 (aarch64)

Kernel: Linux 5.18.7-rockchip (SMP w/6 CPU threads)
Kernel taint flags: TAINT_CRAP, TAINT_UNSIGNED_MODULE
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages cloud-initramfs-growroot depends on:
pn  cloud-utils      <none>
ii  fdisk            2.38-4
ii  initramfs-tools  0.141
ii  util-linux       2.38-4

cloud-initramfs-growroot recommends no packages.

cloud-initramfs-growroot suggests no packages.

Shane Frasier

unread,
Nov 29, 2022, 3:30:04 PM11/29/22
to
Dear Maintainer,

I am seeing exactly this same issue in Kali Linux, which uses the Debian Bullseye package.  This is causing our AMIs (which use the official Kali AMI as the base) to fail to boot.

Thank you,
Shane Frasier

Santiago Vila

unread,
Feb 17, 2023, 2:30:05 PM2/17/23
to
severity 1014662 serious
tags 1014662 + patch
thanks

I can reproduce this as well.

I have a packer setup which takes a Hetzner cx11 instance (the smallest
available size), upgrades it to bookworm, installs some extra packages,
and then takes a snapshot.

This used to work before I added the "upgrades it to bookworm" part.

Now it does not work, and as a result, the images only work ok
if I create an instance of the same size that was used to create
the image.

undef <deb...@undef.tools> wrote:
> Without updating to the latest upstream version, simply adding
> `copy_exec /bin/flock /bin` to the growroot hook also solves the issue.

I've converted the above hint into a patch.

(using /usr/bin/flock as the path as that's what dpkg -L util-linux
reports as the canonical location)

Please consider applying the patch before the hard freeze. The package
is not very useful in its current state.

Thanks.
cloud-initramfs-tools.debdiff.txt

Santiago Vila

unread,
Feb 17, 2023, 4:00:04 PM2/17/23
to
After applying the suggested patch, the reported error
does not show anymore.

Instead, I get this:

/scripts/local-bottom/growroot: line 97: wait-for-root: not found

Where does this "wait-for-root" come from?
I can't find it in any package.

Thanks.

undef

unread,
Feb 17, 2023, 5:00:04 PM2/17/23
to
Given that upstream changes to this package haven't been integrated in
years and this bug being pretty limiting to users, Mobian moved to
systemd-repart. If it's possible for you I might recommend the same
solution.

Our experience has been that once implemented it is far more reliable.
The switch can be seen at
https://salsa.debian.org/Mobian-team/mobian-recipes/-/merge_requests/67/diffs

Key parts:

1. Partitions need to be GPT

2. Partitions being resized need a specific "parttype" UUID configured
on them.

3. A simple config file needs to be installed in /etc/repart.d.

Santiago Vila

unread,
Feb 17, 2023, 6:30:04 PM2/17/23
to
El 17/2/23 a las 22:57, Ross Vandegrift escribió:
> There's a relevant MR in salsa:
> https://salsa.debian.org/cloud-team/cloud-initramfs-tools/-/merge_requests/2
>
> Would you mind testing the patch there?

Yes, I confirm that your patch works. Thanks a lot!

> I don't know how widely used this package is.

It's used by Hetzner, which has a lot of customers (I'm one of them).

Without a fix for this, they will be unable to offer images for Debian 12
which actually work (people will wonder why instances with 80 GB of disk
appear to have only 20 GB).

Thanks.

Santiago Vila

unread,
Feb 17, 2023, 7:10:05 PM2/17/23
to
severity 1014662 important
thanks

Note: I'm restoring the original severity because Martin Pitt says
in #1027050 that the fatal failure is due to wait-for-root, not flock.

(However, I could not imagine an upload fixing #1027050 which
would not fix this one in the same upload as well).

Thanks.
0 new messages