# Raspi3 Usage
Rapsi3 almost works, but:
* reboot fails with kernel hang
* usb not work (qemu not support)
* network is based on usb, not work, nfs boot not work
## Boot with graphic
Note: login console is there, but not accept input currently.
$ make boot V=1 G=1
## Boot with serial
$ make boot V=1 // with pl011, by default
## Boot debian
It is able to boot externl kernel, dtb, initrd and sdcard rootfs image from debian, please refer to [Raspi3 debian][4]:
$ mkdir debian
$ cd debian
$ wget -c https://people.debian.org/~stapelberg/raspberrypi3/2018-01-08/2018-01-08-raspberry-pi-3-buster-PREVIEW.img.xz
$ xz -d 2018-01-08-raspberry-pi-3-buster-PREVIEW.img.xz
$ fdisk -l 2018*.img
Disk 2018-01-08-raspberry-pi-3-buster-PREVIEW.img: 1.1 GiB, 1153433600 bytes, 2252800 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xac8dad98
Device Boot Start End Sectors Size Id Type
2018-01-08-raspberry-pi-3-buster-PREVIEW.img1 2048 614399 612352 299M c W95 FAT32 (LBA)
2018-01-08-raspberry-pi-3-buster-PREVIEW.img2 614400 2252799 1638400 800M 83 Linux
$ sudo mkdir /mnt/debian
$ sudo mount -o offset=$((2048*512)) /mnt/debian/
$ sudo cp /mnt/debian/vmlinuz-4.14.0-3-arm64 .
$ sudo cp /mnt/debian/initrd.img-4.14.0-3-arm64 .
$ sudo cp /mnt/debian/bcm2837-rpi-3-b.dtb .
$ make boot KIMAGE=$PWD/debian/vmlinuz-4.14.0-3-arm64 INITRD=$PWD/debian/initrd.img-4.14.0-3-arm64 DTB=$PWD/debian/bcm2837-rpi-3-b.dtb \
ROOTDEV=/dev/mmcblk0p2 ROOTFS=$PWD/debian/2018-01-08-raspberry-pi-3-buster-PREVIEW.img V=1
rpi3 login: root
password: <------ input raspberry as passwd
root@rpi3:~# cat /etc/issue
Debian GNU/Linux buster/sid \n \l
root@rpi3:~# uname -a
Linux rpi3 4.14.0-3-arm64 #1 SMP Debian 4.14.12-2 (2018-01-06) aarch64 GNU/Linux
# Boot ubuntu
Here introduces how to download and boot ubuntu from docker image, the following steps are done in host system, except the one explicitly said in Linux Lab.
Check official arm64 ubuntu image:
$ docker search arm64v8 | grep ubuntu
arm64v8/ubuntu Ubuntu is a Debian-based Linux operating system 25
Download and extract the rootfs out to `prebuilt/fullroot/tmp`:
$ cd $(path-to)/linux-lab
$ tools/root/docker/extract.sh arm64v8/ubuntu aarch64
LOG: Pulling arm64v8/ubuntu
Using default tag: latest
latest: Pulling from arm64v8/ubuntu
745b76626a20: Pulling fs layer
6ce7a8922cb8: Download complete
565a1332f5cd: Download complete
...
LOG: Running arm64v8/ubuntu
LOG: Creating temporary rootdir: ...linux-lab/prebuilt/fullroot/tmp/arm64v8-ubuntu
LOG: Extract docker image to ...linux-lab/prebuilt/fullroot/tmp/arm64v8-ubuntu
[sudo] password for falcon:
LOG: Removing docker container
8c15a9d30b402e46f63227b6286d54c6afdd80d9193c2ee28684395830fef042
LOG: Chroot into new rootfs
Linux ubuntu 4.4.0-148-generic #174-Ubuntu SMP Tue May 7 12:20:14 UTC 2019 aarch64 aarch64 aarch64 GNU/Linux
Ubuntu 18.04.2 LTS \n \l
Or pull it and then extract:
$ docker pull arm64v8/ubuntu
$ PULL=0 tools/root/docker/extract.sh arm64v8/ubuntu aarch64
Use it with docker:
$ sudo apt-get install qemu-user-static
$ $ docker run -it -v /usr/bin/qemu-aarch64-static:/usr/bin/qemu-aarch64-static arm64v8/ubuntu
root@bceb61278159:/# uname -a
Linux bceb61278159 4.4.0-148-generic #174-Ubuntu SMP Tue May 7 12:20:14 UTC 2019 aarch64 aarch64 aarch64 GNU/Linux
root@bceb61278159:/# cat /etc/issue
Ubuntu 18.04.2 LTS \n \l
Use it with chroot:
$ tools/root/docker/chroot.sh arm64v8/ubuntu
LOG: Chroot into ...linux-lab/prebuilt/fullroot/tmp/arm64v8-ubuntu
root@ubuntu:/#
Boot it in Linux Lab, please launch it at fist:
$ make boot ROOTFS=$PWD/prebuilt/fullroot/tmp/arm64v8-ubuntu
hctosys: unable to open rtc device (rtc0)
EXT4-fs (vda): mounting ext2 file system using the ext4 subsystem
EXT4-fs (vda): mounted filesystem without journal. Opts: (null)
VFS: Mounted root (ext2 filesystem) on device 254:0.
devtmpfs: mounted
Freeing unused kernel memory: 832K
Run /sbin/init as init process
Run /etc/init as init process
Run /bin/init as init process
Run /bin/sh as init process
/bin/sh: 0: can't access tty; job control turned off
# uname -a
Linux (none) 5.1.0-dirty #13 SMP Tue May 28 02:17:08 UTC 2019 aarch64 aarch64 aarch64 GNU/Linux
Similarly, boot another `tinylab/arm64v8-ubuntu` docker image, it is a more powerful ubuntu system, please download and extract it at first:
$ make boot ROOTFS=$PWD/prebuilt/fullroot/tmp/tinylab-arm64-ubuntu
...
[ OK ] Started Set console scheme.
[ OK ] Created slice system-getty.slice.
[ OK ] Started Getty on tty1.
[ OK ] Reached target Login Prompts.
[ OK ] Reached target Multi-User System.
[ OK ] Reached target Graphical Interface.
Starting Update UTMP about System Runlevel Changes...
[ OK ] Started Update UTMP about System Runlevel Changes.
Ubuntu 18.04.2 LTS localhost.localdomain ttyAMA0
localhost login: root
Password: <------ input root as password
Last login: Wed May 15 04:58:46 UTC 2019 on ttyAMA0
Welcome to Ubuntu 18.04.2 LTS (GNU/Linux 5.1.0-dirty aarch64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
root@localhost:~#
root@localhost:~#
root@localhost:~# cat /etc/issue
Ubuntu 18.04.2 LTS \n \l
root@localhost:~# uname -a
Linux localhost.localdomain 5.1.0-dirty #13 SMP Tue May 28 02:17:08 UTC 2019 aarch64 aarch64 aarch64 GNU/Linux
Since raspi3 qemu not support network yet, please use chroot or docker to run the rootfs and install necessary packages if required.
# Boot buildroot
Buildroot is able to compile a whole system for raspi3, include kernel image, dtb, initrd and sdcard image, just configure, build and boot:
$ find buildroot/ -name "*pi3*defconfig"
buildroot/configs/raspberrypi3_defconfig
buildroot/configs/raspberrypi3_qt5we_defconfig
buildroot/configs/raspberrypi3_64_defconfig
$ make root-defconfig RCFG=raspberrypi3_64_defconfig V=1
$ make root-menuconfig
$ make root
$ make boot KIMAGE=$PWD/build/aarch64/buildroot-2019.02.2-cortex-a53/images/Image DTB=$PWD/build/aarch64/buildroot-2019.02.2-cortex-a53/images/bcm2710-rpi-3-b.dtb INITRD=$PWD/build/aarch64/buildroot-2019.02.2-cortex-a53/images/rootfs.cpio.gz V=1
## References
* [Qemu raspi3 support][1]
* [Raspi3 hardware spec][2]
* [Raspi3 linux kernel][3]
* [Raspi3 debian][6]
* [Raspbian][5]
* [Ubuntu rootfs][10]
* [Ubuntu docker image][11]
* [Debian rootfs][12]
* [Debian docker image][13]
* [Reproducible, snapshot-based Debian rootfs builder][14]
* buildroot/configs/raspberrypi3_64_defconfig
[1]: https://github.com/bztsrc/qemu-raspi3
[2]: https://www.raspberrypi.org/magpi/raspberry-pi-3-specs-benchmarks/
[3]: https://github.com/raspberrypi/linux
[4]: https://translatedcode.wordpress.com/2018/04/25/debian-on-qemus-raspberry-pi-3-model/
[5]: https://www.raspberrypi.org/downloads/
[6]: https://wiki.debian.org/RaspberryPi3
[7]: https://github.com/Debian/raspi3-image-spec
[8]: https://people.debian.org/~stapelberg/
[9]: https://people.debian.org/~gwolf/raspberrypi3/
[10]: https://partner-images.canonical.com/core/
[11]: https://hub.docker.com/r/arm64v8/ubuntu
[12]: https://github.com/debuerreotype/docker-debian-artifacts/tree/dist-arm64v8
[13]: https://hub.docker.com/r/arm64v8/debian
[14]: https://github.com/debuerreotype/debuerreotype
没有合适的资源?快使用搜索试试~ 我知道了~
基于 Docker + QEMU 的 Linux 实验环境,方便大家学习、开发和测试 Linux 内核
共368个文件
sh:84个
makefile:59个
md:52个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 45 浏览量
2024-04-28
15:45:12
上传
评论
收藏 2.53MB ZIP 举报
温馨提示
Linux 内核实验室,基于 Docker/Qemu 的极速 Linux 内核学习、开发和测试环境。社区制作了多款免安装的随身Linux Lab系统盘
资源推荐
资源详情
资源评论
收起资源包目录
基于 Docker + QEMU 的 Linux 实验环境,方便大家学习、开发和测试 Linux 内核 (368个子文件)
Makefile.linux_v2.6.10 679B
Makefile.linux_v2.6.11.12 63B
AUTHORS 161B
gdbinit.auto 71B
backup 9KB
config.aarch64.virt.broken 207B
ldt.c 14KB
misc_loop_drv.c 9KB
dio.c 7KB
ldt_plat_drv.c 3KB
ldt_configfs_basic.c 2KB
ldt_plat_dev.c 1KB
kthread_sample.c 919B
hello.c 746B
exception.c 600B
hello.c 431B
hello.c 97B
cache 16KB
kft.conf 115B
resolv.conf 38B
config 5KB
config 266B
config 237B
config 198B
config 143B
config 143B
config 128B
config 124B
config 109B
config 101B
config 89B
config 76B
config 40B
config 27B
config_iface 628B
COPYING 18KB
kernel.default 503B
uboot.default 306B
Dockerfile 166B
dtc 135KB
gc.eps 1.88MB
typical.eps 1.87MB
extract-ikconfig 842B
free 9KB
env.g3beige 8B
env.g3beige 8B
env.g3beige 8B
Makefile.gcc 128B
gdbinit 66B
.gitignore 241B
.gitignore 106B
.gitignore 83B
.gitignore 73B
.gitignore 73B
.gitignore 53B
.gitignore 38B
.gitignore 33B
.gitignore 25B
.gitignore 19B
.gitignore 18B
.gitignore 18B
.gitignore 18B
.gitignore 18B
.gitignore 16B
.gitignore 15B
.gitignore 14B
.gitignore 13B
.gitignore 10B
.gitignore 7B
.gitignore 6B
.gitignore 6B
.gitignore 6B
.gitignore 5B
.gitmodules 4KB
ctracer.h 10KB
tracing.h 1KB
wordsize.h 1KB
common.h 570B
qemu-3.1.50-doc.html 536KB
qemu-doc.html 408KB
interfaces 185B
linux-lab.jpg 142KB
linux-lab-logo.jpg 7KB
tinylab-wechat.jpg 7KB
daemon.json 1KB
kd 17KB
.labbegin 2KB
.labinit 529B
elf2flt.ld 6KB
ldt-test 4KB
ldt_plat_test 122B
Makefile 144KB
Makefile 6KB
Makefile 3KB
Makefile 3KB
Makefile 2KB
Makefile 2KB
Makefile 2KB
Makefile 2KB
Makefile 2KB
共 368 条
- 1
- 2
- 3
- 4
资源评论
Java程序员-张凯
- 粉丝: 1w+
- 资源: 6749
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功