aux-file-data.sh 958 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. # Bootscript data
  8. bootscripts=$(ls lfs-bootscripts*.bz2)
  9. base=$(basename $bootscripts .tar.bz2)
  10. bootsize=$(ls -lk $bootscripts | cut -f5 -d" ")
  11. bootmd5=$(md5sum $bootscripts | cut -f1 -d" ")
  12. # Figure intalled size of bootscripts
  13. TOPDIR=$(pwd)
  14. TMP_DIR=$(mktemp -d /tmp/lfsbootfiles.XXXXXX)
  15. pushd $TMP_DIR > /dev/null
  16. tar -xf $TOPDIR/$bootscripts
  17. bootinstallsize=$(du -sk $TMP_DIR | cut -f1)
  18. popd > /dev/null
  19. rm -rf $TMP_DIR
  20. sed -i -e s/BOOTSCRIPTS-SIZE/$bootsize/ \
  21. -e s/BOOTSCRIPTS-INSTALL-KB/$bootinstallsize/ \
  22. -e s/BOOTSCRIPTS-MD5SUM/$bootmd5/ $FILE
  23. ############
  24. # udev configuration tarball data
  25. udevconfig=$(ls udev-config*.bz2)
  26. udevsize=$(ls -lk $udevconfig | cut -f5 -d" ")
  27. udevmd5=$(md5sum $udevconfig | cut -f1 -d" ")
  28. sed -i -e s/UDEV-SIZE/$udevsize/ \
  29. -e s/UDEV-MD5SUM/$udevmd5/ $FILE