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

Fixing error on update-initramfs #2

Merged
merged 1 commit into from
Aug 20, 2016
Merged

Conversation

459below
Copy link
Collaborator

This fixes the issue of the missing .ssh folder on updating the
initrd. This seems to happen on a stretch/testing debian system.

This fixes the issue of the missing .ssh folder on updating the
initramfs.
@fetzerms
Copy link
Owner

I think the right place to make sure that the .ssh directory exists would be in the README.md, right before the key generation for the client (around line 122). The ssh-keygen already requires the .ssh directory to exist, even before running update-initramfs.

Can you review your changes?

@459below
Copy link
Collaborator Author

I've forgotten to make it clear that this is about sid/stretch. I was using 'testing' in my VM tests, since it is what I'm using on the real system. I guess that somewhere in the initramfs package something was changed so that '.ssh' inside the newly generated initrd.img (or the temp folder from which it will be generated) isn't created before the hook 'ssh-client' is executed. This patch and #3 don't seem to be needed on raspbian 7.11. The installation on that system went smoothly through with no patches to the upstream repository.

I also checked how it will respond if the directory has already been created by duplicating that command and it doesn't throw an error or even a warning. Running the update-initramfs without this patch on stretch/sid looks like this:

root@debian:~# update-initramfs -u -k all
update-initramfs: Generating /boot/initrd.img-4.6.0-1-amd64
cp: cannot stat '/etc/modprobe.d/*': No such file or directory
dropbear: WARNING: Setting DROPBEAR in /etc/initramfs-tools/initramfs.conf is deprecated and will be ignored in a future release
cp: cannot create regular file '/var/tmp/mkinitramfs_v9ONaw/root/.ssh/': No such file or directory
cp: cannot create regular file '/var/tmp/mkinitramfs_v9ONaw/root/.ssh/': No such file or directory
cp: cannot create regular file '/var/tmp/mkinitramfs_v9ONaw/root/.ssh/': No such file or directory
E: /etc/initramfs-tools/hooks/unlock-keys failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.6.0-1-amd64 with 1.
root@debian:~# 

this is with this patch

root@debian:~# vim /etc/initramfs-tools/hooks/ssh-client 
root@debian:~# update-initramfs -u -k all
update-initramfs: Generating /boot/initrd.img-4.6.0-1-amd64
cp: cannot stat '/etc/modprobe.d/*': No such file or directory
dropbear: WARNING: Setting DROPBEAR in /etc/initramfs-tools/initramfs.conf is deprecated and will be ignored in a future release
root@debian:~# 

@fetzerms fetzerms merged commit 8ea7ff0 into fetzerms:master Aug 20, 2016
@459below 459below deleted the patch-1 branch August 2, 2018 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants