AsteroidOS / asteroidos.org

AsteroidOS official website. Built using Assemble, Grunt, Bootstrap and Less.
Other
23 stars 37 forks source link

Update Porting Guide? #6

Closed nspector closed 6 years ago

nspector commented 6 years ago

I have an old device that is smartwatch that I'd like to try to port asteroid too, however when I went to try to follow the porting guide, it looked like the link to the initial PR as an example and some of the file references no longer matched up?

This was in following the first steps at: Creating an OpenEmbedded BSP layer

FlorentRevest commented 6 years ago

Hi nspector,

Could you be more specific about what link you think is incorrect? I reviewed every link in the "Creating an OpenEmbedded BSP layer" section and I don't see anything wrong there.

Good luck with your port.

nspector commented 6 years ago

I don't remember specifically, I'll try to refollow the instructions in the next day or two and get the exact issues I saw.

Thank you! Looking forward to it!

nspector commented 6 years ago

Alright, so my first go around I did not realize I had to follow the steps on https://asteroidos.org/wiki/building-asteroidos/ first to setup the environment (I had cloned the dory repo and couldn't match all the changes to what was in the dory repo, think that will be same once I get past this issue, https://github.com/AsteroidOS/meta-swift-hybris/commit/b665878f80936f21cec1757cdc4d10fa95af1841 no longer matches the repo). So cloned the repo, cd'd in. ran the prepare, it thinks it did everything right. Though I have none of the environment setup correctly it seems. I am on elementaryos (ubuntu fork).

FlorentRevest commented 6 years ago

https://github.com/AsteroidOS/meta-swift-hybris/commit/b665878f80936f21cec1757cdc4d10fa95af1841 this is just an example. If you give it a quick look you notice that every "dory" string is just replaced with the codename of the new watch. You don't have to change the exact same files, you can just grep for "dory" in meta-dory-hybris and then change what you find. The porting guide is clear on that "Once you have that layer setup, roughly replace all references to the previous codename with XXX in the layer".

Also, when you say "ran the prepare, it thinks it did everything right. Though I have none of the environment setup correctly" it looks like you didn't follow the instructions properly. The "Building AsteroidOS" documentation says ". ./prepare-build.sh" not "./prepare-build.sh" and there is also a comment next to it that clearly insists: you need to source the script, not just run it.

I close this issue since it doesn't seem to be one.

nspector commented 6 years ago

Thanks, somehow I missed the .. Will give it another try and see if I run into issue. With your example there are clear places where you didn't do a full replace, https://github.com/AsteroidOS/meta-swift-hybris/commit/b665878f80936f21cec1757cdc4d10fa95af1841#diff-dfdc5f4979764fc351e620b22d7f3633L3 for instance.

FlorentRevest commented 6 years ago

This is indeed a mistake that had to be fixed later on by https://github.com/AsteroidOS/meta-swift-hybris/commit/c5d71ad07177f6f8edeabc8472e24c1483cdfe87#diff-dfdc5f4979764fc351e620b22d7f3633

If you find a better example of replacement commit, feel free to pull request this repository with a link to a better patch.

nspector commented 6 years ago

Cool, thanks! Also when you say: Start by cloning the most appropriate layer into an src/meta-XXX-hybris/ directory in your AsteroidOS build tree, do you mean git clone or copy the directory?

nspector commented 6 years ago

Alright, so ran it with the . this time.. and ran into issue where texinfo wasn't installed (it was exhibited when I ran bitbake asteroid-image and got ERROR: The following required tools (as specified by HOSTTOOLS) appear to be unavailable in PATH, please install them in order to proceed: makeinfo error. I ran sudo apt-get intsall texinfo, which fixed it and I believe everything is building correctly. Will now work on starting to follow the actual porting steps.

Hope it's ok if I document here, or would you prefer somewhere else?

nspector commented 6 years ago

Hmm actually ran into an error with building:

$ bitbake asteroid-image
WARNING: /home/nspector/Desktop/puls/asteroid/src/oe-core/meta/recipes-core/meta/meta-environment.bb: Exception during build_dependencies for toolchain_create_sdk_version
WARNING: /home/nspector/Desktop/puls/asteroid/src/oe-core/meta/recipes-core/meta/meta-environment.bb: Error during finalise of /home/nspector/Desktop/puls/asteroid/src/oe-core/meta/recipes-core/meta/meta-environment.bb
WARNING: /home/nspector/Desktop/puls/asteroid/src/oe-core/meta/recipes-core/meta/meta-environment-extsdk.bb: Exception during build_dependencies for toolchain_create_sdk_version
WARNING: /home/nspector/Desktop/puls/asteroid/src/oe-core/meta/recipes-core/meta/meta-environment-extsdk.bb: Error during finalise of /home/nspector/Desktop/puls/asteroid/src/oe-core/meta/recipes-core/meta/meta-environment-extsdk.bb
ERROR: ExpansionError during parsing /home/nspector/Desktop/puls/asteroid/src/oe-core/meta/recipes-core/meta/meta-environment-extsdk.bb
Traceback (most recent call last):
bb.data_smart.ExpansionError: Failure expanding variable METADATA_REVISION, expression was ${@base_detect_revision(d)} which triggered exception CmdError: Execution of 'git rev-parse HEAD' failed: [Errno 12] Cannot allocate memory

Summary: There were 4 WARNING messages shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.

Maybe I should run it one of my more powerful computers?

nspector commented 6 years ago

Tried to run the build step on my mac and it did not work at all:

$ . ./prepare-build.sh dory
\e[32mCloning branch rocko of https://github.com/openembedded/openembedded-core.git in src/oe-core\e[39m
Cloning into 'src/oe-core'...
remote: Counting objects: 307898, done.
remote: Compressing objects: 100% (259/259), done.
remote: Total 307898 (delta 302), reused 369 (delta 253), pack-reused 307381
Receiving objects: 100% (307898/307898), 118.03 MiB | 13.67 MiB/s, done.
Resolving deltas: 100% (211805/211805), done.
Checking connectivity... done.
\e[32mCloning branch 1.36 of https://github.com/openembedded/bitbake.git in src/oe-core/bitbake\e[39m
Cloning into 'src/oe-core/bitbake'...
remote: Counting objects: 49545, done.
remote: Compressing objects: 100% (85/85), done.
remote: Total 49545 (delta 146), reused 120 (delta 107), pack-reused 49353
Receiving objects: 100% (49545/49545), 17.10 MiB | 6.88 MiB/s, done.
Resolving deltas: 100% (34496/34496), done.
Checking connectivity... done.
\e[32mCloning branch rocko of https://github.com/openembedded/meta-openembedded.git in src/meta-openembedded\e[39m
Cloning into 'src/meta-openembedded'...
remote: Counting objects: 86782, done.
remote: Compressing objects: 100% (423/423), done.
remote: Total 86782 (delta 436), reused 698 (delta 381), pack-reused 85914
Receiving objects: 100% (86782/86782), 32.14 MiB | 10.20 MiB/s, done.
Resolving deltas: 100% (49498/49498), done.
Checking connectivity... done.
\e[32mCloning branch 5.10 of https://code.qt.io/yocto/meta-qt5.git in src/meta-qt5\e[39m
Cloning into 'src/meta-qt5'...
remote: Counting objects: 10762, done.
remote: Compressing objects: 100% (6474/6474), done.
remote: Total 10762 (delta 7649), reused 6473 (delta 3949)
Receiving objects: 100% (10762/10762), 2.38 MiB | 1.31 MiB/s, done.
Resolving deltas: 100% (7649/7649), done.
Checking connectivity... done.
\e[32mCloning branch rocko of https://github.com/shr-distribution/meta-smartphone in src/meta-smartphone\e[39m
Cloning into 'src/meta-smartphone'...
remote: Counting objects: 23451, done.
remote: Total 23451 (delta 0), reused 0 (delta 0), pack-reused 23451
Receiving objects: 100% (23451/23451), 8.45 MiB | 5.68 MiB/s, done.
Resolving deltas: 100% (10704/10704), done.
Checking connectivity... done.
\e[32mCloning branch master of https://github.com/AsteroidOS/meta-asteroid in src/meta-asteroid\e[39m
Cloning into 'src/meta-asteroid'...
remote: Counting objects: 3992, done.
remote: Total 3992 (delta 0), reused 0 (delta 0), pack-reused 3992
Receiving objects: 100% (3992/3992), 578.69 KiB | 0 bytes/s, done.
Resolving deltas: 100% (2100/2100), done.
Checking connectivity... done.
\e[32mCloning branch master of https://github.com/AsteroidOS/meta-anthias-hybris in src/meta-anthias-hybris\e[39m
Cloning into 'src/meta-anthias-hybris'...
remote: Counting objects: 449, done.
remote: Total 449 (delta 0), reused 0 (delta 0), pack-reused 449
Receiving objects: 100% (449/449), 107.58 MiB | 13.00 MiB/s, done.
Resolving deltas: 100% (149/149), done.
Checking connectivity... done.
\e[32mCloning branch master of https://github.com/AsteroidOS/meta-bass-hybris in src/meta-bass-hybris\e[39m
Cloning into 'src/meta-bass-hybris'...
remote: Counting objects: 553, done.
remote: Total 553 (delta 0), reused 0 (delta 0), pack-reused 553
Receiving objects: 100% (553/553), 452.15 KiB | 0 bytes/s, done.
Resolving deltas: 100% (185/185), done.
Checking connectivity... done.
\e[32mCloning branch master of https://github.com/AsteroidOS/meta-dory-hybris in src/meta-dory-hybris\e[39m
Cloning into 'src/meta-dory-hybris'...
remote: Counting objects: 572, done.
remote: Total 572 (delta 0), reused 0 (delta 0), pack-reused 572
Receiving objects: 100% (572/572), 524.05 KiB | 0 bytes/s, done.
Resolving deltas: 100% (195/195), done.
Checking connectivity... done.
\e[32mCloning branch master of https://github.com/AsteroidOS/meta-lenok-hybris in src/meta-lenok-hybris\e[39m
Cloning into 'src/meta-lenok-hybris'...
remote: Counting objects: 743, done.
remote: Total 743 (delta 0), reused 0 (delta 0), pack-reused 743
Receiving objects: 100% (743/743), 548.40 KiB | 0 bytes/s, done.
Resolving deltas: 100% (247/247), done.
Checking connectivity... done.
\e[32mCloning branch master of https://github.com/AsteroidOS/meta-sparrow-hybris in src/meta-sparrow-hybris\e[39m
Cloning into 'src/meta-sparrow-hybris'...
remote: Counting objects: 431, done.
remote: Total 431 (delta 0), reused 0 (delta 0), pack-reused 431
Receiving objects: 100% (431/431), 230.14 KiB | 0 bytes/s, done.
Resolving deltas: 100% (147/147), done.
Checking connectivity... done.
\e[32mCloning branch master of https://github.com/AsteroidOS/meta-sprat-hybris in src/meta-sprat-hybris\e[39m
Cloning into 'src/meta-sprat-hybris'...
remote: Counting objects: 575, done.
remote: Total 575 (delta 0), reused 0 (delta 0), pack-reused 575
Receiving objects: 100% (575/575), 500.48 KiB | 0 bytes/s, done.
Resolving deltas: 100% (196/196), done.
Checking connectivity... done.
\e[32mCloning branch master of https://github.com/AsteroidOS/meta-swift-hybris in src/meta-swift-hybris\e[39m
Cloning into 'src/meta-swift-hybris'...
remote: Counting objects: 671, done.
remote: Total 671 (delta 0), reused 0 (delta 0), pack-reused 670
Receiving objects: 100% (671/671), 528.96 KiB | 0 bytes/s, done.
Resolving deltas: 100% (223/223), done.
Checking connectivity... done.
\e[32mCloning branch master of https://github.com/AsteroidOS/meta-tetra-hybris in src/meta-tetra-hybris\e[39m
Cloning into 'src/meta-tetra-hybris'...
remote: Counting objects: 325, done.
remote: Total 325 (delta 0), reused 0 (delta 0), pack-reused 325
Receiving objects: 100% (325/325), 14.28 MiB | 8.08 MiB/s, done.
Resolving deltas: 100% (95/95), done.
Checking connectivity... done.
\e[32mCloning branch master of https://github.com/AsteroidOS/meta-wren-hybris in src/meta-wren-hybris\e[39m
Cloning into 'src/meta-wren-hybris'...
remote: Counting objects: 482, done.
remote: Total 482 (delta 0), reused 0 (delta 0), pack-reused 482
Receiving objects: 100% (482/482), 501.98 KiB | 0 bytes/s, done.
Resolving deltas: 100% (164/164), done.
Checking connectivity... done.
\e[32mWriting build/conf/local.conf\e[39m
\e[32mWriting build/conf/bblayers.conf\e[39m
readlink: illegal option -- f
usage: readlink [-n] [file ...]
-bash: /scripts/oe-buildenv-internal: No such file or directory
Welcome to the Asteroid compilation script.

If you meet any issue you can report it to the project's github page:
    https://github.com/AsteroidOS

You can now run the following command to get started with the compilation:
    bitbake asteroid-image

Have fun!
FlorentRevest commented 6 years ago

do you mean git clone or copy the directory?

The folders in src/ are obtained by git clone so if you copy one of those folders or if you clone a repository again, it's gonna be the exact same result.

I ran sudo apt-get intsall texinfo, which fixed it and I believe everything is building correctly.

Sorry to insist but again, that is clearly documented on the "Building AsteroidOS" page. https://asteroidos.org/wiki/building-asteroidos/ "Make sure you have the following build dependencies before starting a build: git build-essential cpio diffstat gawk chrpath texinfo"

Porting Asteroid to a new watch requires an in-depth knowledge of Linux, following the documentation is by far the easiest part, we can't hold your hand through the entire process.

Maybe I should run it one of my more powerful computers?

Googling your error https://lists.yoctoproject.org/pipermail/yocto/2015-February/023774.html indeed shows that you don't have enough RAM on your machine to run an OpenEmbedded build.

Tried to run the build step on my mac and it did not work at all

Getting OpenEmbedded/Yocto to work on Mac OS X is out of the scope of the AsteroidOS project. Please get in touch with the Yocto developers if you want to know more about that.