@stephenw10 An intermediate report. I have implemented a basic PHP tracing system which gave me a first timing from /etc/rc.bootup, the time stamps are prior to the execution of the function next to it:
Logging /etc/rc.bootup_with_trace 24/04/2024 11:09:16 L75: led_normalize(); 24/04/2024 11:09:16 L122: notices_setup(); 24/04/2024 11:09:16 L138: system_dmesg_save(); 24/04/2024 11:09:16 L141: system_check_reset_button(); 24/04/2024 11:09:16 L167: mute_kernel_msgs(); 24/04/2024 11:09:16 L168: start_devd(); 24/04/2024 11:09:18 L169: set_device_perms(); 24/04/2024 11:09:18 L170: unmute_kernel_msgs(); 24/04/2024 11:09:18 L174: parse_config_bootup(); 24/04/2024 11:09:18 L177: mwexec("/usr/sbin/gnid > {$g['vardb_path']}/uniqueid 2>/dev/null"); 24/04/2024 11:09:18 L194: convert_config(); 24/04/2024 11:09:19 L230: load_crypto(); 24/04/2024 11:09:19 L235: system_setup_sysctl(); 24/04/2024 11:09:19 L248: system_do_shell_commands(1); 24/04/2024 11:12:48 L252: load_thermal_hardware(); 24/04/2024 11:12:48 L255: system_timezone_configure(); 24/04/2024 11:12:48 L258: system_hostname_configure(); 24/04/2024 11:12:50 L261: system_hosts_generate(); 24/04/2024 11:12:55 L264: enable_carp(false); 24/04/2024 11:12:55 L267: interfaces_loopback_configure(); 24/04/2024 11:12:55 L270: ca_setup_trust_store(); 24/04/2024 11:12:55 L277: exec("/sbin/zfs get -H compression /var/log | /usr/bin/awk '{print $3;}'", $varlog_compression_state); 24/04/2024 11:12:55 L285: system_syslogd_start(); 24/04/2024 11:12:57 L288: set_pam_auth(); 24/04/2024 11:12:57 L296: switches_configure(); 24/04/2024 11:12:57 L300: setup_microcode(); 24/04/2024 11:12:58 L321: interfaces_configure(); 24/04/2024 11:13:07 L322: interfaces_sync_setup(); 24/04/2024 11:13:07 L328: system_hosts_generate(); 24/04/2024 11:13:07 L334: send_event("service reload sshd"); 24/04/2024 11:13:07 L340: openvpn_resync_all(); 24/04/2024 11:13:07 L344: system_resolvconf_generate(); 24/04/2024 11:13:07 L347: filter_pflow_configure(); 24/04/2024 11:13:07 L350: filter_configure_sync(); 24/04/2024 11:13:09 L354: filter_pflog_start(); 24/04/2024 11:13:09 L358: setup_gateways_monitor(); 24/04/2024 11:13:11 L362: system_routing_configure(); 24/04/2024 11:13:12 L371: services_dnsmasq_configure(); 24/04/2024 11:13:12 L374: services_unbound_configure(); 24/04/2024 11:13:22 L378: local_reset_accounts(); 24/04/2024 11:13:22 L383: configure_cron(); 24/04/2024 11:13:22 L387: system_routing_enable(); 24/04/2024 11:13:22 L424: mwexec("/usr/bin/timeout -k 45 30 /usr/local/sbin/ntpd -g -q -c /dev/null {$ntp_boot_time_servers}"); 24/04/2024 11:13:29 L429: system_ntp_configure(); 24/04/2024 11:13:29 L437: system_webgui_start(); 24/04/2024 11:13:31 L441: console_configure(); 24/04/2024 11:13:31 L444: services_dhcpd_configure(); 24/04/2024 11:13:31 L447: system_dhcpleases_configure(); 24/04/2024 11:13:31 L450: services_dhcrelay_configure(); 24/04/2024 11:13:31 L453: services_dhcrelay6_configure(); 24/04/2024 11:13:31 L456: send_event("service reload dyndnsall"); 24/04/2024 11:13:31 L459: filter_configure_sync(); 24/04/2024 11:13:32 L462: vpn_setup(); 24/04/2024 11:13:32 L465: captiveportal_configure(); 24/04/2024 11:13:32 L468: voucher_configure(); 24/04/2024 11:13:32 L471: system_do_shell_commands(); 24/04/2024 11:13:32 L474: $ipsec_dynamic_hosts = ipsec_configure(); 24/04/2024 11:13:34 L477: services_snmpd_configure(); 24/04/2024 11:13:36 L480: system_set_harddisk_standby(); 24/04/2024 11:13:36 L483: reload_ttys(); 24/04/2024 11:13:36 L486: enable_rrd_graphing(); 24/04/2024 11:13:37 L489: enable_watchdog(); 24/04/2024 11:13:37 L519: services_igmpproxy_configure(); 24/04/2024 11:13:37 L522: upnp_start(); 24/04/2024 11:13:37 L525: activate_powerd(); 24/04/2024 11:13:37 L528: prefer_ipv4_or_ipv6(); 24/04/2024 11:13:37 L536: register_all_installed_packages(); 24/04/2024 11:13:37 L541: system_syslogd_start(); 24/04/2024 11:13:39 L548: enable_carp(); 24/04/2024 11:13:39 L572: filter_configure(); 24/04/2024 11:13:39 L576: led_normalize(); 24/04/2024 11:13:39 L578: notify_all_remote("Bootup complete");The execution of system_do_shell_commands() is taking up most of the boot time, 3.5 minutes
24/04/2024 11:09:19 L248: system_do_shell_commands(1); 24/04/2024 11:12:48 L252: load_thermal_hardware();I will continue digging.