Bug 803320 - File preservation doesn't work for rhel 6.2
Summary: File preservation doesn't work for rhel 6.2
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Clients
Version: 0.9
Hardware: All
OS: Linux
high
medium
Target Milestone: ---
Assignee: Milan Zázrivec
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space18
TreeView+ depends on / blocked
 
Reported: 2012-03-14 12:46 UTC by Milan Zázrivec
Modified: 2012-11-01 16:19 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 796466
Environment:
Last Closed: 2012-11-01 16:19:20 UTC
Embargoed:


Attachments (Terms of Use)

Description Milan Zázrivec 2012-03-14 12:46:48 UTC
+++ 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 13:10:51 UTC
spacewalk.git master: b9b37f60c835c8f916e34075c20b8a1366a9101b

Comment 2 Jan Pazdziora 2012-10-30 19:24:05 UTC
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 16:19:20 UTC
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.