Difference between revisions of "Template:S5P4418BuildFromSource/zh"

From FriendlyELEC WiKi
Jump to: navigation, search
(updated by API)
(如何编译系统)
Line 91: Line 91:
 
需要特别注意的是,不同版本的U-Boot不能交叉更新,不能使用fastboot更新现在运行的U-Boot v2014.07,也不能使用bootloader.img去替换一个ROM中的u-boot.bin,否则会导致系统无法正常启动。
 
需要特别注意的是,不同版本的U-Boot不能交叉更新,不能使用fastboot更新现在运行的U-Boot v2014.07,也不能使用bootloader.img去替换一个ROM中的u-boot.bin,否则会导致系统无法正常启动。
  
===编译Linux kernel 3.4.y===
+
===编译Android7.1.2===
====准备mkimage====
+
====搭建编译环境====
编译内核需要用到U-Boot中的工具mkimage,因此,在编译内核uImage前,您需要保证您的主机环境可以成功运行它。<br />
+
搭建用于编译Android的环境,建议使用64位的Ubuntu 16.04,需要安装如下软件包:
你可以直接使用命令 sudo apt-get install u-boot-tools 来安装,也可以自己编译并安装:
+
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
cd uboot_nanopi2
+
sudo apt-get install bison g++-multilib git gperf libxml2-utils make python-networkx zip
make CROSS_COMPILE=arm-linux- tools
+
sudo apt-get install flex curl libncurses5-dev libssl-dev zlib1g-dev gawk minicom
sudo mkdir -p /usr/local/sbin && sudo cp -v tools/mkimage /usr/local/sbin
+
sudo apt-get install openjdk-8-jdk
 +
sudo apt-get install exfat-fuse exfat-utils device-tree-compiler liblz4-tool
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
更多说明可查看 https://source.android.com/source/initializing.html; <br />
  
====编译内核====
+
====下载Android7源代码====
* 下载内核源代码
+
{{{1}}} 源代码托管在 gitlab 上,使用以下命令进行下载:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
git clone https://github.com/friendlyarm/linux-3.4.y.git
+
git clone https://gitlab.com/friendlyelec/s5pxx18-android-7.git -b master
cd linux-3.4.y
+
git checkout nanopi2-lollipop-mr1
+
 
</syntaxhighlight>
 
</syntaxhighlight>
{{{1}}}内核所属的分支是nanopi2-lollipop-mr1,在开始编译前先切换分支。
+
由于Android7源代码较大(约8.2GB),下载可能需要较长时间且容易受网络环境的影响而中断,请耐心等待并重试。
* 编译Android内核
+
 
 +
====编译Android7内核====
 +
Android 7.1.2源代码已包含预先编译好的内核,如果需要进行定制,可根据以下方法编译内核。
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
make nanopi2_android_defconfig
+
git clone https://github.com/friendlyarm/linux.git -b nanopi2-v4.4.y --depth 1
 +
cd linux
 
touch .scmversion
 
touch .scmversion
make uImage
+
make ARCH=arm nanopi2_nougat_defconfig
 +
make ARCH=arm
 
</syntaxhighlight>
 
</syntaxhighlight>
* 编译FriendlyCore内核
+
编译成功结束后,新生成的内核是 arch/arm/boot/zImage,目录arch/arm/boot/dts/下还包括新的DTB文件(s5p4418-nanopi2-rev*.dtb)。
 +
如果只想调试内核,可通过 adb 来快速更新。
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
make  nanopi2_core-qt_defconfig
+
adb root; adb shell mkdir /storage/sdcard1/; adb shell mount -t ext4 /dev/block/mmcblk0p1 /storage/sdcard1/;
touch .scmversion
+
adb push arch/arm/boot/zImage arch/arm/boot/dts/s5p4418-nanopi2-rev*.dtb /storage/sdcard1/
make uImage
+
</syntaxhighlight>
+
编译成功结束后,新生成的内核烧写文件为 arch/arm/boot/uImage,此内核支持LCD输出,用于替换掉SD卡boot分区下的uImage。<br />
+
如果要支持HDMI,则需要使用 nanopi2_core-qt_hdmi_defconfig , 具体如下:
+
<syntaxhighlight lang="bash">
+
make nanopi2_core-qt_hdmi_defconfig
+
touch .scmversion
+
make uImage
+
</syntaxhighlight>
+
使用新的uImage 替换SD卡boot分区下的uImage.hdmi 即可支持HDMI 720p,如果要支持1080p,则需要修改内核配置:
+
<syntaxhighlight lang="bash">
+
touch .scmversion
+
make nanopi2_core-qt_hdmi_defconfig
+
make menuconfig
+
  Device Drivers -->
