Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

    Arch Linux 下使用 sunxi-livesuite-git 烧录

    Linux
    3
    7
    3295
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • taotieren
      taotieren LV 3 last edited by

      在 GitHub 看到 https://github.com/linux-sunxi/sunxi-livesuite 烧录工具。
      将其打包到 AUR 仓库,发现 aw-usb 在编译进 5.x 内核时报错,使用了其他开发者修改后的 aw-usb 。并重写了 aw-usb.rules

      打包脚本如下。

      # Maintainer: taotieren <admin@taotieren.com>
      
      pkgbase=sunxi-livesuite-git
      pkgname=($pkgbase sunxi-livesuite-dkms-git)
      pkgver=1a0b52a
      pkgrel=2
      arch=('x86_64' 'i686')
      url="https://github.com/linux-sunxi/sunxi-livesuite"
      license=('GPLv2')
      provides=()
      conflicts=(${pkgbase} ${pkgbase%-git})
      #replaces=(${pkgname})
      makedepends=('git')
      backup=()
      options=('!strip')
      #install=${pkgname}.install
      groups=($pkgbase)
      source=("${pkgbase%-git}::git+${url}.git"
              "git+https://github.com/M0Rf30/sunxi-awusb.git"
      )
      sha256sums=('SKIP'
                  'SKIP')
      
      pkgver() {
          cd "${srcdir}/${pkgbase%-git}"
          git describe --always | sed 's|-|.|g'
      }
      
      package_sunxi-livesuite-git() {
          pkgdesc="LiveSuit is a tool to flash Images to the NAND of Allwinner devices."
          depends=('sunxi-livesuite-dkms-git')
      
          install -dm0755 "${pkgdir}/opt/sunxi/${pkgbase%-git}"
          cp -r "${srcdir}/${pkgbase%-git}/x86" "${pkgdir}/opt/sunxi/${pkgbase%-git}"
          cp -r "${srcdir}/${pkgbase%-git}/x86-64" "${pkgdir}/opt/sunxi/${pkgbase%-git}"
          cp -r "${srcdir}/${pkgbase%-git}/LiveSuit.sh" "${pkgdir}/opt/sunxi/${pkgbase%-git}"
      
          install -Dm0755 /dev/stdin "${pkgdir}/usr/bin/${pkgbase%-git}" << EOF
      #!/bin/env bash
      
      cd /opt/sunxi/${pkgbase%-git}/
      bash LiveSuit.sh
      EOF
      
          install -Dm0644 /dev/stdin "$pkgdir/usr/share/applications/${pkgname}.desktop" <<EOF
      [Desktop Entry]
      Name=${pkgbase%-git}
      Comment=${pkgbase%-git}
      GenericName=${pkgbase%-git}
      Exec=${pkgbase%-git}
      Icon=
      Path=/opt/sunxi/${pkgbase%-git}
      Terminal=false
      StartupNotify=true
      Type=Application
      Categories=Development
      EOF
      
      }
      
      package_sunxi-livesuite-dkms-git() {
          pkgdesc="DKMS module for Allwinner devices"
          url="https://github.com/M0Rf30/sunxi-awusb"
          depends=('dkms')
          conflicts=('sunxi-awusb-dkms')
          replaces=('sunxi-livesuite-git-dkms' 'sunxi-awusb-dkms')
          cd "${srcdir}/sunxi-awusb/"
          install -Dt "${pkgdir}/usr/src/${pkgname}" -m644 awusb.c Makefile dkms.conf
          install -Dm0644 /dev/stdin "${pkgdir}/usr/lib/udev/rules.d/99-aw_usb.rules" << EOF
      # Copy this file to /etc/udev/rules.d/
      # If rules fail to reload automatically, you can refresh udev rules
      # with the command "udevadm control --reload"
      
      # This rules are based on the udev rules from the OpenOCD project, with unsupported probes removed.
      # See http://openocd.org/ for more details.
      #
      # This file is available under the GNU General Public License v2.0
      
      ACTION!="add|change", GOTO="aw_usb_rules_end"
      
      #SUBSYSTEM=="gpio", MODE="0660", GROUP="plugdev", TAG+="uaccess"
      
      SUBSYSTEM!="usb|tty|hidraw", GOTO="aw_usb_rules_end"
      
      # [GNU MCU Eclipse] -----------------------------------------------------------
      # To simplify access, the access rights were changed from:
      #   MODE="660", GROUP="plugdev", TAG+="uaccess"
      # to:
      #   MODE="666"
      # -----------------------------------------------------------------------------
      
      # Please keep this list sorted by VID:PID
      
      # aw
      # define USB_AW_VENDOR_ID	0x1f3a
      # define USB_AW_PRODUCT_ID	0xefe8
      ATTR{idVendor}=="1F3A", ATTR{idProduct}=="EFE8", MODE="666"
      
      LABEL="aw_usb_rules_end"
      EOF
      
          install -dm0755 "${pkgdir}/etc/udev/rules.d"
          ln -sf "/usr/lib/udev/rules.d/99-aw_usb.rules" "${pkgdir}/etc/udev/rules.d/99-aw_usb.rules"
      
      }
      
      taotieren 2 Replies Last reply Reply Quote Share 0
      • taotieren
        taotieren LV 3 @taotieren last edited by

        @taotieren 其他 Linux 发行版可以参考这个 PKGBUILD shell 进行相应系统的本地安装。
        安装或修改 udev rules 文件都需要运行一下命令 sudo udevadm control --reload 刷新 udev rules

        1 Reply Last reply Reply Quote Share 0
        • taotieren
          taotieren LV 3 @taotieren last edited by

          @taotieren AUR 的仓库地址 https://aur.archlinux.org/packages/sunxi-livesuite-git/ 有问题可以在这里反馈,方便跟踪处理。

          1 Reply Last reply Reply Quote Share 0
          • xiaowenge
            DOT小文哥 LV 8 last edited by

            好东西,感谢分享~

            taotieren 1 Reply Last reply Reply Quote Share 0
            • taotieren
              taotieren LV 3 @xiaowenge last edited by

              @xiaowenge 官方提供的工具比较新,只支持 ubuntu 和 centos 等系统。不支持 Arch,这个是使用官方开源的包打包的。

              1 Reply Last reply Reply Quote Share 0
              • T
                tripod9 LV 5 last edited by

                全志D1裸奔开发工具XFEL
                https://zhuanlan.zhihu.com/p/376797719

                taotieren 1 Reply Last reply Reply Quote Share 0
                • taotieren
                  taotieren LV 3 @tripod9 last edited by

                  @tripod9 已将其打包到 AUR 仓库:
                  https://aur.archlinux.org/packages/xfel/

                  PKGBUILD

                  # Maintainer: taotieren <admin@taotieren.com>
                  
                  pkgname=xfel
                  pkgver=1.0.1
                  pkgrel=1
                  pkgdesc="Tiny FEL tools for allwinner SOC, support RISC-V D1 chip."
                  arch=('any')
                  url="https://github.com/xboot/xfel"
                  license=('MIT')
                  provides=(${pkgname})
                  conflicts=(${pkgname} ${pkgname}-git)
                  #replaces=(${pkgname})
                  depends=('libusb')
                  makedepends=()
                  backup=()
                  options=('!strip')
                  #install=${pkgname}.install
                  source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz")
                  sha256sums=('85b8f1fe6a58149c9eb5c270e279f0dbedb882a349799a70105e4e415182aa9a')
                  
                  build() {
                      cd "${srcdir}/${pkgname}-${pkgver}"
                      make
                  }
                  
                  package() {
                      install -Dm755 "${srcdir}/${pkgname}-${pkgver}/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
                      install -Dm644 "${srcdir}/${pkgname}-${pkgver}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
                  }
                  
                  

                  https://aur.archlinux.org/packages/xfel-git/

                  PKGBUILD

                  # Maintainer: taotieren <admin@taotieren.com>
                  
                  pkgname=xfel-git
                  pkgver=eb5f578
                  pkgrel=1
                  pkgdesc="Tiny FEL tools for allwinner SOC, support RISC-V D1 chip."
                  arch=('any')
                  url="https://github.com/xboot/xfel"
                  license=('MIT')
                  provides=(${pkgname})
                  conflicts=(${pkgname} ${pkgname%-git})
                  #replaces=(${pkgname})
                  depends=('libusb')
                  makedepends=('git')
                  backup=()
                  options=('!strip')
                  #install=${pkgname}.install
                  source=("${pkgname%-git}::git+${url}.git")
                  sha256sums=('SKIP')
                  
                  pkgver() {
                      cd "${srcdir}/${pkgname%-git}"
                      git describe --always | sed 's|-|.|g'
                  }
                  
                  build() {
                      cd "${srcdir}/${pkgname%-git}"
                      make
                  }
                  
                  package() {
                      install -Dm755 "${srcdir}/${pkgname%-git}/${pkgname%-git}" "${pkgdir}/usr/bin/${pkgname%-git}"
                      install -Dm644 "${srcdir}/${pkgname%-git}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname%-git}/LICENSE"
                  }
                  
                  
                  1 Reply Last reply Reply Quote Share 0
                  • 1 / 1
                  • First post
                    Last post

                  Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

                  行为准则 | 用户协议 | 隐私权政策