因为有个ssh的问题要分析,所以移植busybox。因为干净,避免其他的问题的干扰。本篇文章将初始化需要创建的内容全都放到了一个脚本文件中,极大的简化了根文件系统的创建过程。
相关文章:
源码下载
官网:
https://busybox.net/
下载最新的版本:
wget https://busybox.net/downloads/busybox-1.36.1.tar.bz2
解压文件:
tar jxvf busybox-1.36.1.tar.bz2
编译脚本 build.sh
脚本完成功能
1 编译busybox的默认配置
2 移植VSFTP,参考vsftpd移植:全配置脚本-CSDN博客
3 移植openssh,参考openssh移植:精致的脚本版-CSDN博客
生成的根文件系统的ssh可使用 -- 用户root,密码root登录
生成的根文件系统的ftp可使用 -- 用户root,密码root登录
#!/bin/bash
set -e
export PATH=/usr/local/arm/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin:$PATH
ARM_BIN_PATH="/usr/local/arm/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin"
MAKE="make ARCH=arm CROSS_COMPILE=${ARM_BIN_PATH}/arm-linux-gnueabihf-"
install_path=`pwd`/myrootfs
rootpath=`pwd`
nfspath="/home/lkmao/nfsroot"
rootfspath="${nfspath}/myrootfs"
function build_busybox {
if [ ! -z "$1" ] && [ -f ".config" ];then
echo "delete .config"
# rm .config
read -p "do you wan to delete .config file? (y/n):" response
echo "$response"
case "$response" in
[yY][eE][sS]|[yY])
if rm .confi