[PATCH] dracut/save-initramfs.sh: don't save /tmp

Brian C. Lane bcl at redhat.com
Thu Oct 2 00:30:12 UTC 2014


On Wed, Oct 01, 2014 at 06:36:25PM -0400, Will Woods wrote:
> When save-initramfs.sh saves a copy of initramfs, we don't need the
> contents of /tmp. I mean, they're *temporary*. You shouldn't expect them
> to be there later.
> 
> This is especially important when we're fetching images (squashfs.img,
> updates.img, product.img, etc.) via http/ftp - they get downloaded into
> /tmp by default, and we really shouldn't be saving extra copies of them
> into an archive in /run.
> 
> This should save us ~275MB RAM on PXE-booted systems using http/ftp.
> 
> Resolves: rhbz#1148618
> ---
>  dracut/save-initramfs.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/dracut/save-initramfs.sh b/dracut/save-initramfs.sh
> index 4ebbdfe..e55291e 100755
> --- a/dracut/save-initramfs.sh
> +++ b/dracut/save-initramfs.sh
> @@ -16,7 +16,7 @@ if [ -z "$initramfs" ]; then
>      gzip=$(type -P pigz || type -P gzip)
>      # Prune out things we don't need - modules & firmware, python, overlay file
>      find / -xdev | \
> -      grep -Ev 'lib/modules|lib/firmware|python|overlay|etc/ssl|fsck' | \
> +      grep -Ev 'tmp/|lib/modules|lib/firmware|python|overlay|etc/ssl|fsck' | \
>        cpio -co 2>/dev/null | $gzip -c1 > $initramfs
>  fi
>  
> -- 
> 1.9.3

Heck ya. ACK.

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)


More information about the anaconda-patches mailing list