Disabling dietpi-boot service?

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
NJS

Disabling dietpi-boot service?

Post by NJS »

I am developing a headless IoT device (wireless wildlife camera) on Dietpi and would like to optimize and strip down the boot sequence. Iam trying to disable the dietpi-boot, which I assume is generating all the colorful information that is displayed E.g.:

Code: Select all

DietPi-CPU_Set
DietPi-Set_Hardware
DietPi-Services
...
DietPi-Process_Tool  
Default Login
I tried to disable it with :

Code: Select all

systemctl disable  dietpi-boot
But it still starts. I also tried to mask it, but that fails.

How can I disable it?

Thanks.
User avatar
Fourdee
Site Admin
Posts: 2783
Joined: Tue Feb 06, 2007 1:36 pm

Re: Disabling dietpi-boot service?

Post by Fourdee »

Boot script and service is critical to basic DietPi operation. It initializes the global variables shared in all DietPi scripts. Modifying or removing dietpi-boot and /DietPi/dietpi/boot is not supported.

I assume you are trying to reduce the boot time on system? What is the current boot time?

Code: Select all

cat /var/log/boottime
If no value, reboot system (due to ramlog clearing every 1 hour)

What is the device you are using?

If no network:
- disable both eth and wlan in dietpi-config.
- disable "boot net wait" in "8 Network Options: NAS/Misc"

If network:
- Set static IP to reduce boot upto 5+ seconds (on wifi)
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
NJS

Re: Disabling dietpi-boot service?

Post by NJS »

FWIW, result of cat /var/log/boottime is currently 33.6 sec and, yes, I do want to reduce overall boot time, but its much more than just that...

I also want to eliminate unneeded CPU cycles (power consumption) and complexity (which is inversely related to reliability) of having unnecessary services running. Also, the output of the standard DietPi boot scripts is cluttering the stdio when I am trying to see messages from my main application, which is being launched as a service right after the file system is ready see: http://dietpi.com/phpbb/viewtopic.php?f ... king#p6606

Networking is already disabled during boot.

Even if not officially supported, how would I disable dietpi-boot and the other scripts it runs? Although many of the DietPi features are great on my development platform, I really don't want or need any DietPi scripts going when I deploy the device. Just a tightly-wound minimal OS.

Thanks.
NJS

Re: Disabling dietpi-boot service?

Post by NJS »

I forgot to answer your other question... It's running on Pi Zero
User avatar
Fourdee
Site Admin
Posts: 2783
Joined: Tue Feb 06, 2007 1:36 pm

Re: Disabling dietpi-boot service?

Post by Fourdee »

NJS wrote:of having unnecessary services running.
DietPi services/scripts only run once, when needed (eg: during boot, or when user runs a dietpi-* script). No background processing. Boot time may be slightly longer (due to RAMdisk creation, process tool apply, device identification, network wait to ensure service launch successfully, etc), but overall much lighter post init.
33.6 sec
Should be sub 25 seconds for Pi Zero, even with network. Which SD card? 17.5MB/s R/W is max regardless of card, however, If no network, and UHS-3 card, overclock SD bus http://dietpi.com/phpbb/viewtopic.php?f=15&t=331. This will vastly improve boot times 35MB/s~.
Although many of the DietPi features are great on my development platform, I really don't want or need any DietPi scripts going when I deploy the device. Just a tightly-wound minimal OS.
As the services/scripts you want to exclude are critical to DietPi, I decline to offer assistance in their removal. You would be better of with Raspbian stock, then customize it to how you want it for your project.
Just a tightly-wound minimal OS.
DietPi is exactly this.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
NJS

Re: Disabling dietpi-boot service?

Post by NJS »

DietPi services/scripts only run once, when needed (eg: during boot, or when user runs a dietpi-* script). No background processing. Boot time may be slightly longer (due to RAMdisk creation, process tool apply, device identification, network wait to ensure service launch successfully, etc), but overall much lighter post init.
The problem in my case is that the Pi will boot potentially 100s of times per day. It spends most of its time powered off until awoken (i.e. powered up) by arduino supervisor (which is also sleeping, but wakes on interrupt from passive IR). It boots, typically just takes a photo, and then goes back to sleep. It has to work this way to conserve battery. So all the extra stuff (over and above the file system) that runs every boot is just wasting CPU cycles (energy).

Should be sub 25 seconds for Pi Zero, even with network. Which SD card? 17.5MB/s R/W is max regardless of card, however, If no network, and UHS-3 card, overclock SD bus http://dietpi.com/phpbb/viewtopic.php?f=15&t=331. This will vastly improve boot times 35MB/s~.
I am using Samsung EVO+ 32GB, which I specifically selected to reduce boot time since it is supposed to be one of the fastest available. But for some reason I am only getting read speed of 21.3 MB/s and write speeds from 4 to 10 MB/s (write speed is different every time I run the benchmark). This is with a fresh install of DietPi which boots in 26.5 sec.

After adding dtoverlay=sdhost,overclock_50=84 to \DietPi\config.txt read speed increases modestly to 28 MB/s but boot time is still over 26 sec (and the Pi Zero W onboard wifi stops working)
NJS

Re: Disabling dietpi-boot service?

Post by NJS »

Any thoughts on this?
User avatar
Fourdee
Site Admin
Posts: 2783
Joined: Tue Feb 06, 2007 1:36 pm

Re: Disabling dietpi-boot service?

Post by Fourdee »

NJS wrote: am only getting read speed of 21.3 MB/s and write speeds from 4 to 10 MB/s (write speed is different every time I run the benchmark). This is with a fresh install of DietPi which boots in 26.5 sec.

