SAFE disabling unused modules

  • Hello, if you need to disable the Rockchip multimedia-related drivers, you can simply delete the insmod_ko.sh file under /oem/usr/ko. This is the easiest way to prevent these drivers from being loaded. If you want to disable them permanently, you need to disable the corresponding modules in the kernel. You can do this by using ./build.sh kernelconfig. After making the changes, they will be automatically saved as defconfig to prevent temporary settings from not taking effect.
  • Hello!

    There are some features that can't remove safely, like samba and others.
    Their links are in some configure files that don`t change with menuconfig. And need to comment them in Makefiles in different folders.
    Some changes need to make in RkLunch.sh that placed in app folder, without it net interface don`t become "up" and don`t fix MAC for interface, seems it random each system boot (SoC does not have it?).

    Still working on "clean unix" build for this system.

    By now there a result:

    Code: Select all

    [root@luckfox root]# df -h
    Filesystem                Size      Used Available Use% Mounted on
    ubi0:rootfs              67.1M     21.2M     45.8M  32% /
    devtmpfs                 28.0M         0     28.0M   0% /dev
    tmpfs                    28.1M         0     28.1M   0% /dev/shm
    tmpfs                    28.1M     44.0K     28.0M   0% /tmp
    tmpfs                    28.1M     76.0K     28.0M   0% /run
    /dev/ubi4_0              22.4M      1.0M     21.4M   4% /oem
    /dev/ubi5_0               4.5M     20.0K      4.5M   0% /userdata
    [root@luckfox root]#
    

    Code: Select all

    Mem: 17876K used, 39584K free, 120K shrd, 0K buff, 4132K cached
    CPU:   0% usr   2% sys   0% nic  97% idle   0% io   0% irq   0% sirq
    Load average: 0.00 0.00 0.00 1/47 219
    
    
    [root@luckfox root]# lsmod
    Module                  Size  Used by    Not tainted
    [root@luckfox root]#
    

    Code: Select all

    [root@luckfox root]# ps
    PID   USER     COMMAND
        1 root     init
        2 root     [kthreadd]
        3 root     [kworker/0:0-eve]
        4 root     [kworker/0:0H]
        5 root     [kworker/u2:0-ev]
        6 root     [mm_percpu_wq]
        7 root     [ksoftirqd/0]
        8 root     [kdevtmpfs]
        9 root     [oom_reaper]
       10 root     [writeback]
       11 root     [kcompactd0]
       12 root     [ksmd]
       28 root     [kblockd]
       29 root     [kconsole]
       30 root     [devfreq_wq]
       31 root     [watchdogd]
       32 root     [kworker/0:1-eve]
       33 root     [rpciod]
       34 root     [kworker/u3:0]
       35 root     [xprtiod]
       36 root     [kswapd0]
       37 root     [nfsiod]
       38 root     [irq/52-rockchip]
       39 root     [irq/53-rockchip]
       40 root     [kworker/u2:1-fl]
       41 root     [hwrng]
       49 root     [stmmac_wq]
       51 root     [kworker/0:2-eve]
       52 root     [irq/22-rockchip]
       53 root     [ubi_bgt0d]
       56 root     [ubifs_bgt0_0]
       72 root     /sbin/syslogd -n
       76 root     /sbin/klogd -n
       87 root     /sbin/udevd -d
      105 root     [kworker/u2:2-ev]
      125 root     [ubi_bgt4d]
      130 root     [ubifs_bgt4_0]
      139 root     [ubi_bgt5d]
      144 root     [ubifs_bgt5_0]
      179 root     /usr/sbin/ntpd -g -p /var/run/ntpd.pid
      190 root     sshd: /usr/sbin/sshd [listener] 0 of 10-100 startups
      196 root     /usr/sbin/telnetd -F
      202 root     -sh
      214 root     udhcpc -i eth0
      218 root     ps
      

    Another question - have SDK ability to copy files from one folder to rootfs after build before packing?
    I mean if I need to add some folders/files to firmware, can I place their structure in one place to auto copy/overwrite each build after CLEAN build before making firmware folder in IMAGE path. This is realized in openwrt and some other SDK for MTK family SoCs, but don`t find for Luckfox SDK. Maybe you can point me where to add own scripts or give an other solution.

    Thanks!
  • You can use ./build.sh buildrootconfig to disable Samba. Afterwards, you can rebuild the image and flash it by running ./build.sh rootfs and ./build.sh firmware. If you need to add custom scripts after executing ./build.sh rootfs (or after building the system with ./build.sh), simply copy the files to <Luckfox_SDK>/output/out/rootfs_uclibc_rv1106. Finally, use ./build.sh firmware to package everything into the firmware.
  • Hi @alex9x!
    I'm looking for small footprint image as well (net, serial, i2c/spi, usb).
    Could you please share your final scripts ?
    Thank you!

    btw which startup time you was able to achieve with your minimal config ?