Image builder executing target's init.d scripts on the build host?

I use the image builder to make images for my various routers/APs.
My current builds of the master branch snapshots are showing evidence that the builds are executing the init.d scripts on the build host. This seems improper--the build host doesn't likely have the same startup script mechanism. Even if the build host is assumed to be Linux, whatever the build is doing seems like it should be done inside the image in a chroot environment?

Sample output:

+ make image PROFILE=linksys_mr8300 EXTRA_IMAGE_NAME=jtk 'PACKAGES= bind-rndc bind-server-filter-aaaa bind-server luci-app-advanced-reboot' 'DISABLED_SERVICES=dnsmasq sqm ddns named watchcat'
Finalizing root filesystem...
/home/osboxes/openwrt-imagebuilder-ipq40xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/root-ipq40xx/etc/init.d/dnsmasq: line 4: /lib/ No such file or directory
Enabling boot
Enabling bootcount
Enabling cron
./etc/init.d/dnsmasq: line 4: /lib/ No such file or directory
Disabling dnsmasq
Enabling done
Enabling dropbear
Enabling firewall
Enabling gpio_switch
Enabling led
Enabling log
Disabling named
Enabling network
Enabling odhcpd
Enabling packet_steering
Enabling rpcd
Enabling sysctl
Enabling sysfixtime
Enabling sysntpd
Enabling system
Enabling ucitrack
Enabling umount
Enabling urandom_seed
Enabling urngd
Enabling wpad

Building images...
Pseudo file "dev" exists in source filesystem "/home/osboxes/openwrt-imagebuilder-ipq40xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/root-ipq40xx/dev".
Ignoring, exclude it (-e/-ef) to override.
Parallel mksquashfs: Using 4 processors
Creating 4.0 filesystem on /home/osboxes/openwrt-imagebuilder-ipq40xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-ipq40xx_generic/root.squashfs, block size 262144.

[|                                                             ]    0/1009   0%
[=============================================================\] 1009/1009 100%

Exportable Squashfs 4.0 filesystem, xz compressed, data block size 262144
	compressed data, compressed metadata, compressed fragments,
	no xattrs, compressed ids
	duplicates are removed
Filesystem size 6400.90 Kbytes (6.25 Mbytes)
	32.65% of uncompressed filesystem size (19605.70 Kbytes)
Inode table size 9064 bytes (8.85 Kbytes)
	20.75% of uncompressed inode table size (43690 bytes)
Directory table size 12660 bytes (12.36 Kbytes)
	44.19% of uncompressed directory table size (28649 bytes)
Number of duplicate files found 154
Number of inodes 1312
Number of files 978
Number of fragments 31
Number of symbolic links 219
Number of device nodes 1
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 114
Number of hard-links 0
Number of ids (unique uids + gids) 1
Number of uids 1
	unknown (0)
Number of gids 1
	unknown (0)
6400+1 records in
6401+0 records out
6554624 bytes (6.6 MB, 6.3 MiB) copied, 0.0221011 s, 297 MB/s
/home/osboxes/openwrt-imagebuilder-ipq40xx-generic.Linux-x86_64/staging_dir/host/bin/tar: Option --mtime: Treating date '@1698017987' as 2023-10-22 19:39:47
6571+1 records in
6571+1 records out
3364860 bytes (3.4 MB, 3.2 MiB) copied, 0.0399664 s, 84.2 MB/s
0+1 records in
1+0 records out
5242880 bytes (5.2 MB, 5.0 MiB) copied, 0.0131676 s, 398 MB/s
25344+0 records in
25344+0 records out
12976128 bytes (13 MB, 12 MiB) copied, 0.143889 s, 90.2 MB/s
1+0 records in
1+0 records out
12976128 bytes (13 MB, 12 MiB) copied, 0.146456 s, 88.6 MB/s
192+0 records in
192+0 records out
192 bytes copied, 0.000973017 s, 197 kB/s

Calculating checksums...

real	0m59.028s
user	0m58.532s
sys	0m20.129s

This is a recent bug where the fix is waiting to be merged,

I don't think it's purely a defect in /etc/init.d/dnsmasq. If you consider the image-builder as a cross-compilation environment, what it is doing is running target code on the host. I'd think it's a defect in the image builder itself. I think it needs a different mechanism to configure the target image that doesn't involve running the target's startup scripts.

It’s documented as a warning:

1 Like

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