20250318在荣品的PRO-RK3566开发板的buildroot系统下使用ll命令【通过VI直接修改profile】

20250318在荣品的PRO-RK3566开发板的buildroot系统下使用ll命令【通过VI直接修改profile】
2025/3/18 10:40


缘起,在ubuntu20.04下使用ll命令习惯了。在Rockchip的Android10/11/12/13下也解决了ll命令的使用。
在Rockchip的buildroot下使用ll命令一直没有解决。


@余顺?请问如何在RK3566的buildroot下实现ll命令 ls -l
在 ubuntu下使用ll习惯了

这个在环境变量配置文件/etc/profile中间加上
alias ll='ls -al' 然后重启测试


在串口终端中使用VI直接修改/etc/profile:
root@rk3566-buildroot:/etc# 
root@rk3566-buildroot:/etc# diff profile profile.bak1 
--- profile
+++ profile.bak1
@@ -16,8 +16,6 @@
   fi
 fi
 
-alias ll='ls -alF'
-
 export EDITOR='/bin/vi'
 
 # Source configuration files from /etc/profile.d
root@rk3566-buildroot:/etc# 
root@rk3566-buildroot:/etc# 


我直接使用了 ubuntu20.04的ll了。可以了

追问:我希望 直接将 ll编译进 IMG固件中。
请问该如何配置呢?


在sdk中find-name 同名文件将修改放进去去,然后重新清理之前构建的文件,重新编译buildroot 


./buildroot/system/skeleton/etc/profile
这个profile和板子上的profile很像。应该是这里了


root@rk3566-buildroot:/# cd /etc/
root@rk3566-buildroot:/etc#  
root@rk3566-buildroot:/etc# cat profile
export PATH="/usr/bin:/usr/sbin"

if [ "$PS1" ]; then
  if [ "$BASH" ]; then
    # The file bash.bashrc already sets the default PS1.
    # PS1='\h:\w\$ '
    if [ -f /etc/bash.bashrc ]; then
      . /etc/bash.bashrc
    fi
  else
    if [ "`id -u`" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi

alias ll='ls -alF'

export EDITOR='/bin/vi'

# Source configuration files from /etc/profile.d
for i in /etc/profile.d/*.sh ; do
    if [ -r "$i" ]; then
        . $i
    fi
done
unset i
root@rk3566-buildroot:/etc# 


修改记录:
root@rk3566-buildroot:/# 
root@rk3566-buildroot:/# ll
sh: ll: command not found
root@rk3566-buildroot:/# 
root@rk3566-buildroot:/# 
root@rk3566-buildroot:/# [   36.569367] vcc3v3_lcd1_n: disabling

root@rk3566-buildroot:/# 
root@rk3566-buildroot:/# ls -l
total 76
lrwxrwxrwx   1 root root     7 Mar 12  2025 bin -> usr/bin
-rw-r--r--   1 root root   489 Mar 12  2025 busybox.fragment
lrwxrwxrwx   1 root root     8 Mar 12  2025 data -> userdata
drwxr-xr-x  15 root root  4900 Aug  4 17:00 dev
drwxr-xr-x  25 root root  4096 Mar 17  2025 etc
drwxr-xr-x   2 root root  4096 Mar 12  2025 info
lrwxrwxrwx   1 root root     7 Mar 12  2025 lib -> usr/lib
lrwxrwxrwx   1 root root     3 Mar 12  2025 lib64 -> lib
lrwxrwxrwx   1 root root    11 Mar 12  2025 linuxrc -> bin/busybox
drwx------   2 root root 16384 Mar 12  2025 lost+found
drwxr-xr-x  11 root root  4096 Mar 12  2025 media
drwxr-xr-x   5 root root  4096 Mar 12  2025 mnt
drwxr-xr-x   2 root root  4096 Mar 12  2025 oem
drwxr-xr-x   3 root root  4096 Mar 12  2025 opt
dr-xr-xr-x 226 root root     0 Aug  4 17:00 proc
drwxr-xr-x  16 root root  4096 Mar 12  2025 rockchip-test
drwx------   2 root root  4096 Mar 17  2025 root
drwxr-xr-x   7 root root  4096 Mar 12  2025 rp_stress_test
drwxr-xr-x  31 root root  4096 Mar 12  2025 rp_test
drwxr-xr-x  10 root root   500 Aug  4 17:00 run
lrwxrwxrwx   1 root root     8 Mar 12  2025 sbin -> usr/sbin
lrwxrwxrwx   1 root root    10 Mar 12  2025 sdcard -> mnt/sdcard
dr-xr-xr-x  14 root root     0 Aug  4 17:00 sys
drwxr-xr-x   3 root root  4096 Mar 12  2025 system
drwxrwxrwt   6 root root   280 Aug  4 17:00 tmp
lrwxrwxrwx   1 root root     9 Mar 12  2025 udisk -> mnt/udisk
drwxr-xr-x   3 root root  4096 Mar 17  2025 userdata
drwxr-xr-x   8 root root  4096 Mar 12  2025 usr
drwxr-xr-x   6 root root  4096 Mar 12  2025 var
lrwxrwxrwx   1 root root     6 Mar 12  2025 vendor -> system
root@rk3566-buildroot:/# cd /etc/
root@rk3566-buildroot:/etc# ls -l
total 384
drwxr-xr-x 3 root root   4096 Mar 12 12:24 alsa
-rw-r--r-- 1 root root    121 Mar 12 11:25 asound.conf
-rw-r--r-- 1 root root   2319 Mar 12 12:25 bash.bashrc
drwxr-xr-x 2 root root   4096 Mar 12 17:25 bash_completion.d
-rw-r--r-- 1 root root    535 Mar 12 12:32 bindresvport.blacklist
drwxr-xr-x 3 root root   4096 Mar 12 12:23 dbus-1
-rw-r--r-- 1 root root   1393 Mar 12 17:25 deviceTest.ini
-rw-r--r-- 1 root root   1429 Mar 12 12:40 dhcpcd.conf
-rw-r-xr-x 1 root root    101 Mar 12 17:30 dnsmasq.conf
drwxr-xr-x 2 root root   4096 Mar 17 14:21 dropbear
drwxr-xr-x 3 root root   4096 Mar 12 12:37 fonts
-rw-r--r-- 1 root root    660 Mar 12 17:30 fstab
-rw-r--r-- 1 root root    694 Mar 12 12:42 fuse.conf
drwxr-xr-x 2 root root   4096 Mar 12 11:25 generate_logs.d
-rw-r--r-- 1 root root    424 Mar 12 17:33 group
-rw-r--r-- 1 root root 128729 Mar 12 13:03 hostapd.conf
-rw-r--r-- 1 root root     17 Mar 12 17:30 hostname
-rw-r--r-- 1 root root     47 Mar 12 17:30 hosts
drwxr-xr-x 2 root root   4096 Mar 12 17:30 init.d
-rw-r--r-- 1 root root   1302 Mar 12 17:25 inittab
-rw-r--r-- 1 root root    215 Mar 12 13:03 input-event-daemon.conf
drwxr-xr-x 2 root root   4096 Mar 12 17:25 input-event-daemon.conf.d
-rw-r--r-- 1 root root   1180 Mar 12 12:22 inputrc
drwxr-xr-x 2 root root   4096 Mar 12 12:30 iproute2
-rw-r--r-- 1 root root      0 Mar 12 12:30 iptables.conf
drwxr-xr-x 2 root root   4096 Mar 12 13:29 iqfiles
drwxr-xr-x 2 root root   4096 Mar 12 11:25 irqbalance.d
-rw-r--r-- 1 root root     35 Mar 12 17:25 issue
-rw-r--r-- 1 root root  21632 Mar 12 17:25 ld.so.cache
drwxr-xr-x 2 root root   4096 Mar 12 12:54 libinput
drwxr-xr-x 2 root root   4096 Mar 12 13:03 libnl
-rw-r--r-- 1 root root    782 Mar 12 12:30 mke2fs.conf
-rwxr-xr-x 1 root root   2234 Mar 12 11:25 mount-M2.sh
lrwxrwxrwx 1 root root     19 Mar 12 11:25 mtab -> ../proc/self/mounts
-rw-r--r-- 1 root root    767 Mar 12 12:32 netconfig
drwxr-xr-x 7 root root   4096 Mar 12 11:25 network
-rw-r--r-- 1 root root    230 Mar 12 12:17 nsswitch.conf
-rw-r--r-- 1 root root    317 Mar 12 12:35 ntp.conf
-rw-r--r-- 1 root root    254 Mar 12 17:30 os-release
-rw-r--r-- 1 root root    490 Mar 12 17:33 passwd
drwxr-xr-x 5 root root   4096 Mar 12 13:17 pm
drwxr-xr-x 3 root root   4096 Mar 12 11:25 ppp
-rw-r--r-- 1 root root    473 Mar 12 12:10 profile
drwxr-xr-x 2 root root   4096 Mar 12 11:25 profile.d
-rw-r--r-- 1 root root   2744 Mar 12 11:25 protocols
drwxr-xr-x 2 root root   4096 Mar 12 17:25 pulse
drwxr-xr-x 2 root root   4096 Mar 12 13:01 rc_keymaps
-rw-r--r-- 1 root root   7692 Mar 12 13:01 rc_maps.cfg
lrwxrwxrwx 1 root root     18 Mar 12 11:25 resolv.conf -> ../tmp/resolv.conf
-rw-r--r-- 1 root root     19 Mar 12 11:25 resolv.conf.tail
-rwxr-xr-x 1 root root   1811 Mar 12 11:25 sata-mount.sh
-rw-r--r-- 1 root root  10873 Mar 12 11:25 services
-rw------- 1 root root    243 Mar 12 17:33 shadow
-rw-r--r-- 1 root root     27 Mar 12 13:37 shells
-rw-r--r-- 1 root root    684 Mar 12 13:31 socketcand.conf
drwxr-xr-x 5 root root   4096 Mar 12 12:22 ssl
drwxr-xr-x 3 root root   4096 Mar 12 17:33 udev
drwxr-xr-x 4 root root   4096 Mar 12 13:33 usbmount
-rw-r-xr-x 1 root root    125 Aug  4  2017 wpa_supplicant.conf
drwxr-xr-x 4 root root   4096 Mar 12 11:25 xdg
root@rk3566-buildroot:/etc# cat profile
export PATH="/usr/bin:/usr/sbin"

if [ "$PS1" ]; then
  if [ "$BASH" ]; then
    # The file bash.bashrc already sets the default PS1.
    # PS1='\h:\w\$ '
    if [ -f /etc/bash.bashrc ]; then
      . /etc/bash.bashrc
    fi
  else
    if [ "`id -u`" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi

export EDITOR='/bin/vi'

# Source configuration files from /etc/profile.d
for i in /etc/profile.d/*.sh ; do
    if [ -r "$i" ]; then
        . $i
    fi
done
unset i
root@rk3566-buildroot:/etc# 
root@rk3566-buildroot:/etc# 
root@rk3566-buildroot:/etc# sudo cp profile profile.bak1
sh: sudo: command not found
root@rk3566-buildroot:/etc# cp profile profile.bak1
root@rk3566-buildroot:/etc# ls -l
total 388
drwxr-xr-x 3 root root   4096 Mar 12 12:24 alsa
-rw-r--r-- 1 root root    121 Mar 12 11:25 asound.conf
-rw-r--r-- 1 root root   2319 Mar 12 12:25 bash.bashrc
drwxr-xr-x 2 root root   4096 Mar 12 17:25 bash_completion.d
-rw-r--r-- 1 root root    535 Mar 12 12:32 bindresvport.blacklist
drwxr-xr-x 3 root root   4096 Mar 12 12:23 dbus-1
-rw-r--r-- 1 root root   1393 Mar 12 17:25 deviceTest.ini
-rw-r--r-- 1 root root   1429 Mar 12 12:40 dhcpcd.conf
-rw-r-xr-x 1 root root    101 Mar 12 17:30 dnsmasq.conf
drwxr-xr-x 2 root root   4096 Mar 17 14:21 dropbear
drwxr-xr-x 3 root root   4096 Mar 12 12:37 fonts
-rw-r--r-- 1 root root    660 Mar 12 17:30 fstab
-rw-r--r-- 1 root root    694 Mar 12 12:42 fuse.conf
drwxr-xr-x 2 root root   4096 Mar 12 11:25 generate_logs.d
-rw-r--r-- 1 root root    424 Mar 12 17:33 group
-rw-r--r-- 1 root root 128729 Mar 12 13:03 hostapd.conf
-rw-r--r-- 1 root root     17 Mar 12 17:30 hostname
-rw-r--r-- 1 root root     47 Mar 12 17:30 hosts
drwxr-xr-x 2 root root   4096 Mar 12 17:30 init.d
-rw-r--r-- 1 root root   1302 Mar 12 17:25 inittab
-rw-r--r-- 1 root root    215 Mar 12 13:03 input-event-daemon.conf
drwxr-xr-x 2 root root   4096 Mar 12 17:25 input-event-daemon.conf.d
-rw-r--r-- 1 root root   1180 Mar 12 12:22 inputrc
drwxr-xr-x 2 root root   4096 Mar 12 12:30 iproute2
-rw-r--r-- 1 root root      0 Mar 12 12:30 iptables.conf
drwxr-xr-x 2 root root   4096 Mar 12 13:29 iqfiles
drwxr-xr-x 2 root root   4096 Mar 12 11:25 irqbalance.d
-rw-r--r-- 1 root root     35 Mar 12 17:25 issue
-rw-r--r-- 1 root root  21632 Mar 12 17:25 ld.so.cache
drwxr-xr-x 2 root root   4096 Mar 12 12:54 libinput
drwxr-xr-x 2 root root   4096 Mar 12 13:03 libnl
-rw-r--r-- 1 root root    782 Mar 12 12:30 mke2fs.conf
-rwxr-xr-x 1 root root   2234 Mar 12 11:25 mount-M2.sh
lrwxrwxrwx 1 root root     19 Mar 12 11:25 mtab -> ../proc/self/mounts
-rw-r--r-- 1 root root    767 Mar 12 12:32 netconfig
drwxr-xr-x 7 root root   4096 Mar 12 11:25 network
-rw-r--r-- 1 root root    230 Mar 12 12:17 nsswitch.conf
-rw-r--r-- 1 root root    317 Mar 12 12:35 ntp.conf
-rw-r--r-- 1 root root    254 Mar 12 17:30 os-release
-rw-r--r-- 1 root root    490 Mar 12 17:33 passwd
drwxr-xr-x 5 root root   4096 Mar 12 13:17 pm
drwxr-xr-x 3 root root   4096 Mar 12 11:25 ppp
-rw-r--r-- 1 root root    473 Mar 12 12:10 profile
-rw-r--r-- 1 root root    473 Mar 18 10:10 profile.bak1
drwxr-xr-x 2 root root   4096 Mar 12 11:25 profile.d
-rw-r--r-- 1 root root   2744 Mar 12 11:25 protocols
drwxr-xr-x 2 root root   4096 Mar 12 17:25 pulse
drwxr-xr-x 2 root root   4096 Mar 12 13:01 rc_keymaps
-rw-r--r-- 1 root root   7692 Mar 12 13:01 rc_maps.cfg
lrwxrwxrwx 1 root root     18 Mar 12 11:25 resolv.conf -> ../tmp/resolv.conf
-rw-r--r-- 1 root root     19 Mar 12 11:25 resolv.conf.tail
-rwxr-xr-x 1 root root   1811 Mar 12 11:25 sata-mount.sh
-rw-r--r-- 1 root root  10873 Mar 12 11:25 services
-rw------- 1 root root    243 Mar 12 17:33 shadow
-rw-r--r-- 1 root root     27 Mar 12 13:37 shells
-rw-r--r-- 1 root root    684 Mar 12 13:31 socketcand.conf
drwxr-xr-x 5 root root   4096 Mar 12 12:22 ssl
drwxr-xr-x 3 root root   4096 Mar 12 17:33 udev
drwxr-xr-x 4 root root   4096 Mar 12 13:33 usbmount
-rw-r-xr-x 1 root root    125 Aug  4  2017 wpa_supplicant.conf
drwxr-xr-x 4 root root   4096 Mar 12 11:25 xdg
root@rk3566-buildroot:/etc# vi profile
root@rk3566-buildroot:/etc# diff profile profile.bak1 
--- profile
+++ profile.bak1
@@ -16,8 +16,6 @@
   fi
 fi
 
-alias ll='ls -alF'
-
 export EDITOR='/bin/vi'
 
 # Source configuration files from /etc/profile.d
root@rk3566-buildroot:/etc# 
root@rk3566-buildroot:/etc# 
root@rk3566-buildroot:/etc# reboot


root@rk3566-buildroot:/# 
root@rk3566-buildroot:/# ll
total 88
drwxr-xr-x  23 root root  4096 Aug  4 17:03 ./
drwxr-xr-x  23 root root  4096 Aug  4 17:03 ../
drwxr-xr-x   3 root root  4096 Mar 17  2025 .cache/
-rw-r--r--   1 root root     0 Mar 17  2025 .resized
-rw-r--r--   1 root root     0 Mar 12  2025 .skip_fsck
lrwxrwxrwx   1 root root     7 Mar 12  2025 bin -> usr/bin/
-rw-r--r--   1 root root   489 Mar 12  2025 busybox.fragment
lrwxrwxrwx   1 root root     8 Mar 12  2025 data -> userdata/
drwxr-xr-x  15 root root  4900 Aug  4 17:03 dev/
drwxr-xr-x  25 root root  4096 Mar 18  2025 etc/
drwxr-xr-x   2 root root  4096 Mar 12  2025 info/
lrwxrwxrwx   1 root root     7 Mar 12  2025 lib -> usr/lib/
lrwxrwxrwx   1 root root     3 Mar 12  2025 lib64 -> lib/
lrwxrwxrwx   1 root root    11 Mar 12  2025 linuxrc -> bin/busybox*
drwx------   2 root root 16384 Mar 12  2025 lost+found/
drwxr-xr-x  11 root root  4096 Mar 12  2025 media/
drwxr-xr-x   5 root root  4096 Mar 12  2025 mnt/
drwxr-xr-x   2 root root  4096 Mar 12  2025 oem/
drwxr-xr-x   3 root root  4096 Mar 12  2025 opt/
dr-xr-xr-x 229 root root     0 Aug  4 17:03 proc/
drwxr-xr-x  16 root root  4096 Mar 12  2025 rockchip-test/
drwx------   2 root root  4096 Mar 17  2025 root/
drwxr-xr-x   7 root root  4096 Mar 12  2025 rp_stress_test/
drwxr-xr-x  31 root root  4096 Mar 12  2025 rp_test/
drwxr-xr-x  10 root root   500 Aug  4 17:03 run/
lrwxrwxrwx   1 root root     8 Mar 12  2025 sbin -> usr/sbin/
lrwxrwxrwx   1 root root    10 Mar 12  2025 sdcard -> mnt/sdcard/
dr-xr-xr-x  14 root root     0 Aug  4 17:03 sys/
drwxr-xr-x   3 root root  4096 Mar 12  2025 system/
drwxrwxrwt   6 root root   280 Aug  4 17:03 tmp/
lrwxrwxrwx   1 root root     9 Mar 12  2025 udisk -> mnt/udisk/
drwxr-xr-x   3 root root  4096 Mar 17  2025 userdata/
drwxr-xr-x   8 root root  4096 Mar 12  2025 usr/
drwxr-xr-x   6 root root  4096 Mar 12  2025 var/
lrwxrwxrwx   1 root root     6 Mar 12  2025 vendor -> system/
root@rk3566-buildroot:/#