{"id":97,"date":"2025-11-13T01:45:59","date_gmt":"2025-11-12T17:45:59","guid":{"rendered":"https:\/\/blog.dream-cast.com.cn\/?p=97"},"modified":"2025-11-13T01:45:59","modified_gmt":"2025-11-12T17:45:59","slug":"setup-the-openwrt-build-environment-and-compile-a-test-image-on-macos","status":"publish","type":"post","link":"https:\/\/blog.dream-cast.com.cn\/?p=97","title":{"rendered":"Setup the\u00a0OpenWRT\u00a0build environment, and compile a test image on macOS"},"content":{"rendered":"\n<pre class=\"wp-block-preformatted\"># Install Xcode from the AppStore\n# Install Xcode build tools\nxcode-select --install\n\n# Install the Hombrew package manager\n\/bin\/bash -c \"$(curl -fsSL https:\/\/raw.githubusercontent.com\/Homebrew\/install\/master\/install.sh)\"\n\n# Install required packages\nbrew install apr apr-util arping asciidoc autoconf automake bash bdw-gc berkeley-db binutils \\\n\tbinwalk boost brotli bzip2 c-ares cmake coreutils curl dash diffutils docbook e2fsprogs \\\n\tfastjar findutils flex freetype gawk gcc gdbm gettext git git-extras gmp gnu-getopt \\\n\tgnu-sed gnu-tar gnutls gpatch gputils grep guile icu4c intltool isl jemalloc libev libevent \\\n\tlibffi libgcrypt libgpg-error libidn2 libmetalink libmpc libnet libpng libssh2 libtasn1 \\\n\tlibtool libunistring libxml2 libxslt libyaml lz4 m4 make mercurial mpdecimal mpfr mtr \\\n\tncurses nettle nghttp2 numpy openblas openldap openssl@1.1 openssl@3 p11-kit p7zip patchutils \\\n\tpcre pcre2 perl pkg-config python quilt readline rtmpdump ruby source-highlight sqlite \\\n\tssdeep subversion tcl-tk unbound unzip utf8proc wget xz zlib zstd\n\n# Link gnu-make to be used as default\ncd \/usr\/local\/bin\nln -s \/usr\/local\/opt\/make\/libexec\/gnubin\/make make\n\n# Link coreutils stat to be used as default\nln -s gstat stat\n\n# Edit \/etc\/shells\nsudo nano \/etc\/shells\n\n# Add the following line at the end\n\/usr\/local\/bin\/bash\n\n# Change the default shell to bash, and exit\nchsh -s \/usr\/local\/bin\/bash\nexit\n\n# open Disk Utility\n# press Command-N to create a new virtual disk\n# Image Format: sparse disk image\n# save as: ~\/vhd\/test\n# Name: test\n# Size: 50 GB\n# Format: APFS (Case-sensitive)\n# Encryption: none\n# Partitions: Single partition - GUID Partition Map\n# Save\n# open a new terminal\n\n# Clone OpenWRT: official or httpstorm fork\n# git clone https:\/\/github.com\/openwrt\/openwrt.git\ngit clone https:\/\/github.com\/httpstorm\/openwrt.git\ncd openwrt\n\n# When using the httpstorm fork, checkout branch gvalkov\ngit checkout <var>gvalkov<\/var>\n\n# Update and install feeds\n.\/scripts\/feeds update -a\n.\/scripts\/feeds install -a\n\n# Make default config and them menuconfig\nmake defconfig\nmake menuconfig\n\n# Configure the target system, e.g.\n# Target System (Marvell EBU Armada)\n# Subtarget (Marvell Armada 37x\/38x\/XP)\n# Target Profile (Linksys WRT3200ACM)\n# Save\n# Exit\n\n# Compile the target image\nmake -j 16\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p># Install Xcode from the AppStore # Inst &hellip; <a href=\"https:\/\/blog.dream-cast.com.cn\/?p=97\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-97","post","type-post","status-publish","format-standard","hentry","category-1"],"_links":{"self":[{"href":"https:\/\/blog.dream-cast.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/97","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.dream-cast.com.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.dream-cast.com.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.dream-cast.com.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.dream-cast.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=97"}],"version-history":[{"count":1,"href":"https:\/\/blog.dream-cast.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/97\/revisions"}],"predecessor-version":[{"id":98,"href":"https:\/\/blog.dream-cast.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/97\/revisions\/98"}],"wp:attachment":[{"href":"https:\/\/blog.dream-cast.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=97"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.dream-cast.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=97"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.dream-cast.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=97"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}