我正在尝试telnet到基于嵌入式Linux的设备,我能够使用root凭据成功登录.但是,我无法运行许多bash命令.
像命令mv,cp,cd,ls,等正在努力,但像命令uname,df,install,等(要求甚至命令POSIX遵守!)似乎并不工作.似乎无法弄清楚我错过了什么.
# install
-sh: install: not found
# uname -1
-sh: uname: not found
# ls
bin etc lib opt sbin tmp utils
dev home mnt proc sys usr var
Run Code Online (Sandbox Code Playgroud) 这是我用来从相机保存文件的代码,并从0001开始命名.相机正在运行Busybox,里面有一个灰壳.
该代码是基于查尔斯·达菲先前的答案在这里.
#!/bin/sh
# Snapshot script
cd /mnt/0/foto
sleep 1
set -- *.jpg # put the sorted list of picture namefiles on argv ( the number of files on the list can be requested by echo $# )
while [ $# -gt 1 ]; do # as long as there's more than one...
shift # ...some rows are shifted until only one remains
done
if [ "$1" = "*.jpg" ]; then # If cycle to determine if argv …Run Code Online (Sandbox Code Playgroud) 我正在尝试为嵌入式系统编译 ncurses 5.9(使用 buildroot),但收到以下错误消息:
\n\nIn file included from ../c++/cursesm.h:39:0,\n from ../c++/cursesm.cc:35:\n../c++/cursesp.h: In member function \xe2\x80\x98T* NCursesUserPanel<T>::UserData() const\xe2\x80\x99:\n../c++/cursesp.h:256:43: error: no matching function for call to \n\xe2\x80\x98NCursesUserPanel<T>::get_user() const\xe2\x80\x99\n return reinterpret_cast<T*>(get_user ());\nRun Code Online (Sandbox Code Playgroud)\n\n这是有问题的代码:
\n\n/* We use templates to provide a typesafe mechanism to associate\n * user data with a panel. A NCursesUserPanel<T> is a panel\n * associated with some user data of type T.\n */\ntemplate<class T> class NCursesUserPanel : public NCursesPanel\n{\npublic:\n NCursesUserPanel (int nlines,\n int ncols,\n int begin_y = 0,\n …Run Code Online (Sandbox Code Playgroud) 我有一个层元测试,我在其中创建了一个 mosquitto_%.bbappend 用于自定义默认的 mosquitto.conf 文件,该文件由元开放嵌入层的配方创建。我的 bbappend 文件如下所示:
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI += "file://mosquitto.conf"
Run Code Online (Sandbox Code Playgroud)
图像构建没有错误,但 mosquitto.conf 没有被替换。我所观察到的是,上述过程仅在存在于任何主层中时才会替换 mosquitto.conf,但由于 mosquitto_1.5.1.bb 文件仅安装此文件,并且由于此文件不存在于任何层中,我该如何覆盖这个文件?该文件在 /etc/mosquitto 目录中生成。这是我想覆盖的 bitbake 文件:http ://cgit.openembedded.org/meta-openembedded/tree/meta-networking/recipes-connectivity/mosquitto/mosquitto_1.5.1.bb?h=thud
我正在尝试手动构建主线内核并在 Pine64_Plus 板上启动。Linux 内核无法挂载启动分区。奇怪的是,它不会在引导日志中的可用分区下显示任何分区。我做了以下步骤。克隆linux主线git repo
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git --depth=1
Run Code Online (Sandbox Code Playgroud)
安装了交叉编译器工具链。
进而..
ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make defconfig
ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make -j4 Image
Run Code Online (Sandbox Code Playgroud)
生成dtb
ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make -j4 dtbs
Run Code Online (Sandbox Code Playgroud)
生成内核模块
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make -j4 modules
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=ker_mod_temp_dir make modules modules_install
Run Code Online (Sandbox Code Playgroud)
我将 MLO、Uboot 和固件文件保存在引导分区中。
我从这里下载了 ArchLinux rootfs
我将下载的 rootfs 复制到我的 SD 卡的 ROOTFS 分区。
sudo cp -rT <path-to-downloaded-rootfs> /media/user/ROOTFS
Run Code Online (Sandbox Code Playgroud)
我将 linux 映像和 dts 文件夹从 /arch/arm64/boot 复制到 rootfs 中的引导文件夹。
我将内核模块复制到根目录
sudo cp -rT ker_mod_temp_dir /media/user/ROOTFS/lib
Run Code Online (Sandbox Code Playgroud)
我试图用 SD 卡启动电路板。uboot 启动成功。我在 …
我想在/home/root我的 bitbake 构建过程中创建一个文件夹。我尝试了两种不同的方法,但都失败了。
第一个给出了一个巨大的错误,我无法滚动到顶部
do_install_append () {
install -d ${D}/root/smg_logs
}
Run Code Online (Sandbox Code Playgroud)
第二个将构建并运行,但我没有看到创建的文件夹。
create_dirs() {
mkdir -p root/smg_logs
}
ROOTFS_POSTPROCESS_COMMAND += "create_dirs ; "
Run Code Online (Sandbox Code Playgroud)
如果我尝试使用前一个和以下
create_dirs() {
install -d ${D}/home/root/smg_logs
mkdir -p /home/root/smg_logs
}
ROOTFS_POSTPROCESS_COMMAND += "create_dirs ; "
Run Code Online (Sandbox Code Playgroud)
这允许我的设备启动,但它似乎覆盖了一些重要的代码。
编辑:与下面答案中的链接类似,我尝试了以下操作。
do_install_append () {
install -d ${D}/root/smg_logs
}
FILES_${PN} += "/root/smg_logs"
Run Code Online (Sandbox Code Playgroud)