Giter VIP home page Giter VIP logo

xen-rpi4-builder's Introduction

Build Xen for Raspberry Pi 4

This script builds Xen, a 64-bit linux kernel from the Raspberry Pi tree, and packages a minimal 64-bit Ubuntu 20.04 rootfs for the Raspberry Pi 4. A recent version of Ubuntu is required to run the build script. An internet connection is required. 8 GB RAM or more is recommended, and 10GB+ free disk space.

Usage:

$ ./rpixen.sh

Ensure that the script prints the message "=== BUILD SUCCEEDED ===". When the script is finished, flash to SD card with (for example):

$ umount /dev/sdX1
$ umount /dev/sdX2
$ sudo dd if=rpixen.img of=/dev/sdX bs=8M
$ sync

Xen will print messages to the UART. Log in with username dornerworks password dornerworks.

To install a graphical desktop, expand the rootfs partition, ensure that you have an internet connection, run the command sudo apt install ubuntu-desktop, and reboot.

This script is a little bit like https://github.com/mirage/xen-arm-builder and https://github.com/RPi-Distro/pi-gen but for Xen+Ubuntu instead of Raspbian. More info about Ubuntu Base is available here https://wiki.ubuntu.com/Base.

Limitations

  • Raspberry Pi kernel not suitable for domU
  • aux spi1 and aux spi2 are disabled

32-bit Linux

A 32-bit linux kernel may be built by doing:

$ ./rpixen.sh armhf

Xen will be built for aarch64 regardless.

xen-rpi4-builder's People

Contributors

aananthcn avatar cminyard avatar jeffkubascik avatar stewdk avatar tklengyel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xen-rpi4-builder's Issues

'python' is no longer a valid package in Ubuntu 22.04

Build script fails early on 22.04 with an error about python not being a valid package.

Suggest changing to python3, as this is the new standard Python name in apt.

+ set -o pipefail
+ trap 'fail_handler ${LINENO}' ERR
++ pwd
+ WRKDIR=/home/rgraves/xen-rpi4-builder-master/
+++ dirname ./rpixen.sh
++ cd .
++ pwd
+ SCRIPTDIR=/home/rgraves/xen-rpi4-builder-master/
+ USERNAME=dornerworks
+ PASSWORD=dornerworks
+ SALT=dw
++ perl -e 'print crypt("dornerworks","dw");'
+ HASHED_PASSWORD=dw3iwiRjCphbk
+ HOSTNAME=ubuntu
+ UBUNTUVERSION=20.04.3
+ BUILD_ARCH=arm64
+ sudo apt install device-tree-compiler tftpd-hpa flex bison qemu-utils kpartx git curl qemu-user-static binfmt-support parted bc libncurses5-dev libssl-dev pkg-config python acpica-tools wget gettext
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package python is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  python2-minimal python2 dh-python 2to3 python-is-python3

E: Package 'python' has no installation candidate
++ fail_handler 27
++ BUILDLINE=27

error "No rule to make target" when running the script

I got this message:

++ nproc
+ make O=.build-arm64 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j 2 overlays/pi4-64-xen.dtbo
make[1]: Entering directory '/home/adam/xen-rpi4-builder/linux/.build-arm64'
make[2]: *** No rule to make target 'arch/arm64/boot/dts/overlays/pi4-64-xen.dtbo'.  Stop.
make[1]: *** [arch/arm64/Makefile:135: overlays/pi4-64-xen.dtbo] Error 2
make[1]: Leaving directory '/home/adam/xen-rpi4-builder/linux/.build-arm64'
make: *** [Makefile:146: sub-make] Error 2

I uploaded a more compete output, and the contents of xen-rpi4-builder/linux/.build-arm64/.config.
output
.config

also I posted question about installing xen on rpi in general on the raspberry stack exchange:
related question on raspberry stackexchange

..How to log in?

The lack of HDMI support makes using this image next to impossible out of the box.

A default login isn't documented anywhere, and poking around the generated image, the only user besides root seems to be

dornerworks:x:1000:1000::/home/dornerworks:/bin/bash

