全志科技
直播中

吴湛

10年用户 943经验值
擅长:电源/新能源
私信 关注
[问答]

Arch Linux下如何使用sunxi-livesuite-git烧录?

Arch  Linux下如何使用sunxi-livesuite-git烧录?

回帖(1)

陈小鸥

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

打包脚本如下。



# Maintainer: taotieren

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-awu***.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" <
[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-awu***"
depends=('dkms')
conflicts=('sunxi-awu***-dkms')
replaces=('sunxi-livesuite-git-dkms' 'sunxi-awu***-dkms')
cd "${srcdir}/sunxi-awu***/"
install -Dt "${pkgdir}/usr/src/${pkgname}" -m644 awu***.c Makefile dkms.conf
install -Dm0644 /dev/stdin "${pkgdir}/usr/lib/udev/rules.d/99-aw_u***.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_u***_rules_end"

#SUBSYSTEM=="gpio", MODE="0660", GROUP="plugdev", TAG+="uaccess"

SUBSYSTEM!="u***|tty|hidraw", GOTO="aw_u***_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_u***_rules_end"
EOF

install -dm0755 "${pkgdir}/etc/udev/rules.d"
ln -sf "/usr/lib/udev/rules.d/99-aw_u***.rules" "${pkgdir}/etc/udev/rules.d/99-aw_u***.rules"

}
举报

更多回帖

×
20
完善资料,
赚取积分