From 860350456aca9cbb5e8728fd71cbb7a4023578db Mon Sep 17 00:00:00 2001 From: FreeArtMan Date: Thu, 21 Dec 2023 12:54:48 +0000 Subject: Added initrd script. Add bootable example with prebuilt images --- create_installroot/boot_qemu_arm64.sh | 10 ++++------ create_installroot/bootfs-arm64/Image.gz | Bin 0 -> 9997538 bytes create_installroot/rootfs-arm64/busybox | Bin 0 -> 1384328 bytes create_installroot/rootfs-arm64/init | 9 +++++++++ create_tools/config/busybox-arm64.config | 2 +- 5 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 create_installroot/bootfs-arm64/Image.gz create mode 100755 create_installroot/rootfs-arm64/busybox create mode 100755 create_installroot/rootfs-arm64/init diff --git a/create_installroot/boot_qemu_arm64.sh b/create_installroot/boot_qemu_arm64.sh index 94c9975..fc4ec51 100755 --- a/create_installroot/boot_qemu_arm64.sh +++ b/create_installroot/boot_qemu_arm64.sh @@ -2,12 +2,10 @@ qemu-system-aarch64 \ - -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 \ + -machine virt -m 1024M -cpu cortex-a53 \ + -kernel bootfs-arm64/Image.gz \ + -initrd initrd-out.gz \ + -append "root=/dev/ram0 console=ttyAMA0 debug " \ -nographic diff --git a/create_installroot/bootfs-arm64/Image.gz b/create_installroot/bootfs-arm64/Image.gz new file mode 100644 index 0000000..7c73fb6 Binary files /dev/null and b/create_installroot/bootfs-arm64/Image.gz differ diff --git a/create_installroot/rootfs-arm64/busybox b/create_installroot/rootfs-arm64/busybox new file mode 100755 index 0000000..3070325 Binary files /dev/null and b/create_installroot/rootfs-arm64/busybox differ diff --git a/create_installroot/rootfs-arm64/init b/create_installroot/rootfs-arm64/init new file mode 100755 index 0000000..53ad0cc --- /dev/null +++ b/create_installroot/rootfs-arm64/init @@ -0,0 +1,9 @@ +#!/sh +/busybox echo "Boom" > /dev/kmsg +export PATH=/sbin:/usr/sbin:/bin:/usr/bin:/ +/busybox mount -t proc none /proc +/busybox mount -t sysfs none /sys +/buysbox mount -t devtmpfs -o nosuid,mode=0755 udev /dev +/busybox mount /dev/pts +/busybox mount -t devpts -o noexec,nosuid,gid=5,mode=0620 devpts /dev/pts || true +exec /busybox sh diff --git a/create_tools/config/busybox-arm64.config b/create_tools/config/busybox-arm64.config index 33049a5..2030765 100644 --- a/create_tools/config/busybox-arm64.config +++ b/create_tools/config/busybox-arm64.config @@ -49,7 +49,7 @@ CONFIG_FEATURE_SYSLOG=y # CONFIG_FEATURE_SHARED_BUSYBOX is not set CONFIG_CROSS_COMPILER_PREFIX="aarch64-linux-gnu-" CONFIG_SYSROOT="" -CONFIG_EXTRA_CFLAGS="" +CONFIG_EXTRA_CFLAGS="-static" CONFIG_EXTRA_LDFLAGS="" CONFIG_EXTRA_LDLIBS="" # CONFIG_USE_PORTABLE_CODE is not set -- cgit v1.2.3