编译完整固件出错,请帮忙看看是什么原因

打印日志如下:

BUILD_TYPE          :   develop
DOWNLOAD_MIRROR     :   default
NO_CCACHE           :        no
COMPRESS_IMAGE      :        no
INSTALL_TYPE_RAW    :        no


***********************PARAMETERS************************
Fenix Version:         0.9.5
Khadas Board:          VIM3
Uboot Version:         2015.01
Uboot Configuration:   kvim3_defconfig
Uboot Branch:          khadas-vims-v2015.01
Linux Version:         4.9
Linux Configuration:    kvims_defconfig
Linux DTB:             arch/arm64/boot/dts/amlogic/kvim3_linux.dtb
Linux Branch:          khadas-vims-4.9.y
Distribution:          Ubuntu
Distribution Release:  bionic
Distribution Type:     gnome
Distribution Arch:     arm64
Install Type:          SD-USB
Final Image:           VIM3_Ubuntu-gnome-bionic_Linux-4.9_arm64_SD-USB_V0.9.5-201020.img
*********************************************************

Info: Build host: focal
Info: Running in container: docker
Info: apt-cacher is disabled in containers.
stat: cannot stat '/home/khadas/.ccache/': No such file or directory
chown: cannot access '/home/khadas/.ccache/': No such file or directory

执行下面命令看看结果:

$ ls -al ~/

结果如下:
total 40
drwxr-xr-x 1 khadas khadas 4096 Oct 14 15:55 .
drwxr-xr-x 1 root root 4096 Oct 13 12:08 …
-rw------- 1 khadas khadas 2223 Oct 19 17:38 .bash_history
-rw-r–r-- 1 khadas khadas 220 Feb 25 2020 .bash_logout
-rw-r–r-- 1 khadas khadas 3771 Feb 25 2020 .bashrc
drwxr-xr-x 1 khadas khadas 4096 Oct 19 17:12 fenix
-rw-r–r-- 1 khadas khadas 807 Feb 25 2020 .profile
-rw-r–r-- 1 khadas khadas 0 Oct 14 15:55 .sudo_as_admin_successful
drwxr-xr-x 1 root root 4096 Oct 12 15:35 toolchains

试试加上这个补丁看看:

diff --git a/config/functions/common-functions b/config/functions/common-functions      
index 0dff705f..e7cdf844 100644
--- a/config/functions/common-functions
+++ b/config/functions/common-functions
@@ -103,8 +103,10 @@ prepare_host() {
                cp -r ~/toolchains/* downloads/
            fi
            # Walkaround for ccache permissions
-           if [ "$(stat -c '%U %G' ~/.ccache/)" != "khadas khadas" ]; then
-               sudo chown khadas:khadas -R ~/.ccache/
+           if [ -d ~/.ccache ]; then
+               if [ "$(stat -c '%U %G' ~/.ccache/)" != "khadas khadas" ]; then
+                   sudo chown khadas:khadas -R ~/.ccache/
+               fi
            fi
        fi
    fi

加了补丁还是一样的错误。

if [ $(systemd-detect-virt) == docker ]; then
                        if [ -d ~/toolchains -a ! -d ~/fenix/downloads ]; then
                                info_msg "Copying preinstalled toolchains ..."
                                mkdir -p ~/fenix/downloads
                                cp -r ~/toolchains/* downloads/
                        fi
                        # Walkaround for ccache permissions
                        if [ "$(stat -c '%U %G' ~/.ccache/)" != "khadas khadas" ]; then
                                sudo chown khadas:khadas -R ~/.ccache/
                        if [ -d ~/.ccache ]; then
                                if [ "$(stat -c '%U %G' ~/.ccache/)" != "khadas khadas" ]; then
                                        sudo chown khadas:khadas -R ~/.ccache/
                                fi
                                fi
                        fi
                fi
        fi

你这个代码加的不对啊,仔细再看下怎么加的。

可以编译了,另外请教个其他的问题
我想配置内核,打开编译CONFIG_USB_F_UVC模块,生成usb_f_uvc.ko,请问如何操作呢

增加新的配置都是通用的方法:

$ make ARCH=arm64 kvims_defconfig
$ make ARCH=arm64 menuconfig
### 增加配置
$ make ARCH=arm64 savedefconfig
$ mv defconfig arch/arm64/config/kvims_defconfig

在参考文档编译更新内核:

1 Like

在进行编译的时候,需要下载这软件包gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz,但一直连接超时,无法完成下载

把你之前旧的docker容器和image删除。在参考README重新拉最新的docker在编译就不会下载了。

请问下在编译内核的时候,那一步会决定使用的内核是刚新配置好的kvimxxx_defconfig文件?

每次编译都会重新加载kvims_defconfig默认配置,所以在你修改配置后,一定要通过make ARCH=arm64 savedefconfig来生成新的配置,并用新的配置来更新之前的kvims_defconfig配置,具体操作如上。

看了一下arch/arm64/config/目录下,分别有defconfig / kvim_defconfig /kvim2_defconfig / kvim2l_defconfig等配置文件,编译的时候是选择那个作为默认的呢?

你确定没有搞错内核?

nick@Nick:~/code/fenix/linux$ ll arch/arm64/configs/
total 84
drwxrwxr-x  2 nick nick  4096 10月 21 10:31 ./
drwxrwxr-x 12 nick nick  4096 10月 21 10:31 ../
-rw-rw-r--  1 nick nick 10443 10月 17 09:26 defconfig
-rw-r--r--  1 nick nick 20298 10月 21 10:31 kvims_defconfig
-rw-r--r--  1 nick nick 16392 10月 21 10:31 meson64_defconfig
-rw-rw-r--  1 nick nick 13835 10月 17 09:26 meson64_smarthome_defconfig
-rw-r--r--  1 nick nick  7637 9月  21 13:59 ranchu64_defconfig

您的意思是?

$ ll arch/arm64/configs
total 236K
-rwxrwxrwx 1 jhc jhc 2.5K 9月 16 11:15 defconfig
-rw-r–r-- 1 user user 14K 10月 21 10:20 kvim2_defconfig
-rwxrwxrwx 1 jhc jhc 99K 9月 16 11:15 kvim2l_defconfig
-rwxrwxrwx 1 jhc jhc 100K 9月 16 11:15 kvim_defconfig
-rwxrwxrwx 1 jhc jhc 13K 9月 16 11:15 meson64_defconfig

我不知道你这个是从哪里看到的?

如果你是用Fenix编译,那么自动下载的内核是没有上面这些配置的。只有我上面贴的那些配置。VIM1、VIM2、VIM3和VIM3L都是用的相同的配置kvims_defconfig

我的linux是自己在官网git上面下载的,您意思是是我用fenix脚本来编译的话,它会自动下载linux/u-boot的仓库源码下来是吗

是的。参考文档重新在试试吧。

贴完整的操作log,还有就是贴log或者代码不要直接粘贴回复,要放到代码引用贴出来。

如:

代码

make kernel的时候,一直弹出如下的手动选择,无止境的enter下一步,这样是正确的吗

khadas@1e4516748dd9:/home/vim3/paycam/khadas/fenix/linux$ make kernel
scripts/kconfig/conf --silentoldconfig Kconfig
drivers/net/wireless/bcmdhd/Kconfig:53:warning: defaults for choice values not supported
*

  • Restart config…
  • General setup

Cross-compiler tool prefix (CROSS_COMPILE)
Compile also drivers which will not load (COMPILE_TEST) [N/y/?] n
Local version - append to kernel release (LOCALVERSION)
Automatically append version information to the version string (LOCALVERSION_AUTO) [Y/n/?] y
Kernel compression mode

  1. Gzip (KERNEL_GZIP) (NEW)
  1. Bzip2 (KERNEL_BZIP2) (NEW)
  2. LZMA (KERNEL_LZMA) (NEW)
  3. XZ (KERNEL_XZ) (NEW)
  4. LZO (KERNEL_LZO) (NEW)
  5. LZ4 (KERNEL_LZ4) (NEW)
    choice[1-6?]: 1
    Default hostname (DEFAULT_HOSTNAME) [(none)] (none)
    Support for paging of anonymous memory (swap) (SWAP) [Y/n/?] y
    System V IPC (SYSVIPC) [Y/n/?] y
    POSIX Message Queues (POSIX_MQUEUE) [Y/n/?] y
    Enable process_vm_readv/writev syscalls (CROSS_MEMORY_ATTACH) [Y/n/?] y
    open by fhandle syscalls (FHANDLE) [Y/n/?] y
    uselib syscall (USELIB) [N/y/?] n
    Auditing support (AUDIT) [Y/n/?] y
    Kernel .config support (IKCONFIG) [Y/n/m/?] y
    Enable access to .config through /proc/config.gz (IKCONFIG_PROC) [Y/n/?] y
    Kernel log buffer size (16 => 64KB, 17 => 128KB) (LOG_BUF_SHIFT) [19] 19
    CPU kernel log buffer size contribution (13 => 8 KB, 17 => 128KB) (LOG_CPU_MAX_BUF_SHIFT) [12] 12
    Temporary per-CPU NMI log buffer size (12 => 4KB, 13 => 8KB) (NMI_LOG_BUF_SHIFT) [13] (NEW)
    Checkpoint/restore support (CHECKPOINT_RESTORE) [N/y/?] n
    Automatic process group scheduling (SCHED_AUTOGROUP) [N/y/?] n
    Boosting for CFS tasks (EXPERIMENTAL) (SCHED_TUNE) [Y/n/?] y
    Default to enabling the Energy Aware Scheduler feature (DEFAULT_USE_ENERGY_AWARE) [Y/n/?] y
    Enable deprecated sysfs features to support old userspace tools (SYSFS_DEPRECATED) [N/y/?] n
    Kernel->user space relay support (formerly relayfs) (RELAY) [N/y/?] n
    Initial RAM filesystem and RAM disk (initramfs/initrd) support (BLK_DEV_INITRD) [Y/n/?] y
    Initramfs source file(s) (INITRAMFS_SOURCE)
    Support initial ramdisks compressed using gzip (RD_GZIP) [Y/n/?] y
    Support initial ramdisks compressed using bzip2 (RD_BZIP2) [Y/n/?] y
    Support initial ramdisks compressed using LZMA (RD_LZMA) [Y/n/?] y
    Support initial ramdisks compressed using XZ (RD_XZ) [Y/n/?] y
    Support initial ramdisks compressed using LZO (RD_LZO) [Y/n/?] y
    Support initial ramdisks compressed using LZ4 (RD_LZ4) [Y/n/?] y
    Compiler optimization level
  1. Optimize for performance (CC_OPTIMIZE_FOR_PERFORMANCE)
  1. Optimize for size (CC_OPTIMIZE_FOR_SIZE)
    choice[1-2]: 1
  • Configure standard kernel features (expert users)

Configure standard kernel features (expert users) (EXPERT) [Y/?] y
Multiple users, groups and capabilities support (MULTIUSER) [Y/n/?] y
sgetmask/ssetmask syscalls support (SGETMASK_SYSCALL) [N/y/?] n
Sysfs syscall support (SYSFS_SYSCALL) [Y/n/?] y
Sysctl syscall support (SYSCTL_SYSCALL) [N/y/?] n
Load all symbols for debugging/ksymoops (KALLSYMS) [Y/?] y
Include all symbols in kallsyms (KALLSYMS_ALL) [Y/n/?] y
Enable support for printk (PRINTK) [Y/n/?] y
BUG() support (BUG) [Y/?] y
Enable ELF core dumps (ELF_CORE) [Y/n/?] y
Enable PC-Speaker support (PCSPKR_PLATFORM) [Y/n/?] (NEW)