The content of this message was lost. It was probably cross-posted to multiple lists and previously handled on another list.
Hi Kevin,
On Sun, 2 Jul 2023 at 10:59 PM Menna Mahmoud eng.mennamahmoud.mm@gmail.com wrote:
---------- Forwarded message --------- From: Menna Mahmoud eng.mennamahmoud.mm@gmail.com Date: Sun, 2 Jul 2023 at 02:23 Subject: Re: [linux-morello-distros] Morello kernel development - Ask for help To: Kevin Brodsky kevin.brodsky@arm.com
Hi Kevin,
On Thu, 29 Jun 2023 at 14:53, Kevin Brodsky kevin.brodsky@arm.com wrote:
On 26/06/2023 12:06, Menna Mahmoud wrote:
Hi All,
I am Menna, a Linux kernel intern- Outreahy internship. I worked on a project related to the Morello kernel. I checked the user guides and followed this: https://git.morello-project.org/morello/morello-linux, but I have a problem I couldn't create my own FVP kernel image and run it, I want to develop the kernel and update the FVP image and run it but I don't know how to do that.
Could you please help me?
Hi Menna,
Welcome to Morello! I apologise for getting back to you only now. We'll be happy to help you get started.
I understand that you have already managed to build the kernel using the SDK [1]. Running it on FVP using the environment provided in [2] is unfortunately not as straightforward at the moment. That said, we have put together some instructions that should allow you to do this fairly easily.
Assuming you already have an SDK environment looking like this (with the kernel built under workspace/linux-out): |-> workspace/ |-> linux/ |-> linux-out/ |-> docker-compose.yml
You can combine this with the morello-linux environment by adding it to docker-compose.yml; for reference I copied the docker-compose.yml I used at the end of this email.
You should then be able to use the following instructions:
- Start the containers:
$ docker-compose up -d
- Still on the host, download this package for later use:
$ curl -O --output-dir workspace
http://deb.debian.org/debian/pool/main/k/kexec-tools/kexec-tools_2.0.20-2.1_...
I got an error with this, so I downloaded ` kexec-tools_2.0.20-2.1_arm64.deb http://deb.debian.org/debian/pool/main/k/kexec-tools/kexec-tools_2.0.20-2.1_arm64.deb` in the workspace directory, Is it right?
It works fine.
- Enter the morello-linux container:
$ docker exec -it -u 1000 morello-linux /bin/bash
- Using an editor like vim, open /usr/bin/morello and append on the
last line "-v /morello", it should now look like this:
morello-run.sh -f distro -i /usr/share/morello/images/morello-fvp/morello-fvp.img -v /morello
(This specifies that /morello should be made available to be mounted as a 9P filesystem in FVP, see step 6.)
- Start FVP:
# morello
- Once FVP has booted, mount the 9P filesystem to access the /morello
directory in the container:
# mkdir /mnt/9p # mount -t 9p -o trans=virtio,version=9p2000.L FM /mnt/9p
- Install the previously downloaded kexec-tools package:
# dpkg -i /mnt/9p/kexec-tools_2.0.20-2.1_arm64.deb
- You should now be able to boot your own kernel image using kexec [3]:
# kexec -l /mnt/9p/linux-out/arch/arm64/boot/Image --reuse-cmdline
I got this after this step:
root@morello:~# kexec -l /mnt/9p/linux-out/arch/arm64/boot/Image --reuse-cmdline Can't open (/proc/kcore). Can't open (/proc/kcore).
any advise, please?
Fixed now. Thanks.
# systemctl kexec
The system will shut down and then reboot using the provided image. To make development easier, you could automate the mounting of the 9P filesystem, for instance by adding it to /etc/fstab.
I hope this will work well for you, let us know otherwise. We are working on improving the environments to remove the need for some of the steps above, and generally make it easier to run custom kernels.
Do not hesitate to ask any further question on the linux-morello list - this is the best place for any question related to Morello kernel development.
Cheers, Kevin
[1] https://sdk.morello-project.org/docs/linux/ [2] https://linux.morello-project.org/docs/intro/ [3] https://man7.org/linux/man-pages/man8/kexec.8.html
------8<------
docker-compose.yml
# Docker composer file for Morello Linux version: '3.8' services: linux-morello-sdk: image: "git.morello-project.org:5050/morello/morello-sdk/morello-sdk:latest" container_name: "linux-morello-sdk" volumes: - ./workspace:/home/morello/workspace tty: true restart: unless-stopped morello-linux: image: "git.morello-project.org:5050/morello/morello-linux/morello-linux:latest" container_name: "morello-linux" environment: - UID=1000 - GID=1000 volumes: - ./workspace:/morello tty: true restart: unless-stopped
Thanks in advance, Menna
Thanks, Menna
On 03/07/2023 02:58, Menna Mahmoud wrote:
Hi Kevin,
On Sun, 2 Jul 2023 at 10:59 PM Menna Mahmoud eng.mennamahmoud.mm@gmail.com wrote:
[...] $ curl -O --output-dir workspace http://deb.debian.org/debian/pool/main/k/kexec-tools/kexec-tools_2.0.20-2.1_arm64.deb I got an error with this, so I downloaded `kexec-tools_2.0.20-2.1_arm64.deb <http://deb.debian.org/debian/pool/main/k/kexec-tools/kexec-tools_2.0.20-2.1_arm64.deb>` in the workspace directory, Is it right?
It works fine.
Nice, that is indeed what I meant. The command should be all in one line but Thunderbird split it when sending the email.
[...] 8. You should now be able to boot your own kernel image using kexec [3]: # kexec -l /mnt/9p/linux-out/arch/arm64/boot/Image --reuse-cmdline I got this after this step: ``` root@morello:~# kexec -l /mnt/9p/linux-out/arch/arm64/boot/Image --reuse-cmdline Can't open (/proc/kcore). Can't open (/proc/kcore). ``` any advise, please?
Fixed now. Thanks.
Great that you got it working! I should have mentioned that these warnings are expected, I saw them too and they seem to be harmless.
Kevin
On Fri, 7 Jul 2023 at 11:00 AM Kevin Brodsky kevin.brodsky@arm.com wrote:
On 03/07/2023 02:58, Menna Mahmoud wrote:
Hi Kevin,
On Sun, 2 Jul 2023 at 10:59 PM Menna Mahmoud eng.mennamahmoud.mm@gmail.com wrote:
[...] $ curl -O --output-dir workspace
http://deb.debian.org/debian/pool/main/k/kexec-tools/kexec-tools_2.0.20-2.1_...
I got an error with this, so I downloaded `kexec-tools_2.0.20-2.1_arm64.deb <
http://deb.debian.org/debian/pool/main/k/kexec-tools/kexec-tools_2.0.20-2.1_...
` in the workspace directory, Is it right?
It works fine.
Nice, that is indeed what I meant. The command should be all in one line but Thunderbird split it when sending the email.
[...] 8. You should now be able to boot your own kernel image using kexec [3]: # kexec -l /mnt/9p/linux-out/arch/arm64/boot/Image
--reuse-cmdline
I got this after this step: ``` root@morello:~# kexec -l /mnt/9p/linux-out/arch/arm64/boot/Image --reuse-cmdline Can't open (/proc/kcore). Can't open (/proc/kcore). ``` any advise, please?
Fixed now. Thanks.
Great that you got it working! I should have mentioned that these warnings are expected, I saw them too and they seem to be harmless.
Kevin
Thanks Kevin for your help, appreciate it.
Menna
linux-morello-distros@op-lists.linaro.org