summaryrefslogtreecommitdiff
path: root/md/writeup/running_disk_images_in_qemu.md
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2023-02-04 14:10:26 +0000
committerFreeArtMan <dos21h@gmail.com>2023-02-04 14:10:26 +0000
commit380f0fe40b1ab20790e75dac779e73667cc5ac72 (patch)
tree9fa3b9c93b58c966daa22f955282bc3c181d909a /md/writeup/running_disk_images_in_qemu.md
parentdf881efab146ca3ee61bf8936f948dd976fc4740 (diff)
downloadmd-content-380f0fe40b1ab20790e75dac779e73667cc5ac72.tar.gz
md-content-380f0fe40b1ab20790e75dac779e73667cc5ac72.zip
Update all content to new pygmentize
Diffstat (limited to 'md/writeup/running_disk_images_in_qemu.md')
-rw-r--r--md/writeup/running_disk_images_in_qemu.md22
1 files changed, 11 insertions, 11 deletions
diff --git a/md/writeup/running_disk_images_in_qemu.md b/md/writeup/running_disk_images_in_qemu.md
index 3a7c4ea..998ec33 100644
--- a/md/writeup/running_disk_images_in_qemu.md
+++ b/md/writeup/running_disk_images_in_qemu.md
@@ -16,28 +16,28 @@ are missing and if needed test your software.
### Download image
Download raspi debian kernel
-```
+```bash
wget -c https://github.com/dhruvvyas90/qemu-rpi-kernel/raw/master/kernel-qemu-4.4.34-jessie
```
Download image
-```
+```bash
wget -c https://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2017-08-17/2017-08-16-raspbian-stretch-lite.zip
unzip 2017-08-16-raspbian-stretch-lite.zip
```
QEMU is using their own file image format lets concert img to qcow2
-```
+```bash
qemu-img convert -f raw -O qcow2 2017-08-16-raspbian-stretch-lite.img raspbian-stretch-lite.qcow
```
Set network on local machine tun0 that will used by qemu to
-```
+```bash
brctl addbr tun0
brctl addif tun0 enp0s25
```
Start qemu with raspi4 image
-````
+```bash
qemu-system-arm \
-kernel ./kernel-qemu-4.4.34-jessie \
-append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" \
@@ -51,13 +51,13 @@ qemu-system-arm \
Login to raspi prompt
-```
+```bash
Username: pi
Password: raspberry
```
Getting cursor back
-```
+```bash
Ctrl+Alt+g
```
@@ -70,7 +70,7 @@ Be careful its your responsibility what you type in terminal.
Create image 128MB in size, with 2 partitions ext2 and ext4, install grub2.
-```
+```bash
dd if=/dev/zero of=disk.img bs=1048576 count=128
parted --script disk.img mklabel msdos mkpart p ext2 1 64 mkpart p ext4 64 128 set 1 boot on
@@ -93,7 +93,7 @@ kpartx -d disk.img
Installing grub
-```
+```bash
grub-install --target=i386-pc --recheck --no-floppy --root-directory=/mnt/disk0 --modules="biosdisk part_msdos ext2 configfile normal multiboot" /dev/loop0
```
@@ -158,12 +158,12 @@ Here is example how to resize image to bigger size and still be able to run it o
qemu.
Main step that is may harm is fdisk, save disk layout with
-```
+```bash
fdisk -l of=raspbian-stretch-lite-20gb.img
```
and use it for later reference when partition will be resized.
-```
+```bash
dd if=2017-08-16-raspbian-stretch-lite.img of=raspbian-stretch-lite-20gb.img seek=0 conv=notrunc
fdisk -l raspbian-stretch-lite-20gb.img
#use here fdisk to resize partiions