当前位置: 首页 > article >正文

20250321在荣品的PRO-RK3566开发板的buildroot系统下使用ll命令【直接编译进IMG】

./buildroot/system/skeleton/etc/profile

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'


20250321在荣品的PRO-RK3566开发板的buildroot系统下使用ll命令【直接编译进IMG】
2025/3/21 16:53


cd /etc/
echo "" >> 
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'


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很像。应该是这里了

rootroot@rootroot-X99-Turbo:~/source$ 
rootroot@rootroot-X99-Turbo:~/source$ find . -name profile
./kernel/include/config/branch/profile
./kernel/include/config/arch/has/gcov/profile
./buildroot/system/skeleton/etc/profile

./buildroot/output/rockchip_rk3566/host/aarch64-buildroot-linux-gnu/sysroot/etc/profile
./buildroot/output/rockchip_rk3566/build/host-gcc-initial-12.3.0/libstdc++-v3/testsuite/23_containers/vector/profile
./buildroot/output/rockchip_rk3566/build/host-gcc-initial-12.3.0/libstdc++-v3/testsuite/23_containers/unordered_map/profile
./buildroot/output/rockchip_rk3566/build/host-gcc-final-12.3.0/libstdc++-v3/testsuite/23_containers/vector/profile
./buildroot/output/rockchip_rk3566/build/host-gcc-final-12.3.0/libstdc++-v3/testsuite/23_containers/unordered_map/profile
./buildroot/output/rockchip_rk3566/build/linux-headers-custom/include/config/branch/profile
./buildroot/output/rockchip_rk3566/build/linux-headers-custom/include/config/arch/has/gcov/profile
./buildroot/output/rockchip_rk3566/build/linux-custom/include/config/branch/profile
./buildroot/output/rockchip_rk3566/build/linux-custom/include/config/arch/has/gcov/profile
./buildroot/output/rockchip_rk3566/build/busybox-1.36.0/examples/bootfloppy/etc/profile
./buildroot/output/rockchip_rk3566/target/etc/profile
./buildroot/output/rockchip_rk3566_recovery/host/aarch64-buildroot-linux-gnu/sysroot/etc/profile
./buildroot/output/rockchip_rk3566_recovery/build/host-gcc-initial-12.3.0/libstdc++-v3/testsuite/23_containers/vector/profile
./buildroot/output/rockchip_rk3566_recovery/build/host-gcc-initial-12.3.0/libstdc++-v3/testsuite/23_containers/unordered_map/profile
./buildroot/output/rockchip_rk3566_recovery/build/host-gcc-final-12.3.0/libstdc++-v3/testsuite/23_containers/vector/profile
./buildroot/output/rockchip_rk3566_recovery/build/host-gcc-final-12.3.0/libstdc++-v3/testsuite/23_containers/unordered_map/profile
./buildroot/output/rockchip_rk3566_recovery/build/linux-headers-custom/include/config/branch/profile
./buildroot/output/rockchip_rk3566_recovery/build/linux-headers-custom/include/config/arch/has/gcov/profile
./buildroot/output/rockchip_rk3566_recovery/build/busybox-1.36.0/examples/bootfloppy/etc/profile
./buildroot/output/rockchip_rk3566_recovery/target/etc/profile
./yocto/poky/meta/recipes-core/base-files/base-files/profile
rootroot@rootroot-X99-Turbo:~/source$ 
 


Z:\source\buildroot\system\skeleton\etc\profile

export PATH=@PATH@

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

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

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:/# 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:/# 
root@rk3566-buildroot:/# ll
total 108
drwxr-xr-x  23 root root  4096 Aug  4 17:00 ./
drwxr-xr-x  23 root root  4096 Aug  4 17:00 ../

drwxr-xr-x   3 root root  4096 Aug  4 17:03 .cache/
-rw-r--r--   1 root root     0 Aug  4  2017 .resized
-rw-r--r--   1 root root     0 Mar 12  2025 .skip_fsck
-rw-r--r--   1 root root     0 Aug  4  2017 640x512-at600.mp4
lrwxrwxrwx   1 root root     7 Mar 21  2025 bin -> usr/bin/
-rw-r--r--   1 root root   489 Mar 12  2025 busybox.fragment
lrwxrwxrwx   1 root root     8 Mar 21  2025 data -> userdata/
drwxr-xr-x  15 root root  4940 Aug  4 17:00 dev/
drwxr-xr-x  25 root root  4096 Aug  4  2017 etc/
drwxr-xr-x   2 root root  4096 Mar 21  2025 info/
lrwxrwxrwx   1 root root     7 Mar 21  2025 lib -> usr/lib/
lrwxrwxrwx   1 root root     3 Mar 21  2025 lib64 -> lib/
lrwxrwxrwx   1 root root    11 Mar 21  2025 linuxrc -> bin/busybox*
drwx------   2 root root 16384 Mar 21  2025 lost+found/
drwxr-xr-x  11 root root  4096 Mar 21  2025 media/
drwxr-xr-x   5 root root  4096 Mar 21  2025 mnt/
drwxr-xr-x   2 root root  4096 Mar 21  2025 oem/
drwxr-xr-x   3 root root  4096 Mar 21  2025 opt/
dr-xr-xr-x 219 root root     0 Aug  4 17:00 proc/
drwxr-xr-x  16 root root  4096 Mar 21  2025 rockchip-test/
drwx------   2 root root  4096 Mar 12  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  11 root root   520 Aug  4 17:00 run/
lrwxrwxrwx   1 root root     8 Mar 21  2025 sbin -> usr/sbin/
lrwxrwxrwx   1 root root    10 Mar 21  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 21  2025 system/
drwxrwxrwt   6 root root   280 Aug  4 17:00 tmp/
-rwxr-xr-x   1 root root 18608 Aug  4  2017 uart_test*
lrwxrwxrwx   1 root root     9 Mar 21  2025 udisk -> mnt/udisk/
drwxr-xr-x   3 root root  4096 Aug  4  2017 userdata/
drwxr-xr-x   8 root root  4096 Mar 21  2025 usr/
drwxr-xr-x   6 root root  4096 Mar 21  2025 var/
lrwxrwxrwx   1 root root     6 Mar 21  2025 vendor -> system/
root@rk3566-buildroot:/# 
root@rk3566-buildroot:/# ls -l
total 96
-rw-r--r--   1 root root     0 Aug  4  2017 640x512-at600.mp4
lrwxrwxrwx   1 root root     7 Mar 21  2025 bin -> usr/bin
-rw-r--r--   1 root root   489 Mar 12  2025 busybox.fragment
lrwxrwxrwx   1 root root     8 Mar 21  2025 data -> userdata
drwxr-xr-x  15 root root  4940 Aug  4 17:00 dev
drwxr-xr-x  25 root root  4096 Aug  4  2017 etc
drwxr-xr-x   2 root root  4096 Mar 21  2025 info
lrwxrwxrwx   1 root root     7 Mar 21  2025 lib -> usr/lib
lrwxrwxrwx   1 root root     3 Mar 21  2025 lib64 -> lib
lrwxrwxrwx   1 root root    11 Mar 21  2025 linuxrc -> bin/busybox
drwx------   2 root root 16384 Mar 21  2025 lost+found
drwxr-xr-x  11 root root  4096 Mar 21  2025 media
drwxr-xr-x   5 root root  4096 Mar 21  2025 mnt
drwxr-xr-x   2 root root  4096 Mar 21  2025 oem
drwxr-xr-x   3 root root  4096 Mar 21  2025 opt
dr-xr-xr-x 219 root root     0 Aug  4 17:00 proc
drwxr-xr-x  16 root root  4096 Mar 21  2025 rockchip-test
drwx------   2 root root  4096 Mar 12  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  11 root root   520 Aug  4 17:00 run
lrwxrwxrwx   1 root root     8 Mar 21  2025 sbin -> usr/sbin
lrwxrwxrwx   1 root root    10 Mar 21  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 21  2025 system
drwxrwxrwt   6 root root   280 Aug  4 17:00 tmp
-rwxr-xr-x   1 root root 18608 Aug  4  2017 uart_test
lrwxrwxrwx   1 root root     9 Mar 21  2025 udisk -> mnt/udisk
drwxr-xr-x   3 root root  4096 Aug  4  2017 userdata
drwxr-xr-x   8 root root  4096 Mar 21  2025 usr
drwxr-xr-x   6 root root  4096 Mar 21  2025 var
lrwxrwxrwx   1 root root     6 Mar 21  2025 vendor -> system
root@rk3566-buildroot:/# 
root@rk3566-buildroot:/# 

