mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-03 13:11:31 +00:00
krata: rework cross-compilation
This commit is contained in:
@ -1,12 +1,13 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
TARGET_ARCH="${1}"
|
||||
apk add --update-cache alpine-base \
|
||||
linux-lts linux-firmware-none \
|
||||
mkinitfs dosfstools e2fsprogs \
|
||||
tzdata chrony
|
||||
|
||||
apk add --allow-untrusted /mnt/target/os/krata.apk
|
||||
apk add --allow-untrusted "/mnt/target/os/krata-${TARGET_ARCH}.apk"
|
||||
|
||||
for SERVICE in kratad kratanet
|
||||
do
|
||||
@ -74,7 +75,7 @@ rm -rf /var/cache/apk/*
|
||||
rm -rf /.dockerenv
|
||||
|
||||
cd /
|
||||
rm -f /mnt/target/os/rootfs.tar
|
||||
tar cf /mnt/target/os/rootfs.tar --numeric-owner \
|
||||
rm -f "/mnt/target/os/rootfs-${TARGET_ARCH}.tar"
|
||||
tar cf "/mnt/target/os/rootfs-${TARGET_ARCH}.tar" --numeric-owner \
|
||||
--exclude 'mnt/**' --exclude 'proc/**' \
|
||||
--exclude 'sys/**' --exclude 'dev/**' .
|
||||
|
@ -1,9 +1,20 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
TARGET_ARCH="${1}"
|
||||
TARGET_ARCH_ALT="${2}"
|
||||
apk add --update-cache grub-efi
|
||||
grub-install --target=x86_64-efi --efi-directory=/boot/efi --no-nvram --skip-fs-probe --bootloader-id=BOOT
|
||||
mv /boot/efi/EFI/BOOT/grubx64.efi /boot/efi/EFI/BOOT/BOOTX64.efi
|
||||
grub-install --target="${TARGET_ARCH_ALT}-efi" --efi-directory=/boot/efi --no-nvram --skip-fs-probe --bootloader-id=BOOT
|
||||
|
||||
FROM_EFI_FILE="grubx64.efi"
|
||||
TO_EFI_FILE="BOOTX64.efi"
|
||||
if [ "${TARGET_ARCH}" = "aarch64" ]
|
||||
then
|
||||
FROM_EFI_FILE="grubaa64.efi"
|
||||
TO_EFI_FILE="BOOTA64.efi"
|
||||
fi
|
||||
|
||||
mv "/boot/efi/EFI/BOOT/${FROM_EFI_FILE}" "/boot/efi/EFI/BOOT/${TO_EFI_FILE}"
|
||||
|
||||
ROOT_UUID="$(cat /root-uuid)"
|
||||
|
||||
|
Reference in New Issue
Block a user