用户工具

站点工具


jaysnote:ramfs_rootfs_initramfs

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录 前一修订版
jaysnote:ramfs_rootfs_initramfs [2018/11/19 15:18]
jaylee
jaysnote:ramfs_rootfs_initramfs [2018/11/19 18:35]
jaylee
行 125: 行 125:
 ## Contents of initramfs: ## Contents of initramfs:
  
-An initramfs archive is a complete self-contained root filesystem for Linux. +An initramfs archive is a complete self-contained root filesystem for Linux.If you don't already understand what shared libraries, devices, and path you need to get a minimal root filesystem up and running, here are som references:
-If you don't already understand what shared libraries, devices, and path ou need to get a minimal root filesystem up and running, here are som eferences:+
  
 * http://www.tldp.org/HOWTO/Bootdisk-HOWTO/ * http://www.tldp.org/HOWTO/Bootdisk-HOWTO/
行 134: 行 133:
 * http://www.linuxfromscratch.org/lfs/view/stable/ * http://www.linuxfromscratch.org/lfs/view/stable/
  
-The "klibc" package (http://www.kernel.org/pub/linux/libs/klibc) i esigned to be a tiny C library to statically link early userspac ode against, along with some related utilities.  It is BSD licensed.+The "klibc" package (http://www.kernel.org/pub/linux/libs/klibc) is designed to be a tiny C library to statically link early userspace code against, along with some related utilities.  It is BSD licensed.
  
-I use uClibc (http://www.uclibc.org) and busybox (http://www.busybox.net) +I use uClibc (http://www.uclibc.org) and busybox (http://www.busybox.net) myself.  These are LGPL and GPL, respectively.  (A self-contained initramf package is planned for the busybox 1.3 release.)
-myself.  These are LGPL and GPL, respectively.  (A self-contained initramf ackage is planned for the busybox 1.3 release.)+
  
-In theory you could use glibc, but that's not well suited for small embedde ses like this.  (A "hello world" program statically linked against glibc i ver 400k.  With uClibc it's 7k.  Also note that glibc dlopens libnss to d ame lookups, even when otherwise statically linked.)+In theory you could use glibc, but that's not well suited for small embedde uses like this.  (A "hello world" program statically linked against glibc is over400k.  With uClibc it's 7k.  Also note that glibc dlopens libnss to do name lookups, even when otherwise statically linked.)
  
-A good first step is to get initramfs to run a statically linked "hello world" +A good first step is to get initramfs to run a statically linked "hello world" program as init, and test it under an emulator like qemu (www.qemu.org) or User Mode Linux, like so:
-program as init, and test it under an emulator like qemu (www.qemu.org) o ser Mode Linux, like so:+
  
 ```c ```c
行 162: 行 159:
 ``` ```
  
-When debugging a normal root filesystem, it's nice to be able to boot with "init=/bin/sh" The initramfs equivalent is "rdinit=/bin/sh", and it' ust as useful.+When debugging a normal root filesystem, it's nice to be able to boot with "init=/bin/sh" The initramfs equivalent is "rdinit=/bin/sh", and it' just as useful.
  
 ## Why cpio rather than tar? ## Why cpio rather than tar?
jaysnote/ramfs_rootfs_initramfs.txt · 最后更改: 2021/06/22 23:14 (外部编辑)