Permalink
Browse files

refactor addition of zopts to compress command

  • Loading branch information...
1 parent 596c7c6 commit 036fdb1edfd3e740182e996f3c04622286bc8734 @falconindy committed May 22, 2011
Showing with 7 additions and 5 deletions.
  1. +2 −4 geninit
  2. +5 −1 geninit.quirks
View
@@ -302,14 +302,12 @@ __build_image() { # {{{
return
fi
- if [[ "$compress" != cat ]]; then
- zopts=('-9')
- [[ "$compress" == xz ]] && zopts+=('--check=crc32')
- fi
+ [[ "$compress" != cat ]] && zopts=(${compressquirks[$compress]} '-9')
msg "Creating$([[ "$compress" == cat ]] || printf " $compress") initramfs: $imagename"
pushd "$buildroot" &>/dev/null
+ (( verbose )) && plain "compress cmd: $compress ${zopts[@]}"
find . -print0 | bsdcpio -0oH newc | "$compress" "${zopts[@]}" > "$imagename.tmp"
pipesave=("${PIPESTATUS[@]}") # save immediately
popd &>/dev/null
View
@@ -5,9 +5,13 @@
# This file declares quirks for modules which have non-explicit dependencies.
#
-declare -A modquirks
+declare -A modquirks compressquirks
+# modules which have non-explicit dependencies
modquirks['fat']="nls_cp437"
modquirks['ocfs2']="configfs"
modquirks['libcrc32c']="crc32c crc32c_intel"
+# extra options necessary for compression methods
+compressquirks['xz']="--check=crc32"
+

0 comments on commit 036fdb1

Please sign in to comment.