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

Failed to check file system type of "/boot": No such file or directory #30

Open
Rotsor opened this issue Feb 14, 2017 · 10 comments
Open

Comments

@Rotsor
Copy link
Contributor

Rotsor commented Feb 14, 2017

I tried running this on Ubuntu 15.10.

This was the error message, looks like it came from the last step in nixos-install.
Now, perhaps I was doomed because I think my system boots using uefi, but the error message would seem to suggest a simple bug or a missing sanity check somewhere. What is responsible for ensuring /boot exists?

finalising the installation...
Failed to check file system type of "/boot": No such file or directory
Traceback (most recent call last):
  File "/nix/store/w3kckp1k7hngiadrcllybnji9nc8di25-systemd-boot-builder.py", line 102, in <module>
    subprocess.check_call(["/nix/store/mnbl0f66cykmwjin47r7rlnwwgiac7ys-systemd-231/bin/bootctl", "--path=/boot", "install"])
  File "/nix/store/ignn33dyacf5vm5hsmwiaj617226x1js-python-2.7.12/lib/python2.7/subprocess.py", line 541, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/nix/store/mnbl0f66cykmwjin47r7rlnwwgiac7ys-systemd-231/bin/bootctl', '--path=/boot', 'install']' returned non-zero exit status 1
@Rotsor
Copy link
Contributor Author

Rotsor commented Feb 15, 2017

I made the bootctl command succeed by doing the following immediately after the failing nixos-install:

Outside of chroot:

# mount my uefi system volume (which happened to be already mounted
# to /boot/efi) so it's available in the chroot; /nixos is not a good place for it,
# but it works
mount --bind /boot/efi /nixos/boot-efi

Inside the chroot:

mount -t efivarfs efivarfs /sys/firmware/efi/efivars
# note the different value of --path
/nix/store/mnbl0f66cykmwjin47r7rlnwwgiac7ys-systemd-231/bin/bootctl --path=/nixos/boot-efi install

... which installed systemd boot fine, but I still don't have the nixos entry there. Looking...

@Rotsor
Copy link
Contributor Author

Rotsor commented Feb 15, 2017

There was no nixos entry because nixos-install ended up writing uefi stuff to /boot, which was not mounted. I should have mounted my /boot/efi to /boot in the chroot.

@jeaye
Copy link
Owner

jeaye commented Feb 15, 2017

Hey, thanks for looking into this! There hasn't been any uefi support added yet, but it sounds like you've actually made it pretty far. If you feel like adding what you've found to a flag on the script, to enable this, I'd be happy to see the PR.

@Rotsor
Copy link
Contributor Author

Rotsor commented Feb 15, 2017

Yeah, I'll think about how to package this up in a way that's not too specific to my system and then get back to you.

@Rotsor
Copy link
Contributor Author

Rotsor commented Feb 17, 2017

efi_loader_get_device_part_uuid function in https://github.com/systemd/systemd/blob/master/src/shared/efivars.c is how to discover what partition is the EFI System Partition.
My plan is to re-implement this logic in bash. Please tell me if that sounds crazy.

@jeaye
Copy link
Owner

jeaye commented Feb 17, 2017

Sounds pretty crazy. I'd be sure to check for existing solutions thoroughly first, even if it means using a Python library or something. The less code we need to maintain, the better.

With that said, I don't know much about EFI, which is why it was never implemented to begin with.

@Rotsor
Copy link
Contributor Author

Rotsor commented Feb 18, 2017

It's not too complicated if you assume existence of a few standard unix tools (C is pretty verbose and we don't need to be as general):

esp_device="/dev/disk/by-partuuid/$(cat /sys/firmware/efi/efivars/LoaderDevicePartUUID-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f | tail -c +5 | head -c -1 | iconv --from-code=UTF16 | tr '[:upper:]' '[:lower:]')"

That said, I agree we should start with a simpler version.

@jeaye
Copy link
Owner

jeaye commented Feb 18, 2017 via email

@Rotsor
Copy link
Contributor Author

Rotsor commented Feb 19, 2017

I was wrong: I thought that variable gets populated by bios, but apparently it's systemd-boot that populates it, which means that the system might not have that variable populated. In #32 I implemented an alternative, less robust way of discovering the EFI System Partition using fdisk.

@jeaye
Copy link
Owner

jeaye commented Feb 27, 2017 via email

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

No branches or pull requests

2 participants