[PATCH] amend casper UUID extraction from initrd
Hello,
Please accept this patch which fixes the casper uuid extraction from
initrd.
The patch addresses the issue by:
* removing an output redirection which is causing the related code to be
always skipped;
* adding a switch to the call to lzma to prevent lzma to complain about
unrecognised file extension;
* returning to the originating directory to perform cleanup.
Cheers,
Luigi Capriotti
--- a/lb_binary_disk 2011-11-30 14:23:45.288289001 +0100
+++ b/lb_binary_disk 2011-11-30 14:25:29.860289000 +0100
@@ -86,9 +86,10 @@
case "${LB_INITRAMFS}" in
casper)
- for INITRD in $(ls binary/casper/initrd.img* > /dev/null 2>&1)
+ for INITRD in $(ls binary/casper/initrd.img*)
do
mkdir -p binary/uuid
+ OLDPWD=$(pwd)
cd binary/uuid
case "${LB_INITRAMFS_COMPRESSION}" in
@@ -101,13 +102,13 @@
;;
lzma)
- lzcat "../../${INITRD}" | cpio --quiet -id conf/uuid.conf
+ lzcat -S "" "../../${INITRD}" | cpio --quiet -id conf/uuid.conf
;;
esac
if [ -e conf/uuid.conf ]
then
- mv conf/uuid.conf "../binary/.disk/casper-uuid${INITRD#binary/casper/initrd.img}"
+ mv conf/uuid.conf "../.disk/casper-uuid${INITRD#binary/casper/initrd.img}"
else
Echo_warning "Failed to find casper uuid.conf in '${INITRD}'"
fi
Reply to: