# HG changeset patch # User Pascal Bellard # Date 1526457804 -7200 # Node ID 5d84fadfd92852384b7bd44a607fd653d92cde2c # Parent 2f9336b7c2908209c9392e9366e1ae263e9032d3 uefi: fix fat12 diff -r 2f9336b7c290 -r 5d84fadfd928 tazlito --- a/tazlito Mon May 14 15:57:23 2018 +0200 +++ b/tazlito Wed May 16 10:03:24 2018 +0200 @@ -405,7 +405,7 @@ n=($1%16)*256+prev if (n!=0) c[pos+1]=n pos++ - prev=$1/16 + prev=int($1/16) state++ next } @@ -422,7 +422,7 @@ for (i=1;i<=pos;i+=2) { if (c[i]=="") c[i]=0 if (c[i+1]=="") c[i+1]=0 - if (fat==12) printf "0 %02X %02X %02X |\n",c[i]%256,(c[i+1]%16)*16+(c[i]/256)%256,(c[i+1]/16)%256 + if (fat==12) printf "0 %02X %1X%1X %02X |\n",c[i]%256,c[i+1]%16,(c[i]/256)%16,(c[i+1]/16)%256 else printf "0 %02X %02X %02X %02X |\n",c[i]%256,(c[i]/256)%256,c[i+1]%256,(c[i+1]/256)%256 } }' | hexdump -R | dd of="$1" seek=$((4*$efiblock+$fatsz+$resv)) \ @@ -457,13 +457,14 @@ stat -c "%s %n" "$i" done 2> /dev/null cat >> $basedir/efi/boot/startup.nsh </dev/null) | awk ' BEGIN { @@ -525,12 +526,12 @@ mkdir -p /tmp/mnt$$ mount -o loop $basedir/boot/isolinux/efi.img /tmp/mnt$$ ( cd $basedir; find efi -type d | cpio -o -H newc ) | \ - ( cd /tmp/mnt$$ ; cpio -idmu ) + ( cd /tmp/mnt$$ ; cpio -idmu 2> /dev/null ) sync dd if=$basedir/boot/isolinux/efi.img of=/tmp/fat$$ \ skip=$rsect bs=512 count=$fsect 2> /dev/null ( cd $basedir; find efi -type f | cpio -o -H newc ) | \ - ( cd /tmp/mnt$$ ; cpio -idmu ) + ( cd /tmp/mnt$$ ; cpio -idmu 2> /dev/null ) umount /tmp/mnt$$ cat /tmp/fat$$ /tmp/fat$$ | dd of=$basedir/boot/isolinux/efi.img \ seek=$rsect bs=512 conv=notrunc 2> /dev/null @@ -2030,7 +2031,7 @@ ;; - extract-distro) + extract-distro|extract-iso) # Extract an ISO image to a directory and rebuild the LiveCD tree. # check_root @@ -2079,13 +2080,13 @@ done action 'Copying the rootfs...' - cp $TMP_DIR/boot/rootfs*.?z "$TARGET/rootcd/boot" + cp $TMP_DIR/boot/rootfs*.?z* "$TARGET/rootcd/boot" status # Extract initramfs. cd "$TARGET/rootfs" action 'Extracting the rootfs...' - for i in $(ls -r $TARGET/rootcd/boot/rootfs*); do + for i in $(ls -r $TARGET/rootcd/boot/rootfs*z); do extract_rootfs "$i" "$TARGET/rootfs" done # unpack /usr