{"id":449,"date":"2023-04-09T13:41:45","date_gmt":"2023-04-09T05:41:45","guid":{"rendered":"https:\/\/yajtech.synology.me\/wordpress\/?p=449"},"modified":"2023-04-09T15:16:21","modified_gmt":"2023-04-09T07:16:21","slug":"quilt","status":"publish","type":"post","link":"https:\/\/www.yaj.com.tw\/wordpress\/?p=449","title":{"rendered":"quilt"},"content":{"rendered":"\n<p>Prepare quilt configuration<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat &lt;&lt; EOF &gt; ~\/.quiltrc\nQUILT_DIFF_ARGS=\"--no-timestamps --no-index -p ab --color=auto\"\nQUILT_REFRESH_ARGS=\"--no-timestamps --no-index -p ab\"\nQUILT_SERIES_ARGS=\"--color=auto\"\nQUILT_PATCH_OPTS=\"--unified\"\nQUILT_DIFF_OPTS=\"-p\"\nEDITOR=\"vim\"\nEOF<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li><code>EDITOR<\/code>&nbsp;specifies the preferred editor for interactive patch editing<\/li><li>The other variables control the patch format property like a\/, b\/ directory names and no timestamps<\/li><li>FreeBSD does not support the&nbsp;<code>--color=auto<\/code>&nbsp;option and&nbsp;<code>-pab<\/code>&nbsp;must be written as&nbsp;<code>-p ab<\/code><\/li><li><img decoding=\"async\" src=\"https:\/\/openwrt.org\/lib\/images\/smileys\/icon_exclaim.gif\" alt=\":!:\">&nbsp;<code>-p ab<\/code>&nbsp;is working with quilt 0.63 on Linux and is documented in man page.<\/li><\/ul>\n\n\n\n<p id=\"adding_a_new_patch\">Adding a new patch<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>make package\/example\/{clean,prepare} V=s QUILT=1\n# or\nmake package\/example\/host\/{clean,prepare} V=s QUILT=1\ncd build_dir\/target-*\/example-*\nquilt push -a\n# or add patch other file\nquilt import \/path\/to\/010-main_code_fix.patch\n\nquilt new 010-main_code_fix.patch\nquilt edit src\/main.c\nquilt diff\nquilt refresh\ncd ..\/..\/..\nmake package\/example\/update V=s\nmake package\/example\/{clean,compile} package\/index V=s<\/code><\/pre>\n\n\n\n<p>Edit an existing patch<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>make package\/example\/{clean,prepare} V=s QUILT=1\ncd build_dir\/target-*\/example-*\nquilt series\nquilt push 010-main_code_fix.patch\nquilt edit src\/main.c\nquilt files\nquilt diff\nquilt refresh\ncd ..\/..\/..\/\nmake package\/example\/update V=s\nmake package\/example\/{clean,compile} package\/index V=s<\/code><\/pre>\n\n\n\n<p>Adding or editing kernel patches<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>make target\/linux\/{clean,prepare} V=s QUILT=1\ncd build_dir\/target-*\/linux-*\/linux-*\nquilt push -a\nquilt new generic\/010-main_code_fix.patch\nor \nquilt new platform\/010-main_code_fix.patch\nquilt edit arch\/mips\/xxx\/xxx.c\nquilt diff\nquilt refresh\ncd ..\/..\/..\/..\nmake target\/linux\/update V=s<\/code><\/pre>\n\n\n\n<p>Adding or editing toolchain patches<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>make toolchain\/gcc\/{clean,prepare} V=99 QUILT=1\ncd build_dir\/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1\/gcc-4.3.3\nmake toolchain\/gcc\/update V=99<\/code><\/pre>\n\n\n\n<p>Naming patches<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">The patches-* subdirectories contain the kernel patches applied for every OpenWrt target.\nAll patches should be named 'NNN-lowercase_shortname.patch' and sorted into the following categories:\n\n0xx - upstream backports\n1xx - code awaiting upstream merge\n2xx - kernel build \/ config \/ header patches\n3xx - architecture specific patches\n4xx - mtd related patches (subsystem and drivers)\n5xx - filesystem related patches\n6xx - generic network patches\n7xx - network \/ phy driver patches\n8xx - other drivers\n9xx - uncategorized other patches\n\nALL patches must be in a way that they are potentially upstreamable, meaning:\n\n- they must contain a proper subject\n- they must contain a proper commit message explaining what they change\n- they must contain a valid Signed-off-by line<\/pre>\n\n\n\n<p>Refreshing patches<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># packge\n<strong>make<\/strong> package\/example\/refresh V=s\n# kernel \nmake target\/linux\/refresh V=s\n<\/pre>\n\n\n\n<p>\u5957\u4ef6\u8def\u7d93<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>make package\/feeds\/packages\/rp-pppoe\/prepare V=s QUILT=1\nmake package\/feeds\/packages\/rp-pppoe\/update V=s\nmake package\/feeds\/packages\/rp-pppoe\/compile package\/index V=s\n\nmake package\/easycwmp\/prepare V=s QUILT=1\nmake package\/easycwmp\/update V=s\nmake package\/easycwmp\/compile package\/index V=s\n\nmake package\/network\/services\/ppp\/prepare V=s QUILT=1\nmake package\/network\/services\/ppp\/update V=s\nmake package\/network\/services\/ppp\/compile package\/index V=s\n\nmake package\/boot\/uboot-mediatek\/prepare V=s QUILT=1 \nmake package\/boot\/uboot-mediatek\/update V=s\nmake package\/boot\/uboot-mediatek\/compile package\/index V=s\n\nmake package\/feeds\/packages\/rp-pppoe\/prepare V=s QUILT=1\nmake package\/feeds\/packages\/rp-pppoe\/update V=s\nmake package\/feeds\/packages\/rp-pppoe\/compile package\/index V=s<\/code><\/pre>\n\n\n\n<p>\u53c3\u8003\u8cc7\u6599<\/p>\n\n\n\n<p><a href=\"https:\/\/openwrt.org\/docs\/guide-developer\/toolchain\/use-patches-with-buildsystem\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/openwrt.org\/docs\/guide-developer\/toolchain\/use-patches-with-buildsystem<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.twblogs.net\/a\/5b96db362b717750bda6bd8d\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.twblogs.net\/a\/5b96db362b717750bda6bd8d<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Prepare quilt configuration EDITOR&nbsp;specifies the p &#8230; <a title=\"quilt\" class=\"read-more\" href=\"https:\/\/www.yaj.com.tw\/wordpress\/?p=449\" aria-label=\"\u95b1\u8b80\u3008quilt\u3009\u5168\u6587\">\u95b1\u8b80\u5168\u6587<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[17,9],"class_list":["post-449","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-linux","tag-openwrt"],"_links":{"self":[{"href":"https:\/\/www.yaj.com.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/449","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yaj.com.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yaj.com.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yaj.com.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yaj.com.tw\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=449"}],"version-history":[{"count":5,"href":"https:\/\/www.yaj.com.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/449\/revisions"}],"predecessor-version":[{"id":470,"href":"https:\/\/www.yaj.com.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/449\/revisions\/470"}],"wp:attachment":[{"href":"https:\/\/www.yaj.com.tw\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=449"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yaj.com.tw\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=449"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yaj.com.tw\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=449"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}