Disabling services in imagebuilder: "No rule to make target 'firewall'"

Hi all,

the docs for the imagebuilder state that one can disable services:

DISABLED_SERVICES 	The names of services from /etc/init.d to disable, e.g. dhcp for dnsmasq 

I am building an image for a "dumb access point", aka it does not need DHCP or a firewall. However, when adding firewall into this variable, I get an error during build:

1+0 records in
1+0 records out
128 bytes copied, 5.5379e-05 s, 2.3 MB/s

Calculating checksums...
make[1]: *** No rule to make target 'firewall'.  Stop.

Is this a known issue? Is the firewall service to important to be disabled?

For the record, I could successfully add dhcp into that variable and it did not error out.

Kind Regards,

Hmmm, if I remove dhcp and only have firewall in that variable, it seems to work. So I guess it does not like it with spaces:

DISABLED_SERVICES="dhcp firewall"

Trying with comma-separated now...

Does not seem like this is working:

Finalizing root filesystem...       
Enabling boot   
Enabling bootcount 
Enabling cron   
Enabling dnsmasq   
Enabling done     
Enabling dropbear  
Enabling firewall                                                                                        
Enabling gpio_switch
Enabling led       
Enabling log                                                                                             
Enabling network
Enabling rpcd  
Enabling sshd                            
Enabling sudo
Enabling sysctl         
Enabling sysfixtime           
Enabling sysntpd                                                                                                                                                                                                  
Enabling system      
Enabling ucitrack                 
Enabling uhttpd                                                                                          
Enabling umount
Enabling urandom_seed
Enabling urngd
Enabling wpad

Both dnsmasq and firewall are being enabled.

Are you trying to fit OpenWrt onto a device with a very small flash storage chip?

I have three devices, two of them are dumb APs. And both of them have little space. So removing some packages and having enough space for python3-light (to allow administration via Ansible) is really nice.

This part already works flawlessly for all three of them. But each time I upgrade I have the unnecessary services enabled again, so I wanted to try out what the docs promise...

Using a - prefix for a package name allows removing the package from an image built using imagebuilder. Or rather, it prevents its installation in the image.

However, that does not seem to fully work for some "important" packages. I do not need DHCP or firewall on my dumb APs, so I tried to exclude them in the image:

PACKAGES="-dnsmasq -kmod-ppp -kmod-pppoe -kmod-pppox -luci-proto-ppp -ppp -ppp-mod-pppoe -odhcp6c -odhcpd-ipv6only -firewall4 -luci-app-firewall -iptables -nftables-json -kmod-nf-conntrack ..."

But some of them still end up in the image. The PPOE packages do not seem to be present, same for the odhcp6c ones. However, dnsmasq and firewall are both present.

Do I need to put the excluded packages at the end of the list?

Or can I simply not exclude those packages?

Thanks in advance.

I had the same problem - InitramFS version without firewall - #16 by lleachii

tried to build w/o fwall but did not success

There was a thread a while ago about the packages which cannot be removed with the IB and will require compiling from scratch to remove. Giving the limitations of the IB, maybe you should use the uci-defaults script to stop/disable services from running on first boot.

I had a thread a while back that was related to the image builder for 18.06, but similar findings.

1 Like

It works like this for the current release:

make image DISABLED_SERVICES="dnsmasq firewall odhcpd"
1 Like

OK, I think I found my mistake.

Setting PROFILE as an environment variable is enough, it is picked up by make even if it is not given on the actual make image ... call.

This is not the case for PACKAGES and also not for DISABLED_SERVICES.

I.e. this works:

make image DISABLED_SERVICES="dnsmasq firewall odhcpd"

This does not:

DISABLED_SERVICES="dnsmasq firewall odhcpd"
make image
1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.