Page 1 of 1

How to configure Busybox on LuckFox Pico

Posted: 2024-04-23 8:26
by ACBIAS
I need to configure Busybox to enable / disable features.
On luckfox, buildroot is configured to use busybox.

The sysdrv/Makefile does a copy of a default snippet configuration to the busybox included in buildroot:

Code: Select all

cp $(SYSDRV_DIR)/tools/board/buildroot/busybox.config $(BUILDROOT_DIR)/$(BUILDROOT_VER)/package/busybox/ ;
However when I modify the snippet sysdrv/tools/board/buildroot/busybox.config, and then issue a

Code: Select all

./build.sh clean rootfs
./build.sh clean sysdrv
./build.sh sysdrv
./build.sh rootfs
./build.sh firmware
then finally flash the generated firmware, my changes are not taken into account.

This problem seems similar to the problems I had configuring buildroot to remove Samba.

So, what is the process to change the config of busybox (ideally using menuconfig), then rebuild the firmware with those changes ?

Re: How to configure Busybox on LuckFox Pico

Posted: 2024-04-24 8:07
by Eng38
Hello, the method to configure busybox using menuconfig is as follows:

1. Enter the directory where buildroot is located.

Code: Select all

cd <SDK>/sysdrv/source/buildroot/buildroot-2023.02.6/
2. Open the configuration interface.

Code: Select all

make busybox-menuconfig
3. Modify the configuration according to needs.
4. Update configuration.

Code: Select all

make busybox-update-config
5. Delete old packages.

Code: Select all

rm -rf output/target
6. Delete package installation records.

Code: Select all

find . -name ".stamp_target_installed" -exec rm {} \;
7. Compile buildroot.

Code: Select all

make
8. Generate image.

Code: Select all

cd <SDK>
rm sysdrv/out/ output/ -rf
./build.sh

Re: How to configure Busybox on LuckFox Pico

Posted: 2024-04-24 13:43
by ACBIAS
I tried this and the result is somehow bizarre. The parts of busybox I deselected are still present, but their hook within busybox is gone, and size of busybox changed.

So, for example I disabled all about TELNETD. But in the resulting firmware that i flashed i can observe_

Code: Select all

# ls -al /usr/sbin/telnetd 
lrwxrwxrwx    1 1000     1000            17 Apr 24  2024 /usr/sbin/telnetd -> ../../bin/busybox
The symlink is still there.

Code: Select all

# cat /etc/init.d/S50telnet 
#!/bin/sh
#
# Start telnet....
#

TELNETD_ARGS=-F
[ -r /etc/default/telnet ] && . /etc/default/telnet

start() {
      printf "Starting telnetd: "
      start-stop-daemon -S -q -m -b -p /var/run/telnetd.pid \
			-x /usr/sbin/telnetd -- $TELNETD_ARGS
      [ $? = 0 ] && echo "OK" || echo "FAIL"
}

stop() {
	printf "Stopping telnetd: "
	start-stop-daemon -K -q -p /var/run/telnetd.pid \
			  -x /usr/sbin/telnetd
	[ $? = 0 ] && echo "OK" || echo "FAIL"
}

case "$1" in
    start)
	start
	;;
    stop)
	stop
	;;
    restart|reload)
	stop
	start
	;;
  *)
	echo "Usage: $0 {start|stop|restart}"
	exit 1
esac

exit $?
The startup script is still there.

Code: Select all

# telnetd --help
telnetd: applet not found
But the hook within busybox is gone: the compilation did not include telnetd, as was the config deselected.

So, how can I get rid of those symlinks that just should not be there ?

Re: How to configure Busybox on LuckFox Pico

Posted: 2024-04-25 3:10
by Eng38
Hello, I have updated steps 5 and 6 in the above steps, please check them out.
Eng38 wrote: 2024-04-24 8:07 5. Delete old packages.

Code: Select all

rm -rf output/target
6. Delete package installation records.

Code: Select all

find . -name ".stamp_target_installed" -exec rm {} \;
The effect of removing telnetd is as follows:
企业微信截图_17140146357889.png

Delete the old build output directory (output/target): This directory contains files generated by the previous build. Deleting it ensures that the old build output is not used.

Delete package installation records (.stamp_target_installed): These files record the installation status of software packages, including which packages have been installed. Deleting these records forces Buildroot to reinstall already compiled packages to ensure build consistency.

The idea behind these steps is to ensure a clean and consistent build process. By deleting old build output and installation records, you avoid problems caused by legacy state, ensuring that the resulting system is based on the latest configuration and packages.

Re: How to configure Busybox on LuckFox Pico

Posted: 2024-04-25 9:12
by ACBIAS
I checked, and it works.
Thanks a lot for your patience !
I think I will add few targets in the build.sh script to allow an easy config of buildroot and busybox ...