From f59507647980cb316a8ebe0ffad33380c56c6360 Mon Sep 17 00:00:00 2001 From: Nulo Date: Sat, 10 Sep 2022 09:10:07 -0300 Subject: [PATCH] qemu.sh: Arreglar/aclarar formatos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tmp.qcow2 nunca se usaba como qcow2 porque se convertía en ext4 como si fuese un archivo raw --- .gitignore | 2 +- qemu.sh | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 3bdcd8f..b1812db 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ v00001/ boot/ image.squashfs cache/ -tmp.qcow2 +tmp.ext4 diff --git a/qemu.sh b/qemu.sh index 00b9c4d..a88544e 100755 --- a/qemu.sh +++ b/qemu.sh @@ -5,12 +5,14 @@ if test "$NOGRAPHIC" = true; then qemuappend="-nographic" fi -qemu-img create -f qcow2 tmp.qcow2 1G -mkfs.ext4 tmp.qcow2 +fallocate --length 1G tmp.ext4 +mkfs.ext4 tmp.ext4 sudo chown root:$(id -u) -R boot/ && sudo chmod g+rw -R boot/ qemu-system-x86_64 -enable-kvm -m 2048 \ - -drive file=image.squashfs,media=disk \ - -drive file=tmp.qcow2,media=disk \ + -drive file=image.squashfs,media=disk,format=raw \ + -drive file=tmp.ext4,media=disk,format=raw \ + -net nic,model=virtio-net-pci \ + -net user,hostfwd=tcp:10.69.0.2:8080-:80 \ -kernel boot/vmlinuz-virt -initrd boot/initramfs-virt \ -append "root=/dev/sda rootfstype=squashfs modules=ext4 init=/sbin/runit-init $append" $qemuappend