From 891d9e18220cd0b14c0b1ae6056513cae4e63492 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 2 May 2021 13:05:04 +0200 Subject: [PATCH] updated READMEs --- doc/README-bbb.md | 45 +++++++++++++++++++++++++-------------------- doc/README-rpi.md | 43 ++++++++++++++++++++++++------------------- 2 files changed, 49 insertions(+), 39 deletions(-) diff --git a/doc/README-bbb.md b/doc/README-bbb.md index 63e4217..0060c3a 100644 --- a/doc/README-bbb.md +++ b/doc/README-bbb.md @@ -93,7 +93,7 @@ These prerequisites are valid for Linux as well as Windows hosts. for the FSFW and isalso applicable to the Raspberry Pi. SSH into the Beagle Bone Black and follow the instructions in that section. -3. Install the correct [ARM Linux cross-compile toolchain](https://releases.linaro.org/components/toolchain/binaries/latest-7/). +3. Install the correct [ARM Linux cross-compile toolchain](https://releases.linaro.org/components/toolchain/binaries/latest-7/arm-linux-gnueabihf/). provided by Linaro. Test the toolchain by running: @@ -121,12 +121,20 @@ These prerequisites are valid for Linux as well as Windows hosts. Use the rootfs location stored from the previous steps as ``. ```sh - rsync -vR --progress -rl --delete-after --safe-links @:/{lib,usr} + rsync -avHAXR --numeric-ids --info=progress2 @:/{lib,usr} ``` Please note that `rsync` sometimes does not copy shared libraries or symlinks properly, - which might result in errors when cross-compiling and cross-linking. See the - [troubleshooting](#troubleshooting) section for more details. + which might result in errors when cross-compiling and cross-linking. It is recommended to run + the following commands in addition to the `rsync` command: + + ```sh + scp @:/lib/arm-linux-gnueabihf/{libc.so.6,ld-linux-armhf.so.3,libm.so.6} /lib/arm-linux-gnueabihf + scp @:/usr/lib/arm-linux-gnueabihf/{libpthread.so,libc.so,librt.so} /usr/lib/arm-linux-gnueabihf + ``` + + See the [troubleshooting](#troubleshooting) section for more details if the compilation process + is problematic. 5. It is recommended to install `gdb-multiarch`. This tool will allow remote debugging on the host computer. Replace `x86_64` with the correct processor architecture for other architectures. @@ -267,7 +275,7 @@ debugging using the TCF agent. # Troubleshooting -## Cloning Sysroot +## Cloning the root filesystem There might be some issues with the pthread symbolic links. Navigate to the folder containing the symlinks @@ -282,24 +290,18 @@ manually to avoid issues when linking against `pthread` later. Run the following command to create a symlink to `libpthread.so.0` +```sh +scp @:/usr/lib/arm-linux-gnueabihf/libpthread.so . +``` + +Alternatively, you can also create the symlink pointing to the correct library with + ```sh ln -s ../../../lib/arm-linux-gnueabihf/libpthread.so.0 libpthread.so ``` -Please note that there might also be issues with some symlinks or libraries not being copied -properly. This has occured with files like `libc.so.6`. If there are linker issues at a later -stage, you can try to rerun `rsync` without `--safe-links` or copy the shared libraries or -symlinks manually from the Linux board to the sysroot with `scp`. - -For example, you can copy `libc.so.6` from the Linux board to the sysroot with -the following command - -```sh -scp @:lib/arm-linux-gnueabihf/lib.so.6 /lib/arm-linux-gnueabihf -``` - -If there are issues with the cross-compilation process, manually copying these shared -libraries can help +If there are issues with the cross-compilation process, manually copying the following +symlinks can help: ```sh scp @:/usr/lib/arm-linux-gnueabihf/libc.so /usr/lib/arm-linux-gnueabihf @@ -312,4 +314,7 @@ scp @:/lib/arm-linux-gnueabihf/librt.so.1 /l scp @:/lib/arm-linux-gnueabihf/libpthread.so.0 /lib/arm-linux-gnueabihf scp @:/lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 /lib/arm-linux-gnueabihf scp @:/lib/arm-linux-gnueabihf/libc.so.6 /lib/arm-linux-gnueabihf -``` +``` + +If any custom libraries are used which rely on symlinks, it might be necessary to copy them +or create them manually as well. diff --git a/doc/README-rpi.md b/doc/README-rpi.md index 090fb64..085e38f 100644 --- a/doc/README-rpi.md +++ b/doc/README-rpi.md @@ -123,12 +123,20 @@ toolchain binaries are added to the path accordingly. `$HOME/raspberrypi/rootfs`. ```sh - rsync -vR --progress -rl --delete-after --safe-links pi@:/{lib,usr,opt/vc/lib} + rsync -avHAXR --numeric-ids --info=progress2 @:/{lib,usr} ``` - + Please note that `rsync` sometimes does not copy shared libraries or symlinks properly, - which might result in errors when cross-compiling and cross-linking. See the - [troubleshooting](#troubleshooting) section for more details. + which might result in errors when cross-compiling and cross-linking. It is recommended to run + the following commands in addition to the `rsync` command: + + ```sh + scp @:/lib/arm-linux-gnueabihf/{libc.so.6,ld-linux-armhf.so.3,libm.so.6} /lib/arm-linux-gnueabihf + scp @:/usr/lib/arm-linux-gnueabihf/{libpthread.so,libc.so,librt.so} /usr/lib/arm-linux-gnueabihf + ``` + + See the [troubleshooting](#troubleshooting) section for more details if the compilation process + is problematic. 3. It is recommended to install `gdb-multiarch`. This tool will allow remote debugging on the host computer. This step is not required if the `tcf-agent` is used. @@ -342,7 +350,7 @@ debugging using the TCF agent. # Troubleshooting -## Cloning Sysroot +## Cloning the root filesystem There might be some issues with the pthread symbolic links. Navigate to the folder containing the symlinks @@ -357,24 +365,18 @@ manually to avoid issues when linking against `pthread` later. Run the following command to create a symlink to `libpthread.so.0` +```sh +scp @:/usr/lib/arm-linux-gnueabihf/libpthread.so . +``` + +Alternatively, you can also create the symlink pointing to the correct library with + ```sh ln -s ../../../lib/arm-linux-gnueabihf/libpthread.so.0 libpthread.so ``` -Please note that there might also be issues with some symlinks or libraries not being copied -properly. This has occured with files like `libc.so.6`. If there are linker issues at a later -stage, you can try to rerun `rsync` without `--safe-links` or copy the shared libraries or -symlinks manually from the Linux board to the sysroot with `scp`. - -For example, you can copy `libc.so.6` from the Linux board to the sysroot with -the following command - -```sh -scp @:lib/arm-linux-gnueabihf/lib.so.6 /lib/arm-linux-gnueabihf -``` - -If there are issues with the cross-compilation process, manually copying these shared -libraries can help +If there are issues with the cross-compilation process, manually copying the following +symlinks can help: ```sh scp @:/usr/lib/arm-linux-gnueabihf/libc.so /usr/lib/arm-linux-gnueabihf @@ -388,3 +390,6 @@ scp @:/lib/arm-linux-gnueabihf/libpthread.so.0 @:/lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 /lib/arm-linux-gnueabihf scp @:/lib/arm-linux-gnueabihf/libc.so.6 /lib/arm-linux-gnueabihf ``` + +If any custom libraries are used which rely on symlinks, it might be necessary to copy them +or create them manually as well.