diff options
author | FreeArtMan <dos21h@gmail.com> | 2020-06-27 18:30:05 +0100 |
---|---|---|
committer | FreeArtMan <dos21h@gmail.com> | 2020-06-27 18:30:05 +0100 |
commit | 56230e82e68912f022e5fa606be93a8e223352bb (patch) | |
tree | 81ef3e18be8767883df93a77a087234807b69645 /create_installroot | |
parent | d8a4544b619c72ab5716c669e21e8d2c68ee5c56 (diff) | |
download | os201-56230e82e68912f022e5fa606be93a8e223352bb.tar.gz os201-56230e82e68912f022e5fa606be93a8e223352bb.zip |
Update image creation scripts
Diffstat (limited to 'create_installroot')
-rwxr-xr-x | create_installroot/boot_qemu.sh | 16 | ||||
-rwxr-xr-x | create_installroot/create_image.sh | 40 |
2 files changed, 56 insertions, 0 deletions
diff --git a/create_installroot/boot_qemu.sh b/create_installroot/boot_qemu.sh new file mode 100755 index 0000000..d7f527b --- /dev/null +++ b/create_installroot/boot_qemu.sh @@ -0,0 +1,16 @@ +#!/bin/dash +qemu-system-x86_64 \ + -kernel bootfs/vmlinuz-xos \ + -hda xos_image.img \ + -append "root=/dev/sda2 rw console=ttyS0 raid=noautodetect init=/Programs/Core/busybox_ASH" \ + -serial stdio -display none \ + -m 256 + +#qemu-system-x86_64 -drive format=raw,file=xos_image.img -m 128 +#qemu-system-x86_64 \ +# -kernel bootfs/vmlinuz-xos \ +# -hda xos_image.img \ +# -append "root=/dev/sda2 rw console=ttyS0 raid=noautodetect init=/Programs/Core/busybox_ASH" \ +# -serial stdio -display none \ +# -m 256 \ +# -vga qxl diff --git a/create_installroot/create_image.sh b/create_installroot/create_image.sh new file mode 100755 index 0000000..6a56fbc --- /dev/null +++ b/create_installroot/create_image.sh @@ -0,0 +1,40 @@ +#!/bin/dash +set -x + +IMG_NAME=xos_image +LOOP_NUM=2 +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 + +kpartx -a ${IMG_NAME}.img +ls /dev/mapper/loop* + +mkfs.ext2 -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/bin/sh /mnt/disk0/bin/ +cp bootfs/bin/init /mnt/disk0/bin/ +cp bootfs/vmlinuz-xos /mnt/disk0/ +ls /mnt/disk0/bin + +mkdir -p /mnt/disk1 +mount ${LOOP}p2 /mnt/disk1/ + +cp -r rootfs/* /mnt/disk1/ +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
\ No newline at end of file |