{"id":495,"date":"2014-06-03T18:19:05","date_gmt":"2014-06-04T03:19:05","guid":{"rendered":"\/blog\/?p=495"},"modified":"2023-09-21T09:38:43","modified_gmt":"2023-09-21T00:38:43","slug":"openwrt-%ec%9d%b4%eb%af%b8%ec%a7%80-%eb%b9%8c%eb%93%9c","status":"publish","type":"post","link":"https:\/\/hasu0707.duckdns.org\/blog\/?p=495","title":{"rendered":"OpenWRT \uc774\ubbf8\uc9c0 \ube4c\ub4dc"},"content":{"rendered":"\n<span style=\"font-family: Courier New;\">export KERNEL_SRC_DIR=\/home\/hasu0707\/ib\/build_dir\/target-mipsel_24kec+dsp_uClibc-0.9.33.2\/linux-ramips_rt305x<\/span><br \/><span style=\"font-family: Courier New;\">export ROOTFS_SRC_DIR=\/home\/hasu0707\/ib\/build_dir\/target-mipsel_24kec+dsp_uClibc-0.9.33.2\/root-ramips<\/span><br \/><span style=\"font-family: Courier New;\">export TOOLCHAIN_BIN_DIR=\/home\/hasu0707\/ib\/staging_dir\/host\/bin<\/span><br \/><span style=\"font-family: Courier New;\">export DTS_DIR=\/home\/hasu0707\/ib\/target\/linux\/ramips\/dts<\/span><br \/><span style=\"font-family: Courier New;\">export OUTPUT_DIR=\/home\/hasu0707\/ib\/bin\/ramips<\/span><br \/><br \/><span style=\"font-family: Courier New;\">cp -fv ${KERNEL_SRC_DIR}\/vmlinux.elf ${OUTPUT_DIR}\/openwrt-ramips-rt305x-vmlinux.elf<\/span><br \/><span style=\"font-family: Courier New;\">cp -fv ${KERNEL_SRC_DIR}\/vmlinux ${OUTPUT_DIR}\/openwrt-ramips-rt305x-vmlinux.bin<\/span><br \/><br \/><span style=\"font-family: Courier New;\">${TOOLCHAIN_BIN_DIR}\/lzma e \\<\/span><br \/><span style=\"font-family: Courier New;\">${KERNEL_SRC_DIR}\/vmlinux \\<\/span><br \/><span style=\"font-family: Courier New;\">-lc1 -lp2 -pb2 \\<\/span><br \/><span style=\"font-family: Courier New;\">${KERNEL_SRC_DIR}\/vmlinux.bin.lzma<\/span><br \/><br \/><span style=\"font-family: Courier New;\">cp -fv ${KERNEL_SRC_DIR}\/uImage.lzma ${OUTPUT_DIR}\/openwrt-ramips-rt305x-uImage.bin<\/span><br \/><br \/><span style=\"font-family: Courier New;\">${TOOLCHAIN_BIN_DIR}\/mksquashfs4 \\<\/span><br \/><span style=\"font-family: Courier New;\">${ROOTFS_SRC_DIR} \\<\/span><br \/><span style=\"font-family: Courier New;\">${KERNEL_SRC_DIR}\/root.squashfs \\<\/span><br \/><span style=\"font-family: Courier New;\">-nopad -noappend -root-owned -comp xz -Xpreset 9 \\<\/span><br \/><span style=\"font-family: Courier New;\">-Xe -Xlc 0 -Xlp 2 -Xpb 2&nbsp; -b 256k -p '\/dev d 755 0 0' \\<\/span><br \/><span style=\"font-family: Courier New;\">-p '\/dev\/console c 600 0 0 5 1' -processors 1<\/span><br \/><br \/><span style=\"font-family: Courier New;\">dd \\<\/span><br \/><span style=\"font-family: Courier New;\">if=${KERNEL_SRC_DIR}\/root.squashfs \\<\/span><br \/><span style=\"font-family: Courier New;\">of=${OUTPUT_DIR}\/openwrt-ramips-rt305x-root.squashfs \\<\/span><br \/><span style=\"font-family: Courier New;\">bs=128k conv=sync<\/span><br \/><br \/><span style=\"font-family: Courier New;\">cp -fv ${KERNEL_SRC_DIR}\/vmlinux ${KERNEL_SRC_DIR}\/vmlinux-sr-k100<\/span><br \/><br \/><span style=\"font-family: Courier New;\">${KERNEL_SRC_DIR}\/linux-3.10.36\/scripts\/dtc\/dtc \\<\/span><br \/><span style=\"font-family: Courier New;\">-O dtb \\<\/span><br \/><span style=\"font-family: Courier New;\">-o ${KERNEL_SRC_DIR}\/SR-K100.dtb \\<\/span><br \/><span style=\"font-family: Courier New;\">${DTS_DIR}\/SR-K100.dts<\/span><br \/><br \/><span style=\"font-family: Courier New;\">${TOOLCHAIN_BIN_DIR}\/patch-dtb \\<\/span><br \/><span style=\"font-family: Courier New;\">${KERNEL_SRC_DIR}\/vmlinux-sr-k100 \\<\/span><br \/><span style=\"font-family: Courier New;\">${KERNEL_SRC_DIR}\/SR-K100.dtb<\/span><br \/><br \/><span style=\"font-family: Courier New;\">${TOOLCHAIN_BIN_DIR}\/lzma e \\<\/span><br \/><span style=\"font-family: Courier New;\">${KERNEL_SRC_DIR}\/vmlinux-sr-k100 \\<\/span><br \/><span style=\"font-family: Courier New;\">-lc1 -lp2 -pb2 \\<\/span><br \/><span style=\"font-family: Courier New;\">${KERNEL_SRC_DIR}\/vmlinux-sr-k100.bin.lzma<\/span><br \/><br \/><span style=\"font-family: Courier New;\">cat \\<\/span><br \/><span style=\"font-family: Courier New;\">${KERNEL_SRC_DIR}\/vmlinux-sr-k100.uImage \\<\/span><br \/><span style=\"font-family: Courier New;\">${KERNEL_SRC_DIR}\/root.squashfs \\<\/span><br \/><span style=\"font-family: Courier New;\">&gt; ${KERNEL_SRC_DIR}\/openwrt-ramips-rt305x-sr-k100-squashfs-sysupgrade.bin<\/span><br \/><br \/><span style=\"font-family: Courier New;\">${TOOLCHAIN_BIN_DIR}\/padjffs2 \\<\/span><br \/><span style=\"font-family: Courier New;\">${KERNEL_SRC_DIR}\/openwrt-ramips-rt305x-sr-k100-squashfs-sysupgrade.bin \\<\/span><br \/><span style=\"font-family: Courier New;\">4 8 16 64 128 256<\/span><br \/><br \/><span style=\"font-family: Courier New;\"># \ud38c\uc6e8\uc5b4 \ud30c\uc77c \uc0ac\uc774\uc988 \uac80\uc0ac<\/span><br \/><span style=\"font-family: Courier New;\">if [ `stat -c%s \"${KERNEL_SRC_DIR}\/openwrt-ramips-rt305x-sr-k100-squashfs-sysupgrade.bin\"` -gt 8060928 ]; \\<\/span><br \/><span style=\"font-family: Courier New;\">then&nbsp; \\<\/span><br \/><span style=\"font-family: Courier New;\">echo \"Warning: ${KERNEL_SRC_DIR}\/openwrt-ramips-rt305x-sr-k100-squashfs-sysupgrade.bin is too big\" &gt;&amp;2;&nbsp; \\<\/span><br \/><span style=\"font-family: Courier New;\">else \\<\/span><br \/><span style=\"font-family: Courier New;\">cp -fvpR ${KERNEL_SRC_DIR}\/openwrt-ramips-rt305x-sr-k100-squashfs-sysupgrade.bin ${OUTPUT_DIR}\/openwrt-ramips-rt305x-sr-k100-squashfs-sysupgrade.bin; \\<\/span><br \/><span style=\"font-family: Courier New;\">fi<\/span><br \/><br \/><span style=\"font-family: Courier New;\">( cd ${OUTPUT_DIR} ; ${TOOLCHAIN_BIN_DIR}\/find -maxdepth 1 -type f \\! -name 'md5sums'&nbsp; -printf \"%P\\n\" | sort | xargs md5sum --binary &gt; md5sums )<\/span><p><br \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>export KERNEL_SRC_DIR=\/home\/hasu0707\/ib\/build_dir\/target-mipsel_24kec+dsp_uClibc-0.9.33.2\/linux-ramips_rt305xexport ROOTFS_SRC_DIR=\/home\/hasu0707\/ib\/build_dir\/target-mipsel_24kec+dsp_uClibc-0.9.33.2\/root-ramipsexport TOOLCHAIN_BIN_DIR=\/home\/hasu0707\/ib\/staging_dir\/host\/binexport DTS_DIR=\/home\/hasu0707\/ib\/target\/linux\/ramips\/dtsexport OUTPUT_DIR=\/home\/hasu0707\/ib\/bin\/ramips cp -fv ${KERNEL_SRC_DIR}\/vmlinux.elf ${OUTPUT_DIR}\/openwrt-ramips-rt305x-vmlinux.elfcp -fv ${KERNEL_SRC_DIR}\/vmlinux ${OUTPUT_DIR}\/openwrt-ramips-rt305x-vmlinux.bin ${TOOLCHAIN_BIN_DIR}\/lzma e \\${KERNEL_SRC_DIR}\/vmlinux \\-lc1 -lp2 -pb2 \\${KERNEL_SRC_DIR}\/vmlinux.bin.lzma cp -fv ${KERNEL_SRC_DIR}\/uImage.lzma ${OUTPUT_DIR}\/openwrt-ramips-rt305x-uImage.bin ${TOOLCHAIN_BIN_DIR}\/mksquashfs4 \\${ROOTFS_SRC_DIR} \\${KERNEL_SRC_DIR}\/root.squashfs \\-nopad -noappend -root-owned -comp xz -Xpreset 9 \\-Xe -Xlc 0 -Xlp 2 -Xpb 2&nbsp; -b 256k -p &#8216;\/dev d 755 0 0&#8217; \\-p &#8216;\/dev\/console c 600 0 0 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[21],"tags":[],"class_list":["post-495","post","type-post","status-publish","format-standard","hentry","category-development_openwrt"],"_links":{"self":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/495","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=495"}],"version-history":[{"count":0,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/495\/revisions"}],"wp:attachment":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=495"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=495"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}