Chinaunix首页 | 论坛 | 博客
  • 博客访问: 631336
  • 博文数量: 75
  • 博客积分: 988
  • 博客等级: 准尉
  • 技术积分: 1269
  • 用 户 组: 普通用户
  • 注册时间: 2011-05-10 15:44
文章分类

全部博文(75)

文章存档

2022年(1)

2019年(1)

2018年(1)

2016年(9)

2015年(7)

2013年(6)

2012年(40)

2011年(10)

分类: Android平台

2019-09-26 15:49:47

  • 安装 openJDK 8
    sudo apt-get update sudo apt-get install openjdk-8-jdk
  • 安装依赖
    sudo apt-get install libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dev g++-multilib sudo apt-get install -y git flex bison gperf build-essential libncurses5-dev:i386 sudo apt-get install tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386 sudo apt-get install dpkg-dev libsdl1.2-dev libesd0-dev sudo apt-get install git-core gnupg flex bison gperf build-essential sudo apt-get install zip curl zlib1g-dev gcc-multilib g++-multilib sudo apt-get install libc6-dev-i386 sudo apt-get install lib32ncurses5-dev x11proto-core-dev libx11-dev sudo apt-get install libgl1-mesa-dev libxml2-utils xsltproc unzip m4 sudo apt-get install lib32z-dev ccache sudo apt install git-lfs
  • 以上libesd0-dev安装的时候会报错,源有问题,添加源并重新执行即可。
  • 开发板采用Edge(RK3399)
  • repo init -u -b khadas-edge-pie
    repo sync -j8 这个过程中老会断,时间也比较久,也不可能老守着。
    #!/bin/bash 
    repo sync -j4 
    while [ $? = 1 ]; do  
        echo "Sync failed, repeat again:"  
        repo sync -j4 
    done
    和意料的一样,会报错,第一个过不了的就是权限不够,
    Traceback (most recent call last):
      File "/home/gavin/Work/RK/Edge/WORKING_DIRECTORY/.repo/repo/main.py", line 47, in 
        import event_log
      File "/home/gavin/Work/RK/Edge/WORKING_DIRECTORY/.repo/repo/event_log.py", line 166, in 
        _EVENT_ID = multiprocessing.Value('i', 1)
      File "/snap/git-repo/18/usr/lib/python2.7/multiprocessing/__init__.py", line 253, in Value
        return Value(typecode_or_type, *args, **kwds)
      File "/snap/git-repo/18/usr/lib/python2.7/multiprocessing/sharedctypes.py", line 108, in Value
        lock = RLock()
      File "/snap/git-repo/18/usr/lib/python2.7/multiprocessing/__init__.py", line 183, in RLock
        return RLock()
      File "/snap/git-repo/18/usr/lib/python2.7/multiprocessing/synchronize.py", line 172, in __init__
        SemLock.__init__(self, RECURSIVE_MUTEX, 1, 1)
      File "/snap/git-repo/18/usr/lib/python2.7/multiprocessing/synchronize.py", line 75, in __init__
        sl = self._semlock = _multiprocessing.SemLock(kind, value, maxvalue)
    OSError: [Errno 13] Permission denied
    
    
    这里直接提升用户组权限。
    echo "gavin ALL=(ALL) ALL">>/etc/sudoers.d/gavin
    chomd 0440 /etc/sudoers.d/gavin
    执行过程中提示缺少的东西,补上就可以了。
    git-lfs filter-process --skip: 1: git-lfs filter-process --skip: git-lfs: not found   
    fatal: The remote end hung up unexpectedly
    error: Cannot checkout android_tools_dexter: GitError: cannot initialize work tree for android_tools_dexter
    Traceback (most recent call last):
      File "/home/gavin/Work/RK/Edge/WORKING_DIRECTORY/.repo/repo/main.py", line 572, in 
        _Main(sys.argv[1:])
      File "/home/gavin/Work/RK/Edge/WORKING_DIRECTORY/.repo/repo/main.py", line 547, in _Main
        result = run()
      File "/home/gavin/Work/RK/Edge/WORKING_DIRECTORY/.repo/repo/main.py", line 540, in 
        run = lambda: repo._Run(name, gopts, argv) or 0
      File "/home/gavin/Work/RK/Edge/WORKING_DIRECTORY/.repo/repo/main.py", line 201, in _Run
        result = cmd.Execute(copts, cargs)
      File "/home/gavin/Work/RK/Edge/WORKING_DIRECTORY/.repo/repo/subcmds/sync.py", line 997, in Execute
        self._Checkout(all_projects, opt)
      File "/home/gavin/Work/RK/Edge/WORKING_DIRECTORY/.repo/repo/subcmds/sync.py", line 554, in _Checkout
        self._CheckoutWorker(**kwargs)
      File "/home/gavin/Work/RK/Edge/WORKING_DIRECTORY/.repo/repo/subcmds/sync.py", line 439, in _CheckoutWorker
        return self._CheckoutOne(opt, project, *args, **kwargs)
      File "/home/gavin/Work/RK/Edge/WORKING_DIRECTORY/.repo/repo/subcmds/sync.py", line 474, in _CheckoutOne
        project.Sync_LocalHalf(syncbuf, force_sync=opt.force_sync)
      File "/home/gavin/Work/RK/Edge/WORKING_DIRECTORY/.repo/repo/project.py", line 1492, in Sync_LocalHalf
        self._InitWorkTree(force_sync=force_sync, submodules=submodules)
      File "/home/gavin/Work/RK/Edge/WORKING_DIRECTORY/.repo/repo/project.py", line 2719, in _InitWorkTree
        raise GitError("cannot initialize work tree for " + self.name)
    error.GitError: cannot initialize work tree for android_tools_dexter
    Sync failed, repeat again:
    fatal: unable to access '/': gnutls_handshake() failed: The TLS connection was non-properly terminated.
    
    
     sudo apt install git-lfs  执行安装。

  • error: unable to read sha1 file of gradle-2.4-all.zip (81710873a6413e6f31c72d16078c9910301f63ac) 
    error: unable to read sha1 file of gradle-3.2-bin.zip (0ffb0cb09c2921602f1a8f15969e2c2bc4f6ff94)
    error: unable to read sha1 file of gradle-3.3-bin.zip (5c8aa568d559da964aa652537b29d604d0aeb61a)
    error: unable to read sha1 file of gradle-3.4.1-bin.zip (a5d650ddf21149c5d2ca3b114887722a58d00ef3)
    error: unable to read sha1 file of gradle-4.0-bin.zip (efaad69ebf8961a43097649b5b1540285d03450f)
    error: unable to read sha1 file of gradle-4.1-bin.zip (a46c12157010d729ff2b1975f3f134e4849f79b8)
    error: unable to read sha1 file of gradle-4.3-bin.zip (d8422a9099f576ee1e53931980c582be550bfc6b)
    error: unable to read sha1 file of gradle-4.4-bin.zip (48b03d0ab1bc41bcd48911ff20632eeb0cf0f0db)
    error: unable to read sha1 file of gradle-api-2.14.1.jar (a365aa49fc9006ef299d2e2cb3d357771a5e0123)
    error: unable to read sha1 file of gradle-api-3.4.1.jar (a14c13e5222087218882bed3244a104d1b5a48bb)
    error: unable to read sha1 file of gradle-api-3.5-20170307000048+0000.jar (147791798b5085bb1cd7ba02815fd516e00921df)
    error: Cannot checkout platform/tools/external/gradle: GitError: cannot initialize work tree for platform/tools/external/gradle
    Traceback (most recent call last):
      File "/home/gavin/Work/RK/Edge/WORKING_DIRECTORY/.repo/repo/main.py", line 572, in
        _Main(sys.argv[1:])
      File "/home/gavin/Work/RK/Edge/WORKING_DIRECTORY/.repo/repo/main.py", line 547, in _Main
        result = run()
      File "/home/gavin/Work/RK/Edge/WORKING_DIRECTORY/.repo/repo/main.py", line 540, in
        run = lambda: repo._Run(name, gopts, argv) or 0
      File "/home/gavin/Work/RK/Edge/WORKING_DIRECTORY/.repo/repo/main.py", line 201, in _Run
        result = cmd.Execute(copts, cargs)
      File "/home/gavin/Work/RK/Edge/WORKING_DIRECTORY/.repo/repo/subcmds/sync.py", line 997, in Execute
        self._Checkout(all_projects, opt)
      File "/home/gavin/Work/RK/Edge/WORKING_DIRECTORY/.repo/repo/subcmds/sync.py", line 554, in _Checkout
        self._CheckoutWorker(**kwargs)
      File "/home/gavin/Work/RK/Edge/WORKING_DIRECTORY/.repo/repo/subcmds/sync.py", line 439, in _CheckoutWorker
        return self._CheckoutOne(opt, project, *args, **kwargs)
      File "/home/gavin/Work/RK/Edge/WORKING_DIRECTORY/.repo/repo/subcmds/sync.py", line 474, in _CheckoutOne
        project.Sync_LocalHalf(syncbuf, force_sync=opt.force_sync)
      File "/home/gavin/Work/RK/Edge/WORKING_DIRECTORY/.repo/repo/project.py", line 1492, in Sync_LocalHalf
        self._InitWorkTree(force_sync=force_sync, submodules=submodules)
      File "/home/gavin/Work/RK/Edge/WORKING_DIRECTORY/.repo/repo/project.py", line 2719, in _InitWorkTree
        raise GitError("cannot initialize work tree for " + self.name)
    error.GitError: cannot initialize work tree for platform/tools/external/gradle
    Sync failed, repeat again:
  • 应该是包没有对上,删掉以下重新同步。
  • system/netd
    .repo/projects/system/netd.git
    .repo/project-objects/platform/system/netd.git
    tools/external/gradle
    .repo/projects/tools/external/gradle.git
    .repo/project-objects/platform/tools/external/gradle.git
    这样源码就可以同步完成了。

  • 接下来执行编译
  • Build U-boot
  • $ cd PATH_YOUR_PROJECT 
    $ cd u-boot $ make mrproper
     $ ./make.sh kedge
  • Build Kernel
  • $ cd PATH_YOUR_PROJECT
    $ cd kernel
    $ make ARCH=arm64 kedge_defconfig -jN
    $ make ARCH=arm64 rk3399-khadas-edge-android.img -j16

  • Build Android
  • $ cd PATH_YOUR_PROJECT 
    $ source build/envsetup.sh $ lunch rk3399-userdebug 
    $ make installclean 
    $ make -j16
    $ ./mkimage.sh

  • 同样报错

  • from Crypto.Signature import PKCS1_v1_5
    ImportError: No module named Crypto.Signature
    /home/gavin/Work/RK/Edge/WORKING_DIRECTORY/external/rk_tee_user/export-user_ta/mk/link.mk:65: recipe for target '/home/gavin/Work/RK/Edge/WORKING_DIRECTORY/external/rk_tee_user/ta/testapp/8cccf200-2450-11e4-abe20002a5d5c52c.ta' failed
    make[2]: *** [/home/gavin/Work/RK/Edge/WORKING_DIRECTORY/external/rk_tee_user/ta/testapp/8cccf200-2450-11e4-abe20002a5d5c52c.ta] Error 1
    make[2]: *** Waiting for unfinished jobs....
    make[2]: Leaving directory '/home/gavin/Work/RK/Edge/WORKING_DIRECTORY/external/rk_tee_user/ta/testapp'
    Makefile:37: recipe for target 'ta' failed
    make[1]: *** [ta] Error 2
    make[1]: Leaving directory '/home/gavin/Work/RK/Edge/WORKING_DIRECTORY/external/rk_tee_user/ta'
    Makefile:27: recipe for target 'ta' failed
    make: *** [ta] Error 2
    make: Leaving directory '/home/gavin/Work/RK/Edge/WORKING_DIRECTORY/external/rk_tee_user'
    [  9% 9925/99418] Build hyb out/target/product/rk3399/obj/ETC/hy...hyph-hu.hyb <- external/hyphenation-patterns/hu//hyph-hu.pat.txt
    21515 unique nodes, 102669 total
    ninja: build stopped: subcommand failed.
    10:25:25 ninja failed with: exit status 1


    #### failed to build some targets (08:59 (mm:ss)) ####
  • 在python中想要使用crypto相关的库,网上的解决方法一大片,但是大多都是废话,能用的没有几个,而且能安装的没有几个。

    首先我告诉大家为什么不能安装,其次告诉一种真正的方法。

    python版本:python3.6,系统:win7;目的:crypto安装

    1.pycrypto、pycrytodome和crypto是一个东西,crypto在python上面的名字是pycrypto,它是一个第三方库,但是已经停止更新三年了,所以不建议安装这个库;

    2.windows下python3.6安装也不会成功!

    这个时候pycryptodome就来了,它是pycrypto的延伸版本,用法和pycrypto是一模一样的;

    所以,我现在告诉大家一种解决方法--直接安装:pip install pycryptodome

    3.但是,在使用的时候导入模块是有问题的,这个时候只要修改一个文件夹的名称就可以完美解决这个问题,

    Python\Python36\Lib\site-packages,找到这个路径,下面有一个文件夹叫做crypto,将小写c改成大写C就ok了。

    我在我的linux生产环境上,版本是3.6,直接安装pycryptodome,第三方目录下的包直接就是:Crypto、pycryptodome-3.6.6.dist-info,连名字都不用改。

    以上红色部分从网上找的。
  • 至此,重新编译就可以通过。
阅读(7130) | 评论(0) | 转发(0) |
0

上一篇:devmem2与devkmem

下一篇:Allegro设置快捷键

给主人留下些什么吧!~~