After trying a few times the password appears to be dornerworks, but this isn't documented anywhere.

Please add documentation for the default login.

pyconfig.h not found

the pyconfig file is in the directory but it still complaining not found.

What could be the possible solution?

image

$ ./rpixen.sh no such file and directory

testrig@raspberrypi:~ $ git clone https://github.com/dornerworks/xen-rpi4-builder.git
Cloning into 'xen-rpi4-builder'...
remote: Enumerating objects: 227, done.
remote: Counting objects: 100% (88/88), done.
remote: Compressing objects: 100% (40/40), done.
remote: Total 227 (delta 58), reused 70 (delta 44), pack-reused 139
Receiving objects: 100% (227/227), 50.47 KiB | 1.44 MiB/s, done.
Resolving deltas: 100% (137/137), done.
testrig@raspberrypi:~ $ ./rpixen.sh
bash: ./rpixen.sh: No such file or directory

**I cloned the repo. and trying to run the coomand but having issue **

HDMI needs to work

Having working HDMI output is a kind of nice feature for a device with impressive media capabilities like the RP4. This is rather important for my purposes.

Thanks for documenting that it isn't working, now an issue of getting it fixed.

Kernel panic bitfill_aligned if HDMI connected

Hello,

If HDMI is left connected, this kind of crash happens.

HDMI is known to be not working, but it is not ignored either.

That would be nice to mention this in documentation

