Bug 803320 - File preservation doesn't work for rhel 6.2
File preservation doesn't work for rhel 6.2
Status: CLOSED CURRENTRELEASE
Product: Spacewalk
Classification: Community
Component: Clients (Show other bugs)
0.9
All Linux
high Severity medium
: ---
: ---
Assigned To: Milan Zázrivec
Red Hat Satellite QA List
:
Depends On:
Blocks: space18
  Show dependency treegraph
 
Reported: 2012-03-14 08:46 EDT by Milan Zázrivec
Modified: 2012-11-01 12:19 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 796466
Environment:
Last Closed: 2012-11-01 12:19:20 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Milan Zázrivec 2012-03-14 08:46:48 EDT
+++ This bug was initially created as a clone of Bug #796466 +++

Description of problem:

rhel 6.2 re provision fails if we add file preservation to the kickstart profile.



How reproducible:

Always

Steps to Reproduce:
1. Create a kickstart profile with file preservation
2. Re-provision a rhel 6.2 machine with this kickstart profile
3.
  
Actual results:

Kickstart fails with the following message
--------------------------
- ['/sbin/grubby', '--add-kernel', '/boot/vmlinuz', '--initrd', '/boot/initrd.img', '--args', '"ks=http://xx.xx.xx.xx/cblr/svc/op/ks/system/dhcp209-194:1 ksdevice=link kssendmac lang= text "', '--make-default', '--title=kick1329790016']
- reboot to apply changes
CMD: ['/usr/sbin/merge-rd.sh', '/boot/initrd.img', '/boot/initrd.img', '/tmp/ks-tree-shadow'] 
/usr/share/rhn/spacewalkkoan/spacewalkkoan.py:293: DeprecationWarning: The popen2 module is deprecated.  Use the subprocess module.
  import popen2
D: Sending back response(2, 'Error creating the new RAM disk', {'status': 2, 'stderr': '\ngzip: /boot/initrd.img: not in gzip format\n/usr/sbin/merge-rd.sh: line 54: return: -1: invalid option\nreturn: usage: return [n]\n', 'stdout': ''})


Additional info:
In rhel6.2, lzma is used for compressing initrd (BZ#694198). I can see a similar BZ for PPC and s390x (#578650)

 Using xzcat instead of zcat in /usr/sbin/merge-rd.sh will fixes the issue in the local re-producer. 
---------------------------
[root@dhcp209-194 ~]# diff -rupN /usr/sbin/merge-rd.sh.orig /usr/sbin/merge-rd.sh
--- /usr/sbin/merge-rd.sh.orig	2012-02-20 22:49:10.811759445 -0500
+++ /usr/sbin/merge-rd.sh	2012-02-20 22:49:59.215766678 -0500
@@ -57,7 +57,7 @@ get_initrd_type() {
 uncompress_rd() {
     local COMPRESSED_INITRD=$1
     local UNCOMPRESSED_INITRD=$2
-    zcat $COMPRESSED_INITRD > $UNCOMPRESSED_INITRD
+    xzcat $COMPRESSED_INITRD > $UNCOMPRESSED_INITRD
 }
 
 # Expands the provided initrd file into the specified directory.  Returns the
@@ -143,7 +143,7 @@ estimate_merged_rd_size() {
     local ORIG_SIZE=$(du -s -b $SOURCE_TREE | cut -f 1)
     local MERGED_SIZE=$(du -s -b $MERGED_TREE | cut -f 1)
     local DELTA="$(($MERGED_SIZE - $ORIG_SIZE))"
-    local ORIG_RD_SIZE=$(zcat $SOURCE_INITRD | wc -c)
+    local ORIG_RD_SIZE=$(xzcat $SOURCE_INITRD | wc -c)
     local MERGED_RD_SIZE="$(( 12 * ($ORIG_RD_SIZE + $DELTA) / 10 ))"
 
     eval "$RESULT_ASSN=\"$MERGED_RD_SIZE\""
---------------------------
Comment 1 Milan Zázrivec 2012-03-14 09:10:51 EDT
spacewalk.git master: b9b37f60c835c8f916e34075c20b8a1366a9101b
Comment 2 Jan Pazdziora 2012-10-30 15:24:05 EDT
Moving ON_QA. Packages that address this bugzilla should now be available in yum repos at http://yum.spacewalkproject.org/nightly/
Comment 3 Jan Pazdziora 2012-11-01 12:19:20 EDT
Spacewalk 1.8 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes18

Note You need to log in before you can comment on or make changes to this bug.