allow specifying a track to follow in inject-subiquity-snap.sh

This commit is contained in:
Michael Hudson-Doyle 2019-03-06 13:28:21 +13:00
parent 8b495cb8f1
commit cb2203be10
1 changed files with 8 additions and 7 deletions

View File

@ -10,7 +10,8 @@ source_filesystem=
# Path on disk to a custom snapd (e.g. one that trusts the test keys) # Path on disk to a custom snapd (e.g. one that trusts the test keys)
snapd_pkg= snapd_pkg=
store_url= store_url=
while getopts ":ifc:s:n:p:u:" opt; do tracking=stable
while getopts ":ifc:s:n:p:u:t:" opt; do
case "${opt}" in case "${opt}" in
i) i)
interactive=yes interactive=yes
@ -33,6 +34,9 @@ while getopts ":ifc:s:n:p:u:" opt; do
u) u)
store_url="${OPTARG}" store_url="${OPTARG}"
;; ;;
t)
tracking="${OPTARG}"
;;
\?) \?)
echo "Invalid option: -$OPTARG" >&2 echo "Invalid option: -$OPTARG" >&2
exit 1 exit 1
@ -107,6 +111,7 @@ subiquity_snap = {
"name": "subiquity", "name": "subiquity",
"classic": True, "classic": True,
"file": sys.argv[1], "file": sys.argv[1],
"channel": sys.argv[3],
} }
if sys.argv[2] == "": if sys.argv[2] == "":
@ -114,17 +119,13 @@ if sys.argv[2] == "":
for snap in old_seed["snaps"]: for snap in old_seed["snaps"]:
if snap["name"] == "subiquity": if snap["name"] == "subiquity":
new_snaps.append({ new_snaps.append(subiquity_snap)
"name": "subiquity",
"classic": True,
"file": sys.argv[1],
})
else: else:
new_snaps.append(snap) new_snaps.append(snap)
with open("new_installer/var/lib/snapd/seed/seed.yaml", "w") as fp: with open("new_installer/var/lib/snapd/seed/seed.yaml", "w") as fp:
yaml.dump({"snaps": new_snaps}, fp) yaml.dump({"snaps": new_snaps}, fp)
' $SUBIQUITY_SNAP $SUBIQUITY_ASSERTION ' $SUBIQUITY_SNAP $SUBIQUITY_ASSERTION $tracking
rm -f new_installer/var/lib/snapd/seed/assertions/subiquity*.assert rm -f new_installer/var/lib/snapd/seed/assertions/subiquity*.assert
rm -f new_installer/var/lib/snapd/seed/snaps/subiquity*.snap rm -f new_installer/var/lib/snapd/seed/snaps/subiquity*.snap