+
    Graphics support -->
+
      Nexell Graphics -->
+
        [ ] LCD
+
        [*] HDMI
+
        (0)  Display In  [0=Display 0, 1=Display 1]
+
              Resolution (1920 * 1080p)  --->
+
make uImage
+
</syntaxhighlight>
+
* 编译Debian内核
+
<syntaxhighlight lang="bash">
+
make nanopi2_linux_defconfig
+
touch .scmversion
+
make uImage
+
</syntaxhighlight>
+
编译成功结束后,新生成的内核烧写文件为 arch/arm/boot/uImage,此内核支持LCD输出,用于替换掉SD卡boot分区下的uImage。<br />
+
如果要支持HDMI,则需要使用 nanopi2_linux_hdmi_defconfig, 具体如下:
+
<syntaxhighlight lang="bash">
+
make nanopi2_linux_hdmi_defconfig
+
touch .scmversion
+
make uImage
+
</syntaxhighlight>
+
使用新的uImage 替换SD卡boot分区下的uImage.hdmi 即可支持HDMI 720p,如果要支持1080p,则需要修改内核配置:
+
<syntaxhighlight lang="bash">
+
touch .scmversion
+
make nanopi2_linux_hdmi_defconfig
+
make menuconfig
+
  Device Drivers -->
+
    Graphics support -->
+
      Nexell Graphics -->
+
        [ ] LCD
+
        [*] HDMI
+
        (0)  Display In  [0=Display 0, 1=Display 1]
+
              Resolution (1920 * 1080p)  --->
+
make uImage
+
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
内核开发/调试完成后,如果想生成用于烧写的boot.img,可复制内核zImage和DTB文件到Android7源代码目录 device/friendlyelec/nanopi2/boot,然后开始编译Android7。
  
====如何使用新编译的内核====
+
====编译Android7====
* 更新SD卡上的内核
+
如果您是使用SD卡启动Android,则在PC上复制为Android编译的uImage到SD卡的boot分区(即分区1,设备是/dev/sdX1)即可。<br />
+
如果您是使用SD卡启动Debian系统,则需要编译好用于HDMI的uImage后替换SD卡boot分区下的uImage.hdmi,然后编译用于LCD的uImage并替换SD卡boot分区下的uImage。
+
 
+
* 更新eMMC上Android的内核
+
如果只想单独更新eMMC上的内核来测试,则需要先正常启动板,然后mount eMMC的boot分区,使用新编译的uImage来替换原有文件,完成后reboot即可。<br />
+
从eMMC启动时可通过以下方法来更新内核:<br />
+
1) 启动完成后,需要手动mount eMMC的boot分区(设备是/dev/mmcblk0p1), 可通过串口在板上操作:<br />
+
<syntaxhighlight lang="bash">
+
su
+
mount -t ext4 /dev/block/mmcblk0p1 /mnt/media_rw/sdcard1/
+
</syntaxhighlight>
+
2) 连接USB,在PC端Ubuntu下使用adb push命令复制新编译的uImage到已mount的boot分区下; <br />
+
<syntaxhighlight lang="bash">
+
adb push uImage /mnt/media_rw/sdcard1/
+
</syntaxhighlight>
+
3) 也可以将编译好的内核复制到SD卡或U盘,然后在板上复制到boot分区下; <br />
+
4) 更新完成后,输入 reboot 命令重启即可,注意不要直接断电或按Reset键,否则可能会损坏文件。 <br />
+
 
+
* 更新eMMC上Debian的内核
+
从eMMC启动时可通过以下方法来更新内核:<br />
+
1) 启动完成后,系统通常会自动mount eMMC的boot分区(设备是/dev/mmcblk0p1), 可输入命令mount来查看; <br />
+
2) 连接网络,使用scp/ftp等方式复制新编译的uImage并替换boot分区下的文件,如果是用于HDMI的内核,则替换uImage.hdmi; <br />
+
3) 也可以将编译好的内核复制到SD卡或U盘,然后在板止复制到boot分区下; <br />
+
4) 更新完成后,输入 reboot 命令重启即可,注意不要直接断电或按Reset键,否则可能会损坏文件. <br />
+
 
+
* 使用新的内核来生成boot.img
+
如果要生成直接烧写eMMC的文件,则需要使用新编译的内核来生成boot.img,然后复制到烧写用的SD卡即可直接烧写到eMMC. <br />
+
对于Android,将新的uImage复制Android源码的device/friendly-arm/nanopi2/boot/ 下,然后编译Android即可获得新的boot.img . <br />
+
对于Debian, 则需要使用按以下方法来生成boot.img : <br />
+
1) 下载debian_nanopi2
+
<syntaxhighlight lang="bash">
+
git clone https://github.com/friendlyarm/debian_nanopi2.git
+
</syntaxhighlight>
+
2) 复制用于HDMI的uImage到debian_nanopi2/boot/uImage.hdmi, 复制用于LCD的 uImage到debian_nanopi2/boot/uImage ; <br />
+
3) 生成Debian的 boot.img
+
<syntaxhighlight lang="bash">
+
cd debian_nanopi2
+
mkdir rootfs
+
./build.sh
+
</syntaxhighlight>
+
新的 boot.img 在 debian_nanopi2/sd-fuse_nanopi2/debian 下. <br />
+
其中命令"mkdir rootfs"只是创建一个空的目录使得build.sh可以运行,因此生成的其它文件比如rootfs.img不能使用。
+
 
+
====编译内核模块====
+
Android包含内核模块,位于system分区的 /lib/modules/ 下,如果您有新的内核模块或者内核配置有变化,则需要重新编译。 <br />
+
首先编译内核源代码中的模块:
+
<syntaxhighlight lang="bash">
+
cd linux-3.4.y
+
make CROSS_COMPILE=arm-linux- modules
+
</syntaxhighlight>
+
另外有2个内核模块的源代码位于Android源代码中,可使用以下命令来编译:
+
<syntaxhighlight lang="bash">
+
cd /opt/FriendlyARM/s5p4418/android
+
./vendor/friendly-arm/build/common/build-modules.sh
+
</syntaxhighlight>
+
其中 “/opt/FriendlyARM/s5p4418/android” 是指Android源代码的TOP目录,使用参数“-h”可查看帮助。<br />
+
编译成功结束后,会显示生成的内核模块。
+
 
+
====编译U-Boot====
+
下载U-Boot v2014.07源代码并编译,注意分支是nanopi2-lollipop-mr1:
+
<syntaxhighlight lang="bash">
+
git clone https://github.com/friendlyarm/uboot_nanopi2.git
+
cd uboot_nanopi2
+
git checkout nanopi2-lollipop-mr1
+
make s5p4418_nanopi2_config
+
make CROSS_COMPILE=arm-linux-
+
</syntaxhighlight>
+
 
+
编译成功结束后您将获得u-boot.bin,您可以通过fastboot来更新正在运行的{{{1}}}板上SD的U-Boot v2014.07,方法如下:<br />
+
1) 在电脑上先用命令 sudo apt-get install android-tools-fastboot 安装 fastboot 工具;<br />
+
2) 用串口配件连接{{{1}}}和电脑,在上电启动的2秒内,在串口终端上按下回车,进入 u-boot 的命令行模式;<br />
+
3) 在u-boot 命令行模式下输入命令 fastboot 回车,进入 fastboot 模式;<br />
+
4) 用microUSB线连接{{{1}}}和电脑,在电脑上输入以下命令烧写u-boot.bin:<br />
+
<syntaxhighlight lang="bash">
+
fastboot flash bootloader u-boot.bin
+
</syntaxhighlight>
+
<br />
+
注意:您不能直接使用dd来更新SD卡,否则有可能会导致无法正常启动。<br />
+
 
+
===编译Android===
+
我们提供了两个版本的Android,分别为Android4.4和Android5.1,这两个版本的Android源码编译方法一样。
+
====搭建编译环境====
+
搭建编译Android的环境建议使用64位的Ubuntu 16.04,安装需要的包即可。
+
<syntaxhighlight lang="bash">
+
sudo apt-get install bison g++-multilib git gperf libxml2-utils make python-networkx zip
+
sudo apt-get install flex libncurses5-dev zlib1g-dev gawk minicom
+
</syntaxhighlight>
+
更多说明可查看 https://source.android.com/source/initializing.html 。
+
 
+
====下载Android5.1源代码====
+
有以下两种途径获取源代码,都需要联网:
+
* '''使用网盘里的git repo压缩包'''
+
网盘下载地址: [http://download.friendlyarm.com/{{#replace:{{#replace:{{BASEPAGENAME}}| |}}|/zh|}} 点击进入]<br />
+
文件位于网盘的以下路径:sources/s5pxx18-android5.git-YYYYMMDD.tgz (YYYYMMDD表示打包的日期)<br />
+
从网盘中获取的 repo 压缩包在解压之后,需要执行一下 sync.sh 脚本,会从gitlab上拉取最新的代码:
+
<syntaxhighlight lang="bash">
+
tar xvzf /path/to/netdisk/sources/s5pxx18-android5.git-20181228.tgz
+
cd s5pxx18-android5
+
./sync.sh
+
</syntaxhighlight>
+
* '''直接克隆git仓库'''
+
{{{1}}} 源代码托管在 gitlab 上,使用以下命令进行下载:
+
<syntaxhighlight lang="bash">
+
git clone https://gitlab.com/friendlyelec/s5pxx18-android5
+
cd s5pxx18-android5
+
</syntaxhighlight>
+
====编译Android====
+
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 +
cd s5pxx18-android-7
 
source build/envsetup.sh
 
source build/envsetup.sh
 
lunch aosp_nanopi2-userdebug
 
lunch aosp_nanopi2-userdebug
Line 287: Line 136:
 
::{| class="wikitable"
 
::{| class="wikitable"
 
|-
 
|-
|filename     || partition || Description   
+
|filename         || partition || Description   
 
|-
 
|-
|boot.img     || boot     || -
+
|bl1-mmcboot.bin  || raw      || boot firmware
 +
|-
 +
|loader-mmc.img   || raw      || boot firmware
 +
|-
 +
|bl_mon.img        || raw      || boot firmware
 +
|-
 +
|bootloader.img    || raw      || uboot-v2016.01
 
|-  
 
|-  
|cache.img    || cache    || -
+
|env.conf          || -        || uboot环境变量,包含Android内核命令行参数
 +
|-
 +
|boot.img          || boot      || kernel zImage, DTBs; logo; Android ramdisk
 
|-  
 
|-  
|userdata.img || userdata  || -
+
|cache.img         || cache    || -
 
|-  
 
|-  
|system.img   || system    || -
+
|userdata.img     || userdata  || -
 
|-  
 
|-  
|partmap.txt || -        || 分区描述文件
+
|system.img        || system    || -
 +
|-
 +
|partmap.txt       || -        || 分区描述文件
 
|-  
 
|-  
 
|}
 
|}
====烧写到SD卡====
 
如果是采用SD卡启动Android,可复制编译生成的image文件到sd-fuse_nanopi2/android/ 下,使用脚本即可烧到到SD卡,具体请查看 https://github.com/friendlyarm/sd-fuse_nanopi2。
 
 
====烧写到eMMC====
 
成功编译Android后,可过2种方式烧写到eMMC,分别如下:<br />
 
1) fastboot: 板子从eMMC启动后通过串口快速按任意键进入uboot命令行模式,输入命令fastboot即可启动此方式。<br />
 
连接USB线,然后PC端输入以下命令:
 
<syntaxhighlight lang="bash">
 
cd out/target/product/nanopi2
 
sudo fastboot flash boot boot.img
 
sudo fastboot flash cache cache.img
 
sudo fastboot flash userdata userdata.img
 
sudo fastboot flash system system.img
 
sudo fastboot reboot
 
</syntaxhighlight>
 
2) 使用SD卡烧写 <br />
 
复制out/target/product/nanopi2下的boot.img, cache.img, userdata.img, system.img, partmap.txt到烧写用SD卡的images/android下,再次烧写即可。<br />
 
 
====下载Android4源代码====
 
如果需要使用Android4.4源码的,则执行以下步骤
 
<syntaxhighlight lang="bash">
 
mkdir android4 && cd android4
 
repo init -u https://github.com/friendlyarm/android_manifest.git -b nanopi2-kitkat
 
repo sync
 
</syntaxhighlight>
 
通过 -b  指定不同的分支即可, Android4.4源代码的下载需要使用repo,其安装和使用请查看 https://source.android.com/source/downloading.html。
 

Revision as of 05:45, 6 August 2019

1 如何编译系统

1.1 安装交叉编译器

首先下载并解压编译器:

git clone https://github.com/friendlyarm/prebuilts.git
sudo mkdir -p /opt/FriendlyARM/toolchain
sudo tar xf prebuilts/gcc-x64/arm-cortexa9-linux-gnueabihf-4.9.3.tar.xz -C /opt/FriendlyARM/toolchain/

然后将编译器的路径加入到PATH中,用vi编辑vi ~/.bashrc,在末尾加入以下内容:

export PATH=/opt/FriendlyARM/toolchain/4.9.3/bin:$PATH
export GCC_COLORS=auto

执行一下~/.bashrc脚本让设置立即在当前shell窗口中生效,注意"."后面有个空格:

. ~/.bashrc

这个编译器是64位的,不能在32位的Linux系统上运行,安装完成后,你可以快速的验证是否安装成功:

arm-linux-gcc -v
Using built-in specs.
COLLECT_GCC=arm-linux-gcc
COLLECT_LTO_WRAPPER=/opt/FriendlyARM/toolchain/4.9.3/libexec/gcc/arm-cortexa9-linux-gnueabihf/4.9.3/lto-wrapper
Target: arm-cortexa9-linux-gnueabihf
Configured with: /work/toolchain/build/src/gcc-4.9.3/configure --build=x86_64-build_pc-linux-gnu
--host=x86_64-build_pc-linux-gnu --target=arm-cortexa9-linux-gnueabihf --prefix=/opt/FriendlyARM/toolchain/4.9.3
--with-sysroot=/opt/FriendlyARM/toolchain/4.9.3/arm-cortexa9-linux-gnueabihf/sys-root --enable-languages=c,c++
--with-arch=armv7-a --with-tune=cortex-a9 --with-fpu=vfpv3 --with-float=hard
...
Thread model: posix
gcc version 4.9.3 (ctng-1.21.0-229g-FA)

1.2 编译Linux kernel 4.4.y

1.2.1 编译内核

  • 下载内核源代码
git clone https://github.com/friendlyarm/linux.git -b nanopi2-v4.4.y --depth 1
cd linux

{{{1}}}内核所属的分支是nanopi2-v4.4.y,在开始编译前先切换分支。

  • 编译Ubuntu内核
touch .scmversion
make ARCH=arm nanopi2_linux_defconfig
make ARCH=arm

编译成功结束后,新生成的内核是 arch/arm/boot/zImage,目录arch/arm/boot/dts/下还包括新的DTB文件(s5p4418-nanopi2-rev*.dtb),用于替换掉SD卡boot分区下对应的文件。

1.2.2 如何使用新编译的内核

  • 更新SD卡上的内核

如果您是使用SD卡启动Ubuntu系统,则在PC上复制编译生成的zImage和DTB文件到SD卡的boot分区(即分区1,设备是/dev/sdX1)即可。

  • 更新eMMC上Ubuntu的内核

从eMMC启动时可通过以下方法来更新内核:
1) 启动完成后,系统通常会自动mount eMMC的boot分区(设备是/dev/mmcblk0p1), 可输入命令mount来查看;
2) 连接网络,使用scp/ftp等方式复制新编译的zImage和DTB文件并替换boot分区下的文件;
3) 也可以将编译好的内核复制到SD卡或U盘,然后在板止复制到boot分区下;
4) 更新完成后,输入 reboot 命令重启即可,注意不要直接断电或按Reset键,否则可能会损坏文件.

  • 使用新的内核来生成boot.img

如果要生成直接烧写eMMC的文件,则需要使用新编译的内核来生成boot.img,然后复制到烧写用的SD卡即可直接烧写到eMMC.
对于Ubuntu, 则需要使用按以下方法来生成boot.img :
1) 下载debian_nanopi2

git clone https://github.com/friendlyarm/debian_nanopi2.git

2) 复制用于新的zImage和DTB文件到debian_nanopi2/boot/, ;
3) 生成Debian的 boot.img

cd debian_nanopi2
mkdir rootfs
./build.sh

新的 boot.img 在 debian_nanopi2/sd-fuse_nanopi2/debian 下.
其中命令"mkdir rootfs"只是创建一个空的目录使得build.sh可以运行,因此生成的其它文件比如rootfs.img不能使用。

1.2.3 编译U-Boot

下载U-Boot v2016.01源代码并编译,注意分支是nanopi2-v2016.01

git clone https://github.com/friendlyarm/u-boot.git 
cd u-boot
git checkout nanopi2-v2016.01
make s5p4418_nanopi2_defconfig
make CROSS_COMPILE=arm-linux-

编译成功结束后您将获得bootloader.img,可以通过fastboot、sd-fuse_nanopi2和eflasher ROM来更新板上的U-Boot v2016.01。
需要特别注意的是,不同版本的U-Boot不能交叉更新,不能使用fastboot更新现在运行的U-Boot v2014.07,也不能使用bootloader.img去替换一个ROM中的u-boot.bin,否则会导致系统无法正常启动。

1.3 编译Android7.1.2

1.3.1 搭建编译环境

搭建用于编译Android的环境,建议使用64位的Ubuntu 16.04,需要安装如下软件包:

sudo apt-get install bison g++-multilib git gperf libxml2-utils make python-networkx zip
sudo apt-get install flex curl libncurses5-dev libssl-dev zlib1g-dev gawk minicom
sudo apt-get install openjdk-8-jdk
sudo apt-get install exfat-fuse exfat-utils device-tree-compiler liblz4-tool

更多说明可查看 https://source.android.com/source/initializing.html;

1.3.2 下载Android7源代码

{{{1}}} 源代码托管在 gitlab 上,使用以下命令进行下载:

git clone https://gitlab.com/friendlyelec/s5pxx18-android-7.git -b master

由于Android7源代码较大(约8.2GB),下载可能需要较长时间且容易受网络环境的影响而中断,请耐心等待并重试。

1.3.3 编译Android7内核

Android 7.1.2源代码已包含预先编译好的内核,如果需要进行定制,可根据以下方法编译内核。

git clone https://github.com/friendlyarm/linux.git -b nanopi2-v4.4.y --depth 1
cd linux
touch .scmversion
make ARCH=arm nanopi2_nougat_defconfig
make ARCH=arm

编译成功结束后,新生成的内核是 arch/arm/boot/zImage,目录arch/arm/boot/dts/下还包括新的DTB文件(s5p4418-nanopi2-rev*.dtb)。 如果只想调试内核,可通过 adb 来快速更新。

adb root; adb shell mkdir /storage/sdcard1/; adb shell mount -t ext4 /dev/block/mmcblk0p1 /storage/sdcard1/;
adb push arch/arm/boot/zImage arch/arm/boot/dts/s5p4418-nanopi2-rev*.dtb /storage/sdcard1/

内核开发/调试完成后,如果想生成用于烧写的boot.img,可复制内核zImage和DTB文件到Android7源代码目录 device/friendlyelec/nanopi2/boot,然后开始编译Android7。

1.3.4 编译Android7

cd s5pxx18-android-7
source build/envsetup.sh
lunch aosp_nanopi2-userdebug
make -j8

编译成功完成后,目录 out/target/product/nanopi2/ 下包含可用于烧写的image文件。

filename partition Description
bl1-mmcboot.bin raw boot firmware
loader-mmc.img raw boot firmware
bl_mon.img raw boot firmware
bootloader.img raw uboot-v2016.01
env.conf - uboot环境变量,包含Android内核命令行参数
boot.img boot kernel zImage, DTBs; logo; Android ramdisk
cache.img cache -
userdata.img userdata -
system.img system -
partmap.txt - 分区描述文件