{"id":2495,"date":"2019-06-11T11:57:54","date_gmt":"2019-06-11T03:57:54","guid":{"rendered":"http:\/\/www.51cos.com\/?p=2495"},"modified":"2019-06-11T12:03:20","modified_gmt":"2019-06-11T04:03:20","slug":"2495","status":"publish","type":"post","link":"http:\/\/www.51cos.com\/?p=2495","title":{"rendered":"Linux 2.6\u6dfb\u52a0lzma\u538b\u7f29\u652f\u6301"},"content":{"rendered":"<p>\u6240\u9700\u6587\u4ef6\uff1a<a href=\"http:\/\/www.51cos.com\/wp-content\/uploads\/2019\/06\/8892172881e7b3940b07843209dcc7d974768cfed.rar\">8892172881e7b3940b07843209dcc7d974768cfed<\/a><br \/>\n\u8bf4\u660e\uff1a<br \/>\na. squashfs3.4.tar.gz\uff0csquashfs\u6587\u4ef6\u5305\uff1b<br \/>\nb. lzma457.tar.bz2\uff0cLZMA\u538b\u7f29\u89e3\u538b\u7b97\u6cd5\u5e93\uff1b<br \/>\nc. sqlzma3.4-457.tar.bz2\uff0csquashfs\u5de5\u5177\u3001kernel\u76f8\u5173\u8865\u4e01\uff08patch\uff09\u548cMakefile.<\/p>\n<p>\u89e3\u538b\u4e0a\u9762\u4e0b\u8f7d\u76843\u4e2a\u6587\u4ef6\u5305\uff1a<br \/>\n1\uff09  tar xvf squashfs3.4.tar.gz<br \/>\n2\uff09  tar xvf lzma457.tar.bz2 \u2013C lzma457<br \/>\n3\uff09  tar xvf sqlzma3.4-457.tar.bz2<\/p>\n<p>patch:<br \/>\n1)\u4e3alzma457\u5e93\u6253patch<br \/>\npatch  -p0 &lt; sqlzma1-457.patch<br \/>\n2)\u4e3asquashfs3.4\u5de5\u5177\u6253patch<br \/>\npatch  -p0 &lt; sqlzma2u-3.4.patch<br \/>\n3)\u4e3akernel\u6253patch\uff0c \u8fd9\u91cc\u5148patch  linux 2.6.16<br \/>\na.patch -p0 &lt;  squashfs3.4\/kernel-patches\/linux-2.6.16<br \/>\nb.cp sqlzma2k-3.4.patch sqlzma2k-3.4.patch-16<br \/>\nc.vi sqlzma2k-3.4.patch-16 \uff0c\u7136\u540e:% s\/ linux-2.6.27.4\/ linux-2.6.16\/g<br \/>\n(\u8fd9\u662f\u4e3a\u4e86\u4fee\u6539\u4e3alinux-2.6.16\u7248\u672c)<br \/>\nd.patch \u2013p0 &lt; sqlzma2k-3.4.patch-16<\/p>\n<p>4)\u6539\u53d8squashfs3.4\u76ee\u5f55\u91cc\u7684linux-2.6.16\u76ee\u5f55\u4e3a\u94fe\u63a5\u6587\u4ef6<br \/>\na.cd squashfs3.4\/kernel-patches\/<br \/>\nb.mv linux-2.6.16  linux-2.6.16-b<br \/>\nc.ln \u2013sf  \/home\/longjindong\/squashfs\/linux-2.6.16;cd \u2013<\/p>\n<p>5)\u6539\/home\/longjindong\/squashfs\u91cc\u7684Makefile<br \/>\nvi  Makefile     #\u628a\u7b2c16\u884c\u6539\u6210KVer = linux-2.6.16<\/p>\n<p>6)\u628alzma\u76f8\u5173\u6587\u4ef6copy\u5230linux-2.6.16\/fs\/squashfs\/\u4e0b<br \/>\ncp -a sqlzma.h sqmagic.h .\/lzma457\/C\/Compress\/Lzma\/{LzmaDecode.h,LzmaDecode.c,LzmaTypes.h,uncomp.c} linux-2.6.16\/fs\/squashfs\/<\/p>\n<p>\u5982\u679c\u4e0dcopy\u8fd9\u6b64\u6587\u4ef6\u7f16\u8bd1\u65f6\u4f1a\u51fa\u73b0\u5982\u4e0b\u8b66\u544a,\u5e76\u4e0d\u80fd\u6b63\u5e38\u4f7f\u7528.<br \/>\n7)vi linux-2.6.16\/fs\/squashfs\/Makefile #\u52a0\u4e0a\u5982\u4e0b\u4e8c\u884c:<br \/>\nsquashfs-y += uncomp.o<br \/>\nsquashfs-y += LzmaDecode.o<\/p>\n<p>8)\u628alinux-2.6.16\/fs\/squashfs\/inode.c\u4e2d\u7684static int __init init_squashfs_fs(void)\u51fd\u6570\u91cc\u7684kmalloc\u6539\u6210vmalloc, static void free_sqlzma(void) \u51fd\u6570\u91cc\u7684kfree\u6539\u6210vfree.\u4e0d\u7136\u540e\u4f1a\u51fa\u5982\u4e0b\u8b66\u544a\u5e76\u4e0d\u80fd\u6b63\u5e38\u4f7f\u7528.<\/p>\n<p>\u7f16\u8bd1<\/p>\n<p>1. ko\u53catools<br \/>\nmake<br \/>\n\u5b8c\u540e,ko\u662f: squashfs3.4\/kernel-patches\/linux-2.6.16\/fs\/squashfs\/squashfs.ko<br \/>\n.\/lzma457\/C\/Compress\/Lzma\/kmod\/sqlzma.ko<br \/>\n.\/lzma457\/C\/Compress\/Lzma\/kmod\/unlzma.ko<br \/>\n Tools \u662f:<br \/>\n.\/squashfs3.4\/squashfs-tools\/unsquashfs<br \/>\n.\/squashfs3.4\/squashfs-tools\/mksquashfs<br \/>\n2. \u8ba9kernel\u4ecesqlzma\u5206\u533a\u8d77\u52a8\u7cfb\u7edf<br \/>\n1) cd linux-2.6.16<br \/>\n2) make menuconfig<br \/>\n3) File systems &#8212;> Miscellaneous filesystems &#8212;> <*> SquashFS 3.4 &#8211; Squashed file system support<br \/>\n4)  make<br \/>\n\u6b63\u5e38\u7684\u8bddkenrel image\u5c31\u662farch\/arm\/boot\/zImage<\/p>\n<p>\u7528mksquashfs \u505a\u6587\u4ef6\u7cfb\u7edf<br \/>\nmksquashfs source1 source2 &#8230;  dest  -all-root \u2013lzmadic 1024K<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6240\u9700\u6587\u4ef6\uff1a8892172881e7b3940b07843209dcc7d974768cfed \u8bf4\u660e\uff1a a. s [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-2495","post","type-post","status-publish","format-standard","hentry","category-embedded"],"_links":{"self":[{"href":"http:\/\/www.51cos.com\/index.php?rest_route=\/wp\/v2\/posts\/2495","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.51cos.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.51cos.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.51cos.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.51cos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2495"}],"version-history":[{"count":4,"href":"http:\/\/www.51cos.com\/index.php?rest_route=\/wp\/v2\/posts\/2495\/revisions"}],"predecessor-version":[{"id":2500,"href":"http:\/\/www.51cos.com\/index.php?rest_route=\/wp\/v2\/posts\/2495\/revisions\/2500"}],"wp:attachment":[{"href":"http:\/\/www.51cos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2495"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.51cos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2495"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.51cos.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}