Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boot-utils: Add support for booting Debian images #35

Merged
merged 12 commits into from
Feb 22, 2021

Conversation

nathanchance
Copy link
Member

Each of these commits should be self explanatory.

'-cpu max' is treated as '-cpu host' when KVM is enabled.

Link: https://gitlab.com/qemu-project/qemu/-/commit/bab52d4bba3f22921a690a887b4bd0342f2754cd
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
* -machine "virtualiation=true" allows the virtual machine to spawn
   virtual guests, which can be useful for verifying KVM without an
   actual arm64 piece of hardware. This only works when KVM is not being
   used though so it is only enabled when not on an arm64 host.

* -machine "virt,gic-version=max" will use the newest Generic Interrupt
  Controller available.

These were taken from Will Deacon's QEMU guide and it was tested on
Debian Buster with Debian's QEMU package and a self compiled tip of tree
version.

Link: https://mirrors.edge.kernel.org/pub/linux/kernel/people/will/docs/qemu/qemu-arm64-howto.html
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Purely aesthetic.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
There are times where there is a need to have a fuller environment for
testing, rather than the simple Busybox based rootfs that is normally
used.

Introduce a Debian build script, which uses debootstrap and
qemu-user-static to generate a bootable rootfs image.

boot-qemu.sh is modified accordingly to support this image if the user
wants it.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
@nathanchance
Copy link
Member Author

I added support for armhf, ppc64el, and s390x. I have verified that they can all make it to userspace.

Additionally, I fixed an issue where ${INTERACTIVE} was not getting a default value, which caused issues with using the script normally.

@msfjarvis msfjarvis self-requested a review February 20, 2021 10:52
README.txt Outdated Show resolved Hide resolved
boot-qemu.sh Outdated Show resolved Hide resolved
@@ -137,8 +155,11 @@ function setup_qemu_args() {
arm32_v7)
ARCH=arm
APPEND_STRING+="console=ttyAMA0 "
# https://lists.nongnu.org/archive/html/qemu-discuss/2018-08/msg00030.html
# VFS: Cannot open root device "vda" or unknown-block(0,0): error -6
${DEBIAN} && HIGHMEM=,highmem=off
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the value assigned to HIGHMEM be a quoted string?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shellcheck does not complain but I can update that if you feel it is worthwhile.

@@ -1,2 +1 @@
qemu-binaries/
rootfs.cpio
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't this mean then that each time we decompress an initrd, that the directory is now dirty?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I just moved it to images/.gitignore.

debian/build.sh Outdated Show resolved Hide resolved
debian/build.sh Outdated Show resolved Hide resolved
debian/build.sh Outdated Show resolved Hide resolved
debian/build.sh Outdated Show resolved Hide resolved
boot-qemu.sh Outdated Show resolved Hide resolved
@nickdesaulniers
Copy link
Member

Looks cool!

Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Requested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Copy link
Member

@nickdesaulniers nickdesaulniers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cant wait to try it out! 🆒 🧔

@nathanchance
Copy link
Member Author

Thank you both for the review!

@nathanchance nathanchance merged commit d59e01f into ClangBuiltLinux:main Feb 22, 2021
@nathanchance nathanchance deleted the debootstrap branch February 22, 2021 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants