{"id":1019,"date":"2019-11-03T10:42:36","date_gmt":"2019-11-03T19:42:36","guid":{"rendered":"\/blog\/?p=1019"},"modified":"2023-09-21T09:26:48","modified_gmt":"2023-09-21T00:26:48","slug":"wevo-11ac-nas-openwrt-%ec%86%8c%ec%8a%a4%ec%bd%94%eb%93%9c-%eb%8b%a4%ec%9a%b4%eb%a1%9c%eb%93%9c%eb%b9%8c%eb%93%9c-%ec%8a%a4%ed%81%ac%eb%a6%bd%ed%8a%b8","status":"publish","type":"post","link":"https:\/\/hasu0707.duckdns.org\/blog\/?p=1019","title":{"rendered":"[WeVO 11AC NAS] OpenWRT \uc18c\uc2a4\ucf54\ub4dc \ub2e4\uc6b4\ub85c\ub4dc&amp;\ube4c\ub4dc \uc2a4\ud06c\ub9bd\ud2b8"},"content":{"rendered":"\n<pre class=\"wp-block-syntaxhighlighter-code\">#!\/bin\/bash\n######################################################################\n#\n# OpenWRT \ube4c\ub4dc \uc2a4\ud06c\ub9bd\ud2b8\n#\n# OS: CentOS 7\n# Target Profile: WeVO 11AC NAS Router\n#\n# Firmware download:\n# http:\/\/downloads.openwrt.org\/releases\/19.07.0\/targets\/ramips\/mt7621\/openwrt-19.07.0-ramips-mt7621-11acnas-squashfs-sysupgrade.bin\n#\n######################################################################\nCURRENT_DIR=$(pwd)\nGIT_URL=\"https:\/\/git.openwrt.org\/openwrt\/openwrt.git\"\nOPENWRT_VER=\"19.07.0\"\nDEVICE_ARCH=\"ramips\"\nDEVICE_SOC=\"mt7621\"\nMY_OPENWRT_CONFIG=\"$(pwd)\/myconfig\"\nCONFIG_DOWNLOAD_URL=\"http:\/\/downloads.openwrt.org\/releases\/${OPENWRT_VER}\/targets\/${DEVICE_ARCH}\/${DEVICE_SOC}\/config.seed\"\nCPU_CORE=3\n\n######################################################################\n#\n# \uc0ac\uc6a9\ubc95 \ucd9c\ub825\n#\n######################################################################\nfunction usage() {\n  echo\n  echo \"$0 (build step)\"\n  echo\n  echo \"build step:\"\n  echo \"  yum: update required files via yum\"\n  echo \"  dnsrc: download openwrt source code via git\"\n  echo \"  dncfg: kernel &amp; openwrt config file download\"\n  echo \"  menuconfig: make menuconfig\"\n  echo \"  make: make\"\n  echo \"  getbin: copy the finished build image to the current directory\"\n  echo \"  clean: make distclean\"\n  echo \"  reset: delete all files, including source code\"\n}\n\n######################################################################\n#\n# \ube4c\ub4dc\uc5d0 \ud544\uc694\ud55c CentOS \ud328\ud0a4\uc9c0\ub97c \uc124\uce58\ud55c\ub2e4.\n#\n######################################################################\nfunction cmd_yum() {\n  yum -y install binutils bzip2 gcc gcc-c++ gawk gettext flex ncurses-devel zlib-devel zlib-static make patch unzip perl-ExtUtils-MakeMaker glibc glibc-devel glibc-static ncurses-libs sed sdcc intltool sharutils bison wget git-core openssl-devel xz subversion\n}\n\n######################################################################\n#\n# OpenWRT \uc18c\uc2a4\ucf54\ub4dc\ub97c \ub2e4\uc6b4\ub85c\ub4dc \ubc1b\uace0, feeds\ub97c \uc5c5\ub370\uc774\ud2b8 \ud55c\ub2e4.\n#\n######################################################################\nfunction cmd_dnsrc() {\n  mkdir -p ${CURRENT_DIR}\n  cd ${CURRENT_DIR}\n  git clone -b \"v${OPENWRT_VER}\" ${GIT_URL}\n\n  cd ${CURRENT_DIR}\/openwrt\n\n  ####################################################################\n  # feeds \uc5c5\ub370\uc774\ud2b8\n  ####################################################################\n  .\/scripts\/feeds update -a\n  .\/scripts\/feeds install -a\n\n\n  ####################################################################\n  # LuCI Web Interface\n  ####################################################################\n  .\/scripts\/feeds update packages luci\n  .\/scripts\/feeds install -a -p luci\n\n  cd ${CURRENT_DIR}\n}\n\n######################################################################\n#\n# \ucee4\ub110 CONFIG \ud30c\uc77c\uc744 \ub2e4\uc6b4\ub85c\ub4dc \ubc1b\ub294\ub2e4.\n#\n######################################################################\nfunction cmd_dncfg() {\n  rm -f ${CURRENT_DIR}\/config.*\n  wget --no-check-certificate -P ${CURRENT_DIR} ${CONFIG_DOWNLOAD_URL}\n  echo \"CONFIG_TARGET_${DEVICE_ARCH}_${DEVICE_SOC}_DEVICE_11acnas=y\" >> ${CURRENT_DIR}\/config.seed\n  cp -fv ${CURRENT_DIR}\/config.seed ${CURRENT_DIR}\/openwrt\/.config\n}\n\n######################################################################\n#\n# menuconfig \uc2e4\ud589\n#\n# \uae00\uc790\uac00 \uae68\uc9c8 \uacbd\uc6b0 vi ~\/.bash_profile \ud574\uc11c\n# export TERM=xterm\n# \uc744 \ucd94\uac00\ud558\uace0 \ud130\ubbf8\ub110 \ud074\ub77c\uc774\uc5b8\ud2b8\ub3c4 \ub9de\ucd98\ub2e4.\n#\n######################################################################\nfunction cmd_menuconfig() {\n  if [ ! -f ${CURRENT_DIR}\/config.seed ]\n  then\n    if [ ! -f ${MY_OPENWRT_CONFIG} ]\n    then\n      echo \"Please execute the \\\"${0} dncfg\\\" first.\"\n      exit 1\n    fi\n  fi\n\n  cd ${CURRENT_DIR}\/openwrt\n  rm -rf tmp\n  rm -f .config\n  make defconfig\n\n  ####################################################################\n  # \ub2e4\uc6b4\ub85c\ub4dc \ub41c config\uac00 \uc788\uc73c\uba74 \uadf8\uac83\uc73c\ub85c make menuconfig \uc900\ube44\n  ####################################################################\n  if [ -f ${CURRENT_DIR}\/config.seed ]\n  then\n    cp -fv ${CURRENT_DIR}\/config.seed ${CURRENT_DIR}\/openwrt\/.config\n  fi\n\n  ####################################################################\n  # \ubbf8\ub9ac \uc900\ube44\ub41c config\uac00 \uc788\uc73c\uba74 \uadf8\uac83\uc73c\ub85c make menuconfig \uc900\ube44\n  ####################################################################\n  if [ -f ${MY_OPENWRT_CONFIG} ]\n  then\n    cp -fv ${MY_OPENWRT_CONFIG} ${CURRENT_DIR}\/openwrt\/.config\n  fi\n\n  make menuconfig\n}\n\n######################################################################\n#\n# make\n# \u203b V=99\ub294 make\uc5d0\uc11c \ube4c\ub4dc\uc2dc \uc0c1\uc138\ud55c \uc815\ubcf4\uac00 \ubcf4\uc5ec\uc9c0\ub3c4\ub85d \ud55c\ub2e4.\n# \u203b \"-j 5\"\ub294 \uba40\ud2f0\uc2a4\ub808\ub4dc\ub85c \ube4c\ub4dc\ub97c \uc9c4\ud589\ud55c\ub2e4 5\ub294 CPU \ucf54\uc5b4\uc218 + 1\n# \u203b IGNORE_ERRORS\ub294 \uc624\ub958\ub97c \ubb34\uc2dc\ud560 \uac83\uc778\uac00 \uacb0\uc815\ud55c\ub2e4.\n#\n######################################################################\nfunction cmd_make() {\n  cd ${CURRENT_DIR}\/openwrt\n\n  if [ ! -f .config ]\n  then\n    echo \"Please execute the \\\"${0} config\\\" first.\"\n    exit 1\n  fi\n\n  rm -rf ${CURRENT_DIR}\/openwrt\/bin\/targets\/${DEVICE_ARCH}\/${DEVICE_SOC}\/*\n  export FORCE_UNSAFE_CONFIGURE=1\n  make -j ${CPU_CORE} IGNORE_ERRORS=1 V=99\n}\n\n######################################################################\n#\n# \ucef4\ud30c\uc77c \uc644\ub8cc\ub41c \uc774\ubbf8\uc9c0 \ud30c\uc77c\uc744 \ud604\uc7ac \ub514\ub809\ud1a0\ub9ac\ub85c \ubcf5\uc0ac\n#\n######################################################################\nfunction cmd_getbin() {\n  rm -f ${CURRENT_DIR}\/*.bin\n\n  cp -fv ${CURRENT_DIR}\/openwrt\/bin\/targets\/${DEVICE_ARCH}\/${DEVICE_SOC}\/*-sysupgrade.bin ${CURRENT_DIR}\n}\n\n######################################################################\n#\n# distclean\n#\n######################################################################\nfunction cmd_clean() {\n  cd ${CURRENT_DIR}\/openwrt\n  rm -rf tmp\n  make distclean\n}\n\n######################################################################\n#\n# \ubaa8\ub4e0 \uc18c\uc2a4\ucf54\ub4dc \uc0ad\uc81c\n#\n######################################################################\nfunction cmd_reset() {\n  rm -rf ${CURRENT_DIR}\n}\n\n######################################################################\n#\n# arguments\uac00 1\ubcf4\ub2e4 \ud06c\uba74 \uc798\ubabb\ub41c \uc635\uc158 \uc9c0\uc815\uc774\ubbc0\ub85c \ub05d\ub0b8\ub2e4.\n#\n######################################################################\nif [ $# -gt 1 ]\nthen\n  usage\n  exit 1\nfi\n\n######################################################################\n#\n# \uc635\uc158\uc5d0 \ub530\ub77c \ubd84\uae30 \ucc98\ub9ac\n#\n######################################################################\ncase ${1} in\n  yum)\n    cmd_yum\n    ;;\n  dnsrc)\n    cmd_dnsrc\n    ;;\n  dncfg)\n    cmd_dncfg\n    ;;\n  menuconfig)\n    cmd_menuconfig\n    ;;\n  make)\n    cmd_make\n    ;;\n  getbin)\n    cmd_getbin\n    ;;\n  clean)\n    cmd_clean\n    ;;\n  reset)\n    cmd_reset\n    ;;\n  *)\n    usage\nesac\n\nexit 0<\/pre>\n","protected":false},"excerpt":{"rendered":"","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-1019","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\/1019","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=1019"}],"version-history":[{"count":0,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1019\/revisions"}],"wp:attachment":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1019"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1019"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1019"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}