Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adaptations to work inside a container #669

Merged
merged 2 commits into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions package/yast2-bootloader.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Jul 25 15:26:05 UTC 2022 - Ancor Gonzalez Sosa <[email protected]>

- Execute the command grub2-mkpasswd-pbkdf2 in the target system
so the module can run in a minimal container (bsc#1199840).
- 4.5.2

-------------------------------------------------------------------
Thu Apr 7 13:21:58 UTC 2022 - Josef Reidinger <[email protected]>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-bootloader.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-bootloader
Version: 4.5.1
Version: 4.5.2
Release: 0
Summary: YaST2 - Bootloader Configuration
License: GPL-2.0-or-later
Expand Down
2 changes: 1 addition & 1 deletion src/lib/bootloader/grub2pwd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def disable
end

def encrypt(password)
result = Yast::Execute.locally("/usr/bin/grub2-mkpasswd-pbkdf2",
result = Yast::Execute.on_target("/usr/bin/grub2-mkpasswd-pbkdf2",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, another option I see is to have that mkpasswd installed locally as it does not need to be on target system if it is decided to split it from grub2. We need on target system mainly tools used to create config and install stage1 due to new kernel and new grub2 modules - so grub2-mkconfig and grub2-install.

In general I am not against change if it is properly tested during upgrade from old SLE...do we still support migration from SLE11?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to go this way because is simpler and I don't think grub2-mkpasswd-pbkdf2 will be split from the grub2 package in the foreseeable future.

That tool is included in the grub2 package even for SLE-11. So if you are upgrading such a system the tool is already in the target.

env: { "LANG" => "C" },
stdin: "#{password}\n#{password}\n",
stdout: :capture)
Expand Down
2 changes: 1 addition & 1 deletion test/grub2pwd_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def mock_file_presence(exists)
PBKDF2 hash of your password is #{ENCRYPTED_PASSWORD}
OUTPUT

expect(Yast::Execute).to receive(:locally)
expect(Yast::Execute).to receive(:on_target)
.with(/grub2-mkpasswd/, anything)
.and_return(success_stdout)
subject.password = "really strong password"
Expand Down