[elbe-devel] [PATCH 7/8] elbepack: commands: drop internal mkcdrom command

Thomas Weißschuh thomas.weissschuh at linutronix.de
Mon Jul 8 11:24:00 CEST 2024


The mkcdrom command is a remnant from the time before the SOAP service
managing all buildenv interaction.
Nowadays it is only a maintenance burden, remove it.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 debian/python3-elbe-buildenv.install |   1 -
 docs/elbe-mkcdrom.rst                |  92 ------------------------------
 docs/elbe.rst                        |   4 --
 elbepack/commands/mkcdrom.py         | 107 -----------------------------------
 newsfragments/+mkcdrom.removal.rst   |   1 +
 5 files changed, 1 insertion(+), 204 deletions(-)

diff --git a/debian/python3-elbe-buildenv.install b/debian/python3-elbe-buildenv.install
index 07139432f151..dbc4a5e928dc 100644
--- a/debian/python3-elbe-buildenv.install
+++ b/debian/python3-elbe-buildenv.install
@@ -3,7 +3,6 @@ usr/lib/python3.*/*-packages/elbepack/commands/chroot.py
 usr/lib/python3.*/*-packages/elbepack/commands/db.py
 usr/lib/python3.*/*-packages/elbepack/commands/fetch_initvm_pkgs.py
 usr/lib/python3.*/*-packages/elbepack/commands/gen_update.py
-usr/lib/python3.*/*-packages/elbepack/commands/mkcdrom.py
 usr/lib/python3.*/*-packages/elbepack/makofiles/environment-setup-elbe.mako
 usr/lib/python3.*/*-packages/elbepack/makofiles/toolchain-shar-extract.sh.mako
 usr/lib/python3.*/*-packages/elbepack/db.py
diff --git a/docs/elbe-mkcdrom.rst b/docs/elbe-mkcdrom.rst
deleted file mode 100644
index 78395a179ecf..000000000000
--- a/docs/elbe-mkcdrom.rst
+++ /dev/null
@@ -1,92 +0,0 @@
-************************
-elbe-mkcdrom
-************************
-
-NAME
-====
-
-elbe-mkcdrom - Create an ISO image containing binary and/or source
-packages used in the given project.
-
-SYNOPSIS
-========
-
-   ::
-
-      elbe mkcdrom \
-              [ --arch <arch> ] \
-              [ --binary ] \
-              [ --buildtype <type> ] \
-              [ --codename <codename> ] \
-              [ --log <logfile> ] \
-              [ --skip-validation ] \
-              [ --source ] \
-              [ --rfs-only ] \
-              <builddir>
-
-DESCRIPTION
-===========
-
-*elbe mkcdrom* creates an ISO image containing the binary and/or source
-packages used in the given project. This command has to be run as root
-**inside the Elbe build VM**.
-
-OPTIONS
-=======
-
---arch <arch>
-   Override the architecture.
-
---binary
-   Build an ISO file for a binary CD-ROM. It will contain all installed
-   packages, including those pulled in by debootstrap (except if
-   *--rfs-only* is used, see down below) and those installed from
-   additional sources. It can also be used as an installation source,
-   see ``elbe-setcdrom(1)``.
-
---buildtype <type>
-   Override the build type specified in the XML file.
-
---codename <codename>
-   Override the Debian code name.
-
---log <logfile>
-   Write a log file.
-
---skip-validation
-   Do not validate the *source.xml* file in <builddir> against the XML
-   schema (Not recommended).
-
---source
-   Build an ISO image for a source CD-ROM.
-
---rfs-only
-   <builddir> is not a build directory, but the path to a root
-   filesystem. In that case, the packages pulled in only by debootstrap
-   will not be included in the ISO image for binary CD-ROM.
-
-<builddir>
-   The path to the Elbe build directory to create the ISO image for. It
-   is also possible to specify the path to the root filesystem instead
-   of the build directory. In that case the *--rfs-only* option has to
-   be given.
-
-EXAMPLES
-========
-
--  Build a binary CD-ROM image for the project in foo/myproject
-
-   ::
-
-      # elbe mkcdrom --binary foo/myproject
-
--  Build a source CD-ROM image for the project in foo/myproject
-
-   ::
-
-      # elbe mkcdrom --source foo/myproject
-
-ELBE
-====
-
-Part of the ``elbe(1)`` suite
diff --git a/docs/elbe.rst b/docs/elbe.rst
index b40b8accbb0e..78ee7903e1f2 100644
--- a/docs/elbe.rst
+++ b/docs/elbe.rst
@@ -53,10 +53,6 @@ Elbe COMMANDS
 ``elbe-init(1)``
    create a project for an Elbe build virtual machine.
 
