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
Adding support to raspbian 32/64 deploy #563
Adding support to raspbian 32/64 deploy #563
Conversation
Codecov Report
@@ Coverage Diff @@
## unstable #563 +/- ##
============================================
+ Coverage 72.97% 73.32% +0.35%
============================================
Files 35 36 +1
Lines 5414 5508 +94
============================================
+ Hits 3951 4039 +88
- Misses 1463 1469 +6
Continue to review full report at Codecov.
|
037ab3a
to
20f87b2
Compare
if [[ ! -f "$config_path" ]]; then | ||
warning "$complain_msg" | ||
return | ||
warning 'Undefined .config file for the target kernel. Consider using kw bd' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this guidance of "using kw bd" to fix the missing config file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a long topic, but in summary, if we just use kw d
we can copy the .config
file, but we are not sure if the current build corresponds to the current config file. Think about this scenario:
- You build the kernel
- You replace the config file
- You deploy your kernel
Notice that we are deploying a kernel in which the config file does not match the build kernel. However, we don't have this problem with kw bd because right after build the kernel; we deploy it, which does not give time for users to change the config file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm.. got it. But I started from the point that I don't have any .config
file in the folder and, therefore, this message showed up. From the situation you explained, the statement makes sense. However, I'm unsure if users can figure out what this guidance means if they don't handle any .config
file.
src/deploy.sh
Outdated
# 2. Copy kernel image | ||
case "$arch" in | ||
'arm') | ||
kernel_name_arch="kernel-${name}.img" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think kernel-version+
.img is not friendly, to be more specific, the +.img
sufix that is generated when joining kernel name with .img. Is it possible to drop the +
or the .img
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm... I'm not sure if this is kw responsibility. I think this is .config
change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, the name of the kernel image when you copy it, I would remove the .img
suffix and use only kernel-${name}. Btw, I tested the last version and the image now is copied as vmlinuz-{name}
that is weird too :) I guess it is happening because only arch=arm is considered in this switch case, so I think arch=arm64 should be included here too, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to prepare a new version, and I'll probably add one extra commit to support rpi 64.
if [[ ! -f "$config_path" ]]; then | ||
warning "$complain_msg" | ||
return | ||
warning 'Undefined .config file for the target kernel. Consider using kw bd' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a long topic, but in summary, if we just use kw d
we can copy the .config
file, but we are not sure if the current build corresponds to the current config file. Think about this scenario:
- You build the kernel
- You replace the config file
- You deploy your kernel
Notice that we are deploying a kernel in which the config file does not match the build kernel. However, we don't have this problem with kw bd because right after build the kernel; we deploy it, which does not give time for users to change the config file.
src/deploy.sh
Outdated
# 2. Copy kernel image | ||
case "$arch" in | ||
'arm') | ||
kernel_name_arch="kernel-${name}.img" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm... I'm not sure if this is kw responsibility. I think this is .config
change.
c53e4de
to
679378e
Compare
679378e
to
e93ea54
Compare
Thanks for adding this feature; kw will help me even more in daily development tasks. It was difficult to understand some points when configuring kworkflow.config because I had some "bias" from my previous setup.
Thanks again |
1a00054
to
4bd8b79
Compare
Some config files that do not enable CONFIG_MODULE_SIG do not have the extra SIGN output, making the progress bar display only half of the progress. This commit fixes this issue by first checking the CONFIG_MODULE_SIG=y option in the config; If it is not enabled, it drops the 2 factor multiply. Signed-off-by: Rodrigo Siqueira <siqueirajordao@riseup.net>
When deploying a kernel to a target machine, we have multiple copy steps spread in different parts of the code, which is a problem since it makes kw deploy code every trick. This commit creates a function responsible for packing all the required files for the boot folder in a single place and send to the target device. This change represents a code refactor in the deploy, which required multiple changes in the test. Since various tests broke during the development of this feature, I also took this opportunity to refactor our tests to make them more manageable. Signed-off-by: Rodrigo Siqueira <siqueirajordao@riseup.net>
This commit is the final piece for enabling kernel deploy for a Raspberry PI that uses Raspbian. This commit refactors the bootloader update part to remove unnecessary steps for non-grub-based systems and add the file responsible for manipulating the config.txt file. Signed-off-by: Rodrigo Siqueira <siqueirajordao@riseup.net>
This commit is responsible for fine-tuning the kernel removal for raspberry pi. Related to kworkflow#354 Signed-off-by: Rodrigo Siqueira <siqueirajordao@riseup.net>
This commit introduces the final adjustment to enable local deploy. Signed-off-by: Rodrigo Siqueira <siqueirajordao@riseup.net>
This commit ensures that we do not pollute the config.txt file by removing kernels name duplications and adding the new kernel to the end. Signed-off-by: Rodrigo Siqueira <siqueirajordao@riseup.net>
For deploying a new kernel to a Raspberry Pi with 32 bits, we need to copy the dtb files by using: cp arch/arm/boot/dts/*.dtb <PATH> In the 64 bits scenario we have to use: cp arch/arm64/boot/dts/broadcom/*.dtb <PATH> This tiny difference raised the attention that we need to handle dtb files deploy a little bit more carefully since any vendor can specify any boot layout (at least, this is what I understood). For this reason, this commit introduces a new config option named dtb_copy_pattern, which gives the developers the flexibility to tell kw how it should copy these dtbs files. Signed-off-by: Rodrigo Siqueira <siqueirajordao@riseup.net>
In the kworkflow.config file, we have a variable named kernel_img_name used to define the binary kernel prefix used during the deploy. Even though we have this variable, we were ignoring it. As a result, when we deploy a new kernel image to a rasp system, we see a kernel image with a vmlinuz prefix. This commit fixes this issue by stopping to ignore that config variable and only set vmlinuz if that variable is empty. Signed-off-by: Rodrigo Siqueira <siqueirajordao@riseup.net>
4bd8b79
to
f02d3b3
Compare
LGTM. |
Hi @melissawen , thanks a lot for your review and test. I merged this PR in the unstable branch. |
This PR introduces support for RPI deploy. I tested it with RPI with Rasbian 32 bits installed on it.