Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Release Engineering
Public
toolkit
Commits
6af12937
Verified
Commit
6af12937
authored
Jul 12, 2021
by
Louis Abel
📺
Browse files
additional fixes
parent
b449dc51
Pipeline
#44
passed with stage
in 30 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
sync/common_8
View file @
6af12937
...
@@ -59,3 +59,59 @@ MODS=(
...
@@ -59,3 +59,59 @@ MODS=(
AppStream
AppStream
PowerTools
PowerTools
)
)
# functions
# Note, EL8 and EL9 may not be the same, do not put in 'common'
function treeinfoFixer() {
BaseOSArch="${1}"
TREEINFO_VAR="${STAGING_ROOT}/${RELEASE_DIR}/BaseOS/${BaseOSArch}/os/.treeinfo"
PRISTINE_TREE="${STAGING_ROOT}/${RELEASE_DIR}/BaseOS/${BaseOSArch}/os/.treeinfo-pristine"
test -f "${PRISTINE_TREE}"
pris_retval=$?
if [ "$pris_retval" -eq 0 ]; then
/bin/cp "${PRISTINE_TREE}" "${TREEINFO_VAR}"
else
echo "WARNING: We do not have a pristine treeinfo to copy from"
fi
}
# Note, EL8 and EL9 may not be the same, do not put in 'common'
function treeinfoModder() {
BaseOSArch="${1}"
TREEINFO_VAR="${STAGING_ROOT}/${RELEASE_DIR}/BaseOS/${BaseOSArch}/os/.treeinfo"
PRISTINE_TREE="${STAGING_ROOT}/${RELEASE_DIR}/BaseOS/${BaseOSArch}/os/.treeinfo-pristine"
test -f "${TREEINFO_VAR}"
treeinfo_retval=$?
test -x /usr/bin/python3
python_retval=$?
# There is an awk way to do this, but it was easier to implement python and
# cat heredoc together. It felt cleaner. This was a trick I had used in a
# previous life when I had to admin Solaris systems, and I needed a way to
# add a solaris 10 system into FreeIPA (it was not fun, let me tell you). But
# the take away is I learned something kind of on the fly and well, it worked.
# Emails should have stamps.
if [ "$treeinfo_retval" -eq 0 ] && [ "$python_retval" -eq 0 ]; then
cat <<EOF | /usr/bin/python3
from configparser import ConfigParser
config = ConfigParser()
config.read('${TREEINFO_VAR}')
config.set('tree', 'variants', 'BaseOS,AppStream')
config.add_section('variant-AppStream')
config.set('variant-AppStream', 'id', 'AppStream')
config.set('variant-AppStream', 'name', 'AppStream')
config.set('variant-AppStream', 'type', 'variant')
config.set('variant-AppStream', 'uid', 'AppStream')
config.set('variant-AppStream', 'packages', '../../../AppStream/${BaseOSArch}/os/Packages')
config.set('variant-AppStream', 'repository', '../../../AppStream/${BaseOSArch}/os/')
with open('${TREEINFO_VAR}', 'w') as configfile:
config.write(configfile)
EOF
else
echo "${TREEINFO_VAR}, or python3 does not exist on this system."
fi
/bin/cp "${TREEINFO_VAR}" "${PRISTINE_TREE}"
}
export -f treeinfoFixer
export -f treeinfoModder
sync/minor-release-sync-to-staging.sh
View file @
6af12937
...
@@ -47,6 +47,11 @@ for ARCH in "${ARCHES[@]}"; do
...
@@ -47,6 +47,11 @@ for ARCH in "${ARCHES[@]}"; do
done
done
done
done
# fix treeinfo
for
ARCH
in
"
${
ARCHES
[@]
}
"
;
do
treeinfoModder
"
${
ARCH
}
"
done
# sign all repos
# sign all repos
test
-f
$(
dirname
"
$0
"
)
/sign-repos-only.sh
test
-f
$(
dirname
"
$0
"
)
/sign-repos-only.sh
ret_val
=
$?
ret_val
=
$?
...
...
sync/prep-staging-8.sh
View file @
6af12937
...
@@ -104,59 +104,5 @@ for x in "${ARCHES[@]}"; do
...
@@ -104,59 +104,5 @@ for x in "${ARCHES[@]}"; do
done
done
echo
"** Fix variants"
echo
"** Fix variants"
TREEINFO_VAR
=
"
${
STAGING_ROOT
}
/
${
RELEASE_DIR
}
/BaseOS/
${
x
}
/os/.treeinfo"
treeinfoFixer
"
${
x
}
"
IMAGES_VAR
=
"
${
STAGING_ROOT
}
/
${
RELEASE_DIR
}
/BaseOS/
${
x
}
/os/images"
test
-f
"
${
TREEINFO_VAR
}
"
treeinfo_retval
=
$?
test
-x
/usr/bin/python3
python_retval
=
$?
# There is an awk way to do this, but it was easier to implement python and
# cat heredoc together. It felt cleaner. This was a trick I had used in a
# previous life when I had to admin Solaris systems, and I needed a way to
# add a solaris 10 system into FreeIPA (it was not fun, let me tell you). But
# the take away is I learned something kind of on the fly and well, it worked.
# Emails should have stamps.
if
[
"
$treeinfo_retval
"
-eq
0
]
&&
[
"
$python_retval
"
-eq
0
]
;
then
# shellcheck disable=SC2086
BOOTISO_CHECKSUM
=
"
$(
sha256sum
${
IMAGES_VAR
}
/boot.iso |
cut
-d
' '
-f1
)
"
# shellcheck disable=SC2086
EFIBOOT_CHECKSUM
=
"
$(
sha256sum
${
IMAGES_VAR
}
/efiboot.img |
cut
-d
' '
-f1
)
"
# shellcheck disable=SC2086
INSTALLIMG_CHECKSUM
=
"
$(
sha256sum
${
IMAGES_VAR
}
/install.img |
cut
-d
' '
-f1
)
"
# shellcheck disable=SC2086
INITRD_CHECKSUM
=
"
$(
sha256sum
${
IMAGES_VAR
}
/pxeboot/initrd.img |
cut
-d
' '
-f1
)
"
# shellcheck disable=SC2086
VMLINUZ_CHECKSUM
=
"
$(
sha256sum
${
IMAGES_VAR
}
/pxeboot/vmlinuz |
cut
-d
' '
-f1
)
"
cat
<<
EOF
| /usr/bin/python3
from configparser import ConfigParser
config = ConfigParser()
config.read('
${
TREEINFO_VAR
}
')
config.set('tree', 'variants', 'BaseOS,AppStream')
config.add_section('variant-AppStream')
config.set('variants-AppStream', 'id', 'AppStream')
config.set('variants-AppStream', 'name', 'AppStream')
config.set('variants-AppStream', 'type', 'variant')
config.set('variants-AppStream', 'uid', 'AppStream')
config.set('variants-AppStream', 'packages', '../../../AppStream/
${
x
}
/os/Packages')
config.set('variants-AppStream', 'repository', '../../../AppStream/
${
x
}
/os/')
config.add_section('images-
${
x
}
')
config.set('images-
${
x
}
', 'boot.iso', 'images/boot.iso')
config.set('images-
${
x
}
', 'efiboot.img', 'images/efiboot.img')
config.set('images-
${
x
}
', 'initrd', 'images/pxeboot/initrd.img')
config.set('images-
${
x
}
', 'kernel', 'images/pxeboot/vmlinuz')
config.add_section('stage2')
config.set('stage2', 'mainimage', 'images/install.img')
config.add_section('checksums')
config.set('checksums', 'images/boot.iso', 'sha256:
${
BOOTISO_CHECKSUM
}
')
config.set('checksums', 'images/efiboot.img', 'sha256:
${
EFIBOOT_CHECKSUM
}
')
config.set('checksums', 'images/install.img', 'sha256:
${
INSTALLIMG_CHECKSUM
}
')
config.set('checksums', 'images/pxeboot/initrd.img', 'sha256:
${
INITRD_CHECKSUM
}
')
config.set('checksums', 'images/pxeboot/vmlinuz', 'sha256:
${
VMLINUZ_CHECKSUM
}
')
with open('
${
TREEINFO_VAR
}
', 'w') as configfile:
config.write(configfile)
EOF
else
echo
"
${
TREEINFO_VAR
}
or python3 does not exist on this system."
fi
done
done
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