root@rk3566-buildroot:/# cd /etc/
root@rk3566-buildroot:/etc# ls -l
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
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
root@rk3566-buildroot:/# 


ubuntu20.04下的ll的配置【.bashrc文件中】
rootroot@rootroot-X99-Turbo:~$ 
rootroot@rootroot-X99-Turbo:~$ cat .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
case $- in
    *i*) ;;
      *) return;;
esac

# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
    xterm-color|*-256color) color_prompt=yes;;
esac

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
    # We have color support; assume it's compliant with Ecma-48
    # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
    # a case would tend to support setf rather than setaf.)
    color_prompt=yes
    else
    color_prompt=
    fi
fi

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='ls --color=auto'
    #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'

    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
fi

# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# Add an "alert" alias for long running commands.  Use like so:
#   sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi
fi
rootroot@rootroot-X99-Turbo:~$ 
rootroot@rootroot-X99-Turbo:~$ cat /etc/issue
Ubuntu 20.04.6 LTS \n \l

rootroot@rootroot-X99-Turbo:~$ 
rootroot@rootroot-X99-Turbo:~$ uanme -a

Command 'uanme' not found, did you mean:

  command 'uname' from deb coreutils (8.30-3ubuntu2)
  command 'uacme' from deb uacme (1.0.22-1)

Try: sudo apt install <deb name>

rootroot@rootroot-X99-Turbo:~$ 
rootroot@rootroot-X99-Turbo:~$ uname -a
Linux rootroot-X99-Turbo 5.15.0-131-generic #141~20.04.1-Ubuntu SMP Thu Jan 16 18:38:51 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
rootroot@rootroot-X99-Turbo:~$ 
rootroot@rootroot-X99-Turbo:~$ 


http://www.kler.cn/a/595287.html

相关文章:

  • 单臂路由实验
  • ubuntu 解挂载时提示 “umount: /home/xx/Applications/yy: target is busy.”
  • 【Linux】Makeflie CMake快速上手指南
  • IoTDB TTL不生效
  • 无人设备遥控器之信道编码技术篇
  • 【AI-Coding】2025再实现简单的省市联动
  • 代码随想录第55期训练营第八天|LeetCode344.反转字符串、541.反转字符串II、卡码网:54.替换数字
  • HTML5拖拽功能教程
  • 【Linux网络-NAT、代理服务、内网穿透】
  • 从沈抖到谢广军,百度智能云何时“云开月明”?
  • poetry安装与使用
  • 什么是跳表?(Skip List)
  • cippe2025北京石油展,遨游通讯将携多款防爆手机亮相!
  • Java高并发容器的内核解析:从无锁算法到分段锁的架构演进
  • 移动WEB开发之rem适配布局
  • 搭建主从DNS、nfs、nginx
  • 36、deque分配器的作用
  • Qt 基本使用方法介绍
  • 从零开始学2PC:分布式事务的原子性保障
  • C++编译流程