* [PATCH] debianize: set Rules-Requires-Root in debian/control
@ 2025-08-14 14:34 Isaac True
2025-08-15 13:01 ` 'Jan Kiszka' via isar-users
2025-09-15 14:49 ` [PATCH v2] debianize: allow setting Rules-Requires-Root Isaac True
0 siblings, 2 replies; 5+ messages in thread
From: Isaac True @ 2025-08-14 14:34 UTC (permalink / raw)
To: isar-users; +Cc: Isaac True
Setting "Rules-Requires-Root: no" in the debian/control file avoids
unnecessarily calling fakeroot in the build environment. Packages which
require root can override the new "DEBIAN_RULES_REQUIRES_ROOT" variable
with the desired value.
This is specifically useful when using dpkg-raw, as it no longer needs
fakeroot to create the packages. This provides a considerable speedup in
some environments (e.g. systems with very high open file descriptor
limits and specific versions of fakeroot).
Signed-off-by: Isaac True <itrue@emlix.com>
---
meta/classes/debianize.bbclass | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/meta/classes/debianize.bbclass b/meta/classes/debianize.bbclass
index 4989c601..eeebea69 100644
--- a/meta/classes/debianize.bbclass
+++ b/meta/classes/debianize.bbclass
@@ -16,6 +16,7 @@ DEBIAN_BREAKS ??= ""
DEBIAN_MULTI_ARCH ??= "no"
DEBIAN_COMPAT ??= "10"
DEBIAN_CHANGELOG_TIMESTAMP ??= "3600"
+DEBIAN_RULES_REQUIRES_ROOT ??= "no"
DESCRIPTION ??= "must not be empty"
MAINTAINER ??= "Unknown maintainer <unknown@example.com>"
@@ -74,7 +75,8 @@ deb_create_control[vardeps] += "DEBIANIZE_BUILD_DEPENDS \
DEBIAN_PROVIDES \
DEBIAN_REPLACES \
DEBIAN_BREAKS \
- DEBIAN_CONFLICTS"
+ DEBIAN_CONFLICTS \
+ DEBIAN_RULES_REQUIRES_ROOT"
deb_create_control() {
cat << EOF > ${S}/debian/control
Source: ${BPN}
@@ -83,6 +85,7 @@ Priority: optional
Standards-Version: 3.9.6
Maintainer: ${MAINTAINER}
Build-Depends: ${@ deb_list_beautify(d, 'DEBIANIZE_BUILD_DEPENDS')}
+Rules-Requires-Root: ${DEBIAN_RULES_REQUIRES_ROOT}
Package: ${BPN}
Architecture: ${DPKG_ARCH}
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20250814143405.204360-2-itrue%40emlix.com.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] debianize: set Rules-Requires-Root in debian/control
2025-08-14 14:34 [PATCH] debianize: set Rules-Requires-Root in debian/control Isaac True
@ 2025-08-15 13:01 ` 'Jan Kiszka' via isar-users
2025-08-15 13:09 ` Isaac True
2025-09-15 14:49 ` [PATCH v2] debianize: allow setting Rules-Requires-Root Isaac True
1 sibling, 1 reply; 5+ messages in thread
From: 'Jan Kiszka' via isar-users @ 2025-08-15 13:01 UTC (permalink / raw)
To: Isaac True, isar-users
On 14.08.25 16:34, Isaac True wrote:
> Setting "Rules-Requires-Root: no" in the debian/control file avoids
> unnecessarily calling fakeroot in the build environment. Packages which
> require root can override the new "DEBIAN_RULES_REQUIRES_ROOT" variable
> with the desired value.
Hmm, but the Policy says it's default-no anyway:
https://www.debian.org/doc/debian-policy/ch-controlfields.html#rules-requires-root
Did that default change recently?
>
> This is specifically useful when using dpkg-raw, as it no longer needs
> fakeroot to create the packages. This provides a considerable speedup in
> some environments (e.g. systems with very high open file descriptor
> limits and specific versions of fakeroot).
>
> Signed-off-by: Isaac True <itrue@emlix.com>
> ---
> meta/classes/debianize.bbclass | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes/debianize.bbclass b/meta/classes/debianize.bbclass
> index 4989c601..eeebea69 100644
> --- a/meta/classes/debianize.bbclass
> +++ b/meta/classes/debianize.bbclass
> @@ -16,6 +16,7 @@ DEBIAN_BREAKS ??= ""
> DEBIAN_MULTI_ARCH ??= "no"
> DEBIAN_COMPAT ??= "10"
> DEBIAN_CHANGELOG_TIMESTAMP ??= "3600"
> +DEBIAN_RULES_REQUIRES_ROOT ??= "no"
> DESCRIPTION ??= "must not be empty"
> MAINTAINER ??= "Unknown maintainer <unknown@example.com>"
>
> @@ -74,7 +75,8 @@ deb_create_control[vardeps] += "DEBIANIZE_BUILD_DEPENDS \
> DEBIAN_PROVIDES \
> DEBIAN_REPLACES \
> DEBIAN_BREAKS \
> - DEBIAN_CONFLICTS"
> + DEBIAN_CONFLICTS \
> + DEBIAN_RULES_REQUIRES_ROOT"
> deb_create_control() {
> cat << EOF > ${S}/debian/control
> Source: ${BPN}
> @@ -83,6 +85,7 @@ Priority: optional
> Standards-Version: 3.9.6
> Maintainer: ${MAINTAINER}
> Build-Depends: ${@ deb_list_beautify(d, 'DEBIANIZE_BUILD_DEPENDS')}
> +Rules-Requires-Root: ${DEBIAN_RULES_REQUIRES_ROOT}
>
> Package: ${BPN}
> Architecture: ${DPKG_ARCH}
>
This is a change that first of all requires an entry in
RECIPE-API-CHANGELOG.md. But you also need to explain if this is fine
down to buster (we still support building for it, yes, it's ELTS). And
you need to ensure that it will not change anything for existing layers
- which is in conflict with the expressed intention of this change.
Jan
--
Siemens AG, Foundational Technologies
Linux Expert Center
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/df5ab881-2c77-4409-8544-f2c0154b62fb%40siemens.com.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] debianize: set Rules-Requires-Root in debian/control
2025-08-15 13:01 ` 'Jan Kiszka' via isar-users
@ 2025-08-15 13:09 ` Isaac True
2025-08-15 13:39 ` 'Jan Kiszka' via isar-users
0 siblings, 1 reply; 5+ messages in thread
From: Isaac True @ 2025-08-15 13:09 UTC (permalink / raw)
To: Jan Kiszka, isar-users
>
> Hmm, but the Policy says it's default-no anyway:
>
>
https://www.debian.org/doc/debian-policy/ch-controlfields.html#rules-requires-root
>
> Did that default change recently?
According to the deb-src-control man page
(https://www.man7.org/linux/man-pages/man5/deb-src-control.5.html) this
only became the default with dpkg >= 1.22.13, which is relatively
recent. Anything with a dpkg version earlier than that (which includes
Ubuntu Jammy and Noble) uses `binary-targets` as the default, which
calls fakeroot.
> This is a change that first of all requires an entry in
> RECIPE-API-CHANGELOG.md. But you also need to explain if this is fine
> down to buster (we still support building for it, yes, it's ELTS). And
> you need to ensure that it will not change anything for existing layers
> - which is in conflict with the expressed intention of this change.
Understood. Would you prefer that it doesn't add the field by default in
order to maintain backwards-compatibility, and instead only add the
field when the value is set?
Cheers,
Isaac
On 15/08/25 15:01, Jan Kiszka wrote:
> On 14.08.25 16:34, Isaac True wrote:
>> Setting "Rules-Requires-Root: no" in the debian/control file avoids
>> unnecessarily calling fakeroot in the build environment. Packages which
>> require root can override the new "DEBIAN_RULES_REQUIRES_ROOT" variable
>> with the desired value.
>
> Hmm, but the Policy says it's default-no anyway:
>
> https://www.debian.org/doc/debian-policy/ch-controlfields.html#rules-requires-root
>
> Did that default change recently?
>
>>
>> This is specifically useful when using dpkg-raw, as it no longer needs
>> fakeroot to create the packages. This provides a considerable speedup in
>> some environments (e.g. systems with very high open file descriptor
>> limits and specific versions of fakeroot).
>>
>> Signed-off-by: Isaac True <itrue@emlix.com>
>> ---
>> meta/classes/debianize.bbclass | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/meta/classes/debianize.bbclass b/meta/classes/debianize.bbclass
>> index 4989c601..eeebea69 100644
>> --- a/meta/classes/debianize.bbclass
>> +++ b/meta/classes/debianize.bbclass
>> @@ -16,6 +16,7 @@ DEBIAN_BREAKS ??= ""
>> DEBIAN_MULTI_ARCH ??= "no"
>> DEBIAN_COMPAT ??= "10"
>> DEBIAN_CHANGELOG_TIMESTAMP ??= "3600"
>> +DEBIAN_RULES_REQUIRES_ROOT ??= "no"
>> DESCRIPTION ??= "must not be empty"
>> MAINTAINER ??= "Unknown maintainer <unknown@example.com>"
>>
>> @@ -74,7 +75,8 @@ deb_create_control[vardeps] += "DEBIANIZE_BUILD_DEPENDS \
>> DEBIAN_PROVIDES \
>> DEBIAN_REPLACES \
>> DEBIAN_BREAKS \
>> - DEBIAN_CONFLICTS"
>> + DEBIAN_CONFLICTS \
>> + DEBIAN_RULES_REQUIRES_ROOT"
>> deb_create_control() {
>> cat << EOF > ${S}/debian/control
>> Source: ${BPN}
>> @@ -83,6 +85,7 @@ Priority: optional
>> Standards-Version: 3.9.6
>> Maintainer: ${MAINTAINER}
>> Build-Depends: ${@ deb_list_beautify(d, 'DEBIANIZE_BUILD_DEPENDS')}
>> +Rules-Requires-Root: ${DEBIAN_RULES_REQUIRES_ROOT}
>>
>> Package: ${BPN}
>> Architecture: ${DPKG_ARCH}
>>
>
> This is a change that first of all requires an entry in
> RECIPE-API-CHANGELOG.md. But you also need to explain if this is fine
> down to buster (we still support building for it, yes, it's ELTS). And
> you need to ensure that it will not change anything for existing layers
> - which is in conflict with the expressed intention of this change.
>
> Jan
>
--
Isaac True
emlix GmbH, https://www.emlix.com
Fon +49 228 94 77 96 94
Bachstraße 6, 53115 Bonn, Germany
Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
Geschäftsfuehrung: Heike Jordan, Dr. Uwe Kracke
Ust-IdNr.: DE 205 198 055
emlix - smart embedded open source
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/13722340-f9b2-4bb0-ae49-90156c7e7087%40emlix.com.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] debianize: set Rules-Requires-Root in debian/control
2025-08-15 13:09 ` Isaac True
@ 2025-08-15 13:39 ` 'Jan Kiszka' via isar-users
0 siblings, 0 replies; 5+ messages in thread
From: 'Jan Kiszka' via isar-users @ 2025-08-15 13:39 UTC (permalink / raw)
To: Isaac True, isar-users
On 15.08.25 15:09, Isaac True wrote:
>>
>> Hmm, but the Policy says it's default-no anyway:
>>
>> https://www.debian.org/doc/debian-policy/ch-controlfields.html#rules-
> requires-root
>>
>> Did that default change recently?
>
> According to the deb-src-control man page (https://www.man7.org/linux/
> man-pages/man5/deb-src-control.5.html) this only became the default with
> dpkg >= 1.22.13, which is relatively recent. Anything with a dpkg
> version earlier than that (which includes Ubuntu Jammy and Noble) uses
> `binary-targets` as the default, which calls fakeroot.
>
>> This is a change that first of all requires an entry in
>> RECIPE-API-CHANGELOG.md. But you also need to explain if this is fine
>> down to buster (we still support building for it, yes, it's ELTS). And
>> you need to ensure that it will not change anything for existing layers
>> - which is in conflict with the expressed intention of this change.
>
> Understood. Would you prefer that it doesn't add the field by default in
> order to maintain backwards-compatibility, and instead only add the
> field when the value is set?
For source-based packages, we should not change the API level's default
unless explicitly requested by the recipe. So, you could add
"Rules-Requires-Root" only if DEBIAN_RULES_REQUIRES_ROOT is set e.g.
For dpkg-prebuilt, I think we can safely go to non-root but only on
those distros that already understood "Rules-Requires-Root".
Jan
--
Siemens AG, Foundational Technologies
Linux Expert Center
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/599ab11c-7a65-46da-8643-95dd2a8c5924%40siemens.com.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2] debianize: allow setting Rules-Requires-Root
2025-08-14 14:34 [PATCH] debianize: set Rules-Requires-Root in debian/control Isaac True
2025-08-15 13:01 ` 'Jan Kiszka' via isar-users
@ 2025-09-15 14:49 ` Isaac True
1 sibling, 0 replies; 5+ messages in thread
From: Isaac True @ 2025-09-15 14:49 UTC (permalink / raw)
To: isar-users; +Cc: Isaac True
Add a new variable "DEBIAN_RULES_REQUIRES_ROOT" which can be used to
control the value of the "Rules-Requires-Root" parameter in the
debian/control file. If this variable has no value (the default
behaviour), nothing is added. Otherwise, it appends
"Rules-Requires-Root: ${DEBIAN_RULES_REQUIRES_ROOT}" to the
Source section of the debian/control file.
This can be useful when using dpkg-raw, as setting this value to "no"
skips calling `fakeroot` during the package build process, which can
provide a considerable speedup in some environments (e.g. systems with
very high open file descriptor limits and specific versions of
fakeroot).
Signed-off-by: Isaac True <itrue@emlix.com>
---
Changes in v2:
- Add information to RECIPE-API-CHANGELOG.md
- Only add Rules-Requires-Root if the DEBIAN_RULES_REQUIRES_ROOT
variable has been set
RECIPE-API-CHANGELOG.md | 8 ++++++++
meta/classes/debianize.bbclass | 17 ++++++++++++++++-
2 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
index 8468717d..f0b94c2f 100644
--- a/RECIPE-API-CHANGELOG.md
+++ b/RECIPE-API-CHANGELOG.md
@@ -727,3 +727,11 @@ Changes in next
This was never documented and never had practical relevance. `oci-archive` is
the useful OCI image format that can be imported, e.g., by podman.
+
+### Allow setting Rules-Requires-Root
+
+Recipes based on the `debianize` class can now set the
+`DEBIAN_RULES_REQUIRES_ROOT` variable to control the value of the
+`Rules-Requires-Root` setting in the `debian/control` file. If this variable is
+unset (the default), `Rules-Requires-Root` will not be added. Otherwise,
+`Rules-Requires-Root` will be added and set to the value of the variable.
diff --git a/meta/classes/debianize.bbclass b/meta/classes/debianize.bbclass
index 4989c601..acc5a1ba 100644
--- a/meta/classes/debianize.bbclass
+++ b/meta/classes/debianize.bbclass
@@ -16,6 +16,7 @@ DEBIAN_BREAKS ??= ""
DEBIAN_MULTI_ARCH ??= "no"
DEBIAN_COMPAT ??= "10"
DEBIAN_CHANGELOG_TIMESTAMP ??= "3600"
+DEBIAN_RULES_REQUIRES_ROOT ??= ""
DESCRIPTION ??= "must not be empty"
MAINTAINER ??= "Unknown maintainer <unknown@example.com>"
@@ -74,8 +75,10 @@ deb_create_control[vardeps] += "DEBIANIZE_BUILD_DEPENDS \
DEBIAN_PROVIDES \
DEBIAN_REPLACES \
DEBIAN_BREAKS \
- DEBIAN_CONFLICTS"
+ DEBIAN_CONFLICTS \
+ DEBIAN_RULES_REQUIRES_ROOT"
deb_create_control() {
+ # Add Source section
cat << EOF > ${S}/debian/control
Source: ${BPN}
Section: misc
@@ -83,6 +86,18 @@ Priority: optional
Standards-Version: 3.9.6
Maintainer: ${MAINTAINER}
Build-Depends: ${@ deb_list_beautify(d, 'DEBIANIZE_BUILD_DEPENDS')}
+EOF
+
+ # If a value has been set, add the value of DEBIAN_RULES_REQUIRES_ROOT to
+ # the control file.
+ if [ -n "${DEBIAN_RULES_REQUIRES_ROOT}" ]; then
+ echo "Rules-Requires-Root: ${DEBIAN_RULES_REQUIRES_ROOT}" >> \
+ ${S}/debian/control
+ fi
+
+ # Add Package section proceeded by an empty line to separate it from the
+ # previous section.
+ cat << EOF >> ${S}/debian/control
Package: ${BPN}
Architecture: ${DPKG_ARCH}
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20250915144925.274032-2-itrue%40emlix.com.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-09-15 16:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-14 14:34 [PATCH] debianize: set Rules-Requires-Root in debian/control Isaac True
2025-08-15 13:01 ` 'Jan Kiszka' via isar-users
2025-08-15 13:09 ` Isaac True
2025-08-15 13:39 ` 'Jan Kiszka' via isar-users
2025-09-15 14:49 ` [PATCH v2] debianize: allow setting Rules-Requires-Root Isaac True
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox