Ubuntu18.04 安装工具包及问题解决记录

Ubuntu18.04 添加一个硬盘分区并挂载
vi /etc/fstab
UUID=c9fc6df3-ad92-4e07-a225-639828535cd8 /home/dennis/sda ext4 defaults 0 2

Ubuntu18.04精简版安装Packages
install_packages.sh

#! /bin/bash
packages=(net-tools samba vim ssh git default-jdk libncurses5-dev libncursesw5-dev) 

#Loop install packages
echo "start to install packages:"${packages[*]}
for var in ${packages[*]}
do
   sudo apt install $var
done

Ubuntu Linux制作Patches + Patch
资料参考:差异文件(diff)和补丁文件(patch)简介

若需要把一方不存在的文件也打包到Patch中,则需要 “-N”
diff -Naur sources-orig/ sources-fixed/ >myfixes.patch

若不需要即只Patch 内容不同的部分,则只需要 “-ur”
diff -ur sources-orig/ sources-fixed/ >myfixes.patch
比如 A501 Driver source files:
diff -ur sources/ a501.sf/ > a501.src.patch

Patch 代码:
进入代码工程目录(如A501 sources/)
patch -p1 < ../a501.src.patch

1:如果当前的目录是和kernel-4.9 同级目录:
$patch -p0 < ../a501.src.patch 
 
2:如果当前的目录为 kernel-4.9/:
[kernel-4.9]$patch -p1 < ../a501.src.patch 
 
3:如果当前的目录为 kernel-4.9/drivers/:
[drivers]$patch -p2 < ../a501.src.patch 

Bug001.Ubuntu 编译Jetson 内核报错:
scripts/kconfig/lxdialog/dialog.h:32:20: fatal error: curses.h: No such file or directory
解决:
sudo apt-get install libncurses5-dev libncursesw5-dev

Bug002.安装CUDA+TensorFlow后 Import FAIL:

dennis@dennis:~$ python3 
Python 3.6.7 (default, Oct 22 2018, 11:32:17) 
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow 
python3: Relink `/lib/x86_64-linux-gnu/libudev.so.1' with `/lib/x86_64-linux-gnu/librt.so.1' for IFUNC symbol `clock_gettime'

解决:
通过NVIDIA SDKManager 仅安装了CUDA-10.0,但未安装cuDNN,需要从NVIDIA 网站下载对应的cuDNNLibrary并安装即可解决:
cuDNN-Download

dennis@dennis:~$  python3 -c "import tensorflow as tf; print(tf.__version__)"
1.13.1
image.png

Bug003. gcc-4.8.5编译TX2 报错

dennis@dennis:~/jetson/JetPack-L4T-3.2/64_TX2/Linux_for_Tegra/sources/kernel/kernel-4.4$ ./make.kernel.sh 
Aborted (core dumped)
Aborted (core dumped)

原因:

解决:
sudo apt-get upgrade locales
LANG=/usr/lib/locale/en_US
sudo vim /etc/locale.gen (检查locale 是否为en_US)
完整Terminal compile log

dennis@dennis:~/sda/home/dennis/JetPack-L4T-3.2/64_TX2/Linux_for_Tegra/sources/kernel/kernel-4.4$ export CROSS_COMPILE=/opt/gcc-linaro-4.8.5-aarch64-linux-gnu/bin/aarch64-unknown-linux-gnu-
dennis@dennis:~/sda/home/dennis/JetPack-L4T-3.2/64_TX2/Linux_for_Tegra/sources/kernel/kernel-4.4$ make ARCH=arm64 O=$TEGRA_KERNEL_OUT 
make[1]: Entering directory '/tmp'
Aborted (core dumped)
...
Aborted (core dumped)
aarch64-unknown-linux-gnu-gcc: loadlocale.c:129: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
Aborted (core dumped)
...
Aborted (core dumped)
/home/dennis/sda/home/dennis/JetPack-L4T-3.2/64_TX2/Linux_for_Tegra/sources/kernel/kernel-4.4/scripts/gcc-goto.sh: line 21: 19620 Done                    cat  <<'END'
int main(void)
{
#if defined(__arm__) || defined(__aarch64__)
    /*
     * Not related to asm goto, but used by jump label
     * and broken on some ARM GCC versions (see GCC Bug 48637).
     */
    static struct { int dummy; int state; } tp;
    asm (".long %c0" :: "i" (&tp.state));
#endif

entry:
    asm goto ("" :::: entry);
    return 0;
}
END

     19621 Aborted                 (core dumped) | $@ -x c - -c -o /dev/null > /dev/null 2>&1
Aborted (core dumped)
Aborted (core dumped)
Aborted (core dumped)
  CHK     include/config/kernel.release
  Using /home/dennis/sda/home/dennis/JetPack-L4T-3.2/64_TX2/Linux_for_Tegra/sources/kernel/kernel-4.4 as source for kernel
  GEN     ./Makefile
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
make[2]: 'include/generated/mach-types.h' is up to date.
  CC      kernel/bounds.s
aarch64-unknown-linux-gnu-gcc: loadlocale.c:129: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
Aborted (core dumped)
/home/dennis/sda/home/dennis/JetPack-L4T-3.2/64_TX2/Linux_for_Tegra/sources/kernel/kernel-4.4/./Kbuild:44: recipe for target 'kernel/bounds.s' failed
make[2]: *** [kernel/bounds.s] Error 134
/home/dennis/sda/home/dennis/JetPack-L4T-3.2/64_TX2/Linux_for_Tegra/sources/kernel/kernel-4.4/Makefile:1016: recipe for target 'prepare0' failed
make[1]: *** [prepare0] Error 2
make[1]: Leaving directory '/tmp'
Makefile:150: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2

你可能感兴趣的:(Ubuntu18.04 安装工具包及问题解决记录)