Go to file
Kairui Song 095e1f37c4 Add support for building a squashed initramfs
With all files stored in ramfs, and most of them are not compressed,
the initramfs will take up a lot of memory. Besides, if the file number
is large, each file will waste some memory due to page fragmetation.
This is due to ramfs' design, at least one page will be allocated for
one file however small the file is. On machine with large page size,
this will become worse and waste too many memory.

One approach to reducing the memory usage is to reduce the number of
files that got directly loaded into the root ramfs, and compress files
by put most files will into a read-only squash image and keep a minimum
set of executable and libraries outside as the loader for the squash
image. After the squash image is mounted, the real 'init' will be
executed and then everything behaves as usual.

This patch will introduce a '99squash' module which will never be
included by default. User can force add it, and if it is included,
dracut will perform some extra steps before creating the final image:

For now, "/etc" and "/usr" will be moved into the squashfs image.
"/init" will be renamed to "/init.stock" and replaced by "/init.squash".
Files and folders need to be accessible before mounting the image will
be still avaliable at their original place. And due to squashfs is
readonly, an overlayfs layer will be created on top of squashfs mount
point, as many dracut module require readwrite access to "/etc" and
"/usr", "init.squash" will ultimately call "/init.stock".

An extra systemd service will be installed. This service will umount all
squashfs related mount points right before switch-root to release
resources properly. This service will not actually do anything if
switch-root is not used.

This is very helpful when mem resource is very limited, like Kdump.
According to my tests, this squash module can help save about 35MB of
memory with 64K page size, or about 15MB with 4K page size on an
ordinary kdump capture routine. This module could also help reduce
memory usage for normal boot up process.

Won't change any behavior if squash module is not enabled.

