Mikrotik Metarouter
Материал из noname.com.ua
Версия от 16:23, 21 июня 2020; Sirmax (обсуждение | вклад)
Mikrotik Metarouter
Подготовка
- Install Xcode or at least Xcode command line tools from the MacOSX App Store
- Install brew.
- Install additional formulae:
brew install coreutils diffutils findutils gawk gnu-getopt gnu-tar grep wget quilt xz
diffutils is required to ensure quilt refreshes patches correctly.
gnu-getopt is keg-only, so force linking it:
brew ln gnu-getopt --force
OS X by default comes with a case-insensitive filesystem. OpenWrt won't build on that. As a workaround, create a (Sparse) case-sensitive disk-image that you then mount in the finder and use as build directory:
hdiutil create -size 20g -type SPARSE -fs "Case-sensitive HFS+" -volname OpenWrt OpenWrt.sparseimage
hdiutil attach OpenWrt.sparseimage
Another option if using an APFS formatted disc is to create a case-sensitive APFS volume.
Now proceed normally (git clone…) Useful things to put in .bash_profile: . /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-completion.bash . /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-prompt.sh export GIT_PS1_SHOWDIRTYSTATE=1 export GIT_PS1_SHOWSTASHSTATE=1 export GIT_PS1_SHOWCOLORHINTS=1 #export GIT_PS1_SHOWUNTRACKEDFILES=1 export GIT_PS1_SHOWUPSTREAM="auto" # Watch the escapes for " in the following export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND;} __git_ps1 \"\[\033[0;33m\]\u@\h \[\033[1;34m\]\w\[\033[0m\]\" \"\[\033[1;34m\] \$\[\033[0m\] \"" <PRE> Makefile will bomb unless you rename gxargs to xargs. ln -s /usr/local/bin/gxargs /usr/local/bin/xargs Create an APFS volume with case-sensitivity enabled Add “brew install gnutime” 18.06.0 Use non-dev build. Dev build seems to be broken at this time. Use 18.06.0 branch in git —- For OS X 10.15 aka Catalina add the following variable to your environment, else toolchain build will fail at kernel-headers MACOSX_DEPLOYMENT_TARGET=10.14 (with Xcode 11.3 + this is no longer required) Some packages/dependencies (eg. glib2) require internationalisation tools such as gettext. By default brew installs this as 'keg only' so will require adding to the path to be discovered: echo 'export PATH=“/usr/local/opt/gettext/bin:$PATH”' » ~/.zshrc OpenWrt on MacOS - Catalina 10.15.3 2020/03/02 Install xcode (v11.3.1 (11C504)) Install Homebrew Install the following brew packages (items in brackets are auto-installed dependencies as at time of writing) items after the ‘-‘ describe which OpenWrt dependencies the package satisfies. grep (pcre) - grep gawk (gmp, mpfr, readline) - awk gnu-tar - tar gnu-getopt - long getopts coreutils - fileutils/filestat findutils - gfind & gxargs wget (gettext, libunistring, libidn2, openssl@1.1) - wget optional but recommended if you’re going to work with patches/patchwork/pull requests: diffutils - diff git-extras - git-pw, git-pr quilt (gnu-sed) - quilt As a one-liner: brew install coreutils findutils gawk grep gnu-getopt gnu-tar wget diffutils git-extras quilt Some of the Homebrew packages are what is known as ‘Keg only’, in other words the commands they provided are NOT linked into /usr/local/bin because they can potentially conflict with the MacOS provided versions. Homebrew no longer supports force linking them either (e.g. brew ln gnu-getopt –force). Whilst it is possible to solve that issue by including the relevant command directory in the PATH, a neater solution is to manually link the 2 commands required into /usr/local/bin. The diff from diffutils is newer than that provided by MacOS and subtly changes the way that quilt patch refreshes work. Without it a lot of unnecessary patch churn is generated. gnu-getopt requires specific linking into /usr/local/bin - linking as gnugetopt avoids conflicting with system getopt and is still found by the build system: (cd /usr/local/bin ; ln -s ../opt/gnu-getopt/bin/getopt gnugetopt) Similarly some OpenWrt packages in the packages feed (e.g. glib2) require msgfmt from gettext (cd /usr/local/bin ; ln -s ../opt/gettext/bin/msgfmt msgfmt) Ensure /usr/local/bin is in your PATH. ==111== <PRE> git clone --branch lede-17.01 git://git.openwrt.org/openwrt/openwrt.git ./lede cd lede