Compare commits

...

5 Commits

Author SHA1 Message Date
Jeremy Soller
ae96ebc267
Update relibc 2020-01-21 20:29:37 -07:00
Jeremy Soller
1bac098cc0
Format harddrive-efi.bin target 2020-01-21 19:52:22 -07:00
Jeremy Soller
c91465dc1c
Make harddrive-efi.bin target run in a single shell instance 2020-01-21 19:50:15 -07:00
Jeremy Soller
6a2ac14550
Remove erroneous ONESHELL usage 2020-01-21 19:41:25 -07:00
Jeremy Soller
175039bded
Revert "Fix .partial paths"
This reverts commit 8cccf0edaa711270faf0318d071f1cb5eba40b68.
2020-01-21 19:39:28 -07:00
3 changed files with 27 additions and 26 deletions

View File

@ -52,29 +52,30 @@ build/harddrive-efi-old.bin: build/bootloader.efi build/filesystem.bin
mcopy -i $@.partial $< ::efi/boot/bootx64.efi mcopy -i $@.partial $< ::efi/boot/bootx64.efi
cat $@.partial build/filesystem.bin > $@ cat $@.partial build/filesystem.bin > $@
.ONESHELL:
build/harddrive-efi.bin: build/bootloader.efi build/filesystem.bin build/harddrive-efi.bin: build/bootloader.efi build/filesystem.bin
# TODO: Validate the correctness of this # TODO: Validate the correctness of this \
# Populate an EFI system partition # Populate an EFI system partition \
dd if=/dev/zero of=$@.esp bs=1048576 count=$$(expr $$(du -m $< | cut -f1) + 1) dd if=/dev/zero of=$@.esp bs=1048576 count=$$(expr $$(du -m $< | cut -f1) + 1) && \
mkfs.vfat $@.esp mkfs.vfat $@.esp && \
mmd -i $@.esp efi mmd -i $@.esp efi && \
mmd -i $@.esp efi/boot mmd -i $@.esp efi/boot && \
mcopy -i $@.esp $< ::efi/boot/bootx64.efi mcopy -i $@.esp $< ::efi/boot/bootx64.efi && \
# Create the disk # Create the disk \
dd if=/dev/zero of=$@ bs=1048576 count=$$(expr $$(du -m $< | cut -f1) + 2 + $$(du -m build/filesystem.bin | cut -f1)) dd if=/dev/zero of=$@ bs=1048576 count=$$(expr $$(du -m $< | cut -f1) + 2 + $$(du -m build/filesystem.bin | cut -f1)) && \
# Create partition table # Create partition table \
parted -s -a minimal $@ mklabel gpt parted -s -a minimal $@ mklabel gpt && \
efi_disk_size=$$(du -m $< | cut -f1) efi_disk_blkcount=$$(expr $$efi_disk_size \* $$(expr 1048576 / 512)) efi_disk_size=$$(du -m $< | cut -f1) && \
efi_end=$$(expr 2048 + $$efi_disk_blkcount) efi_disk_blkcount=$$(expr $$efi_disk_size \* $$(expr 1048576 / 512)) && \
efi_last=$$(expr $$efi_end - 1) efi_end=$$(expr 2048 + $$efi_disk_blkcount) && \
parted -s -a minimal $@ mkpart EFI fat32 2048s "$${efi_last}s" efi_last=$$(expr $$efi_end - 1) && \
fs_disk_size=$$(du -m build/filesystem.bin | cut -f1) fs_disk_blkcount=$$(expr $$fs_disk_size \* $$(expr 1048576 / 512)) parted -s -a minimal $@ mkpart EFI fat32 2048s "$${efi_last}s" && \
parted -s -a minimal $@ mkpart redox ext4 "$${efi_end}s" $$(expr $$efi_end + $$fs_disk_blkcount)s fs_disk_size=$$(du -m build/filesystem.bin | cut -f1) && \
parted -s -a minimal $@ set 1 boot on fs_disk_blkcount=$$(expr $$fs_disk_size \* $$(expr 1048576 / 512)) && \
parted -s -a minimal $@ set 1 esp on parted -s -a minimal $@ mkpart redox ext4 "$${efi_end}s" $$(expr $$efi_end + $$fs_disk_blkcount)s && \
# Write the partitions parted -s -a minimal $@ set 1 boot on && \
dd if=$@.esp bs=512 seek=2048 conv=notrunc count=$$efi_disk_blkcount of=$@ parted -s -a minimal $@ set 1 esp on && \
# Write the partitions \
dd if=$@.esp bs=512 seek=2048 conv=notrunc count=$$efi_disk_blkcount of=$@ && \
dd if=build/filesystem.bin seek=$$efi_end bs=512 conv=notrunc of=$@ count=$$fs_disk_blkcount dd if=build/filesystem.bin seek=$$efi_end bs=512 conv=notrunc of=$@ count=$$fs_disk_blkcount
build/livedisk-efi.iso: build/bootloader.efi build/kernel_live build/livedisk-efi.iso: build/bootloader.efi build/kernel_live

View File

@ -42,9 +42,9 @@ $(PREFIX)/relibc-install: $(ROOT)/relibc | $(PREFIX)/gcc-install
make -j `$(NPROC)` install-headers DESTDIR="$(ROOT)/$@.partial/$(TARGET)" && \ make -j `$(NPROC)` install-headers DESTDIR="$(ROOT)/$@.partial/$(TARGET)" && \
make -j `$(NPROC)` all && \ make -j `$(NPROC)` all && \
make -j `$(NPROC)` install DESTDIR="$(ROOT)/$@.partial/$(TARGET)" make -j `$(NPROC)` install DESTDIR="$(ROOT)/$@.partial/$(TARGET)"
cd "$(ROOT)/$@.partial" && $(PREFIX_STRIP) cd "$@.partial" && $(PREFIX_STRIP)
touch "$(ROOT)/$@.partial" touch "$@.partial"
mv "$(ROOT)/$@.partial" "$(ROOT)/$@" mv "$@.partial" "$@"
$(PREFIX)/relibc-install.tar.gz: $(PREFIX)/relibc-install $(PREFIX)/relibc-install.tar.gz: $(PREFIX)/relibc-install
tar \ tar \

2
relibc

@ -1 +1 @@
Subproject commit 2e5d4a4d25e7364786802f0d899e789962c5ce6a Subproject commit 9a449d4f6c5fe68f93afb7dd97900f33907a7388