Close issue #267

Add "uninstall" script to `get` file, "uninstall" markdown to `README.md`, "remember install path" script to `templates/latest/cri-o/bundle/install`.

Signed-off-by: anlex N <1293006794@qq.com>
This commit is contained in:
anlex N 2025-08-13 10:00:44 +03:00
parent 1a8a15e28b
commit 5a2b944945
3 changed files with 75 additions and 1 deletions

View File

@ -38,6 +38,7 @@ dedicated repository, following official Kubernetes guidelines by using the
- [Bootstrap a cluster](#bootstrap-a-cluster-1)
- [Publishing](#publishing)
- [Using the static binary bundles directly](#using-the-static-binary-bundles-directly)
- [Uninstall the static binary bundles](#uninstall-the-static-binary-bundles)
- [CRI-O bundles as OCI artifacts](#cri-o-bundles-as-oci-artifacts)
- [More to read](#more-to-read)
<!-- /toc -->
@ -344,6 +345,12 @@ like the bundle itself, but suffixed with `.spdx`:
https://storage.googleapis.com/cri-o/artifacts/cri-o.$ARCH.$REV.tar.gz.spdx
```
## Uninstall the static binary bundles
```console
> curl https://raw.githubusercontent.com/cri-o/packaging/main/get | bash -s -- -u
```
## CRI-O bundles as OCI artifacts
The [`obs` GitHub action workflow](https://github.com/cri-o/packaging/actions/workflows/obs.yml)

43
get
View File

@ -18,10 +18,21 @@ usage() {
printf " -h\tShow this help message\n"
}
uninstall() {
while read -r file; do
echo "$file will be uninstalled."
rm -f "$file"
echo "$file have been uninstalled."
done <~/.crio-install
rm -f ~/.crio-install
echo "uninstall is finished!"
}
parse_args() {
echo "Welcome to the CRI-O install script!"
while getopts 'a:b:t:h' OPTION; do
while getopts 'a:b:t:h:u' OPTION; do
case "$OPTION" in
a)
ARCH="$OPTARG"
@ -39,6 +50,10 @@ parse_args() {
usage
exit 0
;;
u)
uninstall
exit 0
;;
?)
usage
exit 1
@ -241,6 +256,32 @@ sed -i 's;/usr/bin;'"$DESTDIR$BINDIR"';g' "$DESTDIR$ETC_CRIO_DIR/crio.conf.d/10-
sed -i 's;/usr/libexec;'"$DESTDIR$LIBEXECDIR"';g' "$DESTDIR$ETC_CRIO_DIR/crio.conf.d/10-crio.conf"
sed -i 's;/etc/crio;'"$DESTDIR$ETC_CRIO_DIR"';g' "$DESTDIR$ETC_CRIO_DIR/crio.conf.d/10-crio.conf"
touch ~/.crio-install
cat <<EOF | tee ~/.crio-install
$DESTDIR$OPT_CNI_BIN_DIR/*
$DESTDIR$CNIDIR/10-crio-bridge.conflist.disabled
$DESTDIR$LIBEXEC_CRIO_DIR/conmon
$DESTDIR$LIBEXEC_CRIO_DIR/conmonrs
$DESTDIR$LIBEXEC_CRIO_DIR/crun
$DESTDIR$LIBEXEC_CRIO_DIR/runc
$DESTDIR$BINDIR/crio
$DESTDIR$BINDIR/pinns
$DESTDIR$BINDIR/crictl
$DESTDIR$ETCDIR/crictl.yaml
$DESTDIR$OCIDIR/crio-umount.conf
$DESTDIR$SYSCONFIGDIR/crio
$DESTDIR$ETC_CRIO_DIR/policy.json
$DESTDIR$ETC_CRIO_DIR/crio.conf.d/10-crio.conf
$DESTDIR$MANDIR/man5/crio.conf.5
$DESTDIR$MANDIR/man5/crio.conf.d.5
$DESTDIR$MANDIR/man8/crio.8
$DESTDIR$BASHINSTALLDIR/crio
$DESTDIR$FISHINSTALLDIR/crio.fish
$DESTDIR$ZSHINSTALLDIR/_crio
$DESTDIR$SYSTEMDDIR/crio.service
$DESTDIR$CONTAINERS_REGISTRIES_CONFD_DIR/registries.conf
EOF
if [ -n "$SELINUX" ]; then
if command -v chcon >/dev/null; then
chcon -u system_u -r object_r -t container_runtime_exec_t \

View File

@ -75,6 +75,32 @@ sed -i 's;/usr/bin;'"$DESTDIR$BINDIR"';g' "$DESTDIR$ETC_CRIO_DIR/crio.conf.d/10-
sed -i 's;/usr/libexec;'"$DESTDIR$LIBEXECDIR"';g' "$DESTDIR$ETC_CRIO_DIR/crio.conf.d/10-crio.conf"
sed -i 's;/etc/crio;'"$DESTDIR$ETC_CRIO_DIR"';g' "$DESTDIR$ETC_CRIO_DIR/crio.conf.d/10-crio.conf"
touch ~/.crio-install
cat <<EOF | tee ~/.crio-install
$DESTDIR$OPT_CNI_BIN_DIR/*
$DESTDIR$CNIDIR/10-crio-bridge.conflist.disabled
$DESTDIR$LIBEXEC_CRIO_DIR/conmon
$DESTDIR$LIBEXEC_CRIO_DIR/conmonrs
$DESTDIR$LIBEXEC_CRIO_DIR/crun
$DESTDIR$LIBEXEC_CRIO_DIR/runc
$DESTDIR$BINDIR/crio
$DESTDIR$BINDIR/pinns
$DESTDIR$BINDIR/crictl
$DESTDIR$ETCDIR/crictl.yaml
$DESTDIR$OCIDIR/crio-umount.conf
$DESTDIR$SYSCONFIGDIR/crio
$DESTDIR$ETC_CRIO_DIR/policy.json
$DESTDIR$ETC_CRIO_DIR/crio.conf.d/10-crio.conf
$DESTDIR$MANDIR/man5/crio.conf.5
$DESTDIR$MANDIR/man5/crio.conf.d.5
$DESTDIR$MANDIR/man8/crio.8
$DESTDIR$BASHINSTALLDIR/crio
$DESTDIR$FISHINSTALLDIR/crio.fish
$DESTDIR$ZSHINSTALLDIR/_crio
$DESTDIR$SYSTEMDDIR/crio.service
$DESTDIR$CONTAINERS_REGISTRIES_CONFD_DIR/registries.conf
EOF
if [ -n "$SELINUX" ]; then
if command -v chcon >/dev/null; then
chcon -u system_u -r object_r -t container_runtime_exec_t \