当前位置:网站首页>busybox login: can't execute '/bin/bash': No such file or directory 解决方法
busybox login: can't execute '/bin/bash': No such file or directory 解决方法
2022-07-27 14:37:00 【xhoufei2010】
1. 问题描述
嵌入式开发板,开机启动执行login,登录时候,弹出提示
login: can’t execute ‘/bin/bash’: No such file or directory
2. 问题分析
busybox支持ash、hush、msh三种shell,但是不支持bash
3. 修改方法
3.1 方法1、修改 login源码,改为 sh执行
本文的busybox版本为busybox-1.22.1
源码路径为 busybox-1.22.1/loginutils/login.c
执行login 动作在 int login_main(int argc UNUSED_PARAM, char **argv) 函数中,源码如下
/* Exec login shell with no additional parameters */
run_shell(pw->pw_shell, 1, NULL, NULL);
/* return EXIT_FAILURE; - not reached */其中
run_shell(pw->pw_shell, 1, NULL, NULL);pw->pw_shell 实际为shell 命令,内容为 “/bin/bash”,所以login,采用/bin/bash方式执行。
修改方法,将 /bin/bash 修改为 /bin/sh,修改后的代码如下
/* Exec login shell with no additional parameters */
//run_shell(pw->pw_shell, 1, NULL, NULL);
// modified by houfei, use the "/bin/sh" exec login, default "pw->pw_shell" is "/bin/bash"
run_shell("/bin/sh", 1, NULL, NULL);
/* return EXIT_FAILURE; - not reached */
3.2 方法2 修改rcS文件
修改etc/init.d/rcS文件的shell解析器为sh或其他。
边栏推荐
- 初识结构体
- C语言:动态内存函数
- C language: dynamic memory function
- Summer Challenge harmonyos realizes a hand-painted board
- [Yunxiang book club issue 13] coding format of video files
- Spark Bucket Table Join
- 折半查找
- C语言:数据的存储
- [Yunxiang book club issue 13] common methods of viewing media information and processing audio and video files in ffmpeg
- Network principle (1) - overview of basic principles
猜你喜欢

线程中死锁的成因及解决方案

Binder initialization process

Is low code the future of development? On low code platform
![[tensorboard] oserror: [errno 22] invalid argument processing](/img/bf/c995f487607e3b307a268779ec1e94.png)
[tensorboard] oserror: [errno 22] invalid argument processing

leetcode234题-简单方法判断回文链表

Troubleshooting the slow startup of spark local programs

Half find

CAS compares the knowledge exchanged, ABA problems, and the process of lock upgrading

语音直播系统——提升云存储安全性的必要手段

折半插入排序
随机推荐
Complexity analysis
C language: string function and memory function
剑指 Offer 51. 数组中的逆序对
Zhaoqi scientific innovation and entrepreneurship competition planning and undertaking organization, mass entrepreneurship and innovation platform, project landing and docking
JS operation DOM node
Leetcode-1: sum of two numbers
Half find
C language: data storage
Summer Challenge harmonyos realizes a hand-painted board
Spark Bucket Table Join
[sword finger offer] interview question 39: numbers that appear more than half of the time in the array
[正则表达式] 单个字符匹配
[sword finger offer] interview question 56-i: the number of numbers in the array I
Go language slow start -- go operator
[sword finger offer] interview question 54: the k-largest node of the binary search tree
Division of entity classes (VO, do, dto)
[sword finger offer] interview question 51: reverse pairs in the array - merge sort
折半插入排序
drf使用:get请求获取数据(小例子)
【剑指offer】面试题39:数组中出现次数超过一半的数字