scripts: New file sort-stage1-manifests

Signed-off-by: Geoff Levand <geoff@infradead.org>
This commit is contained in:
Geoff Levand
2017-09-22 13:50:26 -07:00
parent 4c4c9a3279
commit 61456e64a6
2 changed files with 30 additions and 0 deletions

View File

@ -80,6 +80,8 @@ done
Usually, there are some updated libraries which need an update on their version numbers.
In our case, there are no updates and all the files mentioned in the manifest are present in the updated Container Linux image.
If any of the manifest files have been modified run the script `scripts/sort-stage1-manifests.sh` to keep the manifest files in sorted order.
## Update the coreos flavor version used by the build system
In the file `stage1/usr_from_coreos/coreos-common.mk`, we define which Container Linux image version we use for the coreos flavor.

View File

@ -0,0 +1,28 @@
#!/bin/bash
# Usage: [TOP_DIR=directory] sort-stage1-manifests.sh
set -e
: ${TOP_DIR:="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"}
tmp=$(mktemp --tmpdir manifest-sort-XXX)
cleanup () {
rm -f ${tmp}
}
trap cleanup EXIT
boards='amd64-usr arm64-usr'
flavors='usr_from_coreos usr_from_kvm'
for board in ${boards}; do
for flavor in ${flavors}; do
dir="${TOP_DIR}/stage1/${flavor}/manifest-${board}.d/"
files=$(find ${dir} -type f -name '*.manifest')
for f in ${files}; do
cat ${f} | sort | uniq | sed '/^$/d' > ${tmp}
cp ${tmp} ${f}
done
done
done