boot-qemu.sh: Allow the user to supply a kernel image directly#29
Merged
nathanchance merged 1 commit intoJan 9, 2021
Merged
Conversation
There are times where supplying a kernel image directly makes more sense than providing the build output folder. For example, when using tuxmake, the build output folder is automatically cleaned up, leaving just the compiled artifacts. To boot kernels in this way, one would have to make a fake boot folder and copy the image to it. Convert '-k' to either take a kernel image directly or the kernel build output folder. Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
| [[ ${KIMAGE:=zImage} == "vmlinux" ]] || BOOT_DIR=arch/${ARCH}/boot/ | ||
| KERNEL=${KBUILD_DIR}/${BOOT_DIR}${KIMAGE} | ||
| # If '-k' is an path that ends in the kernel image, we can just use it directly | ||
| if [[ ${KERNEL_LOCATION##*/} = "${KIMAGE:=zImage}" ]]; then |
Member
There was a problem hiding this comment.
what is ##*/?
Do none of the existing arch's specify a KIMAGE of zImage? (I assume there's probably a list of possible image names, since the compression scheme is encoded in the name).
Member
Author
There was a problem hiding this comment.
##*/ is bash parameter substitution for basename essentially (remove the last / and everything before it): https://wiki.bash-hackers.org/syntax/pe#from_the_beginning
No, because zImage used to be the most common image name. All of ARCH=arm uses it and 32-bit PowerPC used it prior to 2a68826). I should probably just add KIMAGE to all of the arm32 switches to avoid that cryptic assignment but I do not feel strongly about it.
nickdesaulniers
approved these changes
Jan 8, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There are times where supplying a kernel image directly makes more sense
than providing the build output folder. For example, when using tuxmake,
the build output folder is automatically cleaned up, leaving just the
compiled artifacts. To boot kernels in this way, one would have to make
a fake boot folder and copy the image to it.
Convert '-k' to either take a kernel image directly or the kernel build
output folder.