BUILD

U-Boot, Kernel, Cross compiler 준비가 되었으면, Ethernet을 통한 Network이 가능한 상태이다. 이 다음 진행의 편의를 위하여 OpenSSH를 사용하기로 한다.

cd ~/repo
git clone <https://github.com/openssh/openssh-portable.git>
cd openssh-portable

의존성 문제를 해결해야하나, 현재 환경에서 모든 준비가 되어 있으므로 zlib. OpenSSL 등의 설치를 불 필요하다.

configure 파일이 존재하지 않으므로 autoconf를 통해 우선 configure 파일을 생성한다. 이렇게 생성한 configure는 —sysroot 옵션을 사용할 수 없으므로 컴파일을 위한 환경 설정이 필요하다.

export CC="arm-poky-linux-gnueabi-gcc -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=/opt/fsl-imx-fb/6.6-scarthgap/sysroots/cortexa9t2hf-neon-poky-linux-gnueabi"
export LD="arm-poky-linux-gnueabi-ld --sysroot=/opt/fsl-imx-fb/6.6-scarthgap/sysroots/cortexa9t2hf-neon-poky-linux-gnueabi"
export AR="arm-poky-linux-gnueabi-ar"
export RANLIB="arm-poky-linux-gnueabi-ranlib"

준비되었으면 configure를 아래와 같이 실행한다.

./configure --host=arm-poky-linux-gnueabi \\
            --prefix=/usr \\
            --sysconfdir=/etc/ssh \\
            --with-sysroot=/opt/fsl-imx-fb/6.6-scarthgap/sysroots/cortexa9t2hf-neon-poky-linux-gnueabi \\
            --with-zlib=/path/to/zlib \\
            --with-ssl-dir=/path/to/openssl