How to configure Busybox on LuckFox Pico

  • 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
    
  • 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 ?
  • 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.
  • 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 ...