After adding dtoverlay=sdhost,overclock_50=84 to \DietPi\config.txt read speed increases modestly to 28 MB/s

Any thoughts on this?
It is not possible to achieve 17.5MB/s+ without overclocking SD bus.

I use Sandisk extreme UHS-3, caps out 35MB's R/W when overclocked.

Use official power supply.

Did you solder the GPIO on RPi Zero? Can damage the board if excessive heat transferred for long periods.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
NJS

Re: Disabling dietpi-boot service?

Post by NJS »

It is not possible to achieve 17.5MB/s+ without overclocking SD bus.
Well, that doesn't seem consistent with my results... I'm getting read speed of 21.3 MB/s with fresh install and read speed of 28 MB/s when I overclock. However there is virtually no change in boot time (26 secs).

Writes results are much slower and less consistent from test to test 4 to 10 MB/s.

Could there be an issue with the benchmark utility?
Use official power supply.

Did you solder the GPIO on RPi Zero? Can damage the board if excessive heat transferred for long periods.
I've tested this on two Pi zeros (one original and one brand new "W" that has not been soldered) with two identical SD cards and with various power supplies (including 7AH battery)
NJS

Overclocking has no effect boot time

Post by NJS »

FWIW, none of the usual pi overclocking setting make any difference in boot time...

I've tried the following settings in /DietPi/config.txt

Code: Select all

temp_limit=65
initial_turbo=30
arm_freq=1000
gpu_freq=500
core_freq=500
sdram_freq=500
sdram_schmoo=0x02000020
over_voltage=2
sdram_over_voltage=2
And whether they are all commented or all uncommitted, I get identical boot time of ~25 sec (per /var/log/boottime) with dmesg ending as follows...

Code: Select all

[    3.486860] systemd[1]: Listening on Journal Socket.
[    3.493561] systemd[1]: Starting System Slice.
[    3.507882] systemd[1]: Created slice System Slice.
[    3.514644] systemd[1]: Starting File System Check on Root Device...
[    3.534336] systemd[1]: Starting system-systemd\x2dfsck.slice.
[    3.560703] systemd[1]: Created slice system-systemd\x2dfsck.slice.
[    3.571560] systemd[1]: Starting system-getty.slice.
[    3.596157] systemd[1]: Created slice system-getty.slice.
[    3.603989] systemd[1]: Starting Nameserver information manager...
[    3.635376] systemd[1]: Mounting POSIX Message Queue File System...
[    3.678156] systemd[1]: Mounted Huge Pages File System.
[    3.715903] systemd[1]: Mounting Debug File System...
[    3.750469] systemd[1]: Starting Create list of required static device nodes for the current kernel...
[    3.913660] systemd[1]: Started Set Up Additional Binary Formats.
[    3.940740] systemd[1]: Starting Load Kernel Modules...
[    3.987038] systemd[1]: Starting udev Coldplug all Devices...
[    4.067408] systemd[1]: Starting LSB: Set keymap...
[    4.133578] fuse init (API version 7.23)
[    4.153447] systemd[1]: Starting Journal Service...
[    4.229576] systemd[1]: Started Journal Service.
[    4.278682] bcm2708_i2c 20804000.i2c: BSC1 Controller at 0x20804000 (irq 77) (baudrate 100000)
[    4.319622] i2c /dev entries driver
[    6.054366] systemd-udevd[135]: starting version 215
[    7.526692] rtc-pcf8523 1-0068: rtc core: registered rtc-pcf8523 as rtc0
[    7.693995] bcm2835-wdt 20100000.watchdog: Broadcom BCM2835 watchdog timer
[    7.741191] gpiomem-bcm2835 20200000.gpiomem: Initialised: Registers at 0x20200000
[    8.126068] EXT4-fs (mmcblk0p2): re-mounted. Opts: discard
[    9.334761] usbcore: registered new interface driver brcmfmac
[    9.547133] brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: May 27 2016 00:13:38 version 7.45.41.26 (r640327) FWID 01-df77e4a7
[    9.571770] random: nonblocking pool is initialized
[    9.596586] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code
[   10.393194] systemd-journald[97]: Received request to flush runtime journal from PID 1
[   12.258605] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code
[   12.258661] cfg80211: World regulatory domain updated:
[   12.258678] cfg80211:  DFS Master region: unset
[   12.258694] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[   12.258715] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[   12.258737] cfg80211:   (2457000 KHz - 2482000 KHz @ 20000 KHz, 92000 KHz AUTO), (N/A, 2000 mBm), (N/A)
[   12.258753] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
[   12.258774] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
[   12.258793] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
[   12.258810] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
[   12.258826] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[   12.258842] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
[   12.917421] cfg80211: Regulatory domain changed to country: US
[   12.917465] cfg80211:  DFS Master region: FCC
[   12.917483] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[   12.917507] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 3000 mBm), (N/A)
[   12.917529] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2300 mBm), (N/A)
[   12.917549] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2300 mBm), (0 s)
[   12.917567] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2300 mBm), (0 s)
[   12.917583] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 3000 mBm), (N/A)
[   12.917600] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)
[   13.769960] brcmfmac: brcmf_add_if: ERROR: netdev:wlan0 already exists
[   13.770003] brcmfmac: brcmf_add_if: ignore IF event
[   13.780044] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   13.780124] brcmfmac: power management disabled
[   14.093267] brcmfmac: power management disabled
[   16.278037] Adding 102396k swap on /var/swap.  Priority:-1 extents:3 across:106492k SSFS
[   17.869005] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   34.407252] brcmfmac: power management disabled
Post Reply