Signed-off-by: Kairui Song <kasong@redhat.com>
2018-09-21 10:32:04 +02:00
dracut.conf.d add --no-reproducible to turn off reproducible mode 2015-11-13 11:53:36 +01:00
install install: avoid non-portable __WORDSIZE 2018-09-10 09:45:22 +02:00
modules.d Add support for building a squashed initramfs 2018-09-21 10:32:04 +02:00
skipcpio skipcpio/skipcpio.c: linux kernel only accepts "070701" signature 2015-07-07 13:44:13 +02:00
test test/test-functions: fixed V=1 logic 2018-08-17 15:38:03 +02:00
.dir-locals.el .dir-locals.el: changed to sane style 2017-01-16 14:27:39 +01:00
.gitignore Ignore more generated files 2017-01-25 13:27:05 +01:00
.kateconfig add kate and emacs per directory config files 2014-08-29 13:38:47 +02:00
.kateproject kate config 2016-04-15 10:27:48 +02:00
.mailmap version 047 2018-02-19 10:00:33 +01:00
.travis.yml travis: re-enable test 14 2018-08-20 10:05:41 +02:00
50-dracut.install 5?-dracut*.install: Allow scripts to install the initramfs in /boot dir 2018-03-01 14:50:30 +01:00
51-dracut-rescue-postinst.sh Bring back 51-dracut-rescue-postinst.sh 2018-07-26 12:58:21 +02:00
51-dracut-rescue.install 51-dracut-rescue.install: Don't install BLS fragment in /boot/efi on EFI 2018-07-02 12:28:04 +02:00
AUTHORS NEWS and AUTHORS update 2018-07-06 10:37:51 +02:00
COPYING
HACKING
Makefile travis: git pull more depth 2018-08-16 10:46:57 +02:00
NEWS NEWS: forgot to update the latest version 2018-07-26 09:54:13 +02:00
PKGBUILD PKGFILE: prevent out of tree builds 2015-11-08 12:57:33 +01:00
README README: update 2016-11-03 14:54:45 +01:00
README.generic
README.kernel
README.md Update README.md 2018-08-14 16:58:52 +02:00
README.modules
README.testsuite Drop dependency on bridge-utils 2017-02-14 14:10:24 +01:00
TODO TODO: remove some items 2016-11-03 15:05:36 +01:00
configure configure, kmod: bump kmod version to >= 23 2018-01-16 23:10:21 +09:00
dracut-bash-completion.sh Remove obsolete prelinking functionality 2018-06-14 12:58:59 +02:00
dracut-catimages.8.asc
dracut-catimages.sh remove all vim and emacs code format comments 2014-08-29 13:38:47 +02:00
dracut-functions.sh dracut-functions: fix the word splitting 2018-08-09 13:13:52 +02:00
dracut-init.sh dracut-init.sh: fix instmods with zero input 2018-07-05 13:39:46 +02:00
dracut-initramfs-restore.sh add support for Zstandard 2017-09-05 01:23:38 +02:00
dracut-logger.sh dracut.sh: only create one TMPDIR 2015-11-25 14:21:33 +01:00
dracut.8.asc Remove obsolete prelinking functionality 2018-06-14 12:58:59 +02:00
dracut.asc Correct path for UEFI stub 2017-03-20 11:43:04 +01:00
dracut.bootup.7.asc documentation: line wrap 2014-01-13 09:51:04 +01:00
dracut.cmdline.7.asc Fix misspellings in man pages and usage 2018-08-30 13:12:00 +02:00
dracut.conf dracut.conf: remove example parameters 2015-07-09 15:36:25 +02:00
dracut.conf.5.asc Remove obsolete prelinking functionality 2018-06-14 12:58:59 +02:00
dracut.css Doc: cleanup, extend and split and reuse 2013-10-08 15:13:12 +02:00
dracut.logrotate
dracut.modules.7.asc Fix misspellings in man pages and usage 2018-08-30 13:12:00 +02:00
dracut.png dracut.png: Optimize with zopflipng -m 2016-07-07 13:54:47 +03:00
dracut.sh Add support for building a squashed initramfs 2018-09-21 10:32:04 +02:00
dracut.spec dracut.spec: remove warpclock from z-series, not the other way round 2018-08-13 16:30:25 +02:00
dracut.svg
dracut.usage.asc Fix misspellings in man pages and usage 2018-08-30 13:12:00 +02:00
fedora-test.sh travis: no rpm check for all matrix tests 2018-08-16 11:57:30 +02:00
git2spec.pl git2spec.pl: handle empty merge commits 2017-10-09 17:40:04 +02:00
logtee.c logtee: reduce output 2018-08-16 11:14:11 +02:00
lsinitrd-bash-completion.sh remove all vim and emacs code format comments 2014-08-29 13:38:47 +02:00
lsinitrd.1.asc lsinitrd: update help message and man page 2018-07-26 09:57:55 +02:00
lsinitrd.sh lsinitrd: update help message and man page 2018-07-26 09:57:55 +02:00
mkinitrd-dracut.sh mkinitrd-dracut.sh: removed trailing space in comment 2013-10-07 17:25:58 +02:00
mkinitrd-suse.8.asc Fix misspellings in man pages and usage 2018-08-30 13:12:00 +02:00
mkinitrd-suse.sh mkinitrd-suse.sh: Implement functionality of -A option 2017-12-19 13:23:08 +01:00
mkinitrd.8.asc documentation: line wrap 2014-01-13 09:51:04 +01:00
profile.py

README.md

dracut - master branch

dracut is an initramfs infrastructure.

Travis

Build Status

CentOS CI

Build Status

  • Test 01: Test 01
  • Test 02: Test 02
  • Test 03: Test 03
  • Test 04: Test 04
  • Test 10: Test 10
  • Test 11: Test 11
  • Test 12: Test 12
  • Test 13: Test 13
  • Test 14: Test 14
  • Test 15: Test 15
  • Test 16: Test 16
  • Test 17: Test 17
  • Test 20: Test 20
  • Test 30: Test 30
  • Test 31: Test 31
  • Test 40: Test 40
  • Test 50: Test 50
  • Test 70: Test 70