This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
hw:zynq:linux:petalinux:rootfs [2021/04/21 16:09] jakub.moron |
hw:zynq:linux:petalinux:rootfs [2022/03/09 10:30] (current) jakub.moron |
||
|---|---|---|---|
| Line 4: | Line 4: | ||
| qemu-user-static debootstrap binfmt-support </code> | qemu-user-static debootstrap binfmt-support </code> | ||
| - Setup enviroment: <code> | - Setup enviroment: <code> | ||
| - | export targetdir=rootfs | + | export targetdir=rootfs</code>For Debian 9:<code> |
| - | export distro=stretch | + | export distro=stretch </code>Or for Debian 10:<code> |
| - | export distro=buster | + | export distro=buster </code>Or for Debian 11:<code> |
| - | mkdir $targetdir | + | export distro=bullseye</code><code> |
| - | </code> | + | sudo mkdir $targetdir |
| + | </code> Ensure that $targetdir is owned by root:root. | ||
| - Build the root file system: download the needed .deb packages and unpack it into ''$targetdir'': <code> | - Build the root file system: download the needed .deb packages and unpack it into ''$targetdir'': <code> | ||
| sudo debootstrap --arch=armhf --foreign $distro $targetdir | sudo debootstrap --arch=armhf --foreign $distro $targetdir | ||
| Line 15: | Line 16: | ||
| sudo chroot $targetdir | sudo chroot $targetdir | ||
| </code> | </code> | ||
| - | - Configure and install the root filesystem by running the .deb configuration scripts inside the emulated ''armhf'' architecture (this is why ''qemu-arm-static'' is needed) <code> | + | - Configure and install the root filesystem by running the .deb configuration scripts inside the emulated ''armhf'' architecture (this is why ''qemu-arm-static'' is needed). For Debian 9:<code> |
| - | export distro=stretch | + | export distro=stretch </code>Or for Debian 10:<code> |
| - | export distro=buster | + | export distro=buster </code>Or for Debian 11:<code> |
| + | export distro=bullseye</code><code> | ||
| export LANG=C | export LANG=C | ||
| /debootstrap/debootstrap --second-stage | /debootstrap/debootstrap --second-stage | ||
| </code> | </code> | ||
| - | - Setup APT: <code> | + | - Setup APT: For Debian 11: <code> |
| + | cat << EOT > /etc/apt/sources.list | ||
| + | deb http://ftp.ch.debian.org/debian/ $distro main contrib non-free | ||
| + | deb-src http://ftp.ch.debian.org/debian/ $distro main contrib non-free | ||
| + | deb http://security.debian.org/debian-security $distro-security main contrib non-free | ||
| + | deb-src http://security.debian.org/debian-security $distro-security main contrib non-free | ||
| + | deb http://ftp.ch.debian.org/debian/ $distro-updates main contrib non-free | ||
| + | deb-src http://ftp.ch.debian.org/debian/ $distro-updates main contrib non-free | ||
| + | EOT | ||
| + | </code> For older Debian: <code> | ||
| cat << EOT > /etc/apt/sources.list | cat << EOT > /etc/apt/sources.list | ||
| deb http://ftp.ch.debian.org/debian/ $distro main contrib non-free | deb http://ftp.ch.debian.org/debian/ $distro main contrib non-free | ||
| Line 101: | Line 112: | ||
| </code> or <code> | </code> or <code> | ||
| sudo tar xvfp build/tmp/deploy/images/zynq-generic/modules-zynq-generic.tgz -C <rootfs_project_path> | sudo tar xvfp build/tmp/deploy/images/zynq-generic/modules-zynq-generic.tgz -C <rootfs_project_path> | ||
| - | </code> The ''<rootfs_project_path>'' __should point at the root of the rootfs__, i.e. at ''$targetdir''. \\ Please __notice__ that the modules file may have different name depending on the architecture.\\ \\ **In the ''chroot'' enviroment:** <code> | + | </code> The ''<rootfs_project_path>'' __should point at the root of the rootfs__, i.e. at ''$targetdir''. \\ Please __notice__ that the modules file may have different name depending on the architecture.\\ \\ **In the ''chroot'' enviroment -- petalinux 2018.3:** <code> |
| chown -R root:root /lib | chown -R root:root /lib | ||
| mv /lib/modules/4.14.0-xilinx-v2018.3/ /lib/modules/`uname -r`/ | mv /lib/modules/4.14.0-xilinx-v2018.3/ /lib/modules/`uname -r`/ | ||
| depmod | depmod | ||
| mv /lib/modules/`uname -r`/ /lib/modules/4.14.0-xilinx-v2018.3/ | mv /lib/modules/`uname -r`/ /lib/modules/4.14.0-xilinx-v2018.3/ | ||
| + | </code>\\ **In the ''chroot'' enviroment -- petalinux 2020.2:** <code> | ||
| + | chown -R root:root /lib | ||
| + | mv /lib/modules/5.4.0-xilinx-v2020.2/ /lib/modules/`uname -r`/ | ||
| + | depmod | ||
| + | mv /lib/modules/`uname -r`/ /lib/modules/5.4.0-xilinx-v2020.2/ | ||
| </code> | </code> | ||
| - Load module for generic UIO with altered ''compatible'' property: <code> | - Load module for generic UIO with altered ''compatible'' property: <code> | ||