Add 436413 Warn about realloc of size zero to NEWS
[valgrind.git] / docs / internals / qemu-aarch64-linux-HOWTO.txt
blob61ae53189ff00e495d94796eaaa35ded0dce7ba6
2 How to install and configure a QEMU aarch64-linux installation.
3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 Last updated 30 April 2015
7 This gives a fairly usable, and not entirely slow, arm64-linux
8 install.  It has the advantage that the idle loop works right and so
9 when the guest becomes idle, qemu uses only very little host cpu, so
10 you can leave the guest idling for long periods without bad
11 performance effects on the host.
13 More or less following
14 https://gmplib.org/~tege/qemu.html, section 14 (for arm64)
16 Build qemu-2.2.1 with --target-list including aarch64-softmmu
18 mkdir Arm64-2
19 cd Arm64-2
21 wget http://d-i.debian.org/daily-images/arm64/daily/netboot/debian-installer/arm64/linux
23 wget http://d-i.debian.org/daily-images/arm64/daily/netboot/debian-installer/arm64/initrd.gz
25 # Note.  6G is easily enough to install debian and do a build of Valgrind.
26 # If you envisage needing more space, now is the time to choose a larger
27 # number.
29 /path/to/Qemu221/bin/qemu-img create disk6G.img 6G
31 /path/to/Qemu221/bin/qemu-system-aarch64 \
32   -M virt -cpu cortex-a57 -m 256             \ 
33   -drive file=disk6G.img,if=none,id=blk -device virtio-blk-device,drive=blk \
34   -net user,hostfwd=tcp::5555-:22 -device virtio-net-device,vlan=0 \
35   -kernel linux                                                 \
36   -initrd initrd.gz                                             \
37   -append "console=ttyAMA0 --"                                  \
38   -nographic
40 Do an install, be as vanilla as possible, allow it to create a user
41 "username", and do not ask it to install any extra software.  But,
42 when you get to here
44   ┌───────────────────┤ [!!] Finish the installation ├────────────────────┐
45   │                                                                       │
46  ┌│                         Installation complete                         │
47  ││ Installation is complete, so it is time to boot into your new system. │
48  ││ Make sure to remove the installation media (CD-ROM, floppies), so     │
49  ││ that you boot into the new system rather than restarting the          │
50  ││ installation.                                                         │
51  ││                                                                       │
52  └│     <Go Back>                                          <Continue>     │
53   │                                                                       │
54   └───────────────────────────────────────────────────────────────────────┘
56 do "Go Back"
57 then in the next menu "Execute a shell", "Continue"
59 This gives you a root shell in the new VM.  In that shell:
61   mount -t proc proc /target/proc
62   mount --rbind /sys /target/sys
63   mount --rbind /dev /target/dev
64   chroot /target bash
65   /etc/init.d/ssh start
66   mv /boot/initrd.img-3.16.0-4-arm64 /boot/initrd.img-3.16.0-4-arm64.old
67   echo virtio-mmio >>/etc/initramfs-tools/modules
68   /usr/sbin/update-initramfs -c -k 3.16.0-4-arm64
70 Then on the host, copy out the files that the above created.
72 cd Arm64-2
73 ssh -p 5555 username@localhost \
74    "tar -c -f - --exclude=lost+found /boot" | tar xf -
76 Now back in the VM, we can finish the installation.
78   exit
79   exit
80   Select "Finish the installation"
81   Continue
83 When it reboots, kill qemu from another shell, else it will try to reinstall.
85 Now start the installation:
87 /path/to/Qemu221/bin/qemu-system-aarch64 -M virt \
88   -cpu cortex-a57 -m 1024 -drive file=disk6G.img,if=none,id=blk \
89   -device virtio-blk-device,drive=blk -net user,hostfwd=tcp::5555-:22 \
90   -device virtio-net-device,vlan=0 -kernel boot/vmlinuz-3.16.0-4-arm64 \
91   -initrd boot/initrd.img-3.16.0-4-arm64 \
92   -append "root=/dev/vda2 rw console=ttyAMA0 --" -nographic
94 Now you can ssh into the VM and install stuff as usual:
96 ssh -XC -p 5555 username@localhost
98   (on the guest)
99   become root
100   apt-get install make gcc g++ automake autoconf emacs git gdb
102 Hack on, etc.