[    1.194681] bcm2708_fb soc:fb: FB found 1 display(s)
(XEN) traps.c:1973:d0v0 HSR=0x93d48046 pc=0xffffff80085394cc gva=0xffffff800a7da000 gpa=0x0000003ebdc000
[    1.231583] Unhandled fault at 0xffffff800a7da000
[    1.231591] Mem abort info:
[    1.231599]   ESR = 0x96000000
[    1.231607]   Exception class = DABT (current EL), IL = 32 bits
[    1.231614]   SET = 0, FnV = 0
[    1.231621]   EA = 0, S1PTW = 0
[    1.231627] Data abort info:
[    1.231634]   ISV = 0, ISS = 0x00000000
[    1.231640]   CM = 0, WnR = 0
[    1.231649] swapper pgtable: 4k pages, 39-bit VAs, pgdp = (____ptrval____)
[    1.231657] [ffffff800a7da000] pgd=0000000033ffe003, pud=0000000033ffe003, 
pmd=00000000321aa003, ptef
[    1.231680] Internal error: ttbr address size fault: 96000000 [#1] PREEMPT SMP
[    1.231687] Modules linked in:
[    1.231695] Process swapper/0 (pid: 1, stack limit = 0x(____ptrval____))
[    1.231704] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.19.93-v8+ #1
[    1.231709] Hardware name: Raspberry Pi 4 Model B Rev 1.1 (DT)
[    1.231716] pstate: 20000005 (nzCv daif -PAN -UAO)
[    1.231728] pc : bitfill_aligned+0xb4/0x188
[    1.231735] lr : cfb_fillrect+0x11c/0x2c8
[    1.231739] sp : ffffff800802b590
[    1.231744] x29: ffffff800802b590 x28: 0000000000000008 
[    1.231753] x27: ffffffc03210a118 x26: 000000000000f000 
[    1.231761] x25: ffffff800a7da000 x24: 0000000000000000 
[    1.231768] x23: 0000000000000000 x22: 0000000000000040 
[    1.231776] x21: 00000000000003c0 x20: 0000000000000000 
[    1.231783] x19: ffffff800a7da000 x18: 0000000000000000 
[    1.231790] x17: 0000000000000000 x16: 0000000000000000 
[    1.231797] x15: ffffffffffffffff x14: 0720072007200720 
[    1.231804] x13: 0720072007200720 x12: 0720072007200720 
[    1.231812] x11: 0720072007200720 x10: 0720072007200720 
[    1.231819] x9 : 0720072007200720 x8 : 0720072007200720 
[    1.231826] x7 : 0720072007200720 x6 : 0000000000000000 
[    1.231833] x5 : 0000000000000040 x4 : 0000000000000000 
[    1.231840] x3 : ffffff800a7dbe00 x2 : ffffffffffffffff 
[    1.231847] x1 : ffffff800a7da000 x0 : ffffffffffffffff 
[    1.231854] Call trace:
[    1.231861]  bitfill_aligned+0xb4/0x188
[    1.231867]  cfb_fillrect+0x11c/0x2c8
[    1.231874]  bcm2708_fb_fillrect+0x28/0x38
[    1.231880]  bit_clear_margins+0xc4/0xf0
[    1.231888]  fbcon_clear_margins+0x94/0xa0
[    1.231896]  fbcon_prepare_logo+0x34c/0x3e0
[    1.231903]  fbcon_init+0x314/0x4c8
[    1.231911]  visual_init+0xb8/0x110
[    1.231918]  do_bind_con_driver+0x1ec/0x3b8
[    1.231925]  do_take_over_console+0x148/0x210
[    1.231933]  do_fbcon_takeover+0x70/0xd8
[    1.231940]  fbcon_event_notify+0x844/0x8b8
[    1.231949]  notifier_call_chain+0x5c/0x98
[    1.231956]  blocking_notifier_call_chain+0x64/0x88
[    1.231963]  fb_notifier_call_chain+0x30/0x40
[    1.231970]  register_framebuffer+0x218/0x300
[    1.231976]  bcm2708_fb_probe+0x354/0x748
[    1.231983]  platform_drv_probe+0x58/0xa8
[    1.231991]  really_probe+0x1f0/0x298
[    1.231999]  driver_probe_device+0x5c/0xf0
[    1.232006]  __driver_attach+0xf0/0xf8
[    1.232013]  bus_for_each_dev+0x84/0xd8
[    1.232021]  driver_attach+0x30/0x40
[    1.232028]  bus_add_driver+0x1e0/0x210
[    1.232034]  driver_register+0x64/0x110
[    1.232040]  __platform_driver_register+0x54/0x60
[    1.232051]  bcm2708_fb_init+0x20/0x28
[    1.232059]  do_one_initcall+0x54/0x240
[    1.232068]  kernel_init_freeable+0x2d8/0x378
[    1.232077]  kernel_init+0x18/0x108
[    1.232085]  ret_from_fork+0x10/0x1c
[    1.232094] Code: 91000463 8b031a63 d503201f aa1303e1 (f9000274) 
[    1.232105] ---[ end trace e4bfa4a14c0baa23 ]---
[    1.232156] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b

Make fails

I've never used github before so please tell me if this isn't the place to ask questions.
I was expecting this script to work out of the box, the documentation is simple enough. But after running through happily for many minutes, it stops with the error below. Anything obvious I'm doing wrong?

+ make O=.build-arm64 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j 6 broadcom/bcm2711-rpi-4-b-xen.dtb
make[1]: Entering directory '/home/developer/pi/xen-rpi4-builder/linux/.build-arm64'
make[2]: *** No rule to make target 'arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b-xen.dtb'.  Stop.
arch/arm64/Makefile:132: recipe for target 'broadcom/bcm2711-rpi-4-b-xen.dtb' failed
make[1]: *** [broadcom/bcm2711-rpi-4-b-xen.dtb] Error 2
make[1]: Leaving directory '/home/developer/pi/xen-rpi4-builder/linux/.build-arm64'
Makefile:146: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2

WiFi not working

After the system boots no wifi interface is present. The following line shows up in the dmesg however:

[ 164.429172] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50

I've tried manually load brcmfmac43455-sdio blobs from https://github.com/RPi-Distro/firmware-nonfree/tree/master/brcm manually but it results in the system freezing up. I don't have serial access on the system (only ssh) so I couldn't investigate any further.

Fix memory limitation

Limiting system memory to 1GB as documented is distinctly sub-optimal and needs fixing.

My understanding of 0001-Add-RPi4-bcm2711-device-tree-for-Xen-64-bit-Linux.patch is you're also forcing Domain 0 to only get 512MB. This is reasonable under many, but not all circumstances. A device where X is being run in Domain 0 may want more there.

Thanks for documenting the limitation though as that is important to know.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.