From e86e5423c0f1ef7ed53a94241145a5f5997c89dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20Sch=C3=A4fer?= Date: Tue, 30 Jul 2024 18:16:54 +0200 Subject: [PATCH] Do not exclude the .profile env file by default kiwi's initrd modules read a .profile file which gets included into the initrd produced at build time. To allow rebuild of a host-only initrd from the booted system this information should be present such that it is possible to re-use kiwi initrd code. --- kiwi/defaults.py | 2 +- test/unit/builder/archive_test.py | 4 ++-- test/unit/builder/disk_test.py | 10 +++++----- test/unit/builder/filesystem_test.py | 4 ++-- test/unit/builder/live_test.py | 2 +- test/unit/container/oci_test.py | 4 ++-- test/unit/defaults_test.py | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/kiwi/defaults.py b/kiwi/defaults.py index 0219a3e35f1..aa23a040f37 100644 --- a/kiwi/defaults.py +++ b/kiwi/defaults.py @@ -397,7 +397,7 @@ def get_exclude_list_for_root_data_sync(no_tmpdirs: bool = True): :rtype: list """ exclude_list = [ - 'image', '.profile', '.kconfig' + 'image', '.kconfig' ] if no_tmpdirs: exclude_list += ['run/*', 'tmp/*'] diff --git a/test/unit/builder/archive_test.py b/test/unit/builder/archive_test.py index 19ae672e084..8c62f944927 100644 --- a/test/unit/builder/archive_test.py +++ b/test/unit/builder/archive_test.py @@ -66,7 +66,7 @@ def test_create_tar(self, mock_tar): ) archive.create_xz_compressed.assert_called_once_with( 'root_dir', exclude=[ - 'image', '.profile', '.kconfig', 'run/*', 'tmp/*', + 'image', '.kconfig', 'run/*', 'tmp/*', '.buildenv', 'var/cache/kiwi' ], xz_options=None ) @@ -89,7 +89,7 @@ def test_create_cpio(self, mock_cpio): ) archive.create.assert_called_once_with( 'root_dir', exclude=[ - 'image', '.profile', '.kconfig', 'run/*', 'tmp/*', + 'image', '.kconfig', 'run/*', 'tmp/*', '.buildenv', 'var/cache/kiwi' ] ) diff --git a/test/unit/builder/disk_test.py b/test/unit/builder/disk_test.py index 2e9e0afe68c..ac01dce1921 100644 --- a/test/unit/builder/disk_test.py +++ b/test/unit/builder/disk_test.py @@ -390,7 +390,7 @@ def test_create_disk_standard_root_with_kiwi_initrd( call = filesystem.sync_data.call_args_list[0] assert filesystem.sync_data.call_args_list[0] == \ call([ - 'image', '.profile', '.kconfig', 'run/*', 'tmp/*', + 'image', '.kconfig', 'run/*', 'tmp/*', '.buildenv', 'var/cache/kiwi', 'boot/*', 'boot/.*', 'boot/efi/*', 'boot/efi/.*' ]) @@ -803,7 +803,7 @@ def test_create_disk_standard_root_with_dracut_initrd( assert filesystem.__enter__.return_value \ .sync_data.call_args_list[2] == call([ - 'image', '.profile', '.kconfig', 'run/*', 'tmp/*', + 'image', '.kconfig', 'run/*', 'tmp/*', '.buildenv', 'var/cache/kiwi', 'boot/*', 'boot/.*', 'boot/efi/*', 'boot/efi/.*' ]) @@ -963,7 +963,7 @@ def test_create_disk_standard_root_is_overlay( assert squashfs.create_on_file.call_args_list == [ call(exclude=['var/cache/kiwi'], filename='kiwi-tempname'), call(exclude=[ - '.profile', '.kconfig', 'run/*', 'tmp/*', + '.kconfig', 'run/*', 'tmp/*', '.buildenv', 'var/cache/kiwi', 'boot/*', 'boot/.*', 'boot/efi/*', 'boot/efi/.*', 'image/*' ], filename='kiwi-tempname') @@ -1453,7 +1453,7 @@ def test_create_disk_volume_managed_root( ] volume_manager.sync_data.assert_called_once_with( [ - 'image', '.profile', '.kconfig', 'run/*', 'tmp/*', + 'image', '.kconfig', 'run/*', 'tmp/*', '.buildenv', 'var/cache/kiwi', 'boot/*', 'boot/.*', 'boot/efi/*', 'boot/efi/.*' ] @@ -1609,7 +1609,7 @@ def test_create_disk_spare_part_requested( ) assert filesystem.sync_data.call_args_list.pop() == call( [ - 'image', '.profile', '.kconfig', 'run/*', 'tmp/*', + 'image', '.kconfig', 'run/*', 'tmp/*', '.buildenv', 'var/cache/kiwi', 'var/*', 'var/.*', 'boot/*', 'boot/.*', 'boot/efi/*', 'boot/efi/.*' ] diff --git a/test/unit/builder/filesystem_test.py b/test/unit/builder/filesystem_test.py index 9a668141981..2fb9a19b792 100644 --- a/test/unit/builder/filesystem_test.py +++ b/test/unit/builder/filesystem_test.py @@ -117,7 +117,7 @@ def test_create_on_loop( ) self.filesystem.create_on_device.assert_called_once_with(None) self.filesystem.sync_data.assert_called_once_with([ - 'image', '.profile', '.kconfig', 'run/*', 'tmp/*', + 'image', '.kconfig', 'run/*', 'tmp/*', '.buildenv', 'var/cache/kiwi' ]) self.setup.export_package_verification.assert_called_once_with( @@ -153,7 +153,7 @@ def test_create_on_file( self.filesystem.create_on_file.assert_called_once_with( 'target_dir/myimage.x86_64-1.2.3.squashfs', None, [ - 'image', '.profile', '.kconfig', 'run/*', 'tmp/*', + 'image', '.kconfig', 'run/*', 'tmp/*', '.buildenv', 'var/cache/kiwi' ] ) diff --git a/test/unit/builder/live_test.py b/test/unit/builder/live_test.py index ff215988f4c..a8cce38dac1 100644 --- a/test/unit/builder/live_test.py +++ b/test/unit/builder/live_test.py @@ -283,7 +283,7 @@ def side_effect(): filesystem.create_on_device.assert_called_once_with() filesystem.sync_data.assert_called_once_with([ - 'image', '.profile', '.kconfig', + 'image', '.kconfig', 'run/*', 'tmp/*', '.buildenv', 'var/cache/kiwi' ]) diff --git a/test/unit/container/oci_test.py b/test/unit/container/oci_test.py index 5fc4ad47f54..ecc45b19201 100644 --- a/test/unit/container/oci_test.py +++ b/test/unit/container/oci_test.py @@ -150,7 +150,7 @@ def test_create_oci_archive(self, mock_Compress, mock_cache, mock_OCI): mock_oci.unpack.assert_called_once_with() mock_oci.sync_rootfs.assert_called_once_with( 'root_dir', [ - 'image', '.profile', '.kconfig', 'run/*', 'tmp/*', + 'image', '.kconfig', 'run/*', 'tmp/*', '.buildenv', 'var/cache/kiwi', 'dev/*', 'sys/*', 'proc/*' ] ) @@ -199,7 +199,7 @@ def test_create_derived_docker_archive( mock_oci.unpack.assert_called_once_with() mock_oci.sync_rootfs.assert_called_once_with( 'root_dir', [ - 'image', '.profile', '.kconfig', 'run/*', 'tmp/*', + 'image', '.kconfig', 'run/*', 'tmp/*', '.buildenv', 'var/cache/kiwi', 'dev/*', 'sys/*', 'proc/*' ] ) diff --git a/test/unit/defaults_test.py b/test/unit/defaults_test.py index 79e7fa49068..faa498c419e 100644 --- a/test/unit/defaults_test.py +++ b/test/unit/defaults_test.py @@ -124,12 +124,12 @@ def test_get_exclude_list_from_custom_exclude_files_is_invalid( def test_get_exclude_list_for_root_data_sync(self): assert Defaults.get_exclude_list_for_root_data_sync() == [ - 'image', '.profile', '.kconfig', + 'image', '.kconfig', 'run/*', 'tmp/*', '.buildenv', 'var/cache/kiwi' ] assert Defaults.get_exclude_list_for_root_data_sync(no_tmpdirs=False) == [ - 'image', '.profile', '.kconfig', + 'image', '.kconfig', '.buildenv', 'var/cache/kiwi' ]