-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
u-boot rework #2178
u-boot rework #2178
Conversation
packages/linux/package.mk
Outdated
@@ -223,7 +217,7 @@ makeinstall_target() { | |||
if [ "$BOOTLOADER" = "u-boot" ]; then | |||
mkdir -p $INSTALL/usr/share/bootloader | |||
for dtb in arch/$TARGET_KERNEL_ARCH/boot/dts/*.dtb; do |
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.
Instead of copying all dtbs, name could be taken from scripts/uboot_helper. In some cases a lot of unrelated dtbs can be built. Is there any usecase when dtb is build but U-Boot is not used? RPi maybe?
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.
At least with imx6 only required dtbs were build: https://github.com/LibreELEC/LibreELEC.tv/blob/master/projects/imx6/options#L36
Seems similar situation for RPi/RPi2.
This functionality should work the same after rework.
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.
It doesn't matter. This way is just fine as it will work for the "general" image. In the update.sh we can control which dtb is updated.
packages/tools/dtc/package.mk
Outdated
|
||
makeinstall_target() { | ||
mkdir -p $INSTALL/usr/bin | ||
cp -P $PKG_BUILD/dtc $INSTALL/usr/bin | ||
} | ||
|
||
PKG_MAKE_OPTS_HOST="dtc libfdt" |
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.
Not really a big fan of this style of intermingling variable assignments and function declarations... I'd be happier if the above assignment is moved immediately above that for PKG_MAKE_OPTS_TARGET
.
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.
better now?
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.
👍
@lrusak: from jnettlet |
overall I'm really happy with this and we should use this as a base to improve upon |
What needs to be done to remove WIP status? |
@jernejsk I imagine this will break Odroid_C2. I need to fix that up first |
@Raybuntu can you test this on Odroid_C2? |
@lrusak sure I will test it tomorrow morning. |
fi | ||
cp -a $(get_build_dir linux)/arch/$TARGET_KERNEL_ARCH/boot/dts/meson64_odroidc2.dtb $RELEASE_DIR/3rdparty/bootloader | ||
cp -a $(get_build_dir $BOOTLOADER)/u-boot.bin $RELEASE_DIR/3rdparty/bootloader | ||
cp -a $PROJECT_DIR/$PROJECT/bootloader/boot.ini $RELEASE_DIR/3rdparty/bootloader |
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.
@lrusak projects/Odroid_C2/bootloader/update.sh is not copied to the tar you might want to include it here.
EDIT: Sorry wrong place. It's not copied to the image of course.
@Raybuntu I added extra commits. I think it's ready to go if you say it's all good for odroid_c2. Then I can squash |
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.
Tested with tar updates and freshly flashed.
No issues so far.
fa7ba8c
to
789039c
Compare
rebased and force pushed. Ready to go 👍 |
@lrusak I think this may break a few things on Rockchip, why is UBOOT_SYSTEM enforced? On Rockchip there is a need for more then just different u-boot config, it needs different kernel patches, systemd service files and mali driver per device. |
UBOOT_SYSTEM is only needed when building an image. For making a regular update tar you do not need it. Unfortunately if the device needs more than just a different bootloader it should be built in a different build dir for the time being. There isn't much we can do about that. (See RPi, slice situation) |
packages/linux/package.mk
Outdated
@@ -223,7 +217,7 @@ makeinstall_target() { | |||
if [ "$BOOTLOADER" = "u-boot" ]; then | |||
mkdir -p $INSTALL/usr/share/bootloader | |||
for dtb in arch/$TARGET_KERNEL_ARCH/boot/dts/*.dtb; do | |||
cp $dtb $INSTALL/usr/share/bootloader 2>/dev/null || : | |||
cp -v $dtb $INSTALL/usr/share/bootloader |
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.
This change will break builds on platforms where dtb files are located in subfolders
cp: cannot stat 'arch/arm64/boot/dts/*.dtb': No such file or directory
Makefile:12: recipe for target 'image' failed
make: *** [image] Error 1
Suggest something like:
for dtb in arch/$TARGET_KERNEL_ARCH/boot/dts/*.dtb arch/$TARGET_KERNEL_ARCH/boot/dts/*/*.dtb; do
if [ -f $dtb ]; then
cp -v $dtb $INSTALL/usr/share/bootloader
fi
done
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.
sure
amended to use extlinux.conf |
@lrusak Thanks for updating this, it is now Rockchip ready 👍 |
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
2aaddb6
to
e40bd96
Compare
squashed and forced pushed. Someone wanna do the honors? |
I'm wanting to get this in before #2177
I'll rework #2129 after this gets in
This makes u-boot much simpler however there is still some work to go as there are different boot scripts available (boot.scr, extlinux.conf, etc) but this is a step in the right direction.
This allows for a device specific release script and mkimage script. This is the only way to make things generic enough to suit all different projects.
This PR moves all the heavy lifting to the new
scripts/uboot_helper
script. This script is designed to provide info for dtb, uboot config, uboot image, seek, blocksize and more. I think this is the best way forward rather than a bunch of#ifdefs
u-boot will be rebuilt each time UBOOT_SYSTEM is changed as a specific stamp for the u-boot package is created. if UBOOT_SYSTEM is the same u-boot will not be rebuilt.
This also doesn't install u-boot to the project tarball (if not defining UBOOT_SYSTEM) this is so we can have a tarball that can be used for all boards. u-boot will not be updated but the normal update will occur and the dtb files will be updated as well. If someone wants to update u-boot they just have to update using a newer device specific image.