Coder Social home page Coder Social logo

mre-fog / tmohs-buildrootd Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 8.68 MB

License: Other

Makefile 67.40% Arc 0.06% Shell 6.12% Tcl 0.18% Batchfile 0.23% Forth 0.03% C 8.78% Gnuplot 0.01% M4 0.05% Lua 0.22% HTML 3.07% Dockerfile 0.03% C++ 0.89% Perl 0.79% Lex 0.11% Yacc 0.28% CMake 0.09% Python 11.60% Java 0.05%

tmohs-buildrootd's Introduction

Intro and Background:

This repo contains a modified version of Buildroot 2022.11 that is able to build
a development environment/toolchain for a rooted TMOHS1. You are solely responsible
for any damages you cause to your device with any custom software you build.

This project was inspired by https://github.com/zefie/buildroot, but I based it off a modern 
Buildroot release with compatibility patches added rather than an older Buildroot with
backports. This allows us to take advantage of newer Buildroot features such as building 
a relocatable SDK. In addition, it allows us to build a modern GCC as our cross compiler, 
which improves compatibility with building most new software.

In order to maintain compatibility with the TMOHS1, however, glibc 2.22 must be selected
as the C library version, so this leads us to the rather absurd solution of linking our
cross-gcc (v10.4.0) with a glibc 7 years older than it. In fact, this version of glibc
is so old that I needed to patch the build process so that it would build on a modern system.
For these reasons, we end up building an extremely bizarre, "Frankenstein" armv7 cross-toolchain that
is only really compatible with the TMOHS1.

Instructions:

Building the cross-toolchain: 
To build a SDK for cross compilation of TMOHS1-compatible binaries, 
run 'make tmohs1_defconfig' then 'make sdk'. This should give you a .tar.gz toolchain
in the output/images directory.

Pre-compiled versions of this SDK are also available for x86_64 and aarch64 Linux hosts
in the "releases" section. The steps to use these are identical to if you built them yourself.
However, they may not contain all the libraries you need to build the specific software you
are targeting.

Using the toolchain: 
1. Extract the [SDK].tar.gz to a directory of your choosing on the host (Linux) machine
2. 'cd' to said directory and run './relocate-sdk.sh' to fix file paths
3. Run 'source environment-setup' to configure the build system environment
4. Use the cross-compilation guide for software of your choosing to build it for
the device

Advice for running custom software:
I have found it easiest to make the directories '/cache/bin' and '/cache/lib' on the TMOHS1,
then place custom binaries produced by this toolchain (either externally sourced or from
output/target) in /cache/bin and custom libraries in /cache/lib. /cache is mounted r/w by default 
and is separate from the main partition of the device. To allow ld-linux to find any custom shared 
libraries you've added, simply run 'export LD_LIBRARY_PATH=/cache/lib' on the device, 
and you will be able to run custom software without any modifications to the original rootfs.


WARNING: This fork of Buildroot has almost all of the sanity checks designed to
catch impossible/broken configurations removed. In addition,
it adds options to the menu that do not check for conflicting packages.
This means that SOME CONFIGURATION COMBINATIONS MAY BE IMPOSSIBLE TO BUILD!

To add custom libraries, binaries, etc. to the SDK, you can modify the tmohs1_defconfig
by running "make menuconfig" once you already have this defconfig as your .config.
If you choose to follow the instructions below to create a custom config, 
you're on your own with any issues you may face.

Several config options especially likely to break things if changed:
- anything to do with glibc/the C library
- anything to do with GCC
- kernel headers
- attempting to build a custom Linux kernel

---

Buildroot is a simple, efficient and easy-to-use tool to generate embedded
Linux systems through cross-compilation.

The documentation can be found in docs/manual. You can generate a text
document with 'make manual-text' and read output/docs/manual/manual.text.
Online documentation can be found at http://buildroot.org/docs.html

To build and use the buildroot stuff, do the following:

1) run 'make menuconfig' 
2) select the target architecture and the packages you wish to compile
3) run 'make'
4) wait while it compiles
5) find the kernel, bootloader, root filesystem, etc. in output/images

You do not need to be root to build or run buildroot.  Have fun!

Buildroot comes with a basic configuration for a number of boards. Run
'make list-defconfigs' to view the list of provided configurations.

Please feed suggestions, bug reports, insults, and bribes back to the
buildroot mailing list: [email protected]
You can also find us on #buildroot on OFTC IRC.

If you would like to contribute patches, please read
https://buildroot.org/manual.html#submitting-patches

tmohs-buildrootd's People

Contributors

mre-fog avatar c-herz avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.