git: mkinitrd(8): determine the initrd size from the contents size

Aaron LI aly at
Fri Mar 30 00:39:20 PDT 2018

commit eeb035f875d0cb79c54938cc9ae8858344059cd1
Author: Aaron LI <aly at>
Date:   Fri Mar 30 14:32:59 2018 +0800

    mkinitrd(8): determine the initrd size from the contents size
    * Calculate the contents size to determine the required initrd size.
      The used initrd size is determined from the total contents size, rounded up
      to align with 1 MiB, added additional 1 MiB.
      The calculated initrd size is 12 MiB at the moment, so we have 3 MiB
      more usable memory now (compared to the fixed 15 MiB before).
    * Add options "-s" to specify the required initrd size as before.  But a check
      against the above determined required initrd size is performance to avoid the
      out-of-space error, resulting in a broken initrd image.
    * Add option "-S" to constrain the allowed maximum initrd size, because a too
      big initrd image will also lead to boot failure, due to the boot loader
    * Some minor cleanups and improvements, better error handle and messages.
    * Update the mkinitrd.conf and man page accordingly.
    Reviewed-by: zrj

Summary of changes:
 etc/defaults/mkinitrd.conf |   4 +-
 sbin/mkinitrd/mkinitrd.8   |  48 +++++++++++++++++----
 sbin/mkinitrd/  | 101 ++++++++++++++++++++++++++++++++++++---------
 3 files changed, 124 insertions(+), 29 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list