Skip to content

Commit

Permalink
Fix initrd permissions
Browse files Browse the repository at this point in the history
kiwi stored the initrd for ISO images as 600 which might
be too restrictive. This commit makes sure the initrd is
stored as 644 and Fixes bsc#1229257
  • Loading branch information
schaefi committed Sep 3, 2024
1 parent 12fccc2 commit 111e457
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kiwi/boot/image/dracut.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ def create_initrd(
self.initrd_filename = os.sep.join(
[self.target_dir, dracut_initrd_basename]
)
Command.run(
['chmod', '644', self.initrd_filename]
)

def _get_modules(self) -> List[str]:
cmd = Command.run(
Expand Down
6 changes: 6 additions & 0 deletions test/unit/boot/image/dracut_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ def test_create_initrd(
'LimeJeOS.x86_64-1.13.2.initrd',
'some-target-dir'
]
),
call(
['chmod', '644', 'some-target-dir/LimeJeOS.x86_64-1.13.2.initrd']
)
]
mock_command.reset_mock()
Expand All @@ -172,6 +175,9 @@ def test_create_initrd(
'system-directory/foo',
'some-target-dir'
]
),
call(
['chmod', '644', 'some-target-dir/foo']
)
]

Expand Down

0 comments on commit 111e457

Please sign in to comment.