-
Notifications
You must be signed in to change notification settings - Fork 12
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
Initial support for >=3.6 firmwares, toolchain v4.x #27
base: v4.x
Are you sure you want to change the base?
Conversation
@@ -103,16 +95,18 @@ RUN export DEBIAN_FRONTEND=noninteractive \ | |||
&& cd .. \ | |||
# Clean up | |||
&& rm -rf systemd \ | |||
# TODO: remove pip packages as well |
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 sure if it's required, they are pretty small (jinja2+yaml, I think)
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 missed replying to this the first time. Yes, removing the packages is required as it's not part of what we intend to deliver by default, especially if we aren't delivering pip.
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 thinking that we can use multi-stage builds: one that cross-compiles all the stuff, then copy the headers/libs to the final one with pre-installed compilers without any extra deps. This should require less friction and layers.
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 would be appreciated, especially if there is caching we can do to avoid rebuilding if we already have a built version later.
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.
Yep, docker allows to cache multi-stage builds with buildx, that should be supported by GHA, will look into that
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've had issues with it not properly caching before, and there is also a limit to how much can be cached, which this would fill it up really quick, so you'd probably still want to clean up as much as possible to keep the cache size needed small.
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.
A better way to do this would be to move the build of these artifacts to a different process that stores them elsewhere with a version number, and then the docker image pulls the versioned artifact.
@@ -90,9 +92,8 @@ RUN export DEBIAN_FRONTEND=noninteractive \ | |||
libssl-dev \ | |||
libtool-bin \ | |||
&& cd /root \ | |||
&& git clone https://git.yoctoproject.org/git/opkg \ | |||
&& git clone --depth 1 --branch v0.4.5 https://git.yoctoproject.org/git/opkg \ |
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.
Updated opkg a bit as well, 0.4.4->0.4.5.
We can bump it all the way to 0.6.2, if this won't break anything.
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.
My reply to this was missing for some reason. The version of opkg in entware is from 2022-02-24, so we should try to match its version here.
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.
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's what we use on device, so it would be best to use the same thing. It's probably a miss that we are using version.
@@ -326,16 +335,20 @@ CT_LINUX_V_5_4=y | |||
# CT_LINUX_V_3_10 is not set | |||
# CT_LINUX_V_3_4 is not set | |||
# CT_LINUX_V_3_2 is not set | |||
CT_LINUX_VERSION="5.4.70" | |||
CT_LINUX_VERSION="5.4.248" |
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 is change made by ./ct-ng arm-remarkable-linux-gnueabihf
. I guess it doesn't matter, as we only need kernel headers, which should not change in minor releases (not sure about that though)
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.
Even previous version of ct-ng bumped version when copying from crosstool.config
to .config
, to something around 5.4.140
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.
We would prefer to target the exact kernel version in use on the device.
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.
Yeah, I tried that for the same reasons, but even if exact older version is specified here, after calling ./ct-ng arm-remarkable-linux-gnueabihf
the latest kernel patch version supported by current ct-ng
(5.4.248 as of now) is written to .config
, and ./ct-ng build
uses newer one.
I think the same happens in 3.x
toolchain, but the version is 5.4.179: https://github.com/crosstool-ng/crosstool-ng/tree/a21748bd5342b72ddf5bfef782e058c3245161f7/packages/linux/5.4.179
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.
We'd need to modify .config
after calling ./ct-ng arm-remarkable-linux-gnueabihf
if we want exact version, which is discouraged by crosstool-ng.
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.
Have you found in the documentation why this is the case? Or opened an issue about it?
I'm not exactly happy that it's ignoring our configuration.
@@ -399,12 +414,14 @@ CT_BINUTILS_V_2_36=y | |||
# CT_BINUTILS_V_2_28 is not set | |||
# CT_BINUTILS_V_2_27 is not set | |||
# CT_BINUTILS_V_2_26 is not set | |||
CT_BINUTILS_VERSION="2.36.1" | |||
CT_BINUTILS_VERSION="2.35.1" |
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.
Downgraded binutils just to be safe when debugged the issues with compilation and forgot to upgrade back. But I guess it's better to have binutils matching glibc?
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 should match what is in the official toolchain ideally. Which would match what is on device if it ends up on device. I don't really think we want to downgrade them unless they actually need to be downgraded.
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.
Still haven't received official toolchain for 3.6, sadly
Nothing from binutils end up on device, as far as I can tell. Also, 3.1.15 toolchain included 2.34.0 binutils, not 2.36.1:
# /opt/codex/rm11x/3.1.15/sysroots/x86_64-codexsdk-linux/usr/libexec/arm-remarkable-linux-gnueabi/gcc/arm-remarkable-linux-gnueabi/9.3.0/ld --version
GNU ld (GNU Binutils) 2.34.0.20200220
I don't think that binutils versions are that important for linking binaries, and probably we can use either one until we get official toolchain, your call.
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 looks like you have the latest toolchain now. Could you also open a PR against https://github.com/Eeems-Org/remarkable.guide/ to add the toolchain to https://github.com/Eeems-Org/remarkable.guide/blob/main/src/devel/toolchains.rst with ipfs links?
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.
Official toolchain includes 2.38, apparently
$ /opt/codex/rm2/4.0.117-1/sysroots/x86_64-codexsdk-linux/usr/libexec/arm-remarkable-linux-gnueabi/gcc/arm-remarkable-linux-gnueabi/11.3.0/ld --version
GNU ld (GNU Binutils) 2.38.20220708
Probably also should bump gcc to 11.3.0
@@ -326,16 +335,20 @@ CT_LINUX_V_5_4=y | |||
# CT_LINUX_V_3_10 is not set | |||
# CT_LINUX_V_3_4 is not set | |||
# CT_LINUX_V_3_2 is not set | |||
CT_LINUX_VERSION="5.4.70" | |||
CT_LINUX_VERSION="5.4.248" |
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.
We would prefer to target the exact kernel version in use on the device.
@@ -399,12 +414,14 @@ CT_BINUTILS_V_2_36=y | |||
# CT_BINUTILS_V_2_28 is not set | |||
# CT_BINUTILS_V_2_27 is not set | |||
# CT_BINUTILS_V_2_26 is not set | |||
CT_BINUTILS_VERSION="2.36.1" | |||
CT_BINUTILS_VERSION="2.35.1" |
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 should match what is in the official toolchain ideally. Which would match what is on device if it ends up on device. I don't really think we want to downgrade them unless they actually need to be downgraded.
This updates all libraries in toolchain/base images according to 3.6.0.1865 firmware. Includes patches for glibc 2.35 (to be upstreamed) and for breakpad. Updated crosstool-ng to latest master and regerated crosstool.config using it.
Btw, @Eeems, ct-ng offers way smaller configs by exporting them:
Which yields the same I can update the PR to include this config format. |
Sure, a simpler config will be easier to maintain. |
@@ -103,16 +95,18 @@ RUN export DEBIAN_FRONTEND=noninteractive \ | |||
&& cd .. \ | |||
# Clean up | |||
&& rm -rf systemd \ | |||
# TODO: remove pip packages as well |
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 missed replying to this the first time. Yes, removing the packages is required as it's not part of what we intend to deliver by default, especially if we aren't delivering pip.
@@ -90,9 +92,8 @@ RUN export DEBIAN_FRONTEND=noninteractive \ | |||
libssl-dev \ | |||
libtool-bin \ | |||
&& cd /root \ | |||
&& git clone https://git.yoctoproject.org/git/opkg \ | |||
&& git clone --depth 1 --branch v0.4.5 https://git.yoctoproject.org/git/opkg \ |
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.
My reply to this was missing for some reason. The version of opkg in entware is from 2022-02-24, so we should try to match its version here.
@@ -326,16 +335,20 @@ CT_LINUX_V_5_4=y | |||
# CT_LINUX_V_3_10 is not set | |||
# CT_LINUX_V_3_4 is not set | |||
# CT_LINUX_V_3_2 is not set | |||
CT_LINUX_VERSION="5.4.70" | |||
CT_LINUX_VERSION="5.4.248" |
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.
Have you found in the documentation why this is the case? Or opened an issue about it?
I'm not exactly happy that it's ignoring our configuration.
@@ -399,12 +414,14 @@ CT_BINUTILS_V_2_36=y | |||
# CT_BINUTILS_V_2_28 is not set | |||
# CT_BINUTILS_V_2_27 is not set | |||
# CT_BINUTILS_V_2_26 is not set | |||
CT_BINUTILS_VERSION="2.36.1" | |||
CT_BINUTILS_VERSION="2.35.1" |
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 looks like you have the latest toolchain now. Could you also open a PR against https://github.com/Eeems-Org/remarkable.guide/ to add the toolchain to https://github.com/Eeems-Org/remarkable.guide/blob/main/src/devel/toolchains.rst with ipfs links?
@jilyaluk poke, any chance you've had time to continue working on this? |
@jilyaluk poke again? |
@Eeems sorry, I did not have access to my reMarkable for quite some time, so could not test anything. Now I got it back, will look at this soon. |
Hey @Eeems, could you bump the v4.x branch in the repo to match v3.x? I'll rebase my branch |
Done. |
This updates all libraries in toolchain/base images according to 3.6.0.1865 firmware.
Includes patches for glibc 2.35 (to be upstreamed) and for breakpad.
Updated crosstool-ng to latest master and regerated crosstool.config using it.
Does not include QT updates yet, waiting on reMarkable toolchain with up-to-date libqsgepaper