Skip to content
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

Add Custom config.txt copy to boot loader during update and version check #389

Merged
merged 3 commits into from
Jun 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,10 @@
# all values below this line were inserted from config.txt.bk (your old config)
# and can be merged with the above values
################################################################################

################################################################################
# Include distribution specific config file if it exists.
################################################################################

[all]
include distroconfig.txt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not entirely sure about this one. I think you should be adding this to your own DISTRO specific config.txt. However, if the include causes no error if it doesn't exist, then maybe there's no harm (and means a distroconfig.txt could be added later, if required). Worst case, we add a "common" distroconfig.txt that is blank?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see the logic in that, however if a user moved from upstream LE to a custom distribution then the overrides would require a full clean install. Thats why I pitched having it in the upstream config file. That way we could avoid shipping our own config.txt and only ship a distroconfig.txt file in the case we wanted to override the upstream version.

8 changes: 7 additions & 1 deletion packages/tools/bcm2835-bootloader/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ makeinstall_target() {
[ -f dt-blob.bin ] && cp -PRv dt-blob.bin $INSTALL/usr/share/bootloader/dt-blob.bin

cp -PRv $PKG_DIR/scripts/update.sh $INSTALL/usr/share/bootloader


if [ -f $DISTRO_DIR/$DISTRO/config/distroconfig.txt ]; then
cp -PRv $DISTRO_DIR/$DISTRO/config/distroconfig.txt $INSTALL/usr/share/bootloader
Copy link
Contributor

@MilhouseVH MilhouseVH Jun 4, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested, and including distroconfig.txt when it doesn't exist is fine, it just results in a few entries appearing in vcdb log msg:

rpi22:~ # vcdbg log msg 2>&1 | grep distroconfig.txt
001121.664: Failed to open include file 'distroconfig.txt'
001169.870: Failed to open include file 'distroconfig.txt'
001907.108: Failed to open include file 'distroconfig.txt'

What we could do here is add an empty (zero byte) $PKG_DIR/files/3rdparty/bootloader/distroconfig.txt to this PR, then add

    else
      cp -PRv $PKG_DIR/files/3rdparty/bootloader/distroconfig.txt $INSTALL/usr/share/bootloader

to the above if.

Not strictly necessary of course, the errors are harmless (and hopefully stay that way) but would be a more complete solution.

Minor nit: could you add a blank line between lines 54 and 55?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

else
cp -PRv $PKG_DIR/files/3rdparty/bootloader/distroconfig.txt $INSTALL/usr/share/bootloader
fi

if [ -f $DISTRO_DIR/$DISTRO/config/config.txt ]; then
cp -PRv $DISTRO_DIR/$DISTRO/config/config.txt $INSTALL/usr/share/bootloader
else
Expand Down
6 changes: 6 additions & 0 deletions packages/tools/bcm2835-bootloader/scripts/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@
# sed -e "s,gpu_mem=100,gpu_mem=128,g" -i $BOOT_ROOT/config.txt
# sed -e "s,gpu_mem_256=100,# gpu_mem_256=128,g" -i $BOOT_ROOT/config.txt
# sed -e "s,gpu_mem_512=128,# gpu_mem_512=128,g" -i $BOOT_ROOT/config.txt
# Add distribution specific extra configuration file for the bootloader
fi

# Add distro config file.
if [ -f $SYSTEM_ROOT/usr/share/bootloader/distroconfig.txt ]; then
cp -p $SYSTEM_ROOT/usr/share/bootloader/distroconfig.txt $BOOT_ROOT
fi

# mount $BOOT_ROOT r/o
Expand Down