{"id":20127,"date":"2024-03-15T20:00:02","date_gmt":"2024-03-15T20:00:02","guid":{"rendered":"https:\/\/www.silicloud.com\/blog\/how-to-compile-your-own-software-package-in-openwrt\/"},"modified":"2024-03-21T17:20:47","modified_gmt":"2024-03-21T17:20:47","slug":"how-to-compile-your-own-software-package-in-openwrt","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/blog\/how-to-compile-your-own-software-package-in-openwrt\/","title":{"rendered":"How to compile your own software package in OpenWrt?"},"content":{"rendered":"<p>To compile your own software package, you can follow these steps:<\/p>\n<ol>\n<li>Firstly, make sure that you have the OpenWrt compilation environment installed. If not, please follow the installation guide provided on the official OpenWrt website.<\/li>\n<li>In the source code directory of OpenWrt, locate the file feeds.conf.default and add the following content to the end of the file (skip this step if it already exists):<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code>src-git mypackages https:\/\/github.com\/your-username\/your-repo.git\r\n<\/code><\/pre>\n<p>The your-username\/your-repo.git is the git URL for your software package code repository.<\/p>\n<ol>\n<li>Execute the following command to update the software package list:<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code>.\/scripts\/feeds update mypackages\r\n<\/code><\/pre>\n<ol>\n<li>Execute the following command to install the software package:<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code>.\/scripts\/feeds install -a -p mypackages\r\n<\/code><\/pre>\n<ol>\n<li>bundle<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code>cd package\r\nmkdir mypackage\r\n<\/code><\/pre>\n<ol>\n<li>Copy your software package source code to a newly created subdirectory.<\/li>\n<li>Create a file named Makefile in the newly created subdirectory and add the following content inside:<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code>include $(TOPDIR)\/rules.mk\r\n\r\nPKG_NAME:=mypackage\r\nPKG_VERSION:=1.0\r\nPKG_RELEASE:=1\r\n\r\nPKG_SOURCE_PROTO:=git\r\nPKG_SOURCE_URL:=https:\/\/github.com\/your-username\/your-repo.git\r\nPKG_SOURCE_VERSION:=master\r\n\r\ninclude $(INCLUDE_DIR)\/package.mk\r\n\r\ndefine Package\/mypackage\r\n  SECTION:=utils\r\n  CATEGORY:=Utilities\r\n  TITLE:=My Package\r\n  DEPENDS:=+libopenssl +libcurl\r\nendef\r\n\r\ndefine Package\/mypackage\/description\r\n  This is my custom package.\r\nendef\r\n\r\ndefine Build\/Prepare\r\nendef\r\n\r\ndefine Build\/Compile\r\nendef\r\n\r\ndefine Package\/mypackage\/install\r\n  $(INSTALL_DIR) $(1)\/usr\/bin\r\n  $(INSTALL_BIN) $(PKG_BUILD_DIR)\/mybinary $(1)\/usr\/bin\/\r\nendef\r\n\r\n$(eval $(call BuildPackage,mypackage))\r\n<\/code><\/pre>\n<p>Replace the values of variables such as PKG_NAME, PKG_VERSION, PKG_RELEASE, PKG_SOURCE_URL, and DEPENDS to fit your package.<\/p>\n<ol>\n<li>Return to the OpenWrt source code directory and run the following command to configure the compilation options.<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code>make menuconfig\r\n<\/code><\/pre>\n<p>Locate your package in the menu, select it, and then save and exit.<\/p>\n<ol>\n<li>Run the following command to start compiling OpenWrt and your package:<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code>make -j8\r\n<\/code><\/pre>\n<p>The option -j8 indicates the number of concurrent compiling threads; you can adjust it according to your system configuration.<\/p>\n<ol>\n<li>trash can<\/li>\n<li>binary file<\/li>\n<li>development directory<\/li>\n<\/ol>\n<p>The above are the basic steps for compiling your own software package using OpenWrt. You can further customize and adjust it according to your needs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To compile your own software package, you can follow these steps: Firstly, make sure that you have the OpenWrt compilation environment installed. If not, please follow the installation guide provided on the official OpenWrt website. In the source code directory of OpenWrt, locate the file feeds.conf.default and add the following content to the end of [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-20127","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to compile your own software package in OpenWrt? - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/blog\/how-to-compile-your-own-software-package-in-openwrt\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to compile your own software package in OpenWrt?\" \/>\n<meta property=\"og:description\" content=\"To compile your own software package, you can follow these steps: Firstly, make sure that you have the OpenWrt compilation environment installed. If not, please follow the installation guide provided on the official OpenWrt website. In the source code directory of OpenWrt, locate the file feeds.conf.default and add the following content to the end of [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/blog\/how-to-compile-your-own-software-package-in-openwrt\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/SiliCloudGlobal\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-15T20:00:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-21T17:20:47+00:00\" \/>\n<meta name=\"author\" content=\"Jackson Davis\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@SiliCloudGlobal\" \/>\n<meta name=\"twitter:site\" content=\"@SiliCloudGlobal\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jackson Davis\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/how-to-compile-your-own-software-package-in-openwrt\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/how-to-compile-your-own-software-package-in-openwrt\/\"},\"author\":{\"name\":\"Jackson Davis\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/55a10b8b0457c35884c25677889ad350\"},\"headline\":\"How to compile your own software package in OpenWrt?\",\"datePublished\":\"2024-03-15T20:00:02+00:00\",\"dateModified\":\"2024-03-21T17:20:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/how-to-compile-your-own-software-package-in-openwrt\/\"},\"wordCount\":249,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\"},\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/how-to-compile-your-own-software-package-in-openwrt\/\",\"url\":\"https:\/\/www.silicloud.com\/blog\/how-to-compile-your-own-software-package-in-openwrt\/\",\"name\":\"How to compile your own software package in OpenWrt? - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#website\"},\"datePublished\":\"2024-03-15T20:00:02+00:00\",\"dateModified\":\"2024-03-21T17:20:47+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/how-to-compile-your-own-software-package-in-openwrt\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/blog\/how-to-compile-your-own-software-package-in-openwrt\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/how-to-compile-your-own-software-package-in-openwrt\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.silicloud.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to compile your own software package in OpenWrt?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/blog\/\",\"name\":\"Silicon Cloud Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\",\"name\":\"Silicon Cloud Blog\",\"url\":\"https:\/\/www.silicloud.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png\",\"contentUrl\":\"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png\",\"width\":1024,\"height\":1024,\"caption\":\"Silicon Cloud Blog\"},\"image\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/SiliCloudGlobal\/\",\"https:\/\/twitter.com\/SiliCloudGlobal\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/55a10b8b0457c35884c25677889ad350\",\"name\":\"Jackson Davis\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2fdb47d6df1226e92380d96973782572a97b0675d098bb914410dec348eb5d29?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2fdb47d6df1226e92380d96973782572a97b0675d098bb914410dec348eb5d29?s=96&d=mm&r=g\",\"caption\":\"Jackson Davis\"},\"url\":\"https:\/\/www.silicloud.com\/blog\/author\/jacksondavis\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to compile your own software package in OpenWrt? - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/blog\/how-to-compile-your-own-software-package-in-openwrt\/","og_locale":"en_US","og_type":"article","og_title":"How to compile your own software package in OpenWrt?","og_description":"To compile your own software package, you can follow these steps: Firstly, make sure that you have the OpenWrt compilation environment installed. If not, please follow the installation guide provided on the official OpenWrt website. In the source code directory of OpenWrt, locate the file feeds.conf.default and add the following content to the end of [&hellip;]","og_url":"https:\/\/www.silicloud.com\/blog\/how-to-compile-your-own-software-package-in-openwrt\/","og_site_name":"Blog - Silicon Cloud","article_publisher":"https:\/\/www.facebook.com\/SiliCloudGlobal\/","article_published_time":"2024-03-15T20:00:02+00:00","article_modified_time":"2024-03-21T17:20:47+00:00","author":"Jackson Davis","twitter_card":"summary_large_image","twitter_creator":"@SiliCloudGlobal","twitter_site":"@SiliCloudGlobal","twitter_misc":{"Written by":"Jackson Davis","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.silicloud.com\/blog\/how-to-compile-your-own-software-package-in-openwrt\/#article","isPartOf":{"@id":"https:\/\/www.silicloud.com\/blog\/how-to-compile-your-own-software-package-in-openwrt\/"},"author":{"name":"Jackson Davis","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/55a10b8b0457c35884c25677889ad350"},"headline":"How to compile your own software package in OpenWrt?","datePublished":"2024-03-15T20:00:02+00:00","dateModified":"2024-03-21T17:20:47+00:00","mainEntityOfPage":{"@id":"https:\/\/www.silicloud.com\/blog\/how-to-compile-your-own-software-package-in-openwrt\/"},"wordCount":249,"commentCount":0,"publisher":{"@id":"https:\/\/www.silicloud.com\/blog\/#organization"},"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/blog\/how-to-compile-your-own-software-package-in-openwrt\/","url":"https:\/\/www.silicloud.com\/blog\/how-to-compile-your-own-software-package-in-openwrt\/","name":"How to compile your own software package in OpenWrt? - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/blog\/#website"},"datePublished":"2024-03-15T20:00:02+00:00","dateModified":"2024-03-21T17:20:47+00:00","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/blog\/how-to-compile-your-own-software-package-in-openwrt\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/blog\/how-to-compile-your-own-software-package-in-openwrt\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/blog\/how-to-compile-your-own-software-package-in-openwrt\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.silicloud.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to compile your own software package in OpenWrt?"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/blog\/#website","url":"https:\/\/www.silicloud.com\/blog\/","name":"Silicon Cloud Blog","description":"","publisher":{"@id":"https:\/\/www.silicloud.com\/blog\/#organization"},"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.silicloud.com\/blog\/#organization","name":"Silicon Cloud Blog","url":"https:\/\/www.silicloud.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png","contentUrl":"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png","width":1024,"height":1024,"caption":"Silicon Cloud Blog"},"image":{"@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/SiliCloudGlobal\/","https:\/\/twitter.com\/SiliCloudGlobal"]},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/55a10b8b0457c35884c25677889ad350","name":"Jackson Davis","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2fdb47d6df1226e92380d96973782572a97b0675d098bb914410dec348eb5d29?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2fdb47d6df1226e92380d96973782572a97b0675d098bb914410dec348eb5d29?s=96&d=mm&r=g","caption":"Jackson Davis"},"url":"https:\/\/www.silicloud.com\/blog\/author\/jacksondavis\/"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts\/20127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/comments?post=20127"}],"version-history":[{"count":1,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts\/20127\/revisions"}],"predecessor-version":[{"id":53907,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts\/20127\/revisions\/53907"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/media?parent=20127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/categories?post=20127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/tags?post=20127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}