added x86_64_uclibc platform support

This commit is contained in:
wt
2025-08-17 14:23:39 +07:00
parent a605476c80
commit f1ad90c8bc
13 changed files with 5485 additions and 12 deletions
+30
View File
@@ -0,0 +1,30 @@
#!/bin/sh
set -ex
mkdir -pv installer
cd installer
dd if=/dev/zero of=installer.img bs=1M count=100
sudo modprobe nbd
sudo qemu-nbd --connect /dev/nbd0 installer.img && sync
printf "o\nn\np\n\n\n\nw\n" | sudo fdisk /dev/nbd0 && sync
sudo mkfs.ext4 /dev/nbd0p1 && sync
sudo mount /dev/nbd0p1 /mnt
cd ../build/rootfs
tar -czvf /tmp/rootfs.tar.gz.tmp .
cd ../../installer
sudo tar -xvf /tmp/rootfs.tar.gz.tmp -C /mnt && sync
sudo grub-install --target=i386-pc --root-directory=/mnt /dev/nbd0 && sync
sudo cp ../grub/grub.cfg /mnt/boot/grub/grub.cfg && sync
rawuuid=$(echo $(sudo blkid /dev/nbd0p1 | echo $(awk '{print $2}')))
echo $rawuuid
uuidIN=(${rawuuid//=/ })
uuid=${uuidIN[1]}
echo $uuid
sudo sed -i "s/ROOTUUID/$uuid/g" /mnt/boot/grub/grub.cfg && sync
sudo sed -i "s/\/dev\/sda/UUID=$uuid/g" /mnt/etc/fstab && sync
sudo cp -v ../build/kernel/linux-6.1.91/arch/x86_64/boot/bzImage /mnt/boot/vmlinuz-6.1.91 && sync
sudo cp -v ../build/initramfs.img /mnt/boot && sync
sudo cp -v /tmp/rootfs.tar.gz.tmp /mnt/rootfs.tar.gz && sync
sudo umount /mnt
sudo qemu-nbd --disconnect /dev/nbd0