{"id":549,"date":"2024-03-21T18:43:49","date_gmt":"2024-03-21T10:43:49","guid":{"rendered":"https:\/\/vm1.go2see.me\/?p=549"},"modified":"2024-05-23T23:10:29","modified_gmt":"2024-05-23T15:10:29","slug":"toolchains-setup","status":"publish","type":"post","link":"https:\/\/vm1.go2see.me\/?p=549","title":{"rendered":"Ubuntu 22.04 \u958b\u767c\u74b0\u5883\u5b89\u88dd"},"content":{"rendered":"<h2>apt \u66f4\u65b0<\/h2>\n<p>sudo apt update; sudo apt upgrade<\/p>\n<h2>\u540c\u6642\u5b89\u88dd\u5169\u500b\u7248\u672c\u7684 python \u8207 PIP2 \u548cPIP3<\/h2>\n<p>python3 \u7684 pip \u5b89\u88dd\u5230 \/usr\/bin, python2 \u7684 pip \u7528\u975e\u5b98\u65b9\u65b9\u6cd5\u5b89\u88dd\u5230 \/usr\/local\/bin\uff0c \u4e26\u5c07 pip \u9810\u8a2d\u4f7f\u7528 pip3 \u7684\u3002<\/p>\n<pre><code class=\"language-bash\">#1. apt install standard python2\/python3\/pip3 in \/usr\/bin\n#  \u4f7f\u7528\u5b98\u65b9\u65b9\u5f0f\u5b89\u88dd python2 python3 \u548c pip3 \u5230 \/usr\/bin\nsudo apt install -y python2 python3 python3-pip\n\n#2. unoffical install pip2 in \/usr\/local\/bin\n#   \u4f7f\u7528\u975e\u5b98\u65b9\u65b9\u5f0f\u5b89\u88dd pip2 \u5230 \/usr\/local\/bin\ncurl https:\/\/bootstrap.pypa.io\/pip\/2.7\/get-pip.py --output get-pip.py\nsudo python2 get-pip.py\n\n#3. use pip3 as default pip\n#   \u9810\u8a2d python3\/pip3 \u7232\u4e3b\u8981python, \u9700\u8981\u8001 python\/pip \u6642\u7528 python2\/pip2 \u547d\u4ee4\nsudo rm \/usr\/local\/bin\/pip\nsudo ln -s \/usr\/bin\/python3 \/usr\/local\/bin\/python\nsudo ln -s \/usr\/bin\/pip3 \/usr\/local\/bin\/pip\n\n#4. check pip versions\n#   \u6aa2\u67e5 pip2 \/ pip3 \/ pip \u7684\u7248\u6b21\npip2 -V; pip3 -V; pip -V\n\n#---my version report is \u6211\u7684\u6aa2\u67e5\u5982\u4e0b:\n#pip 20.3.4 from \/usr\/local\/lib\/python2.7\/dist-packages\/pip (python 2.7)\n#pip 22.0.2 from \/usr\/lib\/python3\/dist-packages\/pip (python 3.10)\n#pip 22.0.2 from \/usr\/lib\/python3\/dist-packages\/pip (python 3.10)<\/code><\/pre>\n<h2>\u5b89\u88dd google repo (\u65b0 repo \u4f7f\u7528 python3)<\/h2>\n<p>\u6211\u5b89\u88dd\u5230 \/usr\/loca\/bin<\/p>\n<pre><code class=\"language-shell\">wget https:\/\/storage.googleapis.com\/git-repo-downloads\/repo \nchmod a+rx repo\nsudo mv repo \/usr\/local\/bin<\/code><\/pre>\n<h2>\u5b89\u88dd Android \u958b\u767c\u5de5\u5177<\/h2>\n<pre><code class=\"language-shell\"># get android tools\nsudo apt install -y git-core gnupg flex bison build-essential zip curl zlib1g-dev libc6-dev-i386 libncurses5 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig ninja-build python3-pip \n# get goldfish tools\nsudo apt install -y git devscripts config-package-dev debhelper-compat golang curl ssh\n\n# usb control:\nsudo usermod -aG plugdev $LOGNAME\nsudo apt install -y android-sdk-platform-tools-common<\/code><\/pre>\n<h2>\u5b89\u88dd QEMU \u9700\u8981\u7684\u5de5\u5177<\/h2>\n<ul>\n<li>In software &amp; update app,  on &quot;Ubuntu Software&quot; tab, check the &quot;Source code&quot; item.<br \/>\n\u9700\u8981\u5728\u8edf\u4ef6\u5b89\u88dd&amp;\u5347\u7d1a app \u7684 Ubuntu\u8edf\u4ef6\u55ae\u4e2d \u6253\u958b \u201c\u5b89\u88dd\u6e90\u4ee3\u78bc\u201d \u9078\u9805<br \/>\n<img decoding=\"async\" src=\"https:\/\/dav2.go2see.co\/md-pics\/image-20240523205727799.png\" alt=\"image-20240523205727799\" \/><\/li>\n<li>then:<br \/>\n\u7136\u5f8c\u5b89\u88dd\u4ee5\u4e0b Lib \u8b93QEMU \u8c50\u5bcc\u9ede<\/p>\n<pre><code class=\"language-sh\">sudo apt build-dep qemu -y\nsudo apt install -y libusb-dev libsdl2-dev libsdl2-image-dev libjpeg-dev libpng-dev pulseaudio alsa virgl-server libsasl2-dev libopengl-dev iasl indent<\/code><\/pre>\n<\/li>\n<\/ul>\n<h2>\u5b89\u88dd AGL \u9700\u8981\u7684\u958b\u767c\u5de5\u5177<\/h2>\n<pre><code class=\"language-sh\"># AGL marlin \u6587\u6863\u53ea\u8bf4\u8981\uff1a\n# - git 1.8.3.1 \u4ee5\u4e0a\n# - tar 1.2.7 \u4ee5\u4e0a\n# - python 3.4 \u4ee5\u4e0a\n# - gcc5 \u4ee5\u4e0a\n# - curl \u52a0\u4e0a yacto \u7684\u9700\u6c42\n\n# yacto\u8bf4 ubuntu \u4e0b\u8981\u5b89\u88c5\uff08\u6211\u52a0\u4e0a curl\uff0c \u6bd4AGL\u8bf4\u7684\u591a\u4e86zstd\u7b49\u3002\u3002\u3002\uff09\uff1a\n# \uff08ubuntu22.04 \u4f7f\u7528 pylint \u5305\u66f4\u540d\/\u53d6\u4ee3 pylint3 \u5305\uff09\nsudo apt install -y gawk wget git diffstat unzip texinfo gcc build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint xterm python3-subunit mesa-common-dev zstd liblz4-tool curl\n\n# \u4f7f\u7528 python3 \u53d6\u4ee3\u7cfb\u7edf\u9884\u8bbe\u7684 python2\nmkdir -p ~\/bin\nln -s \/usr\/bin\/python3 ~\/bin\/python<\/code><\/pre>\n<h2>\u5b89\u88dd Zephyr \u958b\u767c\u5de5\u5177<\/h2>\n<pre><code class=\"language-sh\">sudo apt install -y --no-install-recommends git cmake ninja-build gperf \\\n  ccache dfu-util device-tree-compiler wget \\\n  python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file libpython3-dev \\\n  make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1 cmake<\/code><\/pre>\n<h2>\u5b89\u88dd Nuttx \u958b\u767c\u5de5\u5177<\/h2>\n<pre><code class=\"language-sh\">sudo apt install -y bison flex gettext texinfo libncurses5-dev libncursesw5-dev gperf automake libtool pkg-config build-essential gperf genromfs libgmp-dev libmpc-dev libmpfr-dev libisl-dev binutils-dev libelf-dev libexpat-dev gcc-multilib g++-multilib picocom u-boot-tools util-linux curl kconfig-frontends calc<\/code><\/pre>\n<h2>arm tools<\/h2>\n<pre><code class=\"language-sh\">sudo apt install gcc-arm-none-eabi binutils-arm-none-eabi<\/code><\/pre>\n<h2>\u5b89\u88dd CVE\/CWE\u8207C\u8a9e\u8a00\u6aa2\u67e5\u5de5\u5177<\/h2>\n<pre><code class=\"language-bash\">\n# 1. \u7528 python3 \u5b89\u88dd cve-bin-tool\nsudo pip3 install cve-bin-tool[PDF]\n# 2. \u7528 python2 \u5b89\u88dd flawfinder \u5230 python2\nsudo pip2 install flawfinder\n# 3. \u7528 apt \u5b89\u88dd cppcheck\nsudo apt install -y cppcheck\n<\/code><\/pre>\n<h2>\u5b89\u88dd Rust \/ LLVM clang<\/h2>\n<p>ubuntu 22\u53ef\u4ee5\u76f4\u63a5\u7528\u7cfb\u7d71\u7684 rust<\/p>\n<pre><code class=\"language-sh\">sudo apt install rustc cargo llvm lldb clang  -y<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>apt \u66f4\u65b0 sudo apt update; sudo apt upgrade \u540c\u6642\u5b89\u88dd\u5169\u500b\u7248\u672c\u7684 pyth&#8230; &raquo; <a class=\"read-more-link\" href=\"https:\/\/vm1.go2see.me\/?p=549\">\u95b1\u8b80\u5168\u6587<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,17,10,8,6,18,1],"tags":[],"class_list":["post-549","post","type-post","status-publish","format-standard","hentry","category-agl","category-android","category-embedded","category-miropython","category-nuttx","category-risc-v","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/vm1.go2see.me\/index.php?rest_route=\/wp\/v2\/posts\/549","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vm1.go2see.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vm1.go2see.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vm1.go2see.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vm1.go2see.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=549"}],"version-history":[{"count":18,"href":"https:\/\/vm1.go2see.me\/index.php?rest_route=\/wp\/v2\/posts\/549\/revisions"}],"predecessor-version":[{"id":577,"href":"https:\/\/vm1.go2see.me\/index.php?rest_route=\/wp\/v2\/posts\/549\/revisions\/577"}],"wp:attachment":[{"href":"https:\/\/vm1.go2see.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=549"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vm1.go2see.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=549"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vm1.go2see.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=549"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}