OpenWRT Cross Compiling

wiki.TerraBase.info
Revision as of 16:44, 30 August 2020 by Root (talk | contribs)
Jump to navigation Jump to search
  • 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)