sipeed / LonganPi-3H-SDK

LonganPi 3H SDK
GNU General Public License v3.0
28 stars 14 forks source link

mkrootfs.sh报错 #5

Closed songyq26 closed 8 months ago

songyq26 commented 8 months ago

mkdir: cannot create directory ‘build’: File exists

D: target: - D: variant: important I: running apt-get update... Get:1 https://mirrors.bfsu.edu.cn/debian testing InRelease [156 kB] Err:1 https://mirrors.bfsu.edu.cn/debian testing InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 Get:2 https://mirrors.bfsu.edu.cn/debian testing-updates InRelease [45.1 kB] Err:2 https://mirrors.bfsu.edu.cn/debian testing-updates InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 Get:3 https://mirrors.bfsu.edu.cn/debian testing-backports InRelease [45.2 kB] Err:3 https://mirrors.bfsu.edu.cn/debian testing-backports InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 Get:4 https://mirrors.bfsu.edu.cn/debian-security testing-security InRelease [43.5 kB] Err:4 https://mirrors.bfsu.edu.cn/debian-security testing-security InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 54404762BBB6E853 NO_PUBKEY BDE6D2B9216EC7A8 Reading package lists... W: GPG error: https://mirrors.bfsu.edu.cn/debian testing InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 E: The repository 'https://mirrors.bfsu.edu.cn/debian testing InRelease' is not signed. W: GPG error: https://mirrors.bfsu.edu.cn/debian testing-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 E: The repository 'https://mirrors.bfsu.edu.cn/debian testing-updates InRelease' is not signed. W: GPG error: https://mirrors.bfsu.edu.cn/debian testing-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 E: The repository 'https://mirrors.bfsu.edu.cn/debian testing-backports InRelease' is not signed. W: GPG error: https://mirrors.bfsu.edu.cn/debian-security testing-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 54404762BBB6E853 NO_PUBKEY BDE6D2B9216EC7A8 E: The repository 'https://mirrors.bfsu.edu.cn/debian-security testing-security InRelease' is not signed. E: apt-get update -oAPT::Status-Fd=<$fd> -oDpkg::Use-Pty=false failed at /usr/bin/mmdebstrap line 126. main::error("apt-get update -oAPT::Status-Fd=<\$fd> -oDpkg::Use-Pty=false f"...) called at /usr/bin/mmdebstrap line 649 main::run_progress(CODE(0x5614a2072158), CODE(0x5614a1e61e40), CODE(0x5614a1e61cd8), "/tmp/mmdebstrap.LfsHc0Bl2n") called at /usr/bin/mmdebstrap line 701 main::run_apt_progress(HASH(0x5614a1fc8b38)) called at /usr/bin/mmdebstrap line 1144 main::setup(HASH(0x5614a1fc7e20)) called at /usr/bin/mmdebstrap line 2200 main::ANON() called at /usr/bin/mmdebstrap line 471 main::get_unshare_cmd(CODE(0x5614a1f9bcf8), ARRAY(0x5614a1f5d4b0)) called at /usr/bin/mmdebstrap line 2221 main::main() called at /usr/bin/mmdebstrap line 2400 I: removing tempdir /tmp/mmdebstrap.LfsHc0Bl2n...

wu-yue-yu commented 8 months ago

可以参考此步骤来添加一下缺失的KEY

songyq26 commented 8 months ago

我这是在生成文件系统的阶段报错了,问题已经解决,是因为文件系统使用的是Debian,而编译环境却是Ubuntu引发的。 解决步骤如下:

  1. 宿主机上执行:sudo apt install debian-archive-keyring
  2. mkrootfs.sh修改如下:

#!/usr/bin/env bash

if [ -z "$MMDEBSTRAP" ]
then
    MMDEBSTRAP=mmdebstrap
fi

mkdir build

set -eux

genrootfs() {
echo "
deb https://mirrors.bfsu.edu.cn/debian/ testing main contrib non-free non-free-firmware
deb https://mirrors.bfsu.edu.cn/debian/ testing-updates main contrib non-free non-free-firmware
deb https://mirrors.bfsu.edu.cn/debian/ testing-backports main contrib non-free non-free-firmware
deb https://mirrors.bfsu.edu.cn/debian-security/ testing-security main contrib non-free non-free-firmware
" | $MMDEBSTRAP unstable sid \
  --aptopt='Dir::Etc::Trusted "/usr/share/keyrings/debian-archive-keyring.gpg"' --architectures=arm64 -v -d \
    --include="ca-certificates locales dosfstools binutils file \
    tree sudo bash-completion memtester openssh-server wireless-regdb \
    wpasupplicant systemd-timesyncd usbutils parted systemd-sysv \
    iperf3 stress-ng avahi-daemon tmux screen i2c-tools net-tools \
    ethtool ckermit lrzsz minicom picocom btop neofetch iotop htop \
    bmon e2fsprogs nvi tcpdump alsa-utils squashfs-tools evtest \
    bluez bluez-hcidump bluez-tools btscanner bluez-alsa-utils \
    device-tree-compiler debian-archive-keyring connman-gtk chromium\
    linux-cpupower task-xfce-desktop xfce4-terminal xfce4-screenshooter \
    pulseaudio-module-bluetooth blueman fonts-noto-core fonts-noto-cjk \
    fonts-noto-mono fonts-noto-ui-core tango-icon-theme" > ./build/rootfs.tar
}

# if you want skip debian rootfs build, please comment this line:
genrootfs
cd overlay
for i in *
do
tar --append --file=../build/rootfs.tar $i
done
cd ..