Compare commits

..

No commits in common. "8ebe0ec6bf0ce393c35bcd4a9a8bc749b5b0fa04" and "ec1a47cfbf49e06db6b41eec8977081a3c4d8202" have entirely different histories.

12 changed files with 769 additions and 521 deletions

View File

@ -0,0 +1,55 @@
From 2d6867c20825c2f021e91365fd6ed4b1ad5db813 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20Sch=C3=A4fer?= <ms@suse.de>
Date: Mon, 16 Nov 2020 16:37:58 +0100
Subject: [PATCH] Added microdnf support in XML schema
The XML schema did not allow to specify microdnf as
supported package manager
---
kiwi/schema/kiwi.rnc | 2 +-
kiwi/schema/kiwi.rng | 1 +
kiwi/xml_parse.py | 1 +
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/kiwi/schema/kiwi.rnc b/kiwi/schema/kiwi.rnc
index 2e296fe..03bfffe 100644
--- a/kiwi/schema/kiwi.rnc
+++ b/kiwi/schema/kiwi.rnc
@@ -793,7 +793,7 @@ div {
#
div {
k.packagemanager.content =
- "apt-get" | "zypper" | "yum" | "dnf" | "pacman"
+ "apt-get" | "zypper" | "yum" | "dnf" | "microdnf" | "pacman"
k.packagemanager.attlist = empty
k.packagemanager =
## Name of the Package Manager
diff --git a/kiwi/schema/kiwi.rng b/kiwi/schema/kiwi.rng
index daaca9e..11a83aa 100644
--- a/kiwi/schema/kiwi.rng
+++ b/kiwi/schema/kiwi.rng
@@ -1228,6 +1228,7 @@ the device is looked up in /dev/disk/by-* and /dev/mapper/*</a:documentation>
<value>zypper</value>
<value>yum</value>
<value>dnf</value>
+ <value>microdnf</value>
<value>pacman</value>
</choice>
</define>
diff --git a/kiwi/xml_parse.py b/kiwi/xml_parse.py
index d5677a5..43ccc0d 100644
--- a/kiwi/xml_parse.py
+++ b/kiwi/xml_parse.py
@@ -730,6 +730,7 @@ class k_packagemanager_content(object):
ZYPPER='zypper'
YUM='yum'
DNF='dnf'
+ MICRODNF='microdnf'
PACMAN='pacman'
--
2.33.0

View File

@ -0,0 +1,163 @@
From 863722fb63f4af7256f7a4d879933b79febf386d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20Sch=C3=A4fer?= <ms@suse.de>
Date: Wed, 19 Aug 2020 09:25:13 +0200
Subject: [PATCH] Added s390 SLE15 integration tests
---
.../sle15/test-image-vmx-oem/appliance.kiwi | 84 +++++++++++++++++++
.../s390/sle15/test-image-vmx-oem/config.sh | 42 ++++++++++
helper/build_status.sh | 1 +
3 files changed, 127 insertions(+)
create mode 100644 build-tests/s390/sle15/test-image-vmx-oem/appliance.kiwi
create mode 100644 build-tests/s390/sle15/test-image-vmx-oem/config.sh
diff --git a/build-tests/s390/sle15/test-image-vmx-oem/appliance.kiwi b/build-tests/s390/sle15/test-image-vmx-oem/appliance.kiwi
new file mode 100644
index 0000000000..cdc859f387
--- /dev/null
+++ b/build-tests/s390/sle15/test-image-vmx-oem/appliance.kiwi
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!-- OBS-Profiles: @BUILD_FLAVOR@ -->
+
+<image schemaversion="7.2" name="SLE15">
+ <description type="system">
+ <author>Marcus Schäfer</author>
+ <contact>ms@suse.com</contact>
+ <specification>Virtual and Physical disk image test</specification>
+ </description>
+ <profiles>
+ <profile name="Virtual" description="Image for use with kvm"/>
+ <profile name="PhysicalBSZ_4096" description="Image for physical 4k storage disk CDL mode"/>
+ </profiles>
+ <preferences>
+ <version>1.15.1</version>
+ <packagemanager>zypper</packagemanager>
+ <locale>en_US</locale>
+ <keytable>us</keytable>
+ <timezone>Europe/Berlin</timezone>
+ <rpm-excludedocs>true</rpm-excludedocs>
+ <rpm-check-signatures>false</rpm-check-signatures>
+ </preferences>
+ <preferences profiles="Virtual">
+ <type image="vmx" filesystem="xfs" kernelcmdline="console=ttyS0 cio_ignore=all,!ipldev,!condev" format="qcow2">
+ <bootloader name="grub2_s390x_emu" console="serial" targettype="FBA"/>
+ </type>
+ </preferences>
+ <preferences profiles="PhysicalBSZ_4096">
+ <type image="oem" filesystem="ext4" initrd_system="dracut" kernelcmdline="console=ttyS0 cio_ignore=all,!ipldev,!condev" target_blocksize="4096">
+ <bootloader name="grub2_s390x_emu" console="serial" targettype="CDL"/>
+ <systemdisk>
+ <volume name="home"/>
+ </systemdisk>
+ <oemconfig>
+ <oem-swap>true</oem-swap>
+ <oem-swapsize>4096</oem-swapsize>
+ </oemconfig>
+ </type>
+ </preferences>
+ <users>
+ <user password="$1$wYJUgpM5$RXMMeASDc035eX.NbYWFl0" home="/root" name="root" groups="root"/>
+ </users>
+ <repository type="rpm-md">
+ <source path="obsrepositories:/"/>
+ </repository>
+ <packages type="image">
+ <package name="patterns-base-minimal_base"/>
+ <package name="kernel-default"/>
+ <package name="iputils"/>
+ <package name="iproute2"/>
+ <package name="vim"/>
+ <package name="s390-tools"/>
+ <package name="grub2-s390x-emu"/>
+ <package name="grub2"/>
+ <package name="lvm2"/>
+ <package name="tar"/>
+ <package name="parted"/>
+ <package name="systemd"/>
+ <package name="dracut"/>
+ <package name="wicked"/>
+ <package name="openssh"/>
+ <package name="rsync"/>
+ <package name="psmisc"/>
+ <package name="sudo"/>
+ <package name="dhcp-client"/>
+ <package name="which"/>
+ <package name="btrfsprogs"/>
+ <package name="kexec-tools"/>
+ <package name="less"/>
+ <package name="patch"/>
+ <package name="util-linux"/>
+ <package name="timezone"/>
+ <package name="dracut-kiwi-oem-repart"/>
+ </packages>
+ <packages type="bootstrap">
+ <package name="udev"/>
+ <package name="filesystem"/>
+ <package name="glibc-locale"/>
+ <package name="cracklib-dict-full"/>
+ <package name="ca-certificates"/>
+ <package name="sles-release"/>
+ </packages>
+</image>
diff --git a/build-tests/s390/sle15/test-image-vmx-oem/config.sh b/build-tests/s390/sle15/test-image-vmx-oem/config.sh
new file mode 100644
index 0000000000..3f41e7cf8e
--- /dev/null
+++ b/build-tests/s390/sle15/test-image-vmx-oem/config.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+#================
+# FILE : config.sh
+#----------------
+# PROJECT : OpenSuSE KIWI Image System
+# COPYRIGHT : (c) 2006 SUSE LINUX Products GmbH. All rights reserved
+# :
+# AUTHOR : Marcus Schaefer <ms@suse.de>
+# :
+# BELONGS TO : Operating System images
+# :
+# DESCRIPTION : configuration script for SUSE based
+# : operating systems
+# :
+# :
+# STATUS : BETA
+#----------------
+#======================================
+# Functions...
+#--------------------------------------
+test -f /.kconfig && . /.kconfig
+test -f /.profile && . /.profile
+
+#======================================
+# Greeting...
+#--------------------------------------
+echo "Configure image: [$kiwi_iname]..."
+
+#======================================
+# Setup baseproduct link
+#--------------------------------------
+suseSetupProduct
+
+#======================================
+# Activate services
+#--------------------------------------
+suseInsertService sshd
+
+#======================================
+# Setup default target, multi-user
+#--------------------------------------
+baseSetRunlevel 3
diff --git a/helper/build_status.sh b/helper/build_status.sh
index b8fe0ea8da..09af11c964 100755
--- a/helper/build_status.sh
+++ b/helper/build_status.sh
@@ -9,6 +9,7 @@ for project in \
Virtualization:Appliances:Images:Testing_x86:fedora \
Virtualization:Appliances:Images:Testing_x86:ubuntu \
Virtualization:Appliances:Images:Testing_s390:suse \
+ Virtualization:Appliances:Images:Testing_s390:sle15 \
Virtualization:Appliances:Images:Testing_arm:suse \
Virtualization:Appliances:Images:Testing_arm:fedora \
Virtualization:Appliances:Images:Testing_ppc:suse \

View File

@ -0,0 +1,21 @@
From 0d473758bc13a622b9b0aa57c7474fea4de5574d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20Sch=C3=A4fer?= <ms@suse.de>
Date: Sun, 8 Nov 2020 20:43:35 +0100
Subject: [PATCH] Added universal box to build status helper
---
helper/build_status.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/helper/build_status.sh b/helper/build_status.sh
index c740700076..177aaf34fa 100755
--- a/helper/build_status.sh
+++ b/helper/build_status.sh
@@ -4,6 +4,7 @@ for project in \
Virtualization:Appliances:SelfContained:fedora \
Virtualization:Appliances:SelfContained:suse \
Virtualization:Appliances:SelfContained:ubuntu \
+ Virtualization:Appliances:SelfContained:universal \
Virtualization:Appliances:Images:Testing_x86:suse \
Virtualization:Appliances:Images:Testing_x86:centos \
Virtualization:Appliances:Images:Testing_x86:fedora \

View File

@ -0,0 +1,61 @@
From 0d006cf1225bd6ca76057ae11e731ff7b4cd0d97 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20Sch=C3=A4fer?= <ms@suse.de>
Date: Mon, 21 Sep 2020 17:04:08 +0200
Subject: [PATCH] Cosmetic update for build status helper
Show disabled integration test builds with a clear indicator
---
helper/build_status.sh | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/helper/build_status.sh b/helper/build_status.sh
index 09af11c..c740700 100755
--- a/helper/build_status.sh
+++ b/helper/build_status.sh
@@ -23,9 +23,11 @@ do
echo -e "$(echo $line |\
sed -e s@^F@'\\033[31mF\\e[0m'@ |\
sed -e s@^U@'\\033[33mU\\e[0m'@ |\
+ sed -e s@^D@'\\033[36mD\\e[0m'@ |\
sed -e s@^\\.@'\\033[32m.\\e[0m'@)"
done < <(osc -A https://api.opensuse.org \
- results -V "${project}" | grep -B100 Legend | grep -v Legend
+ results -V "${project}" | sed -e 's@^ @ D @' |\
+ grep -B100 Legend | grep -v Legend
)
else
for package in $(osc -A https://api.opensuse.org list "${project}");do
@@ -43,18 +45,18 @@ if [ ! "$1" = "refresh" ];then
cat << EOF
Legend:
. succeeded
- disabled
- U unresolvable
- F failed
- B broken
- b blocked
- % building
- f finished
- s scheduled
- L locked
- x excluded
- d dispatching
- S signing
+ D Disabled
+ U unresolvable
+ F failed
+ B broken
+ b blocked
+ % building
+ f finished
+ s scheduled
+ L locked
+ x excluded
+ d dispatching
+ S signing
? buildstatus not available
EOF
fi
--
2.33.0

View File

@ -0,0 +1,68 @@
From 8794d4a7cbf7bb43382e283c9c6f6c77c712d0b8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20Sch=C3=A4fer?= <ms@suse.de>
Date: Thu, 10 Jun 2021 11:10:56 +0200
Subject: [PATCH] Fixed cleanup of temporary directory
In the custom kiwi initrd build process a temporary directory
holding a copy of the initrd root tree is created. That data
got never cleaned up. This commit uses a TemporaryDirectory
object from the tempfile module to make sure it gets deleted
once the execution scope is done. This Fixes #1837
---
kiwi/boot/image/builtin_kiwi.py | 7 +++----
test/unit/boot/image/builtin_kiwi_test.py | 6 +++++-
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/kiwi/boot/image/builtin_kiwi.py b/kiwi/boot/image/builtin_kiwi.py
index 8ac574a..c404b09 100644
--- a/kiwi/boot/image/builtin_kiwi.py
+++ b/kiwi/boot/image/builtin_kiwi.py
@@ -17,6 +17,7 @@
#
import os
import logging
+from tempfile import TemporaryDirectory
from tempfile import mkdtemp
# project
@@ -142,13 +143,11 @@ class BootImageKiwi(BootImageBase):
kiwi_initrd_basename = basename
else:
kiwi_initrd_basename = self.initrd_base_name
- temp_boot_root_directory = mkdtemp(
+ temp_boot_root = TemporaryDirectory(
prefix='kiwi_boot_root_copy.'
)
+ temp_boot_root_directory = temp_boot_root.name
os.chmod(temp_boot_root_directory, 0o755)
- self.temp_directories.append(
- temp_boot_root_directory
- )
data = DataSync(
self.boot_root_directory + '/',
temp_boot_root_directory
diff --git a/test/unit/boot/image/builtin_kiwi_test.py b/test/unit/boot/image/builtin_kiwi_test.py
index 7a0ff1d..f7d98ec 100644
--- a/test/unit/boot/image/builtin_kiwi_test.py
+++ b/test/unit/boot/image/builtin_kiwi_test.py
@@ -102,12 +102,16 @@ class TestBootImageKiwi:
@patch('kiwi.boot.image.builtin_kiwi.mkdtemp')
@patch('kiwi.boot.image.builtin_kiwi.os.chmod')
def test_create_initrd(
- self, mock_os_chmod, mock_mkdtemp, mock_prepared, mock_sync,
+ self, mock_TemporaryDirectory, mock_os_chmod,
+ mock_mkdtemp, mock_prepared, mock_sync,
mock_wipe, mock_create, mock_compress, mock_cpio
):
data = mock.Mock()
mock_sync.return_value = data
mock_mkdtemp.return_value = 'temp-boot-directory'
+ temporary_directory = Mock()
+ temporary_directory.name = 'temp-boot-directory'
+ mock_TemporaryDirectory.return_value = temporary_directory
mock_prepared.return_value = True
self.boot_image.boot_root_directory = 'boot-root-directory'
mbrid = mock.Mock()
--
1.8.3.1

View File

@ -0,0 +1,49 @@
From 49d09e9667e90562470d58ab369614f2db8c5c0c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20Sch=C3=A4fer?= <ms@suse.de>
Date: Thu, 13 Aug 2020 11:17:33 +0200
Subject: [PATCH] Include box plugin images to build_status
Also show some colors for failed and unresolvable builds
---
helper/build_status.sh | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/helper/build_status.sh b/helper/build_status.sh
index ef93ee847c..b8fe0ea8da 100755
--- a/helper/build_status.sh
+++ b/helper/build_status.sh
@@ -1,6 +1,9 @@
#!/bin/bash
for project in \
+ Virtualization:Appliances:SelfContained:fedora \
+ Virtualization:Appliances:SelfContained:suse \
+ Virtualization:Appliances:SelfContained:ubuntu \
Virtualization:Appliances:Images:Testing_x86:suse \
Virtualization:Appliances:Images:Testing_x86:centos \
Virtualization:Appliances:Images:Testing_x86:fedora \
@@ -9,13 +12,20 @@ for project in \
Virtualization:Appliances:Images:Testing_arm:suse \
Virtualization:Appliances:Images:Testing_arm:fedora \
Virtualization:Appliances:Images:Testing_ppc:suse \
+ Virtualization:Appliances:Images:Testing_ppc:sle15 \
Virtualization:Appliances:Images:Testing_ppc:fedora \
Virtualization:Appliances:Images:Testing_x86:archlinux
do
echo "${project}"
if [ ! "$1" = "refresh" ];then
- osc -A https://api.opensuse.org \
+ while read -r line;do
+ echo -e "$(echo $line |\
+ sed -e s@^F@'\\033[31mF\\e[0m'@ |\
+ sed -e s@^U@'\\033[33mU\\e[0m'@ |\
+ sed -e s@^\\.@'\\033[32m.\\e[0m'@)"
+ done < <(osc -A https://api.opensuse.org \
results -V "${project}" | grep -B100 Legend | grep -v Legend
+ )
else
for package in $(osc -A https://api.opensuse.org list "${project}");do
if [[ "${package}" =~ ^test- ]];then
~
~
~

View File

@ -1,26 +0,0 @@
From 53ad53556e476961e76c99d14b492250704acccc Mon Sep 17 00:00:00 2001
From: zhoujing <zhoujing106@huawei.com>
Date: Tue, 7 Nov 2023 20:32:54 +0800
Subject: [PATCH] [sync] Support for building with clang
cherry-pick from https://gitee.com/openeuler-risc-v/kiwi/commit/b896168af10084bd227918eb1e68cfe34581a635
---
tools/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/Makefile b/tools/Makefile
index f2ea5d7..126aaa3 100755
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -3,7 +3,7 @@ buildroot = /
SRCS := $(wildcard *.c)
PRGS := $(patsubst %.c,%,$(SRCS))
-CC = gcc
+CC ?= gcc
all: $(PRGS)
--
2.42.0

BIN
kiwi-9.21.7.tar.gz Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,7 +1,7 @@
%{?python_enable_dependency_generator}
Name: kiwi
Version: 9.25.1
Version: 9.21.7
Release: 2
License: GPLv3+
Summary: Flexible operating system image builder
@ -9,9 +9,14 @@ Summary: Flexible operating system image builder
URL: http://osinside.github.io/kiwi/
Source0: https://files.pythonhosted.org/packages/source/k/%{name}/%{name}-%{version}.tar.gz
Patch0: openEuler-use-rsync-link.patch
Patch1: openEuler-custom-make.patch
Patch2: huawei-sync-support-for-building-with-clang.patch
Patch0: backport-Added-microdnf-support-in-XML-schema.patch
Patch2: backport-Include-box-plugin-images-to-build_status.patch
Patch3: backport-Added-s390-SLE15-integration-tests.patch
Patch4: backport-Cosmetic-update-for-build-status-helper.patch
Patch5: backport-Added-universal-box-to-build-status-helper.patch
Patch6: openEuler-custom-make.patch
Patch7: openEuler-use-rsync-link.patch
Patch8: backport-Fixed-cleanup-of-temporary-directory.patch
BuildRequires: bash-completion dracut fdupes gcc make
BuildRequires: python3-devel python3-setuptools shadow-utils
@ -37,7 +42,7 @@ Requires: yum
Provides: %{name}-packagemanager:yum
Requires: device-mapper-multipath dosfstools e2fsprogs
Requires: gdisk lvm2 mtools parted
Requires: xorriso gdisk lvm2 mtools parted
Requires: qemu-img rsync squashfs-tools tar >= 1.2.7
Requires: %{name}-tools = %{version}-%{release}
%ifarch x86_64
@ -164,7 +169,6 @@ done
%license LICENSE
%{_bindir}/%{name}*
%{python3_sitelib}/%{name}*/
%exclude %{_bindir}/kiwi-parse-verity
%files tools
%defattr(-,root,root)
@ -174,9 +178,8 @@ done
%files cli
%defattr(-,root,root)
%{_bindir}/%{name}*
%{_datadir}/bash-completion/completions/%{name}-ng
%{_datadir}/bash-completion/completions/%{name}-ng.sh
%config(noreplace) %{_sysconfdir}/kiwi.yml
%exclude %{_bindir}/kiwi-parse-verity
%ifarch %{ix86} x86_64
%files pxeboot
@ -195,30 +198,6 @@ done
%{_mandir}/man8/%{name}*
%changelog
* Thu Feb 22 2024 luofng <luofeng13@huawei.com> - 9.25.1-2
- Type: enhencement
- CVE:NA
- SUG:NA
- DESC:support for building with clang
* Tue Oct 24 2023 yanglongkang <yanglongkang@h-partners.com> - 9.25.1-1
- update version to 9.25.1
* Thu Jul 20 2023 yanglongkang <yanglongkang@h-partners.com> - 9.24.1-1
- update version to 9.24.1
* Thu Jan 12 2023 Chenxi Mao <chenxi.mao@suse.com>> - 9.21.7-4
- Type:bugfix
- ID:NA
- SUG:NA
- DESC: Support UEFI on ARM64 platform.
* Wed Jun 29 2022 tianwei <tianwei12@h-partners.com>> - 9.21.7-3
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:Delete xorriso dependencies
* Wed Apr 27 2022 shixuantong <shixuantong@h-partners.com> - 9.21.7-2
- add release for rebuild

View File

@ -1,20 +1,22 @@
diff --git a/kiwi/archive/cpio.py b/kiwi/archive/cpio.py
index 27d596c..042f1cd 100644
index 27d596c..f147aa1 100644
--- a/kiwi/archive/cpio.py
+++ b/kiwi/archive/cpio.py
@@ -17,7 +17,11 @@
@@ -16,8 +16,13 @@
# along with kiwi. If not, see <http://www.gnu.org/licenses/>
#
# project
from kiwi.command import Command
+from kiwi.runtime_config import RuntimeConfig
from kiwi.command import Command
+import os
+import logging
+
+log = logging.getLogger('kiwi')
class ArchiveCpio:
"""
@@ -27,6 +31,7 @@ class ArchiveCpio:
@@ -27,6 +32,7 @@ class ArchiveCpio:
"""
def __init__(self, filename):
self.filename = filename
@ -22,7 +24,7 @@ index 27d596c..042f1cd 100644
def create(self, source_dir, exclude=None):
"""
@@ -35,6 +40,62 @@ class ArchiveCpio:
@@ -35,6 +41,62 @@ class ArchiveCpio:
:param string source_dir: data source directory
:param list exclude: list of excluded items
"""
@ -86,10 +88,10 @@ index 27d596c..042f1cd 100644
find_command = ['cd', source_dir, '&&', 'find', '.']
cpio_command = [
diff --git a/kiwi/boot/image/builtin_kiwi.py b/kiwi/boot/image/builtin_kiwi.py
index 5b26798..30d30bc 100644
index 08c5644..1e8a3b4 100644
--- a/kiwi/boot/image/builtin_kiwi.py
+++ b/kiwi/boot/image/builtin_kiwi.py
@@ -33,6 +33,7 @@ from kiwi.archive.cpio import ArchiveCpio
@@ -29,6 +29,7 @@ from kiwi.archive.cpio import ArchiveCpio
from kiwi.utils.compress import Compress
from kiwi.path import Path
from kiwi.boot.image.base import BootImageBase
@ -97,46 +99,44 @@ index 5b26798..30d30bc 100644
log = logging.getLogger('kiwi')
@@ -99,6 +100,7 @@ class BootImageKiwi(BootImageBase):
system.install_system(
manager
)
+ self.runtime_config = RuntimeConfig()
@@ -79,6 +80,7 @@ class BootImageKiwi(BootImageBase):
system.install_system(
manager
)
+ self.runtime_config = RuntimeConfig()
profile = Profile(self.boot_xml_state)
profile.add('kiwi_initrdname', boot_image_name)
@@ -121,16 +123,22 @@ class BootImageKiwi(BootImageBase):
self.setup.import_overlay_files(
follow_links=True
)
+
+ if self.runtime_config.get_custom_hw_systemflag():
+ self.setup.setup_groups()
+ self.setup.setup_users()
self.setup.call_config_script()
profile = Profile(self.boot_xml_state)
profile.add('kiwi_initrdname', boot_image_name)
@@ -96,16 +98,21 @@ class BootImageKiwi(BootImageBase):
self.setup.import_overlay_files(
follow_links=True
)
+ if self.runtime_config.get_custom_hw_systemflag():
+ self.setup.setup_groups()
+ self.setup.setup_users()
self.setup.call_config_script()
- system.pinch_system(
- manager=manager, force=True
- )
+ if not self.runtime_config.get_custom_hw_systemflag():
+ system.pinch_system(
+ manager=manager, force=True
+ )
# make sure system instance is cleaned up before setting up
del system
self.setup.call_image_script()
- self.setup.create_init_link_from_linuxrc()
+ if not self.runtime_config.get_custom_hw_systemflag():
+ self.setup.create_init_link_from_linuxrc()
def create_initrd(
self, mbrid: Optional[SystemIdentifier] = None,
@@ -169,15 +177,16 @@ class BootImageKiwi(BootImageBase):
data.sync_data(
options=Defaults.get_sync_options()
- system.pinch_system(
- manager=manager, force=True
- )
+ if not self.runtime_config.get_custom_hw_systemflag():
+ system.pinch_system(
+ manager=manager, force=True
+ )
# make sure system instance is cleaned up before setting up
del system
self.setup.call_image_script()
- self.setup.create_init_link_from_linuxrc()
+ if not self.runtime_config.get_custom_hw_systemflag():
+ self.setup.create_init_link_from_linuxrc()
def create_initrd(self, mbrid=None, basename=None, install_initrd=False):
"""
@@ -144,14 +151,15 @@ class BootImageKiwi(BootImageBase):
options=['-a']
)
- boot_directory = temp_boot_root_directory + '/boot'
boot_directory = temp_boot_root_directory + '/boot'
- Path.wipe(boot_directory)
- if mbrid:
- log.info(
@ -145,7 +145,6 @@ index 5b26798..30d30bc 100644
- Path.create(boot_directory)
- image_identifier = boot_directory + '/mbrid'
- mbrid.write(image_identifier)
+
+ if not self.runtime_config.get_custom_hw_systemflag():
+ Path.wipe(boot_directory)
+ if mbrid:
@ -158,7 +157,7 @@ index 5b26798..30d30bc 100644
cpio = ArchiveCpio(
os.sep.join([self.target_dir, kiwi_initrd_basename])
@@ -185,19 +194,33 @@ class BootImageKiwi(BootImageBase):
@@ -159,19 +167,34 @@ class BootImageKiwi(BootImageBase):
# the following is a list of directories which were needed
# during the process of creating an image but not when the
# image is actually booting with this initrd
@ -176,19 +175,19 @@ index 5b26798..30d30bc 100644
+ '/' + Defaults.get_shared_cache_location(),
+ '/image', '/usr/lib/grub*'
+ ]
+
# the following is a list of directories to exclude which
- # are not needed inside of the initrd
# are not needed inside of the initrd
- exclude_from_archive += [
- '/usr/share/doc', '/usr/share/man', '/home', '/media', '/srv'
- ]
+ #
+ if self.runtime_config.get_custom_hw_systemflag():
+ exclude_from_archive += [
+ '/media'
+ ]
+ else:
+ exclude_from_archive += [
+ '/usr/share/doc', '/usr/share/man', '/home', '/media', '/srv'
+ '/usr/share/doc', '/usr/share/man', '/home', '/media', '/srv'
+ ]
cpio.create(
source_dir=temp_boot_root_directory,
@ -201,14 +200,15 @@ index 5b26798..30d30bc 100644
'--> xz compressing archive'
)
diff --git a/kiwi/builder/kis.py b/kiwi/builder/kis.py
index 55da66f..271f46b 100644
index ea33c6a..542a345 100644
--- a/kiwi/builder/kis.py
+++ b/kiwi/builder/kis.py
@@ -140,24 +140,27 @@ class KisBuilder:
@@ -132,25 +132,27 @@ class KisBuilder:
self.system_setup.export_modprobe_setup(
self.boot_image_task.boot_root_directory
)
- # extract kernel from boot system
-
- # extract kernel from boot(initrd) root system
- kernel = Kernel(self.boot_image_task.boot_root_directory)
- kernel_data = kernel.get_kernel()
- if kernel_data:
@ -228,7 +228,7 @@ index 55da66f..271f46b 100644
- 'No kernel in boot image tree %s found' %
- self.boot_image_task.boot_root_directory
- )
+ # extract kernel from boot system
+ # extract kernel from boot(initrd) root system
+ kernel = Kernel(self.boot_image_task.boot_root_directory)
+ kernel_data = kernel.get_kernel()
+ if kernel_data:
@ -249,7 +249,7 @@ index 55da66f..271f46b 100644
# extract hypervisor from boot(initrd) root system
if self.xen_server:
@@ -198,6 +201,8 @@ class KisBuilder:
@@ -187,6 +189,8 @@ class KisBuilder:
cmdline += ' {}'.format(self.custom_cmdline)
with open(self.append_file, 'w') as append:
append.write(cmdline)
@ -259,10 +259,104 @@ index 55da66f..271f46b 100644
# put results into a tarball
if not self.xz_options:
diff --git a/kiwi/config/functions.sh b/kiwi/config/functions.sh
index 98915af..0a7afb3 100644
index a81be6a..cd28ec8 100644
--- a/kiwi/config/functions.sh
+++ b/kiwi/config/functions.sh
@@ -173,10 +173,22 @@ function baseStripLocales {
@@ -176,6 +176,34 @@ function suseInsertService {
baseInsertService "$@"
}
+
+#======================================
+# suseActivateAllServices ---- add
+#--------------------------------------
+function suseRemoveAllServices {
+ # /.../
+ # Check all services in /etc/init.d/ and activate them
+ # by calling insertService
+ # -----
+ for i in /etc/init.d/*;do
+ if [ -x $i ] && [ -f $i ];then
+ echo $i | grep -q skel
+ if [ $? = 0 ];then
+ continue
+ fi
+ echo $i | grep -q halt
+ if [ $? = 0 ];then
+ continue
+ fi
+ echo $i | grep -q reboot
+ if [ $? = 0 ];then
+ continue
+ fi
+ suseRemoveService ${i##*/}
+ fi
+ done
+}
+
#======================================
# suseService
#--------------------------------------
@@ -361,10 +389,58 @@ function baseStripDocs {
grep -iv "copying\|license\|copyright")
rm -f "${docfiles}"
done
+ rm -rf `rpm -qad`
rm -rf /usr/share/info
rm -rf /usr/share/man
}
+#======================================
+# baseStripcustomBep
+#--------------------------------------
+function baseStripcustomBep {
+ # /.../
+ # remove custom difference files
+ # ----
+ local hookdir=$1
+ local hookscript=$hookdir/S00bep
+
+ [ ! -d "$hookdir" ] && return
+ [ ! -f "$hookscript" ] && return
+ chmod u+x $hookscript &>/dev/null
+ dos2unix $hookscript &>/dev/null
+ if [ -x "$hookscript" ]; then
+ /bin/bash $hookscript
+ fi
+ rm -rf $hookdir
+ rm -rf /usr/custom/usrfile/$hookdir
+
+}
+
+#======================================
+# baseStripBep
+#--------------------------------------
+function baseStripBep {
+ # /.../
+ # remove log,dnf, files
+ # ----
+ local dbepfiles=""
+ local directories="
+ /var/log/
+ /var/lib/systemd/catalog
+ "
+ local dbephookdir="/usr/openEuler/hook/bep_delete_hook"
+ for dir in $directories; do
+ dbepfiles=$(find $dir -type f)
+ for file in $dbepfiles
+ do
+ echo -n > $file
+ done
+ done
+ rm -f /var/lib/dnf/history*
+ rm -f /var/lib/rpm/__db.00*
+ baseStripcustomBep $dbephookdir
+}
+
#======================================
# baseStripLocales
#--------------------------------------
@@ -374,13 +450,25 @@ function baseStripLocales {
baseStripAndKeep "${keepLocales}"
}
@ -279,6 +373,9 @@ index 98915af..0a7afb3 100644
+ baseStripAndKeep ${keepGconv}
+}
+
#======================================
# baseStripTranslations
#--------------------------------------
function baseStripTranslations {
- local keepMatching="$*"
- find /usr/share/locale -name "*.mo" |\
@ -287,8 +384,63 @@ index 98915af..0a7afb3 100644
+ find /usr/share/locale -name "*.mo" | baseStripAndKeep ${keepMatching}
}
function baseStripUnusedLibs {
@@ -187,6 +199,8 @@ function baseStripUnusedLibs {
#======================================
@@ -422,7 +510,7 @@ function baseStripAndKeep {
fi
done
if [ "${found}" = 0 ]; then
- Rm -rf "${file}"
+ rm_isnot_usrfile $file
fi
done
}
@@ -507,6 +595,45 @@ function Debug {
echo "+++++> (caller:${FUNCNAME[1]}:${FUNCNAME[2]} ) $*"
fi
}
+#======================================
+# baseSetupBusyBox
+#--------------------------------------
+function baseSetupBusyBox {
+ # /.../
+ # activates busybox if installed for all links from
+ # the busybox/busybox.links file - you can choose custom apps to
+ # be forced into busybox with the "-f" option as first parameter
+ # ---
+ # example: baseSetupBusyBox -f /bin/zcat /bin/vi
+ # ---
+ local applets=""
+ local force=no
+ local busyboxlinks=/usr/share/busybox/busybox.links
+ if [ ! -f "/usr/sbin/busybox" ]; then
+ echo "Busybox not installed... skipped"
+ return 0
+ fi
+ if [ $# -gt 0 ] && [ "$1" = "-f" ]; then
+ force=yes
+ shift
+ fi
+ if [ $# -gt 0 ]; then
+ for i in "$@"; do
+ if grep -q "^$i$" "$busyboxlinks"; then
+ applets="${applets} $i"
+ fi
+ done
+ else
+ applets=`cat "$busyboxlinks"`
+ fi
+ for applet in $applets; do
+ if [ ! -f "$applet" ] || [ "$force" = "yes" ]; then
+ echo "Busybox Link: ln -sf /usr/sbin/busybox $applet"
+ ln -sf /usr/sbin/busybox "$applet"
+ fi
+ done
+}
+
#======================================
# stripUnusedLibs
#--------------------------------------
@@ -518,6 +645,8 @@ function baseStripUnusedLibs {
local needlibs
local found
local dir
@ -297,7 +449,7 @@ index 98915af..0a7afb3 100644
local lib
local lddref
# /.../
@@ -194,33 +208,33 @@ function baseStripUnusedLibs {
@@ -525,33 +654,33 @@ function baseStripUnusedLibs {
# on files in *bin*
# ---
ldconfig
@ -344,15 +496,14 @@ index 98915af..0a7afb3 100644
count=$((count + 1))
fi
done
@@ -228,47 +242,41 @@ function baseStripUnusedLibs {
@@ -559,46 +688,42 @@ function baseStripUnusedLibs {
# /.../
# add exceptions
# ----
- for libname in $1; do
- for libfile in \
- /lib*/"$libname"* /usr/lib*/"$libname"* \
- /lib/x86_64-linux-gnu/"$libname"* \
- /usr/lib/x86_64-linux-gnu/"$libname"* \
- /lib/x86_64-linux-gnu/"$libname"* /usr/lib/x86_64-linux-gnu/"$libname"* \
- /usr/X11R6/lib*/"$libname"*
- do
- if [ -e "$libfile" ];then
@ -390,6 +541,7 @@ index 98915af..0a7afb3 100644
fi
- if [ -L "$i" ];then
+ if [ -L $i ];then
+ continue
continue
fi
for n in ${needlibs[*]};do
@ -406,16 +558,11 @@ index 98915af..0a7afb3 100644
fi
done
}
@@ -289,27 +297,160 @@ function baseUpdateSysConfig {
@@ -622,60 +747,144 @@ function baseUpdateSysConfig {
fi
}
-function baseStripInitrd {
- declare kiwi_initrd_system=${kiwi_initrd_system}
- declare kiwi_strip_tools=${kiwi_strip_tools}
- declare kiwi_strip_libs=${kiwi_strip_libs}
+
+#find all need tool which һ
+#find all need tool which ÃüÁîÒ»¶¨ÓÐ
+function baseStripAllTools {
+ local needtools=$1
+ local newneedtools=
@ -448,30 +595,14 @@ index 98915af..0a7afb3 100644
+
+}
+
+# function baseStripInitrd {
+# declare kiwi_initrd_system=${kiwi_initrd_system}
+# declare kiwi_strip_tools=${kiwi_strip_tools}
+# declare kiwi_strip_libs=${kiwi_strip_libs}
+# #==========================================
+# # Check for initrd system
+# #------------------------------------------
+# if [ "${kiwi_initrd_system}" = "dracut" ]; then
+# echo "dracut initrd system requested, initrd strip skipped"
+# return
+# fi
+# #==========================================
+# # remove unneeded tools
+# #------------------------------------------
+# local tools="${kiwi_strip_tools}"
+# tools="${tools} $*"
+# for path in /sbin /usr/sbin /usr/bin /bin;do
+# baseStripTools "${path}" "${tools}"
+# done
+# }
+
+#======================================
#======================================
-# baseStripInitrd
+# baseStripInvalidLink
+#--------------------------------------
#--------------------------------------
-function baseStripInitrd {
- declare kiwi_initrd_system=${kiwi_initrd_system}
- declare kiwi_strip_tools=${kiwi_strip_tools}
- declare kiwi_strip_libs=${kiwi_strip_libs}
+function baseStripInvalidLink {
+ local path
+ local link_file
@ -497,8 +628,17 @@ index 98915af..0a7afb3 100644
- return
- fi
+ echo $kiwi_strip_delete | xargs rm -rfv
#==========================================
# remove unneeded tools
#------------------------------------------
- local tools="${kiwi_strip_tools}"
- tools="${tools} $*"
- for path in /sbin /usr/sbin /usr/bin /bin;do
- baseStripTools "${path}" "${tools}"
- done
+ local tools="$kiwi_strip_tools"
+ tools="$tools $@"
+
+ #for path in /sbin /usr/sbin /usr/bin /bin;do
+ # baseStripTools "$path" "$tools"
+ #done
@ -508,18 +648,18 @@ index 98915af..0a7afb3 100644
+ baseSetupBusyBox -f
+
#==========================================
- # remove unneeded tools
+ # remove unused libs
# remove unused libs
#------------------------------------------
- local tools="${kiwi_strip_tools}"
- tools="${tools} $*"
- for path in /sbin /usr/sbin /usr/bin /bin;do
- baseStripTools "${path}" "${tools}"
- done
- baseStripUnusedLibs "${kiwi_strip_libs}"
+ baseStripUnusedLibs $kiwi_strip_libs
+ #==========================================
#==========================================
- # remove package manager meta data
+ # remove images.sh
+ #------------------------------------------
#------------------------------------------
- for p in dpkg rpm yum;do
- rm -rf "/var/lib/$p"
- done
-}
+ rm -f /image/images.sh
+ #==========================================
+ # remove unused root directories
@ -534,14 +674,21 @@ index 98915af..0a7afb3 100644
+ rm -rf /usr/share/doc
+ rm -rf /usr/share/man
+ #==========================================
+
+ find /sbin /usr/sbin /usr/bin /bin -maxdepth 1 -type f |xargs rpm -qf --qf '%{name}\n' |sort -u > /opt/need_rpmlst
+ find /sbin /usr/sbin /usr/bin /bin -maxdepth 1 -type l |xargs rpm -qf --qf '%{name}\n' |sort -u >> /opt/need_rpmlst
+
+ find /lib /lib64 /usr/lib /usr/lib64 \
+ /usr/X11R6/lib /usr/X11R6/lib64 \
+ -maxdepth 1 -type f |grep so |xargs rpm -qf --qf '%{name}\n' |sort -u >> /opt/need_rpmlst
+
+
+ find /lib/modules/ -type f -name "*.ko" |xargs rpm -qf --qf '%{name}\n' |sort -u >> /opt/need_rpmlst
-#======================================
-# suseStripInitrd
-#--------------------------------------
-function suseStripInitrd {
- baseStripInitrd "$@"
+ for i in `baseGetPackagesForDeletion`;do
+ grep -q ^${i}$ /opt/need_rpmlst
+ if [ $? -ne 0 ];then
@ -551,16 +698,6 @@ index 98915af..0a7afb3 100644
+ chmod 640 /var/log/cancel_uninstallrpm
+ fi
+ done
+
+ # remove invalid link file
+ #------------------------------------------
+ baseStripInvalidLink
}
+function strip_rpm {
+ #==========================================
+ # remove rpm cmd, until get src rpm list
+ #------------------------------------------
+
+ if [ "$sys_cut" = "yes" ];then
+
@ -576,13 +713,30 @@ index 98915af..0a7afb3 100644
+ rm -rf /var/lib/$p
+ done
+ fi
+}
+
+
function baseStripFirmware {
# /.../
# check all kernel modules if they require a firmware and
@@ -412,7 +553,7 @@ function baseStripModules {
+ #==========================================
+ # remove invalid link file
+ #------------------------------------------
+ baseStripInvalidLink
}
#======================================
# rhelStripInitrd
#--------------------------------------
function rhelStripInitrd {
- baseStripInitrd "$@"
+ suseStripInitrd
}
-#======================================
-# debianStripInitrd
-#--------------------------------------
-function debianStripInitrd {
- baseStripInitrd "$@"
-}
#======================================
# rhelSplashToGrub
@@ -825,7 +1034,7 @@ function baseStripModules {
if [[ ${file} =~ ${mod} ]] && [[ ! ${file} =~ "updates" ]];then
echo "baseStripModules: Update driver found for ${mod}"
echo "baseStripModules: Removing old version: ${file}"
@ -591,7 +745,22 @@ index 98915af..0a7afb3 100644
fi
done
done
@@ -478,10 +619,6 @@ function baseStripKernel {
@@ -852,6 +1061,14 @@ function baseSyncKernelTree {
rm -rf /lib/modules/*
cp -a /kernel-tree/* /lib/modules/
rm -rf /kernel-tree
+ if [ -d /lib/modules/openEuler ]; then
+ kversion=($(ls /lib/modules/|grep -v 'openEuler'))
+ for((i=0;i<${#kversion[@]};i++))
+ do
+ rm -rf /lib/modules/${kversion[i]}/openEuler
+ ln -sf /lib/modules/openEuler /lib/modules/${kversion[i]}/openEuler
+ done
+ fi
}
#======================================
@@ -976,10 +1193,6 @@ function baseStripKernel {
if [ "${kiwi_initrd_system}" = "dracut" ]; then
echo "dracut initrd system requested, kernel strip skipped"
else
@ -602,185 +771,27 @@ index 98915af..0a7afb3 100644
baseCreateKernelTree
baseStripKernelModules
baseFixupKernelModuleDependencies
@@ -594,14 +731,40 @@ function suseInsertService {
baseInsertService "$@"
}
+
+
+#======================================
+# suseActivateAllServices ---- add
+#--------------------------------------
+function suseRemoveAllServices {
+ # /.../
+ # Check all services in /etc/init.d/ and activate them
+ # by calling insertService
+ # -----
+ for i in /etc/init.d/*;do
+ if [ -x $i ] && [ -f $i ];then
+ echo $i | grep -q skel
+ if [ $? = 0 ];then
+ continue
+ fi
+ echo $i | grep -q halt
+ if [ $? = 0 ];then
+ continue
+ fi
+ echo $i | grep -q reboot
+ if [ $? = 0 ];then
+ continue
+ fi
+ suseRemoveService ${i##*/}
+ fi
+ done
+}
+
function suseService {
# function kept for compatibility
baseService "$@"
}
-function suseStripInitrd {
- baseStripInitrd "$@"
-}
function suseStripKernel {
baseStripKernel
@@ -677,6 +840,46 @@ function Debug {
fi
}
+
+#======================================
+# baseSetupBusyBox
+#--------------------------------------
+function baseSetupBusyBox {
+ # /.../
+ # activates busybox if installed for all links from
+ # the busybox/busybox.links file - you can choose custom apps to
+ # be forced into busybox with the "-f" option as first parameter
+ # ---
+ # example: baseSetupBusyBox -f /bin/zcat /bin/vi
+ # ---
+ local applets=""
+ local force=no
+ local busyboxlinks=/usr/share/busybox/busybox.links
+ if [ ! -f "/usr/sbin/busybox" ]; then
+ echo "Busybox not installed... skipped"
+ return 0
+ fi
+ if [ $# -gt 0 ] && [ "$1" = "-f" ]; then
+ force=yes
+ shift
+ fi
+ if [ $# -gt 0 ]; then
+ for i in "$@"; do
+ if grep -q "^$i$" "$busyboxlinks"; then
+ applets="${applets} $i"
+ fi
+ done
+ else
+ applets=`cat "$busyboxlinks"`
+ fi
+ for applet in $applets; do
+ if [ ! -f "$applet" ] || [ "$force" = "yes" ]; then
+ echo "Busybox Link: ln -sf /usr/sbin/busybox $applet"
+ ln -sf /usr/sbin/busybox "$applet"
+ fi
+ done
+}
+
function baseQuoteFile {
# /.../
# Quote file to be shell sourceable
@@ -715,6 +918,14 @@ function baseSyncKernelTree {
rm -rf /lib/modules/*
cp -a /kernel-tree/* /lib/modules/
rm -rf /kernel-tree
+ if [ -d /lib/modules/openEuler ]; then
+ kversion=($(ls /lib/modules/|grep -v 'openEuler'))
+ for((i=0;i<${#kversion[@]};i++))
+ do
+ rm -rf /lib/modules/${kversion[i]}/openEuler
+ ln -sf /lib/modules/openEuler /lib/modules/${kversion[i]}/openEuler
+ done
+ fi
}
function baseFixupKernelModuleDependencies {
@@ -797,7 +1008,7 @@ function baseStripAndKeep {
fi
done
if [ "${found}" = 0 ]; then
- Rm -rf "${file}"
+ rm_isnot_usrfile $file
fi
done
}
@@ -816,6 +1027,11 @@ function baseStripTools {
while IFS= read -r -d $'\0' file; do
found=0
base=$(/usr/bin/basename "${file}")
+ if [ "${base}" = "rpm" ]; then
+ # Keep the RPM command, and delete by sys_cut=yes
+ echo "sys_cut keep rpm cmd."
+ found=1
+ fi
for need in ${tools};do
if [ "${base}" = "$need" ];then
found=1
@@ -846,16 +1062,133 @@ function deprecated {
exit 1
}
+#======================================
+# baseStripcustomBep
+#--------------------------------------
+function baseStripcustomBep {
+ # /.../
+ # remove custom difference files
+ # ----
+ local hookdir=$1
+ local hookscript=$hookdir/S00bep
+
+ [ ! -d "$hookdir" ] && return
+ [ ! -f "$hookscript" ] && return
+ chmod u+x $hookscript &>/dev/null
+ dos2unix $hookscript &>/dev/null
+ if [ -x "$hookscript" ]; then
+ /bin/bash $hookscript
+ fi
+ rm -rf $hookdir
+ rm -rf /usr/custom/usrfile/$hookdir
+
+}
#======================================
-# Deprecated methods
+# baseStripBep
@@ -1001,14 +1214,7 @@ function suseStripKernel {
# rhelStripKernel
#--------------------------------------
+function baseStripBep {
+ # /.../
+ # remove log,dnf, files
+ # ----
+ local dbepfiles=""
+ local directories="
+ /var/log/
+ /var/lib/systemd/catalog
+ "
+ local dbephookdir="/usr/openEuler/hook/bep_delete_hook"
+ for dir in $directories; do
+ dbepfiles=$(find $dir -type f)
+ for file in $dbepfiles
+ do
+ echo -n > $file
+ done
+ done
+ rm -f /var/lib/dnf/history*
+ rm -f /var/lib/rpm/__db.00*
+ baseStripcustomBep $dbephookdir
+}
+
function rhelStripKernel {
- baseStripKernel
-}
-
-#======================================
-# debianStripKernel
-#--------------------------------------
-function debianStripKernel {
- baseStripKernel
+ suseStripKernel
}
#======================================
@@ -1160,4 +1366,18 @@ function baseQuoteFile {
mv "${conf}" "${file}"
}
-# vim: set noexpandtab:
+function rm_isnot_usrfile {
+ local rm_file=$1
+ local usrrpm_filelst='/opt/usrrpm_filelst'
@ -796,142 +807,6 @@ index 98915af..0a7afb3 100644
+
+ return 0
+}
+
+function rhelStripKernel {
+ suseStripKernel
+}
+
+function rhelStripInitrd {
+ suseStripInitrd
+}
+
+function baseStripDocs {
+ # /.../
+ # remove all documentation, except
+ # copying license copyright
+ # ----
+ local docfiles
+ local dir
+ local directories="
+ /opt/gnome/share/doc/packages
+ /usr/share/doc/packages
+ /opt/kde3/share/doc/packages
+ "
+ for dir in ${directories}; do
+ docfiles=$(find "${dir}" -type f |\
+ grep -iv "copying\|license\|copyright")
+ rm -f "${docfiles}"
+ done
+ rm -rf `rpm -qad`
+ rm -rf /usr/share/info
+ rm -rf /usr/share/man
+}
+
function baseCleanMount {
- deprecated "${FUNCNAME[0]}" <<- EOF
- Cleanup operations are a responsibility of the kiwi code
- EOF
+ for path in /proc/sys/fs/binfmt_misc /proc /dev/pts /sys;do
+ [ -d "${path}" ] && umount "${path}" &>/dev/null
+ done
+}
+
+function suseConfig {
+ return
+}
+
+#======================================
+# Rpm
+#--------------------------------------
+function Rpm {
+ # /.../
+ # all rpm function & anounce it to log
+ # ----
+ Debug "rpm $*"
+ rpm "$@"
}
+#======================================
+# baseGetPackagesForDeletion
+#--------------------------------------
+function baseGetPackagesForDeletion {
+ declare kiwi_delete=${kiwi_delete}
+ echo "${kiwi_delete}"
+}
+
+
+#======================================
+# Deprecated methods
+#--------------------------------------
+
function baseMount {
deprecated "${FUNCNAME[0]}" <<- EOF
Mounting of kernel and other base filesystems are a
@@ -877,18 +1210,6 @@ function baseSetupUserPermissions {
EOF
}
-function suseConfig {
- deprecated "${FUNCNAME[0]}" <<- EOF
- suse script no longer present
- EOF
-}
-
-function baseGetPackagesForDeletion {
- deprecated "${FUNCNAME[0]}" <<- EOF
- Provided by the kiwi_delete environment variable
- EOF
-}
-
function baseGetProfilesUsed {
deprecated "${FUNCNAME[0]}" <<- EOF
Provided by the kiwi_profiles environment variable
@@ -902,13 +1223,6 @@ function baseStripMans {
EOF
}
-function baseStripDocs {
- deprecated "${FUNCNAME[0]}" <<- EOF
- Documentation lives at different places and a method
- to do this in a common way should not be a responsibility
- of kiwi
- EOF
-}
function baseStripInfos {
deprecated "${FUNCNAME[0]}" <<- EOF
@@ -917,18 +1231,6 @@ function baseStripInfos {
EOF
}
-function Rpm {
- deprecated "${FUNCNAME[0]}" <<- EOF
- Please call rpm as it fits in the caller scope
- EOF
-}
-
-function rhelStripInitrd {
- deprecated "${FUNCNAME[0]}" <<- EOF
- Useful only in the context of a kiwi created initrd
- This concept was never exposed to RHEL/Fedora
- EOF
-}
function debianStripInitrd {
deprecated "${FUNCNAME[0]}" <<- EOF
@@ -937,12 +1239,6 @@ function debianStripInitrd {
EOF
}
-function rhelStripKernel {
- deprecated "${FUNCNAME[0]}" <<- EOF
- Useful only in the context of a kiwi created initrd
- This concept was never exposed to RHEL/Fedora
- EOF
-}
function debianStripKernel {
deprecated "${FUNCNAME[0]}" <<- EOF
diff --git a/kiwi/path.py b/kiwi/path.py
index b763211..b2ce909 100644
--- a/kiwi/path.py
@ -946,10 +821,10 @@ index b763211..b2ce909 100644
for path_index in reversed(range(0, len(path_elements))):
sub_path = os.sep.join(path_elements[0:path_index])
diff --git a/kiwi/runtime_config.py b/kiwi/runtime_config.py
index 11863c3..5fb93dc 100644
index e968f3c..ba13267 100644
--- a/kiwi/runtime_config.py
+++ b/kiwi/runtime_config.py
@@ -345,6 +345,56 @@ class RuntimeConfig:
@@ -259,6 +259,56 @@ class RuntimeConfig:
)
return disabled_checks or ''
@ -1004,15 +879,15 @@ index 11863c3..5fb93dc 100644
+ return hw_relese_iso_cmdline or None
+
def _get_attribute(self, element, attribute):
if RUNTIME_CONFIG:
if self.config_data:
try:
diff --git a/kiwi/tasks/base.py b/kiwi/tasks/base.py
index 68b7bd5..d714770 100644
index 90f7c45..426e79b 100644
--- a/kiwi/tasks/base.py
+++ b/kiwi/tasks/base.py
@@ -75,7 +75,6 @@ class CliTask:
@@ -74,7 +74,6 @@ class CliTask:
'check_minimal_required_preferences': [],
'check_efi_mode_for_disk_overlay_correctly_setup': [],
'check_initrd_selection_required': [],
'check_boot_description_exists': [],
- 'check_consistent_kernel_in_boot_and_system_image': [],
'check_container_tool_chain_installed': [],
@ -1020,3 +895,4 @@ index 68b7bd5..d714770 100644
'check_volume_setup_defines_multiple_fullsize_volumes': [],
--
2.33.0

View File

@ -1,24 +1,26 @@
diff --git a/kiwi/boot/image/builtin_kiwi.py b/kiwi/boot/image/builtin_kiwi.py
index 6167ad5..5811a96 100644
index 1e8a3b4..8ac574a 100644
--- a/kiwi/boot/image/builtin_kiwi.py
+++ b/kiwi/boot/image/builtin_kiwi.py
@@ -113,9 +113,14 @@ class BootImageKiwi(BootImageBase):
Defaults.get_profile_file(self.boot_root_directory)
)
self.setup.import_description()
- self.setup.import_overlay_files(
- follow_links=True
- )
+ if self.runtime_config.get_custom_hw_systemflag():
+ self.setup.import_overlay_files(
+ follow_links=False
+ )
+ else:
+ self.setup.import_overlay_files(
+ follow_links=True
+ )
self.setup.call_config_script()
system.pinch_system(
@@ -95,9 +95,15 @@ class BootImageKiwi(BootImageBase):
Defaults.get_profile_file(self.boot_root_directory)
)
self.setup.import_description()
- self.setup.import_overlay_files(
- follow_links=True
- )
+ if self.runtime_config.get_custom_hw_systemflag():
+ self.setup.import_overlay_files(
+ follow_links=False
+ )
+ else:
+ self.setup.import_overlay_files(
+ follow_links=True
+ )
+
if self.runtime_config.get_custom_hw_systemflag():
self.setup.setup_groups()
self.setup.setup_users()
--
2.39.1
2.23.0