How can I send a patch?

Asked by Hiroaki Nakamura

Hi, I tried to use mock 1.3.2-2 on Ubuntu 18.04 LTS, but I got the following error when I run mock --rebuild.

ERROR: Command failed. See logs for output.
 # ['/usr/sbin/groupadd', '-g', '999', 'mockbuild']

I made a patch at https://github.com/hnakamur/mock-deb/commit/08ca79ca674e4c20b9a06a96b90794d2a735c8b2
and my custom deb package at https://launchpad.net/~hnakamur/+archive/ubuntu/mock.

I would like to send the patch if you are interested.
Could you tell me how to send the patch?
Thanks!

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu mock Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Hiroaki Nakamura (hnakamur) said :
#1

Here is more detailed explanation to reproduce the error.

I tried again to install mock-1.3.2-2 on a fresh clean environment and I got the following error.

```
$ sudo apt install mock
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  pigz
The following NEW packages will be installed:
  mock
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 99.0 kB of archives.
After this operation, 503 kB of additional disk space will be used.
Get:1 http://jp.archive.ubuntu.com/ubuntu bionic/universe amd64 mock all 1.3.2-2 [99.0 kB]
Fetched 99.0 kB in 0s (1,185 kB/s)
dpkg: unrecoverable fatal error, aborting:
 unknown group 'mock' in statoverride file
E: Sub-process /usr/bin/dpkg returned an error code (2)
```

As a workaround, I created the "mock" group before installing the mock package.

```
$ sudo groupadd --system mock
$ sudo apt install mock
```

Then I added my user to the "mock" group.

```
$ sudo usermod -a -G mock $USER
$ newgrp mock
```

When I tried to init the epel-7-x86_64 chroot, I got the following error, the same error as I reported in the previous message.

```
$ /usr/bin/mock -r epel-7-x86_64 --init
...
ERROR: Command failed. See logs for output.
 # /usr/sbin/groupadd -g 999 mockbuild
```

I uninstalled the mock package.

```
$ sudo apt purge mock
...
dpkg: warning: while removing mock, directory '/var/lib/mock' not empty so not removed
dpkg: warning: while removing mock, directory '/var/cache/mock' not empty so not removed
```

And I cleaned up the environment.

```
$ sudo rm -rf /var/lib/mock /var/cache/mock
$ sudo groupdel mock
```

And I tried again with my custom mock package.

```
$ sudo groupadd --system mock
$ sudo add-apt-repository ppa:hnakamur/mock
$ sudo apt update
$ sudo apt install mock
$ sudo usermod -a -G mock $USER
$ newgrp mock
```

This time when I tried to init the epel-7-x86_64 chroot, I got the following error.

```
$ /usr/bin/mock -r epel-7-x86_64 --init
...
ERROR: Command failed. See logs for output.
 # /usr/sbin/groupadd -g 999 mock
```

The reason for the above error is that another group uses the gid 999.

```
$ grep :999: /var/lib/mock/epel-7-x86_64/root/etc/group
input:x:999:
```

As a workaround, I changed the gid of the "mock" group.

```
$ sudo groupmod -g 998 mock
```

Now I can init the epel-7-x86_64 chroot successfully.

```
$ /usr/bin/mock -r epel-7-x86_64 --init
```

Revision history for this message
Adolfo Jayme Barrientos (fitojb) said :
#2

Please attach your patch to a new bug report and tag the report with “patch” :)

Can you help with this problem?

Provide an answer of your own, or ask Hiroaki Nakamura for more information if necessary.

To post a message you must log in.