Navigation Menu

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

[WIP] oneplus-bacon: add kernel #89

Closed
wants to merge 5 commits into from

Conversation

dguibert
Copy link
Member

@dguibert dguibert commented Mar 5, 2020

This patch adds kernel for the Oneplus One (bacon).

It has been cross-compiled some weeks ago.

But today I tried to build with nixpgks-unstable but it suffers from:
NixOS/nixpkgs#79793 (too old gcc to compile glibc 2.30)
NixOS/nixpkgs#80497 (libssp missing)

To be noticed that my main machine is x86_64-linux type, so I figured out to to not cross compile by setting the system option to
"armv7a-linux". This way the build is uploaded to my raspberry pi 4.

$ nix-build --argstr device oneplus-bacon -A build.android-bootimg --option system "armv7a-linux"
trace: Building with crossSystem?: armv7a-linux != armv7a-linux → we're not.
[...]

@samueldr samueldr added the 4. type: port New device port label Mar 5, 2020
@samueldr
Copy link
Member

samueldr commented Mar 5, 2020

Hi! 👋

Thanks for your contribution.

The currrent state of armv7l in nixpkgs-unstable is being worked on. The glibc upgrade did cause bootstrap issues.

I have another armv7l device I will use to validate cross-compilation can happen. As a goal, the boot image / stage-1 should always be cross-compilable (when Nixpkgs allows it).

It may take a small while for me to come back to this PR. If you think it has been forgotten don't hesitate to ping me.

Anyway, I have added couple notes to the PR as a pre-review.

modules/system-target.nix Outdated Show resolved Hide resolved
@samueldr samueldr changed the title oneplus-bacon: add kernel [WIP] oneplus-bacon: add kernel Mar 28, 2020
@dguibert
Copy link
Member Author

Got nixpkgs-unstable working, but get this

$ nix-build --argstr device oneplus-bacon -A build.android-bootimg
trace: ************************************
trace: * Evaluating device: oneplus-bacon *
trace: ************************************
trace: Building with crossSystem?: armv7l-linux != x86_64-linux → we are.
trace:     crossSystem: config: armv7l-unknown-linux-gnueabihf
these derivations will be built:
  /nix/store/8wj9mnj96zdxsxfm63p821fp0dqwx0v0-initrd-oneplus-bacon.drv
  /nix/store/4b5r8i5z7hcs8sbfb5yvxhl0q8yw12yb-mobile-nixos_oneplus-bacon_boot.img-armv7l-unknown-linux-gnueabihf.drv
error: path '/nix/store/m6132gqk3awijlm2qd5670w4gxq6hhmr-extra-utils-oneplus-bacon-extra-utils-armv7l-unknown-linux-gnueabihf/bin/sh' is not in the Nix store

I'll (we'll) have to investigate...

@samueldr
Copy link
Member

samueldr commented Apr 3, 2020

This looks like this is an issue with Nix, for now you can work around this by using Nix 2.3.*.

See NixOS/nix#3471

@dguibert
Copy link
Member Author

dguibert commented Apr 3, 2020

This looks like this is an issue with Nix, for now you can work around this by using Nix 2.3.*.

Thanks.

@samueldr samueldr added the 9. status: WIP The PR is not ready for merge, work in progress label Apr 23, 2020
@samueldr samueldr marked this pull request as draft April 30, 2020 00:48

{
mobile.device.name = "oneplus-bacon";
mobile.device.info = rec {
Copy link
Contributor

Choose a reason for hiding this comment

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

Per #152, device.info options need to be reorganized.

@dguibert
Copy link
Member Author

dguibert commented Jul 2, 2020

This allows me to run sucessfully (with current nixpkgs-unstable):

   $ nix-build --argstr device oneplus-bacon -A build.android-recovery
   $ nix-build examples/hello --argstr device oneplus-bacon -A build.default

Still need to figure out why my device screen remains black...

sha256 = "sha256-odpo3vnQ1M2eWzqEFrXtipQZxlL5ko0/tfDM5yUplMc=";
};
patches = [
#./99_framebuffer.patch
Copy link
Member

Choose a reason for hiding this comment

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

Since it's at the end of this list you can remove this commented-out instance :).

devices/oneplus-bacon/kernel/default.nix Show resolved Hide resolved
@dguibert
Copy link
Member Author

I was able to build example/demo.
But after flashing recovery and system partitions and fastboot boot boot.img the screen remains with "fastboot mode"... BTW I don't know much how to debug this :-/

, dtbTool
}:

(mobile-nixos.kernel-builder-gcc6 {
Copy link
Member

Choose a reason for hiding this comment

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

Try building with kernel-builder-gcc-49.

Some vendor kernels require a specific compiler version to even boot. Generally when it doesn't boot, IIRC it will hang. Yes, it doesn't make sense.

@samueldr
Copy link
Member

Hi!

We just had some major~ish changes, at least one affecting new ports. I would heavily suggest rebasing on top of the latest master update.

The main change affecting ports is that we now have required kernel configuration options, which set known good values to a lot of "difficult to guess" options. A simple bin/kernel-normalize-config should be all that is needed.

Hope this helps!

Though uh... This port is a bit old, don't worry if it gets hard to rebase, you could always ping me if you need help going forward.

@dguibert
Copy link
Member Author

dguibert commented Sep 1, 2021

Hi Samuel,

As the phone has became my main phone again, I can't test it right now but example/hello and example/demo compile.

@samueldr
Copy link
Member

samueldr commented Sep 1, 2021

Heh, no worries, I broadcasted this message to every port :).

Take all the time you need, and even then, there's no rush.

@ryneeverett
Copy link
Contributor

I was able to build example/demo.
But after flashing recovery and system partitions and fastboot boot boot.img the screen remains with "fastboot mode"... BTW I don't know much how to debug this :-/

I reproduced this on the latest version of this branch and I also have no idea where to begin debugging.

$ fastboot boot result
Sending 'boot.img' (13850 KB)                      OKAY [  0.436s]
Booting                                            OKAY [  0.024s]
Finished. Total time: 0.477s

@samueldr
Copy link
Member

Hi! 👋

I have taken the (not so hard) decision to drop support for vendor-based devices.

I'm closing this PR since it only targets working with vendor-based devices. It is not a judgement of the quality of the changes, but really that I don't think it's healthy to keep hoping they may end-up working fine in that state.

Though, it doesn't mean there's no hope to ever see these devices end-up useful. Far from it. But to see them being useful, work on mainline Linux and other projects will need to happen.

I see hints of mainline stuff being WIP in your PR, so feel free to rework that into a mainline-based device! Either reopen the PR targeting development, or maybe make a new PR, since a lot changed since.

Thank you for your understanding,

(See also: #643)

@samueldr samueldr closed this Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. type: port New device port 9. status: WIP The PR is not ready for merge, work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants