我正在从底部为Beagle Bone板构建一个Linux系统.我编译了vanilla内核并构建了一个基本的根文件系统busybox.系统使用U-boot启动,而rootfs它位于Linux PC上并通过NFS导出:
/path/to/rootfs 10.42.0.17(rw,wdelay,no_root_squash,no_subtree_check,sec=sys,rw,secure,no_root_squash,no_all_squash)
Run Code Online (Sandbox Code Playgroud)
U-boot bootargs是:
bootargs console=ttyO0,115200n8 root=/dev/nfs rw nfsroot=${serverip}:/path/to/rootfs,v3,tcp ip=dhcp
Run Code Online (Sandbox Code Playgroud)
我在尝试su为非root用户工作时遇到了问题.为了解决这个问题,互联网上的人们建议设置二进制suid位busybox.这样做之后:
$ sudo chmod u+s busybox
Run Code Online (Sandbox Code Playgroud)
并验证:
$ ls -la
...
-rwsr-xr-x 1 myuser myuser 1882976 Jan 13 21:47 busybox
...
$ stat -c "%a %n" busybox
4755 busybox
Run Code Online (Sandbox Code Playgroud)
有些不对劲.内核正在启动并显示所有常用消息,但最后会卡住,并且不会login显示任何行.以下是启动顺序的最后几行:
[ 3.776185] IP-Config: Complete:
[ 3.779656] device=eth0, hwaddr=c8:a0:30:c5:80:e9, ipaddr=10.42.0.17, mask=255.255.255.0, gw=10.42.0.1
[ 3.789877] host=10.42.0.17, domain=, nis-domain=(none)
[ 3.795822] bootserver=10.42.0.1, rootserver=10.42.0.1, rootpath=
[ 3.802492] nameserver0=10.42.0.1 …Run Code Online (Sandbox Code Playgroud) 我为Yocto的Intel主板生成了一个最小核心图像。
查看tmp / deploy / images文件夹中,它们是很多图像。
我使用USB上的dd命令刷新了* .wic映像,它创建了两个分区(Boot和Platform),并且只允许执行实时启动,而不能将其安装在主板的硬盘上。
然后,我使用dd命令在USB上闪烁* .hddimg。它仅创建了一个具有rootfs.img,syslinux和EFI文件夹的“启动”分区。
使用USB引导为我提供了一个“安装”选项,该选项已安装在板上,当我在安装后重新引导时,它显示“找不到可引导媒体”
使用可引导映像,硬盘中有两个分区。为什么它不启动。
遵循的步骤:
我在这里做错了什么。
选择哪个图像以及何时选择..
我正在构建 Yocto(重击)图像,但在执行过程中出现错误do_rootfs:
update-alternatives:错误:自 xxx/tmp/work/cc 起未将 xxx/tmp/work/cc-dey-linux/dey-image/1.0-r0/rootfs/usr/sbin/rtcwake 链接到 /bin/busybox.nosuid -dey-linux/dey-image/1.0-r0/rootfs/usr/sbin/rtcwake 存在且不是链接
然后是详细的错误:
ERROR: dey-image-1.0-r0 do_rootfs: Postinstall scriptlets of ['busybox'] have failed. If the intention is to defer them to first boot,
then please place them into pkg_postinst_ontarget_${PN} ().
Deferring to first boot via 'exit 1' is no longer supported.
Details of the failure are in xxx/tmp/work/cc-dey-linux/dey-image/1.0-r0/temp/log.do_rootfs.
ERROR: dey-image-1.0-r0 do_rootfs: Function failed: do_rootfs
ERROR: Logfile of failure stored in: xxx/tmp/work/cc-dey-linux/dey-image/1.0-r0/temp/log.do_rootfs.835055
Run Code Online (Sandbox Code Playgroud)
在 的文件中log.do_rootfs.835055,它具有与上面相同的错误日志。
我想我有3个选择:
update-alternatives,但是实在不知道怎么更新pkg_postinst_ontarget_${PN} …我在SD卡上安装了linux,我用这个命令来安装rootfs
tar xpjf rootfs.tar.bz -C/mnt/rootfs /
现在,我对rootfs进行了一些更改,我想创建一个备份,我可以使用上面的相同命令,我尝试使用:
tar cpjf rootfs.tar.bz2 /mnt/rootfs
and
tar cpjf rootfs.tar.bz2 -C / mnt/rootfs
I also tried
tar cpjf rootfs.tar.bz2 /mnt/rootfs/*
Run Code Online (Sandbox Code Playgroud)
并试过:
cd /mnt/rootfs
tar -cvpjf rootfs.tar.bz2 --exclude=/rootfs.tar.bz2 .
tar: ./rootfs.tar.bz2: file changed as we read it
Run Code Online (Sandbox Code Playgroud)
但我最终得到的档案在文件系统之前有两个级别,即mnt/rootfs/files我做错了什么?
在 Docker v1.4.1 中,我们可以在宿主机上找到容器的rootfs。例如:
cd /var/lib/docker/devicemapper/mnt/ab83a2638bb23f24d8811fa9b4ca458efca9269696ff3112cc670be2833f3f92/rootfs/
.autofsck .dockerenv lost+found/ proc/ sys/
.autorelabel .dockerinit media/ root/ tmp/
bin/ etc/ mnt/ sbin/ usr/
boot/ lib/ opt/ selinux/ var/
dev/ lib64/ .pki/ srv/
Run Code Online (Sandbox Code Playgroud)
但是在 Docker v1.6.0 中,我发现它/var/lib/docker/devicemapper/mnt/911d7ac8fca78b2beca8752ec89d80c06a1ea1dd8a65099d074ed40eec0c6cce是空的。
v1.6.0在哪里?
它已经使用了 devicemapper
# docker -D info
Containers: 4
Images: 58
Storage Driver: devicemapper
Pool Name: docker-253:1-2886824-pool
Pool Blocksize: 65.54 kB
Backing Filesystem: extfs
Data file: /dev/loop0
Metadata file: /dev/loop1
Data Space Used: 12.12 GB
Data Space Total: 107.4 …Run Code Online (Sandbox Code Playgroud) 我正在研究Linux中的启动过程.我遇到这句话"RAM比软盘快几个数量级,所以系统操作从ramdisk快速"
无论如何,内核将在RAM中加载根文件系统以执行它.所以我的问题是,如果内核将根文件系统加载到RAM中,为什么我们需要一个ramdisk来加载根文件系统?
我想将 docker 映像保存为 rootfs 格式(例如由 组成的目录/etc /var ...),这就像docker export所做的那样。也docker save无法满足我的需求,因为它保存了图像的各层,而不是它们安装在一起的目录。但我不想使用,docker export因为它仅在使用此映像的容器运行时才有效。现在我有一个包含大约 1000 个条目的图像列表,如何将每个图像保存到 rootfs,而不先在每个图像上启动一个容器?
我在带有busybox的嵌入式Linux环境中。我已经通读了几篇 文章,试图学习如何使用switch_root。我尝试了这个:
exec switch_root -c /dev/console /mnt/newroot /bin/busybox init
Run Code Online (Sandbox Code Playgroud)
在switch_root帮助打印,我提出了一个新的登录:
[root@buildroot ~]# exec switch_root -c /dev/console /mnt/newroot /bin/busybox init
BusyBox v1.21.0 (2015-04-24 18:14:40 MDT) multi-call binary.
busybox init
Usage: switch_root [-c /dev/console] NEW_ROOT NEW_INIT [ARGS]root /bin/busybox in
Free initramfs and switch to another root fs:
chroot to NEW_ROOT, delete all in /, move NEW_ROOT to /,
execute NEW_INIT. PID must be 1. NEW_ROOT must be a mountpoint.
-c DEV Reopen stdio to DEV after …Run Code Online (Sandbox Code Playgroud) 我接管了一个 Yocto 项目,在一个 .bb 配方文件中,我看到以下几行在图像中安装新目录:
do_install() {
install -m 0755 -d ${DEPLOY_DIR_IMAGE}/app
install -m 0755 -d ${DEPLOY_DIR_IMAGE}/app/apiary
install -m 0755 -d ${DEPLOY_DIR_IMAGE}/app/lib
install -m 0755 -d ${DEPLOY_DIR_IMAGE}/app/config
install -m 0755 -d ${DEPLOY_DIR_IMAGE}/app/scripts
install -m 0755 -d ${DEPLOY_DIR_IMAGE}/app/keys
Run Code Online (Sandbox Code Playgroud)
这有效,但我很困惑。从我阅读 Yocto 和做 do_install 来看,我认为-m选项仅用于安装文件而不是目录。
使用 install 命令执行install -m 0755 -d,-m和-d选项的效果是什么?
另外,为什么我看到的大多数其他目录安装中没有 ${D} 变量?对于这样的问题,我通常不会求助于 Stack Overflow,但有太多的不一致,我不明白,而且很难找到答案。
我试图从我的rootfs提供对coredump文件生成的支持,我已经用"ulimit -c unlimited"命令和"*hard core -1"修改了/ etc/limits文件,现在当我给kill -6 $$时,期待核心文件生成,但要获得此核心文件必须显式运行ulimit -c unlimited.
但是我想让它自动发生,不需要在shell中再次运行ulimit -c unlimited.
任何人都可以告诉我,为了发生同样的事情,我必须做出哪些改变
到目前为止,我一直在使用buildroot,最近又切换到Yocto。在buildroot中,根文件系统位于“目标”文件夹中。根文件系统在Yocto中的位置是什么。我知道它将位于“ build / tmp”文件夹中,而不是“ sysroots”文件夹中。
纠正我,如果我错了。
谢谢你的时间
我是新的,yocto 在imx6q嵌入式系统中构建。
我想在 do_rootfs 之后覆盖 linux 系统文件。例如,目标系统文件如下。
所以,我制作了自定义图层和自定义配方。helloworld 二进制文件可以复制。
但是,不调用 do_mytask 函数。
我的代码有什么问题?或任何其他方法用于我的目的。
#
# This file was derived from the 'Hello World!' example recipe in the
# Yocto Project Development Manual.
#
SUMMARY = "Simple helloworld application"
SECTION = "examples"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "file://helloworld.c"
S = "${WORKDIR}"
do_compile() {
${CC} helloworld.c -o helloworld
}
do_install() {
install -d ${D}${bindir}
install -m 0755 helloworld ${D}${bindir}
}
FILESEXTRAPATHS_prepend := "${THISDIR}/files:" …Run Code Online (Sandbox Code Playgroud)