-
Notifications
You must be signed in to change notification settings - Fork 94
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
RAUC Integration #80
Comments
Do I just need to add a UBOOT_ENV and UBOOT_ENV_SUFFIX to my custom board config? I'd like to point out that I do not have a choice but to use your u-boot and your kernel as my board simply will not boot with the official Yocto version. When adding u-boot-fw-utils to my image and running the fw_printenv command without setting the fw_env.config file, I get the following error:
When I set the file /etc/fw_env.config to the contents below, I get the following error:
I know that this must be compatible as I have a debian based version of the same board that uses u-boot-rockchip and linux-rockchip and I am able to run fw_printenv after setting /etc/fw_env.config to:
Any idea what I might be doing wrong? |
Okay, so after doing some looking around, I realized that CONFIG_IS_IN_NOWHERE=y is set in the .config file for u-boot-rockchip somehow. I am assuming that means it is relying on compiled in versions which won't work with this. I'm going to try and change it so that it uses the emmc and then add the config directly to the emmc using the wks file. Will get back to this later. |
OKAY! So this was very difficult to figure out but I finally managed to get the fw_printenv and fw_setenv working and to get u-boot to use the uboot in mmc. I will try to get the rest of the RAUC implementation done later. PreparationFirst things first, we need to add the Board ConfigYou need to edit the defconfig for your board in u-boot. In my case, that was
This switches u-boot from using the compiled env file (compiled in the binary) to one that is located on the eMMC flash. We are essentially giving the env space 128KB of storage (CONFIG_ENV_SIZE) and an offset of 24MB (CONFIG_ENV_OFFSET). We set it to 24MB to give us ample room for uboot.img, trust.img, and boot.img that needs to come before it. Of course, the more space between, the better. I just happen to know that those three files from the output take a total of 23.7MB for my compilation. Modify WICI am sure you could do this in your own layer but for simplicity sake I modified meta-rockchip's Here is what the file contents should look like for now (we won't add the dual partition yet, this is just to test to see if we can get fw_printenv working):
You'll notice there is a new part there called env, and it compiles a file called env.img. We need to create that env.img file using a special tool, and for that we are going to use a bbappend file in our own layer. Adding env.imgIn your own u-boot-rockchip.bbappend file in your own layer, add the following (you'll notice that I used devtool to make a patch for my rk3288_defconfig from earlier):
What we are doing here is adding the u-boot-tools-native package which will give us the tool In do_deploy:append, we add the env.img file to our deploy directory so it can be used later during WIC creation. Build and FlashBuild your image like you normally would, but we need to do something special for flashing: For whatever reason, *** we are unable to use the update.img*** when flashing. I am not sure why yet but I will figure it out eventually. Instead, we can use the wic file and flash that instead. If your device is in MASKROM mode, which it probably is, you will need to flash the loader.bin first into memory (I happen to have the rkbin tools at a different directory but you'll need to have access to the rkbin tools first):
Of course, replace After that is complete, the device will now be in rockusb mode, and you can flash the WIC
Of course, replace both the latest_build_image_location and your_wic_file_name with their appropriate locations and names. Setting /etc/fw_env.configI haven't done it yet, but you can do this in a recipe. You'll need to create a file at /etc/fw_env.config in order to get this working, but your configuration might vary depending on the name of the block device and the partition that the env.img gets put on. You can use lsblk (make sure you include that in your image) to get the name of the partition with a size of 128K. Here is the /etc/fw_env.config file I used:
And thats it! Test it with fw_printenv |
Okay, so I've made some major progress with the bootloader and integrating RAUC and I will have an update soon. |
Sorry, I was off of work for a couple of days. Got RAUC mostly working. Just need to generate a system.conf file for it and add it to the guide I'm working on to post here. Any chance we could maybe add a markdown file to the source of meta-rockchip with the guide I am making? |
good to hear that, you can create a pull request for adding that guide, or using the github wiki |
@medemi68 Did you had any success with rauc? Do you have the code somewhere so I can use it? |
Hello,
I was wondering if it would be possible to add integration for RAUC. It doesn't require patching the bootloader like Mender does, and works with a boot.scr script and userspace configuration of the boot environment (using fw_setenv and fw_getenv).
It seems the only real things that are required for it are using a custom boot.scr file, and of course whatever implementation is required to use fw_setenv and fw_getenv. I'll also add that it is much easier to modify the partition layout as we can optionally change the wks file.
Miguel
The text was updated successfully, but these errors were encountered: