diff options
author | FreeArtMan <dos21h@gmail.com> | 2023-10-14 08:24:18 +0100 |
---|---|---|
committer | FreeArtMan <dos21h@gmail.com> | 2023-10-14 08:24:18 +0100 |
commit | 6db32478d5951f01fd055c61176db0fea84379a7 (patch) | |
tree | fd5dec7df6bb293f8754335648bb97c3c106bab4 /create_installroot | |
parent | d06103b3d68eff371751c0ab21c478077718a937 (diff) | |
download | os201-6db32478d5951f01fd055c61176db0fea84379a7.tar.gz os201-6db32478d5951f01fd055c61176db0fea84379a7.zip |
Compiling and createing arm64 image
Diffstat (limited to 'create_installroot')
-rwxr-xr-x | create_installroot/boot_qemu_arm64.sh | 14 | ||||
-rwxr-xr-x | create_installroot/create_image_arm64.sh | 41 |
2 files changed, 51 insertions, 4 deletions
diff --git a/create_installroot/boot_qemu_arm64.sh b/create_installroot/boot_qemu_arm64.sh index 08020e9..94c9975 100755 --- a/create_installroot/boot_qemu_arm64.sh +++ b/create_installroot/boot_qemu_arm64.sh @@ -2,10 +2,13 @@ qemu-system-aarch64 \ - -machine virt -m 256M \ - -append "root=/dev/mtdblock0 rw console=ttyAMA0" \ - -kernel bootfs-arm64/Image -nographic -smp 1 -cpu cortex-a53 - + -machine virt -m 1024M -cpu cortex-a53 \ + -kernel xos_image_arm64.gz \ + -initrd initramfs.cpio.zst \ + -append "root=/dev/initrd init=init" \ + -netdev user,id=mynet \ + -device virtio-net-pci,netdev=mynet \ + -nographic #qemu-system-x86_64 \ @@ -16,6 +19,9 @@ qemu-system-aarch64 \ # -m 256 \ # -netdev tap,id=mynet0,ifname=tap0,script=no,downscript=no -device e1000,netdev=mynet0,mac=52:55:00:d1:55:01 +# -drive if=none,file=xos_image_arm64.img,id=hd0 \ +# -device virtio-blk-device,drive=hd0 \ + #https://gist.github.com/extremecoders-re/e8fd8a67a515fee0c873dcafc81d811c #https://stackoverflow.com/questions/15626088/tap-interfaces-and-dev-net-tun-device-using-ip-tuntap-command diff --git a/create_installroot/create_image_arm64.sh b/create_installroot/create_image_arm64.sh new file mode 100755 index 0000000..65ed8e2 --- /dev/null +++ b/create_installroot/create_image_arm64.sh @@ -0,0 +1,41 @@ +#!/bin/dash +set -x + +IMG_NAME=xos_image_arm64 +LOOP_NUM=0 +LOOP=/dev/mapper/loop${LOOP_NUM} + +dd if=/dev/zero of=${IMG_NAME}.img bs=1048576 count=256 +#parted --script ${IMG_NAME}.img mklabel msdos mkpart p ext2 1 128 mkpart p ext4 128 256 set 1 boot on +parted --script ${IMG_NAME}.img mklabel msdos mkpart p ext4 1 256 set 1 boot on + +kpartx -a ${IMG_NAME}.img +ls /dev/mapper/loop* + +mkfs.ext4 -F ${LOOP}p1 +#mkfs.ext4 -F ${LOOP}p2 + + +mkdir -p /mnt/disk0 +mount ${LOOP}p1 /mnt/disk0/ +#grub-install --target=i386-pc --recheck --no-floppy --root-directory=/mnt/disk0 --modules="biosdisk part_msdos ext2 configfile normal multiboot" /dev/loop${LOOP_NUM} +mkdir -p /mnt/disk0/bin +#cp bootfs-arm64/bin/sh /mnt/disk0/bin/ +#cp bootfs-arm64/bin/init /mnt/disk0/bin/ +#cp bootfs-arm64/vmlinux /mnt/disk0/ +ls /mnt/disk0/bin + +#mkdir -p /mnt/disk1 +#mount ${LOOP}p2 /mnt/disk1/ + +cp -r rootfs-arm64/* /mnt/disk0/ +ls /mnt/disk1/bin/ + +#nano /mnt/disk0/boot/grub/grub.cfg +#cp bootfs/grub.cfg /mnt/disk0/boot/grub/grub.cfg +umount /mnt/disk0 +#umount /mnt/disk1 +kpartx -d ${IMG_NAME}.img + +chown fam ${IMG_NAME}.img +chgrp fam ${IMG_NAME}.img |