aux-file-data.sh 743 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. if [ $# -lt 1 ] ; then
  3. echo "This script needs the location of the xml file to update"
  4. exit 1
  5. fi
  6. FILE=$1
  7. ./make-aux-files.sh
  8. # Bootscript data
  9. bootscripts=$(ls lfs-bootscripts*.xz)
  10. base=$(basename $bootscripts .tar.xz)
  11. bootsize=$(ls -l --block-size=1024 $bootscripts | cut -f5 -d" ")
  12. bootmd5=$(md5sum $bootscripts | cut -f1 -d" ")
  13. # Figure intalled size of bootscripts
  14. TOPDIR=$(pwd)
  15. TMP_DIR=$(mktemp -d /tmp/lfsbootfiles.XXXXXX)
  16. pushd $TMP_DIR > /dev/null
  17. tar -xf $TOPDIR/$bootscripts
  18. bootinstallsize=$(du -sk $TMP_DIR | cut -f1)
  19. popd > /dev/null
  20. rm -rf $TMP_DIR
  21. sed -i -e s/BOOTSCRIPTS-SIZE/$bootsize/ \
  22. -e s/BOOTSCRIPTS-INSTALL-KB/$bootinstallsize/ \
  23. -e s/BOOTSCRIPTS-MD5SUM/$bootmd5/ $FILE