OpenWRT Cross Compiling: Difference between revisions

wiki.TerraBase.info
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
* CentOS 8
*CentOS 8, OpenWRT 17.07.3, Perl 5.28.1
* Perlbrew for matching the exact version of PERL on the router and controlling it easily: https://perlbrew.pl/
*Directory: The default for most of the items below is the users "home" directory ( ~ )
** Nice tutorial for Perlbrew basics: https://www.digitalocean.com/community/tutorials/how-to-install-perlbrew-and-manage-multiple-versions-of-perl-5-on-centos-7
*Perlbrew for matching the exact version of Perl on the router and controlling it easily: https://perlbrew.pl/
* Download pre-requisites for a Cross Compile Build system: https://openwrt.org/docs/guide-developer/build-system/install-buildsystem
**Nice tutorial for Perlbrew basics: https://www.digitalocean.com/community/tutorials/how-to-install-perlbrew-and-manage-multiple-versions-of-perl-5-on-centos-7
** EPEL repository needed for some: yum install <nowiki>https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm</nowiki>
**perlbrew list
** yum install binutils bzip2 gcc gcc-c++ gawk gettext flex ncurses-devel zlib-devel zlib-static make patch unzip perl-ExtUtils-MakeMaker glibc glibc-devel glibc-static ncurses-libs sed sdcc intltool sharutils bison wget git-core openssl-devel xz
**perlbrew list-modules
*** And of course some of the above (zlib-static, glibc-static, sdcc, shareutils) doesn't work and is also a bit ambivalent, so;
**perlbrew use NameOfVersion
**** yum install zlib glibc-common glibc-devel glibc-headers glibc-langpack-en (sdcc (compiler for 8501 microcontroller) and shareutils (for specific encoding for paid RedHat subscribers) are not readily available for CentOS 8)
**perl -v: Verify current version used
* Download OpenWRT Files (from https://openwrt.org/docs/guide-developer/build-system/install-buildsystem)
**Install a Perl Module: curl -L <nowiki>https://cpanmin.us</nowiki> | perl - Name::Name
** git clone <nowiki>https://git.openwrt.org/openwrt/openwrt.git</nowiki>
*Download pre-requisites for a Cross Compile Build system: https://openwrt.org/docs/guide-developer/build-system/install-buildsystem
**EPEL repository needed for some: yum install <nowiki>https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm</nowiki>
**yum install binutils bzip2 gcc gcc-c++ gawk gettext flex ncurses-devel zlib-devel zlib-static make patch unzip perl-ExtUtils-MakeMaker glibc glibc-devel glibc-static ncurses-libs sed sdcc intltool sharutils bison wget git-core openssl-devel xz
***And of course some of the above (zlib-static, glibc-static, sdcc, shareutils) doesn't work and is also a bit ambivalent, so;
****yum install zlib glibc-common glibc-devel glibc-headers glibc-langpack-en (sdcc (compiler for 8501 microcontroller) and shareutils (for specific encoding for paid RedHat subscribers) are not readily available for CentOS 8)
*If one wants to build firmware version of OpenWRT: Download OpenWRT Files (from https://openwrt.org/docs/guide-developer/build-system/install-buildsystem)
**git clone <nowiki>https://git.openwrt.org/openwrt/openwrt.git</nowiki>
*If one wants to build Perl and compile modules that include other libraries such as OpenSSL
**yum install openssl-devel
**Download the TAR package from CPAN
**perl Makefile.PL
**make
**make test
**make dist
*OpenSSL Cross Compiling
**https://stackoverflow.com/questions/15539062/cross-compiling-of-openssl-for-linux-arm-v5te-linux-gnueabi-toolchain
**./Configure LIST
**Header files should be in /usr/include
*Compiling
**file NameOfBinary: Shows information about binary file (opkg install file)
**

Revision as of 16:44, 30 August 2020

  • CentOS 8, OpenWRT 17.07.3, Perl 5.28.1
  • Directory: The default for most of the items below is the users "home" directory ( ~ )
  • Perlbrew for matching the exact version of Perl on the router and controlling it easily: https://perlbrew.pl/
  • Download pre-requisites for a Cross Compile Build system: https://openwrt.org/docs/guide-developer/build-system/install-buildsystem
    • EPEL repository needed for some: yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
    • yum install binutils bzip2 gcc gcc-c++ gawk gettext flex ncurses-devel zlib-devel zlib-static make patch unzip perl-ExtUtils-MakeMaker glibc glibc-devel glibc-static ncurses-libs sed sdcc intltool sharutils bison wget git-core openssl-devel xz
      • And of course some of the above (zlib-static, glibc-static, sdcc, shareutils) doesn't work and is also a bit ambivalent, so;
        • yum install zlib glibc-common glibc-devel glibc-headers glibc-langpack-en (sdcc (compiler for 8501 microcontroller) and shareutils (for specific encoding for paid RedHat subscribers) are not readily available for CentOS 8)
  • If one wants to build firmware version of OpenWRT: Download OpenWRT Files (from https://openwrt.org/docs/guide-developer/build-system/install-buildsystem)
    • git clone https://git.openwrt.org/openwrt/openwrt.git
  • If one wants to build Perl and compile modules that include other libraries such as OpenSSL
    • yum install openssl-devel
    • Download the TAR package from CPAN
    • perl Makefile.PL
    • make
    • make test
    • make dist
  • OpenSSL Cross Compiling
  • Compiling
    • file NameOfBinary: Shows information about binary file (opkg install file)