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

Support EFI booting #27

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

matthijskooijman
Copy link
Member

@matthijskooijman matthijskooijman commented Apr 8, 2019

This PR adds support for EFI booting using syslinux.

This just adds the needed syslinux config files. To actually make this work, live-build must support it. Currently, I've submitted a merge request mto live-build to make this work, see https://salsa.debian.org/live-team/live-build/merge_requests/19. Since the next Debian release (buster) is in freeze, this is not expected to be released until bullseye. To test this now, here's a build of live-build with the above MR applied I built locally: https://salsa.debian.org/live-team/live-build/merge_requests/19#note_79971

Also, this requires installing the syslinux, syslinux-efi and syslinux-common packages from Debian buster, since the stretch versions do not work with EFI booting (boot will fail with Undef symbol FAIL: memset, see this update).

Note that this PR includes the commits from #24, which is still unmerged. Only the last 2 commits are related to EFI support.

I would suggest not merging this PR yet, but first wait until the upstream change in live-build is merged (or at least approved), so we can be sure that EFI-support will work as expected.

This reverts commit 89dcd1c.

The commit didn't really solve the problem (it stopped making
SOURCE_DATE_EPOCH available for all commands) and broke building using
sudo by removing the SUDO variable for no apparent reason.
Previously, it would be based on the git version of this repo, which
isn't quite correct. Also, when running the build using the Dockerfile,
the .git directory of this repo would not be available, so no date could
be determined, which might break the build.

This should fix Webconverger#23 again.
When building a hdd image, syslinux is used. However, there seems to
be some kind of locking or timing issue, that causes the "sylinux"
command to fail:

	P: Copying binary contents into image...
	plain floppy: device "/proc/27467/fd/3" busy (Resource temporarily unavailable):
	Cannot initialize 'S:'
	Bad target s:/ldlinux.sys
	syslinux: failed to create ldlinux.sys

Note that the first two error messages are normal, the "Bad target"
error message is particular to this issue.

I have never figured out what the actual cause is, but it turns out that
adding a second sleep before the mcopy command (which is called by the
syslinux command) prevents this problem from occuring.

This commit adds a wrapper script for the mcopy command that does
exactly this.
There was an extra pair of parenthesis which bash didn't mind, but
breaks with dash.
It seems this script was written for an sha1sum command that only
returns the sum, but my version also returns the filename. This should
now work for both.
This command then shows the UUID from the VirtualBox database, which is
exactly what we need (since that is the UUID that VirtualBox expects to
be able to run without error). If the VDI file is not registered with
VirtualBox, it just shows the UUID from the current file, if any.

This change means the VDI file no longer needs to be kept around, it can
be removed and recreated later without problems.
This prevents issues with the (default) bootloader configuration not
being updated switching between isohybrid and hdd images.
@matthijskooijman
Copy link
Member Author

I updated this PR with a few minor changes, following similar changes in the live-build merge request. I also included a link to an updated live-build package in the first post. Nothing functionally changed though, changes are really just cosmetic.

This allows using the EFI version of syslinux on the hdd images. At the
time of writing, live-build support for syslinux-efi is not merged yet,
but this commit works with custom build of live-build that has
https://salsa.debian.org/live-team/live-build/merge_requests/19 applied
(version of 2019-05-30).

Also note that this does not work (that is, fails at boot with `Undef
symbol FAIL: memset`) with the stretch version of syslinux-efi, but
upgrading the syslinux, syslinux-common and syslinux-efi on the build
host to the buster versions should make things work.

There is no need to explicitly enable syslinux-efi support in the
live-build configuration, since it is enabled by default for hdd images.

When using an unmodified version of live-build (e.g. the Debian/stretch
version), the build still works, but the image will only have BIOS
syslinux support.
@matthijskooijman
Copy link
Member Author

Pushed on more update (I broke things with the previous push). I also updated the first post with some more links and instructions and a link to a newer version of a custom live-build package (again, not real functional changes).

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.

1 participant