{"id":1022,"date":"2019-11-05T00:17:22","date_gmt":"2019-11-05T09:17:22","guid":{"rendered":"\/blog\/?p=1022"},"modified":"2023-09-21T09:26:48","modified_gmt":"2023-09-21T00:26:48","slug":"build-u-boot","status":"publish","type":"post","link":"https:\/\/hasu0707.duckdns.org\/blog\/?p=1022","title":{"rendered":"Build u-boot"},"content":{"rendered":"\n<pre class=\"wp-block-syntaxhighlighter-code\">\n#!\/bin\/bash\n#####################################################################\n#\n# u-boot \ube4c\ub4dc\n#\n# Homepage: http:\/\/www.denx.de\/wiki\/U-Boot\/WebHome\n#\n# target SoC: MT7620A-https:\/\/www.mediatek.com\/products\/homeNetworking\/mt7620n-a\n#\n# \u203b\ucc38\uace0: https:\/\/www.denx.de\/wiki\/view\/ELDK-5\/WebHome#Section_1.6.\n#\n#####################################################################\n\nCURRENT_DIR=$(pwd)\n\nfunc_ubuntu_ready() {\n  sed -i \"s\/kr.ftp.daumkakao.com\/ftp.daumkakao.com\/g\" \/etc\/apt\/sources.list\n  apt-get -y update\n  apt-get -y install build-essential\n  apt-get -y install zlib1g zlib1g-dev\n  apt-get -y install libncurses5-dev libncursesw5-dev\n  apt-get -y install python-dev\n  apt-get -y install bison\n}\n\nfunc_ubuntu_install_cross_compiler() {\n  #apt-get install gcc-7-multilib-arm-linux-gnueabi -y\n  #apt-get install gcc-7-multilib-arm-linux-gnueabihf -y\n  #apt-get install gcc-7-multilib-mips64el-linux-gnuabi64 -y\n  #apt-get install gcc-7-multilib-mips64-linux-gnuabi64 -y\n  #apt-get install gcc-7-multilib-mipsel-linux-gnu -y\n  apt-get install gcc-7-multilib-mips-linux-gnu -y\n  #apt-get install gcc-7-multilib-powerpc64-linux-gnu -y\n  #apt-get install gcc-7-multilib-powerpc-linux-gnu -y\n  #apt-get install gcc-7-multilib-s390x-linux-gnu -y\n  #apt-get install gcc-7-multilib-sparc64-linux-gnu -y\n}\n\nfunc_install_eldk() {\n  mkdir eldk_install\n  cd eldk_install\n  mkdir -p targets\/mips\n  wget ftp:\/\/ftp.denx.de\/pub\/eldk\/5.6\/install.sh\n  chmod 755 install.sh\n  cd targets\/mips\n  wget ftp:\/\/ftp.denx.de\/pub\/eldk\/5.6\/targets\/mips\/target.conf\n  wget ftp:\/\/ftp.denx.de\/pub\/eldk\/5.6\/targets\/mips\/eldk-eglibc-i686-mips-toolchain-5.6.sh\n  wget ftp:\/\/ftp.denx.de\/pub\/eldk\/5.6\/targets\/mips\/core-image-minimal-generic-mips.tar.bz2\n  wget ftp:\/\/ftp.denx.de\/pub\/eldk\/5.6\/targets\/mips\/core-image-sato-sdk-generic-mips.tar.bz2\n  cd ..\/..\n  .\/install.sh -s toolchain -r \"sato-sdk\" mips\n}\n\nfunc_edit_profile() {\n  echo \"\" >> ~\/.profile\n  echo \"export ARCH=\\\"mips\\\"\" >> ~\/.profile\n  echo \"export CROSS_COMPILE=\\\"mips-linux-\\\"\" >> ~\/.profile\n  echo \"export PATH=\\\"\/opt\/eldk-5.6\/mips\/sysroots\/i686-eldk-linux\/usr\/bin:\/opt\/eldk-5.6\/mips\/sysroots\/i686-eldk-linux\/usr\/bin\/powerpc-linux:${PATH}\\\"\" >> ~\/.profile\n}\n\nfunc_download_uboot() {\n  rm -rf u-boot\n  git clone https:\/\/github.com\/tessel\/uboot-mt7620 u-boot\/\n}\n\nfunc_build_uboot() {\n  source \/opt\/eldk-5.6\/mips\/environment-setup-mips32-linux\n  export CFLAGS=\"-O2 -pipe -g -feliminate-unused-debug-types -fno-PIE\"\n  #export LDFLAGS=\"-O1 --ignore-unresolved-symbol _GLOBAL_OFFSET_TABLE_\"\n  export LDFLAGS=\"-O1\"\n  cd u-boot\n  make\n\n  # \ud0c0\uac9f SoC \uce69\uc744 config\ub97c \uc54c\uc544\ubcf8\ub2e4.\n  #ls -l configs\/\n}\n\n#func_ubuntu_ready\n#func_ubuntu_install_cross_compiler\n#func_install_eldk\n#func_edit_profile\nfunc_download_uboot\nfunc_build_uboot\n<\/pre>\n\n<!-- \/wp:post-content -->\n<!-- \/wp:syntaxhighlighter\/code -->\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-1022","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\/1022","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=1022"}],"version-history":[{"count":0,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1022\/revisions"}],"wp:attachment":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1022"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1022"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1022"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}