elementary / os

The OS build system
https://elementary.io
GNU General Public License v3.0
966 stars 129 forks source link

Build failed on create EFI image (Disk full) #657

Closed Sunderland93 closed 12 months ago

Sunderland93 commented 1 year ago

Hello. I try to build ElementaryOS on Docker (host distro is Ubuntu 22.04), but builder is failed with following error:

P: UEFI Secure Boot support enabled.
Reading package lists...
Building dependency tree...
Reading state information...
grub-efi-amd64-bin is already the newest version (2.06-2ubuntu14.1).
grub-efi-amd64-bin set to manually installed.
Suggested packages:
  floppyd
Recommended packages:
  efibootmgr
The following NEW packages will be installed:
  grub-efi-ia32-bin mtools
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 955 kB of archives.
After this operation, 5965 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 mtools amd64 4.0.33-1+really4.0.32-1build1 [201 kB]
Get:2 https://ppa.launchpadcontent.net/elementary-os/os-patches/ubuntu jammy/main amd64 grub-efi-ia32-bin amd64 2.06-2ubuntu7.1+elementary1~ubuntu7.1 [754 kB]
Fetched 955 kB in 2s (456 kB/s)
Selecting previously unselected package grub-efi-ia32-bin.
(Reading database ... 118750 files and directories currently installed.)
Preparing to unpack .../grub-efi-ia32-bin_2.06-2ubuntu7.1+elementary1~ubuntu7.1_amd64.deb ...
Unpacking grub-efi-ia32-bin (2.06-2ubuntu7.1+elementary1~ubuntu7.1) ...
Selecting previously unselected package mtools.
Preparing to unpack .../mtools_4.0.33-1+really4.0.32-1build1_amd64.deb ...
Unpacking mtools (4.0.33-1+really4.0.32-1build1) ...
Setting up grub-efi-ia32-bin (2.06-2ubuntu7.1+elementary1~ubuntu7.1) ...
Setting up mtools (4.0.33-1+really4.0.32-1build1) ...
Processing triggers for install-info (6.8-4build1) ...
Processing triggers for man-db (2.10.2-1) ...
mkfs.fat 4.2 (2021-01-31)
mkfs.fat 4.2 (2021-01-31)
Disk full
P: Begin unmounting filesystems...
E: An unexpected failure occurred, exiting...
P: Saving caches...

Disk space is more than enough (about 150G)

Sunderland93 commented 1 year ago

Seems like error in tmp/amd64/chroot/binary.sh script, which is generated by lb binary_grub-efi stage

Sunderland93 commented 1 year ago

I wrote simple patch that fix this error for me. It increases number of blocks for creating efi.img:


--- /usr/lib/live/build/binary_grub-efi 2023-02-19 00:09:59.711144321 +0400
+++ /usr/lib/live/build/binary_grub-efi.orig    2023-02-19 00:10:30.827749004 +0400
@@ -255,7 +255,7 @@
 # directories: EFI EFI/boot boot boot/grub
 size=\$((\$size + 4096 * 4))

-blocks=\$(((\$size / 1024 + 55) / 32 * 32 ))
+blocks=\$(((\$size / 1024 + 1540) / 32 * 32 ))

 rm -f ${_CHROOT_DIR}/grub-efi-temp/boot/grub/efi.img
 # The VOLID must be (truncated to) a 32bit hexadecimal number
mirkobrombin commented 1 year ago

I wrote simple patch that fix this error for me. It increases number of blocks for creating efi.img

Thank you for providing the patch. I had encountered the same issue and had worked around it by forcing a larger size for the efi.img file. However, since your solution use a better approach and fix the issue in a cleaner way, I tried it out and the build completed successfully.