Skip to content

Commit

Permalink
add how to rename chroot doc
Browse files Browse the repository at this point in the history
Signed-off-by: Li Chaoran <[email protected]>
  • Loading branch information
pkking committed Jun 28, 2023
1 parent 02aa009 commit 16790de
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
37 changes: 37 additions & 0 deletions doc/how_to_rename_chroot.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.. _how_to_rename_chroot:

How to rename a chroot
================================

In the openEuler copr instance, we unfortunately need to rename a chroot.

The operations need to be done can be described as:

* [backend]: symlinks all the old chroot dir in resultdir to the new one
* [frontend]: change the os_release/os_version in frontend table mock_chroot
* [builder]: add new mock chroot configs to all builder

To be more precisely, here are some operation details:

*Suppose you have a chroot named* ``foo-bar-x86_64`` *and want to rename it to* ``new-foo_bar-x86_64``

1. For backend: login as copr user to backend node, and run:

.. code-block:: console
$ /usr/bin/copr-rename-chroot --real-run --pair PAIRS foo-bar-x86_64:new-foo_bar-x86_64
Explain: the ``/usr/bin/copr-rename-chroot`` script will rename the dir in ``destdir`` from ``foo-bar-x86_64`` to ``new-foo_bar-x86_64``

.. warning::

You may note the ``--real-run`` arguement, without it the script will perform a dry-run and just print the operations out.
Run the command without ``real-run`` until you make sure all the operations are expected!

2. For frontend: login to the frontend database and run:

.. code-block:: sql
coprdb# UPDATE mock_chroot SET os_version='foo_bar', os_release='new' WHERE os_version='foo' AND os_release='bar' AND arch='x86_64'
3. For builder: update your mock package to ensure the ``new-foo_bar-x86_64.cfg`` existed!
1 change: 1 addition & 0 deletions doc/maintenance_documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This section contains information about maintenance topics. You may also be inte
how_to_upgrade_builders
how_to_upgrade_persistent_instances
How to manage active chroots <how_to_manage_chroots>
How to rename chroots <_how_to_rename_chroot>


.. toctree::
Expand Down
2 changes: 1 addition & 1 deletion doc/seeddb.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _seeddb:

Populate DB with pruduction data
Populate DB with production data
================================

While setting your local development environment, you might want to
Expand Down

0 comments on commit 16790de

Please sign in to comment.