-
Notifications
You must be signed in to change notification settings - Fork 297
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
Run /usr/lib/ostree-boot/setup.sh if it exists during u-boot bootloader setup #2416
base: main
Are you sure you want to change the base?
Conversation
during ostree admin deploy after the uEnv.txt file has been written. setup.sh could write out a whole new uEnv.txt file and/or write out other files/symlinks. The script is passed the sysroot path, the ostree deployment path and the boot/loader.# path, so it can make the proper links.
Hi @jallwine. Thanks for your PR. I'm waiting for a ostreedev member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
There are 2 parts I'd like to think about before adding this.
|
Thanks for taking a look @dbnicholson! I agree we should discuss further. I'm not sure if I'm doing it the best way, but it seems to work. I went this route due to how Beaglebone's custom version of U-Boot works. A lot of the custom U-Boot code is here: https://github.com/beagleboard/u-boot/blob/v2019.04-bbb.io-am335x/include/configs/ti_armv7_common.h The key pieces are under the uname_boot variable when it detects a uname_r variable set in the uEnv.txt file.
The rest of the lines create symlinks so that Beaglebone's custom U-Boot can find specific paths at boot. In most Beaglebone uEnv.txt files, there's a uname_r variable that should be set to the kernel version of the system. uname_r is used in a number of paths in U-Boot. These paths include /lib/firmware and /boot. When preparing my rootfs, I set the uname_r variable to always be the value
Any thoughts you have on the best way forward are appreciated! |
Oh, and there’s one other thing that’s been in the back of my mind, but I haven’t implemented yet in the setup.sh. The U-Boot build does get updated occasionally and needs to be written to the first portion of the Beaglebone’s eMMC (I’ve run into complications with certain device tree overlays when updating them, but didn’t update U-Boot). There’s a script that does this in any given deployment so it seems appropriate to run it from setup.sh during an ostree admin deploy. I would only want to run that piece on the client, and not on the build system. |
Hello. |
Standard Beaglebone images have a custom version of U-Boot installed that looks for specific variables in the uEnv.txt file as well as specific files for loading various device tree overlays. In order to properly set up the /boot/loader.# directory at
ostree admin deploy
time, I added a check for the existence of /usr/lib/ostree-boot/setup.sh in the deployment and run it so it can set up the necessary symlinks and modifications to uEnv.txt (this is much easier than implementing it explicitly in C). The script is passed the sysroot path, the deployment path, and the /boot/loader.# path so that it can properly set everything up. If the script fails to run (not executable, for example) or exits with an error status, the deployment will fail.See #2357 for more info.
Here is an example setup.sh script that I use for the Beaglebone: