问题标签 [initrd]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
2238 浏览

linux - 嵌入式 linux,带有 buildroot 的 initramfs

在我的嵌入式系统中,我想使用 initramfs 来执行一些特殊操作。有人设法使 initramfs 工作?我使用的是 buildroot 2016.2,内核来自我的提供商,我们使用的是 3.0.x。我已经启用了 initramfs,所以我只需要将路径传递给我的 cpio。目前 getty 无法正常工作。

并永远挂起。

任何想法?可能是工具链问题?

我使用了标签 initrd,因为没有“initramfs”

0 投票
1 回答
1168 浏览

linux - Why can't I specify my rootfs with PARTUUID when I use initramfs?

I have an embedded ARM board and am experimenting with initramfs.

Since my root filesystem is EXT4 and the EXT4 driver is built into the kernel (not compiled as a module), I can directly boot the kernel and mount the root filesystem, no initramfs required. Without initramfs, the kernel won't recognize filesystem UUIDs, of course, hence I specified root with the partition identifier PARTUUID, as described in the kernel docs. The boot argument in question looks like this: root=PARTUUID=7acc80f1-01 This works perfectly fine.

Now, when I try to boot the same kernel version with an initramfs, the system won't boot. It complains the root device cannot be found. When I change my boot arguments to use the filesystem UUID intstead of the PARTUUID, then it works again: root=UUID=c9fd552c-921c-4ddb-bb46-fe557943d311 But why is that? Why would using an initramfs lead to less boot options when the kernel supports PARTUUID natively in the first place?

I'd like to specify root in unique way that works in both setups, regardless of whether an initramfs is used or not. Device names such as /dev/sda1 are not an option as they can vary during boot (multiple disks attached).

Any clues?

Thanks and regards,

Timo

P.S: The kernel version is mainline 4.4.16. U-Boot is 2015.5. Distro is Debian 8.

0 投票
1 回答
1022 浏览

linux - 什么时候需要重建 initrd(Linux 初始 ramdisk)?

背景:我正在为我的内核模块开发一个 DKMS 包。DKMS 联机帮助页包含以下句子:

REMAKE_INITRD = 该指令指定在模块安装到内核后是否应该重新制作您的 initrd。

问题:什么时候需要重新制作 initrd?在将模块安装到内核后,如何确定是否需要重新制作 initrd?

0 投票
1 回答
1592 浏览

linux - 如何在 yocto 配方中启用 udev 包以进行 initramfs 构建

如何在 yocto 配方中启用 udev 包以进行 initramfs 构建?

请提供样本 yocto bb 文件。

谢谢

0 投票
1 回答
94 浏览

linux - 我可以在 linux 启动时在 initrd 中运行 Qt 应用程序吗?

我想知道我是否可以在grub 和真正的操作系统启动之间的initrd中运行 Qt 应用程序。并在 Qt 应用程序运行时停止。

0 投票
0 回答
289 浏览

linux - 在启动时挂载映射设备

我有一个 2.4 内核版本的 Linux 系统。我需要通过设备映射器为根分区制作一个映射设备,并在启动时挂载到它。

我需要使用特殊的映射器类型(不是像线性镜像这样的标准映射器)。因此,我尝试编写自己的内核模块,实现必要的功能(现在它只是将查询传输到真实设备)。

我以这篇文章为起点。我已经对其代码进行了一些更改,所以现在它看起来像这样:

您会看到,主要功能是将目标设备更改为另一个(真实)并重新提交查询:

Rowbh->b_dev = MKDEV(3, 3);是错误的,但不知道合适的设备号在哪里,所以我尝试自己计算。

我的下一步是更改其中的initrd映像和linuxrc文件:

其中sddm_target - 是我的内核模块。

表文件包含:

映射设备出现在给定的目录中,所以看起来一切都很好。但是当我尝试引导我的系统时,我运行了几次 sddm_target_map函数,并通过设备安装调用,然后引导保持并显示以下消息:

一些谷歌搜索帮助我理解,这条消息是由文件系统检查程序打印的。但它的原因是什么 - 我不知道。

我需要帮助!

0 投票
1 回答
2228 浏览

linux-kernel - 当我的 initrd (cpio) 很大 ~80 mb 时,Qemu 无法加载

我是 qemu 的新手并且正在尝试学习内核编程,我创建了一个具有繁忙框的 initrd,但是当我在 cpio qemu 中添加一个 ~80Mb 的大 tarbal 时无法加载。

我想在 intrd 中包含 golang,以便我可以测试新内核。

这是正在发生的事情:

然后我使用带有 rootfs = 2.6 M 的新内核的 qemu 运行它

但是当我在 rootfs 中包含 golang 的 tar.gz 时,它会达到 80M,然后无法启动

我尝试使用相同的命令运行它,但它无法运行...

我究竟做错了什么 ?任何指针请:)

0 投票
0 回答
200 浏览

linux - 在 Amazon EC2 ubuntu 实例上的 linux 4.4 上构建 initramfs 时出错

全部,

我下载了内核源代码树 4.4.66(来自 kernel.org)并尝试从中构建内核和 initramfs。内核构建良好,但 initramfs 构建不正确。

通过我在 Amazon AWS EC2 ubuntu 实例上尝试这个

4.4.0-75-generic #96-Ubuntu SMP Thu Apr 20 09:56:33 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

知道如何克服这个问题吗?

0 投票
1 回答
644 浏览

linux - 如何将位序列(位掩码)转换为相应的十六进制数

假设我有 bitmask 1000000000。我想将其转换为等效的十六进制数,即0x200(具体来说,我只想要200部分,但这很容易处理)

我知道我可以用 Python 或使用各​​种bash特性和功能来做到这一点。例子:

但是,我想只使用可用的函数sh(即 Shell,而不是 Bash)来做到这一点。更具体地说,我希望它可以shinitrd我正在组合的图像中使用。AFAIK,上面的例子都不能在initramfs/busybox上下文中工作。

0 投票
0 回答
719 浏览

linux-kernel - 自定义 initrd 无法挂载 RAM 磁盘映像

我正在尝试构建一个我想与 qemu 一起使用的简约内核和 initrd 映像。

我正在使用 cpio 打包 initrd 图像,

如果我没有在 /lib/modules 中保留任何内容,内核可以很好地加载和安装 RAM 磁盘映像。当我将内核模块保留在其中的那一刻,RAM 磁盘映像没有被挂载并且失败并出现以下错误,

我能够理解如何通过在 initrd 中添加模块导致这种行为?