-``elbe-mkcdrom(1)``
-   create an ISO image containing all binary or source packages used in
-   the given project.
-
 ``elbe-pbuilder(1)``
    generate a pbuilder environment and build packages within it
 
diff --git a/elbepack/commands/mkcdrom.py b/elbepack/commands/mkcdrom.py
deleted file mode 100644
index 1cdafb33dfdd..000000000000
--- a/elbepack/commands/mkcdrom.py
+++ /dev/null
@@ -1,107 +0,0 @@
-# ELBE - Debian Based Embedded Rootfilesystem Builder
-# SPDX-License-Identifier: GPL-3.0-or-later
-# SPDX-FileCopyrightText: 2014-2017 Linutronix GmbH
-# SPDX-FileCopyrightText: 2015 Matthias Buehler <Matthias.Buehler at de.trumpf.com>
-
-import logging
-import os
-import sys
-from optparse import OptionParser
-
-from elbepack.cdroms import CDROM_SIZE, mk_binary_cdrom, mk_source_cdrom
-from elbepack.efilesystem import ChRootFilesystem
-from elbepack.elbeproject import ElbeProject
-from elbepack.elbexml import ValidationError
-from elbepack.log import elbe_logging
-from elbepack.rpcaptcache import get_rpcaptcache
-
-
-def run_command(argv):
-
-    # pylint disable=too-many-statements
-
-    oparser = OptionParser(usage='usage: %prog mkcdrom [options] <builddir>')
-    oparser.add_option('--skip-validation', action='store_true',
-                       dest='skip_validation', default=False,
-                       help='Skip xml schema validation')
-    oparser.add_option('--buildtype', dest='buildtype',
-                       help='Override the buildtype')
-    oparser.add_option('--arch', dest='arch',
-                       help='Override the architecture')
-    oparser.add_option('--codename', dest='codename',
-                       help='Override the codename')
-    oparser.add_option('--init_codename', dest='init_codename',
-                       help='Override the initvm codename')
-    oparser.add_option('--rfs-only', action='store_true',
-                       dest='rfs_only', default=False,
-                       help='builddir points to RFS')
-    oparser.add_option('--log', dest='log',
-                       help='Log to filename')
-    oparser.add_option('--binary', action='store_true',
-                       dest='binary', default=False,
-                       help='build binary cdrom')
-    oparser.add_option('--source', action='store_true',
-                       dest='source', default=False,
-                       help='build source cdrom')
-    oparser.add_option(
-        '--cdrom-size',
-        action='store',
-        dest='cdrom_size',
-        default=CDROM_SIZE,
-        help='Source ISO CD size in bytes')
-
-    (opt, args) = oparser.parse_args(argv)
-
-    if len(args) != 1:
-        print('wrong number of arguments', file=sys.stderr)
-        oparser.print_help()
-        sys.exit(74)
-
-    with elbe_logging({'files': opt.log}):
-
-        if not opt.rfs_only:
-            try:
-                project = ElbeProject(args[0],
-                                      override_buildtype=opt.buildtype,
-                                      skip_validate=opt.skip_validation)
-            except ValidationError:
-                logging.exception('XML validation failed.  Bailing out')
-                sys.exit(75)
-
-            builddir = project.builddir
-            rfs = project.buildenv.rfs
-            xml = project.xml
-            arch = xml.text('project/arch', key='arch')
-            codename = xml.text('project/suite')
-            init_codename = xml.get_initvm_codename()
-        else:
-            builddir = os.path.abspath(os.path.curdir)
-            rfs = ChRootFilesystem(args[0])
-            arch = opt.arch
-            codename = opt.codename
-            init_codename = opt.init_codename
-            xml = None
-
-        generated_files = []
-        if opt.source:
-            with rfs:
-                cache = get_rpcaptcache(rfs, arch)
-                components = {'main': (rfs,
-                                       cache,
-                                       cache.get_corresponding_source_packages())}
-                generated_files += mk_source_cdrom(components, codename,
-                                                   init_codename, builddir,
-                                                   opt.cdrom_size)
-
-        if opt.binary:
-            with rfs:
-                generated_files += mk_binary_cdrom(rfs,
-                                                   arch,
-                                                   codename,
-                                                   init_codename,
-                                                   xml,
-                                                   builddir)
-
-        logging.info('Image Build finished.')
-        logging.info('Files generated:\n%s',
-                     '\n'.join([str(f) for f in generated_files]))
diff --git a/newsfragments/+mkcdrom.removal.rst b/newsfragments/+mkcdrom.removal.rst
new file mode 100644
index 000000000000..18f28c11efb9
--- /dev/null
+++ b/newsfragments/+mkcdrom.removal.rst
@@ -0,0 +1 @@
+The *internal* command `elbe mkcdrom`.

-- 
2.45.2



More information about the elbe-devel mailing list