summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2020-11-13 20:30:04 -0500
committerAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2020-11-13 20:30:04 -0500
commitcd207c62ab30200b8b97dab9cc76beda98d44ce8 (patch)
treea695adb42585592e096bb8fc67efee60eeb6a640
parentbde1d90ae348d5459168d74790f2c34a073b7962 (diff)
downloadminitramfs-cd207c62ab30200b8b97dab9cc76beda98d44ce8.tar.xz
minitramfs-cd207c62ab30200b8b97dab9cc76beda98d44ce8.zip
update README
-rw-r--r--README45
1 files changed, 16 insertions, 29 deletions
diff --git a/README b/README
index a2f004d..c755e6d 100644
--- a/README
+++ b/README
@@ -1,36 +1,33 @@
-minitramfs is a minimal initramfs generator. I use this on my desktop Gentoo
-system. For my laptop Arch system, I use mkinitcpio.
-
-Basically, it's a suckless initramfs generator: it does exactly what I need.
-You need something else? Patch it, it's only 117 lines. Or use mkinitcpio or
-dracut, I won't feel bad.
+minitramfs is a minimal initramfs generator, in the "suckless" style: it does
+exactly what I need. You need something else? Patch it, it's only 80 lines. Or
+use mkinitcpio or dracut, I won't feel bad.
Features:
- uses existing system tools
-- password LUKS unlock
+- LUKS password unlock
- SSH remote unlock
-- firmware loading (trivial, done by kernel)
-- extremely fast initramfs creation: compression off: ~70ms cold cache, ~30ms
+- firmware loading
+- extremely fast initramfs creation: compression off: ~80ms cold cache, ~30ms
warm; lz4 --best: 1.6s
- udev/mdev-free module loading
- no temporary files during creation
-- extremely fast initramfs runtime: ~zero overhead compared to direct kernel
- loading
-- minimal code: 117 SLOC total (init + make + Makefile + unlock)
+- minimal runtime overhead
+- minimal code: 80 SLOC total (init + make + Makefile + unlock)
- pure POSIX shell + POSIX Makefile
Drawbacks:
- uses existing system tools
+- requires exact module list
- pure POSIX shell + POSIX Makefile
Usage:
0. Read (skim) https://wiki.gentoo.org/wiki/Custom_Initramfs.
-1. Install busybox, dropbear, e2fsprogs if you use ext4, and C toolchain for
- building gen_init_cpio.
+1. Install busybox, dropbear, e2fsprogs for e2fsck, and C toolchain for
+ gen_init_cpio.
2. Adjust ./init as required:
a) Adjust networking as required. For example, use static IP instead of DHCP, or
@@ -41,24 +38,14 @@ Usage:
c) Change or remove fsck for non-ext4 roots
d) Put whatever you want: usr mount, NFS root, whatever.
-3. Adjust ./make as required:
- a) Put your needed commands in gen_cpio_list.
- b) Select your desired compressor at the end. Try make comp_bench for a comparison.
- summary: lz4 is usually best, xz if storage is important above all (saves
- a few MB but adds ~0.5s to boot), gzip is mediocre on both size and
- speed, lzo is usually worse than gzip, never use bzip2 or lzma.
-
-4. Customize cpio_list.txt with your required files. Remember that commands
- must go in ./make (for library detection), and device files except
- /dev/console and non-empty directories can be omitted.
+3. Adjust ./make as required. Mainly, put your needed commands in gen_cpio_list.
-5. Add your public keys to authorized_keys. Note that dropbear only supports
- RSA and ECDSA keys.
+4. Customize cpio_list.txt with your required non-executable files.
-6. make
+5. Add your public keys to authorized_keys.
-7. sudo make install
+6. make && sudo make install
-8. Configure your boot loader/boot manager to use initramfs.img.
+8. Configure your boot loader/manager to use initramfs.img.
9. Use as usual. For remote unlock, SSH to port 2222 and "exec unlock".