summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdriaan de Groot <groot@kde.org>2019-04-29 08:49:53 -0400
committerAdriaan de Groot <groot@kde.org>2019-04-29 08:49:53 -0400
commit7d8b122835c31085ba4f12f9b8981ffb10764dfb (patch)
tree5f534d362abf6d97035a1bab6e12498a5dc414b1
parent6d073b675716647123480f52bf973618f03f9614 (diff)
[oemid] New module, stub
- OEMID is a module for configuring phase-0 things for an OEM, like batch-ID. This is just a stub. - Currently planned functionality is limited to just batch-ID.
-rw-r--r--CHANGES2
-rw-r--r--src/modules/oemid/CMakeLists.txt10
-rw-r--r--src/modules/oemid/OEMViewStep.cpp75
-rw-r--r--src/modules/oemid/OEMViewStep.h60
-rw-r--r--src/modules/oemid/oemid.conf7
5 files changed, 154 insertions, 0 deletions
diff --git a/CHANGES b/CHANGES
index cb4b0a7ce..c6a9c9a8b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -24,6 +24,8 @@ This release contains contributions from (alphabetically by first name):
## Modules ##
+ - *oemid* is a new module for configuring OEM phase-0 (image pre-mastering,
+ or pre-deployment) things. It has limited functionality at the moment.
- All Python modules now bail out gracefully on (at least some) bad
configurations, rather than raising an exception. The pre-release
scripts now test for exceptions to avoid shipping modules with
diff --git a/src/modules/oemid/CMakeLists.txt b/src/modules/oemid/CMakeLists.txt
new file mode 100644
index 000000000..be7c97c61
--- /dev/null
+++ b/src/modules/oemid/CMakeLists.txt
@@ -0,0 +1,10 @@
+calamares_add_plugin( oemid
+ TYPE viewmodule
+ EXPORT_MACRO PLUGINDLLEXPORT_PRO
+ SOURCES
+ OEMViewStep.cpp
+ LINK_PRIVATE_LIBRARIES
+ calamaresui
+ Qt5::Widgets
+ SHARED_LIB
+)
diff --git a/src/modules/oemid/OEMViewStep.cpp b/src/modules/oemid/OEMViewStep.cpp
new file mode 100644
index 000000000..8e038e7ff
--- /dev/null
+++ b/src/modules/oemid/OEMViewStep.cpp
@@ -0,0 +1,75 @@
+/* === This file is part of Calamares - <https://github.com/calamares> ===
+ *
+ * Copyright 2019, Adriaan de Groot <groot@kde.org>
+ *
+ * Calamares is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Calamares is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Calamares. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "OEMViewStep.h"
+
+#include "utils/Variant.h"
+
+#include <QLabel>
+
+OEMViewStep::OEMViewStep(QObject* parent)
+ : Calamares::ViewStep( parent )
+ , m_widget( nullptr )
+{
+}
+
+OEMViewStep::~OEMViewStep()
+{
+}
+
+bool OEMViewStep::isBackEnabled() const
+{
+ return true;
+}
+
+bool OEMViewStep::isNextEnabled() const
+{
+ return true;
+}
+
+bool OEMViewStep::isAtBeginning() const
+{
+ return true;
+}
+
+bool OEMViewStep::isAtEnd() const
+{
+ return true;
+}
+
+QString OEMViewStep::prettyName() const
+{
+ return tr( "OEM Configuration" );
+}
+
+QWidget * OEMViewStep::widget()
+{
+ return nullptr; // m_widget;
+}
+
+Calamares::JobList OEMViewStep::jobs() const
+{
+ return Calamares::JobList();
+}
+
+void OEMViewStep::setConfigurationMap(const QVariantMap& configurationMap)
+{
+ m_batch = CalamaresUtils::getString( configurationMap, "batch-identifier" );
+}
+
+CALAMARES_PLUGIN_FACTORY_DEFINITION( OEMViewStepFactory, registerPlugin<OEMViewStep>(); )
diff --git a/src/modules/oemid/OEMViewStep.h b/src/modules/oemid/OEMViewStep.h
new file mode 100644
index 000000000..137047b11
--- /dev/null
+++ b/src/modules/oemid/OEMViewStep.h
@@ -0,0 +1,60 @@
+/* === This file is part of Calamares - <https://github.com/calamares> ===
+ *
+ * Copyright 2019, Adriaan de Groot <groot@kde.org>
+ *
+ * Calamares is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Calamares is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Calamares. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef OEMVIEWSTEP_H
+#define OEMVIEWSTEP_H
+
+#include <utils/PluginFactory.h>
+#include <viewpages/ViewStep.h>
+
+#include <PluginDllMacro.h>
+
+#include <QVariantMap>
+
+class OEMPage;
+
+class PLUGINDLLEXPORT OEMViewStep : public Calamares::ViewStep
+{
+ Q_OBJECT
+
+public:
+ explicit OEMViewStep( QObject* parent = nullptr );
+ virtual ~OEMViewStep() override;
+
+ QString prettyName() const override;
+
+ QWidget* widget() override;
+
+ bool isNextEnabled() const override;
+ bool isBackEnabled() const override;
+
+ bool isAtBeginning() const override;
+ bool isAtEnd() const override;
+
+ Calamares::JobList jobs() const override;
+
+ void setConfigurationMap( const QVariantMap& configurationMap ) override;
+
+private:
+ QString m_batch;
+ OEMPage* m_widget;
+};
+
+CALAMARES_PLUGIN_FACTORY_DECLARATION( OEMViewStepFactory )
+
+#endif
diff --git a/src/modules/oemid/oemid.conf b/src/modules/oemid/oemid.conf
new file mode 100644
index 000000000..90587faae
--- /dev/null
+++ b/src/modules/oemid/oemid.conf
@@ -0,0 +1,7 @@
+# This is an OEM setup (phase-0) configuration file.
+---
+# The batch-identifier is written to /var/log/installer/oem-id.
+# This value is put into the text box as the **suggested**
+# OEM ID. If @@DATE@@ is included in the identifier, then
+# that is replaced by the current date in YYYYMMDD (ISO) format.
+batch-identifier: neon-@@DATE@@