Line | |
---|
1 | #!/bin/bash
|
---|
2 |
|
---|
3 | if [ $# -lt 1 ] ; then
|
---|
4 | echo "This script needs the location of the xml file to update"
|
---|
5 | exit 1
|
---|
6 | fi
|
---|
7 |
|
---|
8 | FILE=$1
|
---|
9 |
|
---|
10 | # Bootscript data
|
---|
11 | bootscripts=$(ls lfs-bootscripts*.bz2)
|
---|
12 | base=$(basename $bootscripts .tar.bz2)
|
---|
13 | bootsize=$(ls -lk $bootscripts | cut -f5 -d" ")
|
---|
14 | bootmd5=$(md5sum $bootscripts | cut -f1 -d" ")
|
---|
15 |
|
---|
16 | # Figure intalled size of bootscripts
|
---|
17 | TOPDIR=$(pwd)
|
---|
18 | TMP_DIR=$(mktemp -d /tmp/lfsbootfiles.XXXXXX)
|
---|
19 | pushd $TMP_DIR > /dev/null
|
---|
20 | tar -xf $TOPDIR/$bootscripts
|
---|
21 | bootinstallsize=$(du -sk $TMP_DIR | cut -f1)
|
---|
22 | popd > /dev/null
|
---|
23 | rm -rf $TMP_DIR
|
---|
24 |
|
---|
25 | sed -i -e s/BOOTSCRIPTS-SIZE/$bootsize/ \
|
---|
26 | -e s/BOOTSCRIPTS-INSTALL-KB/$bootinstallsize/ \
|
---|
27 | -e s/BOOTSCRIPTS-MD5SUM/$bootmd5/ $FILE
|
---|
28 |
|
---|
29 | ############
|
---|
30 |
|
---|
31 | # udev configuration tarball data
|
---|
32 | udevconfig=$(ls udev-config*.bz2)
|
---|
33 | udevsize=$(ls -lk $udevconfig | cut -f5 -d" ")
|
---|
34 | udevmd5=$(md5sum $udevconfig | cut -f1 -d" ")
|
---|
35 |
|
---|
36 | sed -i -e s/UDEV-SIZE/$udevsize/ \
|
---|
37 | -e s/UDEV-MD5SUM/$udevmd5/ $FILE
|
---|
38 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.