Debian 10 Buster - Rrefractasnapshot decompression error

Post your questions about Refracta here.

Re: Debian 10 Buster - Rrefractasnapshot decompression error

Postby fsmithred » July 10th, 2019, 3:02 am

I've only gotten part way through the log, but I noticed that I dropped the cpio command for repacking the initrd. I fixed it above, and here it is again.
Code: Select all
find . | cpio -o -H newc > ${work_dir}/iso/live/${initrd_image##*/}


Edit: The uncompressed version is very large.

if you want to gzip the initrd you can use this:
Code: Select all
find . -print0 | cpio -0 -H newc -o | gzip -c > ${work_dir}/iso/live/${initrd_image##*/}


If you want to xz compress it (smaller)
Code: Select all
find . -print0 | cpio -0 -H newc -o | gzip -c > ${work_dir}/iso/live/${initrd_image##*/}
fsmithred
 
Posts: 354
Joined: February 11th, 2011, 4:14 am

Re: Debian 10 Buster - Rrefractasnapshot decompression error

Postby fsmithred » July 10th, 2019, 3:08 am

paulhoffusa wrote:The only special thing thing I did after install was update and upgrade all packages but I don't think that changed the kernel version at all. Then I deleted the libreoffice packages and added the mono repo and installed a few other packages. Could any of this have messed up the /initrd.img file? I'm trying figure out how it would be uncompressed when you mentioned it should be compressed.


The kernel doesn't have to be changed to trigger a rebuild of the initrd. Lots of packages do it when they are installed. Maybe one time something went wrong and it didn't compress.

If you want to trace the source of the problem, you could reinstall and pay close attention to what happens when you install extra packages (more or less one at a time).
fsmithred
 
Posts: 354
Joined: February 11th, 2011, 4:14 am

Re: Debian 10 Buster - Rrefractasnapshot decompression error

Postby paulhoffusa » July 10th, 2019, 4:41 am

As a test I uninstalled refracta-snapshot-base ver 10.2.4 and installed ver 10.2.0. Guess what there is no issue or error and I can boot the iso. I then upgraded to ver 10.2.4 unmodified script and got uncompression error then I reverted back to 10.2.0 and re-tested and I don't get the error. So it's some difference between the 2 versions.
paulhoffusa
 
Posts: 12
Joined: July 9th, 2019, 4:06 am

Re: Debian 10 Buster - Rrefractasnapshot decompression error

Postby paulhoffusa » July 10th, 2019, 4:50 am

Sorry typo not ver 10.2.4 but 10.2.3
paulhoffusa
 
Posts: 12
Joined: July 9th, 2019, 4:06 am

Re: Debian 10 Buster - Rrefractasnapshot decompression error

Postby fsmithred » July 10th, 2019, 9:53 am

The difference is that 10.2.0 doesn't have this following function and won't edit the initrd contents like 10.2.3 does. If you have an uncompressed cpio archive, 10.2.3 will give you "Decompression error" and 10.2.0 won't.

If it turns out that you need to remove the resume file from the initrd, there are scripts in /usr/lib/refractasnapshot for doing that manually.. (nocrypt, I think). In Buster, you need to be root to extract the contents of the initrd.

Code: Select all
+extract_initrd () {
+
+       mkdir /tmp/extracted
+       pushd /tmp/extracted
+
+       COMPRESSION=$(file -L "$initrd_image" | egrep -o 'gzip compressed|XZ compressed')
+
+       if [ "$COMPRESSION" = "gzip compressed" ]; then
+               echo "Archive is gzip compressed..."
+               zcat "$initrd_image" | cpio -i
+
+       elif [ "$COMPRESSION" = "XZ compressed" ]; then
+               echo "Archive is XZ compressed..."
+               xzcat "$initrd_image" | cpio -d -i -m
+       else
+               echo "Decompession error..." && exit 1
+       fi
+
+       popd
+
+       echo "Initrd is extracted"
+
+}
fsmithred
 
Posts: 354
Joined: February 11th, 2011, 4:14 am

Re: Debian 10 Buster - Rrefractasnapshot decompression error

Postby paulhoffusa » July 10th, 2019, 2:07 pm

Would you be willing to change refractasnapshot ver 10.2.4 (next version) to check for the uncompressed img file and if it was not compressed then compress it using either gzip or xz compression in the check_initrd function? That way later in script when the uncompress check is done in the extract_initrd function it can use the existing code with no mods needed in that function?
I can patch my code but it will get overwritten with your next update is what I'm worried about.
I understand now thank you for your patience and your quick responses.
paulhoffusa
 
Posts: 12
Joined: July 9th, 2019, 4:06 am

Re: Debian 10 Buster - Rrefractasnapshot decompression error

Postby paulhoffusa » July 10th, 2019, 2:57 pm

Forgot to post prev ... Running nocrypt.sh script is not an option as a pre-process to refractasnapshot because it can't handle uncompressed img ... output error says "not in gzip format"
paulhoffusa
 
Posts: 12
Joined: July 9th, 2019, 4:06 am

Re: Debian 10 Buster - Rrefractasnapshot decompression error

Postby fsmithred » July 10th, 2019, 7:18 pm

Check /etc/initramfs-tools/initramfs.conf and make sure it's set for gzip or xz compression. The default setting looks like this:
Code: Select all
#
# COMPRESS: [ gzip | bzip2 | lzma | lzop | xz ]
#

COMPRESS=gzip



I'd like to know how you got an uncompressed initrd before I change the script to accomadate that. If it's there because of some error, it would make more sense to have a more informative error message.
fsmithred
 
Posts: 354
Joined: February 11th, 2011, 4:14 am

Re: Debian 10 Buster - Rrefractasnapshot decompression error

Postby paulhoffusa » July 12th, 2019, 3:07 pm

Yes mine says 'COMPRESS=gzip' as your above does. Now that I've had more time to think (I can't remember if I did this or not) what would happen if CNTRL-C was pressed or power failure or hard drive failure in the middle of running the script? Would that leave the img file in an uncompressed state before script had a chance to repack it? If so then running the script after would try to uncompress the img file again giving the uncompress error I'm seeing.
paulhoffusa
 
Posts: 12
Joined: July 9th, 2019, 4:06 am

Re: Debian 10 Buster - Rrefractasnapshot decompression error

Postby fsmithred » July 12th, 2019, 8:10 pm

The only thing the script does with the initrd on the host system is read it and copy the contents to a temporary directory. Then it repacks the edited contents into a different file (different location) in the work directory. It gets compressed on the way to becoming that target file.
Code: Select all
find . -print0 | cpio -0 -H newc -o | gzip -c > ${work_dir}/iso/live/${initrd_image##*/}


If you run 'update-initramfs -u' or install a package that rebuilds the initrd, you should get a gzip compressed file. If you interrupted that process with ctrl-c or power failure, I don't know what would happen. I expect you would not be able to boot the computer.
fsmithred
 
Posts: 354
Joined: February 11th, 2011, 4:14 am

PreviousNext

Return to Refracta

Who is online

Users browsing this forum: No registered users and 1 guest

x