Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
initramfs-with-mca
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
initramfs-with-mca
Commits
3c4d9ded
Commit
3c4d9ded
authored
Dec 12, 2022
by
Ophélie Gagnard
Committed by
Ophélie Gagnard
Mar 21, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
generation: Improve shadir metadata upload.
parent
d8dc19a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletion
+22
-1
generation/40upload-image.sh
generation/40upload-image.sh
+22
-1
No files found.
generation/40upload-image.sh
View file @
3c4d9ded
...
...
@@ -9,11 +9,32 @@ cd $GIT_ROOT
# define useful variables
source
generation/00env.sh
metadata_file
=
metadata.json
uefi_image_name
=
"
$(
uname
-s
|
tr
'[:upper:]'
'[:lower:]'
)
-
$(
uname
-r
)
_
${
MCA_NAME_AND_VERSION
}
_
${
FLB_NAME_AND_VERSION
}
_
${
SERVER_GROUP
}
"
.efi
sha_list
=
installation/images-sha512.list
hash_comment
=
"# KVM off + dummy ips, rd.neednet=1 LABEL=Root, in shadir"
networkcache-upload
--conf
../tls-access-to-shacache/test.cfg
--id
river
--file
"
$uefi_image_name
"
"server-group=
$SERVER_GROUP
"
"kernel-version=
$(
uname
-v
|
cut
-d
' '
-f4
)
"
"mca-version=
$MCA_VERSION
"
"flb-version=
$FLB_VERSION
"
"plg-version=
$PLG_VERSION
"
"timestamp=
$(
date
+%s
)
"
"comment=
$hash_comment
"
version_to_list
()
{
# take a version with no letters, and return a json list
# remove everything after "+" and "-", and separate numbers according to "."
python3
-c
"import sys; print(list(map(int, sys.argv[1].split(
\"
+
\"
)[0].split(
\"
-
\"
)[0].split(
\"
.
\"
))))"
"
$1
"
}
# the keys "file" and "urlmd5" are sometimes mandatory in shadir metadata
# and are defined here only for the sake of shadir compliance
json_metadata
=
"{
\
\"
server-group
\"
:
\"
$SERVER_GROUP
\"
,
\
\"
kernel-version
\"
:
\"
$(
version_to_list
$(
uname
-v
|
cut
-d
' '
-f4
))
\"
,
\
\"
mca-version
\"
:
\"
$(
version_to_list
$MCA_VERSION
)
\"
,
\
\"
flb-version
\"
:
\"
$(
version_to_list
$FLB_VERSION
)
\"
,
\
\"
plg-version
\"
:
\"
$(
version_to_list
$PLG_VERSION
)
\"
,
\
\"
timestamp
\"
:
$(
date
+%s
)
,
\
\"
comment
\"
:
\"
$hash_comment
\"
,
\
\"
file
\"
:
\"
notused
\"
,
\
\"
urlmd5
\"
:
\"
notused
\"
\
}"
echo
"
$json_metadata
"
>
"
$metadata_file
"
networkcache-upload
--conf
../tls-access-to-shacache/test.cfg
--id
river
--file
"
$uefi_image_name
"
--metadata
"
$metadata_file
"
echo
$(
sha512sum
"
$uefi_image_name
"
|
cut
-d
' '
-f1
)
"
$hash_comment
"
>>
"
$sha_list
"
git add
"
$sha_list
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment