meta-nilrt: Integrate firewalld and retire legacy firewall#1030
meta-nilrt: Integrate firewalld and retire legacy firewall#1030Vairamani-NI wants to merge 2 commits into
Conversation
0ad457d to
75a12ab
Compare
There was a problem hiding this comment.
Pull request overview
This PR migrates NILRT runmode images from a legacy iptables-restore SysV init script to firewalld, updating both the runmode package set and the persisted-configuration paths to match firewalld’s configuration locations.
Changes:
- Add
firewalldandni-firewalld-servicedefsto the runmode packagegroup. - Remove the legacy
/etc/init.d/firewalliptables/ip6tables restore script and its recipe install/rc.d registration. - Update
ninetcfgutilpersistence to track firewalld configuration paths; adjust ARM distro opt-outs to keepgobject-introspection-dataavailable.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| recipes-ni/ni-netcfgutil/files/ninetcfgutil | Updates persisted configuration entries from legacy iptables conf files to firewalld-related paths. |
| recipes-ni/initscripts-nilrt/initscripts-nilrt.bb | Stops installing/enabling the legacy firewall SysV init script. |
| recipes-ni/initscripts-nilrt/files/firewall | Removes the legacy iptables/ip6tables restore/clear init script. |
| recipes-core/packagegroups/packagegroup-ni-runmode.bb | Pulls firewalld (and NI service definitions) into runmode images. |
| conf/distro/nilrt.inc | Adjusts ARM feature opt-outs to avoid dropping gobject-introspection-data, which firewalld depends on. |
Comments suppressed due to low confidence (1)
recipes-ni/initscripts-nilrt/initscripts-nilrt.bb:61
- NILRT is configured to use sysvinit (conf/distro/nilrt.inc sets VIRTUAL-RUNTIME_init_manager = "sysvinit"). This PR removes the legacy /etc/init.d/firewall startup, but I don't see any replacement SysV init script or update-rc.d enablement for firewalld in this layer. On sysvinit images this can result in firewalld never starting at boot, effectively leaving the system without the intended firewall enforcement.
Consider adding a SysV init script for firewalld (or a lightweight wrapper that starts/stops /usr/sbin/firewalld) and enabling it via update-rc.d, or adding a bbappend to the firewalld recipe that installs/enables a SysV init script when sysvinit is the init manager.
update-rc.d -r ${D} cleanvarcache start 38 0 6 S .
update-rc.d -r ${D} mountconfig start 35 S .
update-rc.d -r ${D} niconfiguretracefs start 82 S .
update-rc.d -r ${D} nicheckbiosconfig start 99 4 5 .
update-rc.d -r ${D} nicleanefivars start 10 S .
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
08216ca to
75a12ab
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
recipes-ni/initscripts-nilrt/initscripts-nilrt.bb:69
nilrt.incsetsVIRTUAL-RUNTIME_init_manager = "sysvinit"(conf/distro/nilrt.inc:81). This recipe removes the legacy/etc/init.d/firewallinstall +update-rc.dregistration, but this PR does not add any SysV init integration to ensurefirewalldis started at boot. If the upstreamfirewalldrecipe only installs a systemd unit (common), runmode images could boot with no firewall service running.
Please add/verify a SysV init path for firewalld on NILRT (e.g., a firewalld_%.bbappend that installs an init.d script + INITSCRIPT_*, or a NILRT-specific init script that starts/stops firewalld) and ensure it is enabled by default.
do_install () {
install -d ${D}${sysconfdir}/init.d/
install -m 0755 ${S}/cleanvarcache ${D}${sysconfdir}/init.d
install -m 0755 ${S}/mountconfig ${D}${sysconfdir}/init.d
install -m 0755 ${S}/niconfiguretracefs ${D}${sysconfdir}/init.d
install -m 0755 ${S}/nicheckbiosconfig ${D}${sysconfdir}/init.d
install -m 0755 ${S}/nicleanefivars ${D}${sysconfdir}/init.d
install -m 0755 ${S}/nicleanstalelinks ${D}${sysconfdir}/init.d
install -m 0755 ${S}/nidisablecstates ${D}${sysconfdir}/init.d
install -m 0755 ${S}/nipopulateconfigdir ${D}${sysconfdir}/init.d
install -m 0755 ${S}/nisetcommitratio ${D}${sysconfdir}/init.d
install -m 0755 ${S}/nisetreboottype ${D}${sysconfdir}/init.d
install -m 0755 ${S}/nisetupkernelconfig ${D}${sysconfdir}/init.d
install -m 0755 ${S}/populateconfig ${D}${sysconfdir}/init.d
install -m 0755 ${S}/wirelesssetdomain ${D}${sysconfdir}/init.d
update-rc.d -r ${D} cleanvarcache start 38 0 6 S .
update-rc.d -r ${D} mountconfig start 35 S .
update-rc.d -r ${D} niconfiguretracefs start 82 S .
update-rc.d -r ${D} nicheckbiosconfig start 99 4 5 .
update-rc.d -r ${D} nicleanefivars start 10 S .
update-rc.d -r ${D} nicleanstalelinks start 5 S .
update-rc.d -r ${D} nidisablecstates start 2 3 4 5 S .
update-rc.d -r ${D} nipopulateconfigdir start 35 S .
update-rc.d -r ${D} nisetcommitratio start 99 S .
update-rc.d -r ${D} nisetreboottype stop 55 6 .
update-rc.d -r ${D} nisetupkernelconfig start 3 5 .
update-rc.d -r ${D} populateconfig start 35 S . start 30 0 6 .
update-rc.d -r ${D} wirelesssetdomain start 36 S .
@chaitu236 I have reverted the arm32 changes for firewalld using iptables, shall we proceed with these changes (firewalld work only on x64) or hold until arm32 kernel bump? |
chaitu236
left a comment
There was a problem hiding this comment.
Please split into multiple commits so that each accomplishes one thing. e.g., one commit to remove legacy firewall, one to add new firewall, etc.
As discussed today, let's only implement for x64 until arm kernel is upgraded. |
Remove the static iptables-based firewall SysV init script along with its SRC_URI reference, install step, configfs path substitution, sanity check, and update-rc.d registration in initscripts-nilrt. This retires the legacy static firewall ruleset to make way for the firewalld daemon. Scoped to runmode images; safemode initramfs unaffected. Signed-off-by: vairamani muthusamy <vairamani.muthusamy@emerson.com>
Add firewalld 2.2.1 and ni-firewalld-servicedefs to packagegroup-ni-runmode, and migrate ninetcfgutil persistence configuration from the static iptables.conf/ip6tables.conf paths to the firewalld configuration directories (etc/firewalld, etc/sysconfig/firewalld). Provides a modern, dynamically managed firewall daemon in place of the retired legacy iptables init script. Scoped to runmode images; safemode initramfs unaffected. Signed-off-by: vairamani muthusamy <vairamani.muthusamy@emerson.com>
75a12ab to
1845620
Compare
Done, I have rebased and built it again too. Pls approve to merge. |
chaitu236
left a comment
There was a problem hiding this comment.
Approved conditional on BSI being bootable and firewalld working.
Summary of Changes
meta-nilrt: Integrate firewalld and retire legacy firewall
Replaces legacy iptables-based firewall with modern firewalld daemon.
Justification
https://dev.azure.com/ni/DevCentral/_workitems/edit/3931336
https://dev.azure.com/ni/DevCentral/_workitems/edit/3931337
Testing
Build
Boot test on hardware — cRIO-9045 (x86_64, NI Linux RT 12.0 "wrynose", kernel 6.12.94-rt18 PREEMPT_RT, run mode)
bitbake packagefeed-ni-core)Procedure