This is an old revision of the document!
qemu-user-static debootstrap binfmt-support
export targetdir=rootfs export distro=stretch mkdir $targetdir
$targetdir
: sudo debootstrap --arch=armhf --foreign $distro $targetdir sudo cp /usr/bin/qemu-arm-static $targetdir/usr/bin sudo cp /etc/resolv.conf $targetdir/etc sudo chroot $targetdir
armhf
architecture (this is why qemu-arm-static
is needed) export distro=stretch export LANG=C /debootstrap/debootstrap --second-stage
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/updates main contrib non-free deb-src http://security.debian.org/debian-security $distro/updates 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
Disable the recommended and suggested packages automatic installation to reduce the root file system size:
cat << EOT > /etc/apt/apt.conf.d/71-no-recommends APT::Install-Recommends "0"; APT::Install-Suggests "0"; EOT
apt update apt install locales dialog dpkg-reconfigure locales apt install openssh-server ntpdate resolvconf sudo less hwinfo ntp tcsh zsh vim
passwd
cat << EOT > /etc/network/interfaces.d/interface auto eth0 iface eth0 inet static address 192.168.0.100 netmask 255.255.255.0 gateway 192.168.0.1 dns-nameservers 192.168.0.1 EOT
cat << EOT >> /etc/resolv.conf nameserver 192.168.0.1 EOT
– or use dhcp:
cat << EOT > /etc/network/interfaces.d/interface auto eth0 iface eth0 inet dhcp EOT
cat << EOT >> /etc/resolv.conf EOT
PasswordAuthentication yes
in vim /etc/ssh/sshd_config
adduser username
and add it to sudo group:
usermod -a -G sudo <username>
/etc/fstab
: /dev/mmcblk0p1 /sdcard auto defaults 0 0
and make mount point
mkdir /sdcard
echo <linux_name> > /etc/hostname echo 127.0.0.1 <linux_name> >> /etc/hosts
echo T0:2345:respawn:/sbin/getty -L ttyS0 115200 vt1000 >> /etc/inittab
apt install net-tools isc-dhcp-client
apt install build-essential bash-completion time python python-pip
cd <boot_project_path>/<boot_project_name> sudo tar xvfp build/tmp/deploy/images/plnx-zynq7/modules-plnx-zynq7.tgz -C <rootfs_project_path>
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:
chown -R root:root /lib mv /lib/modules/4.14.0-xilinx-v2018.3/ /lib/modules/`uname -r`/ depmod mv /lib/modules/`uname -r`/ /lib/modules/4.14.0-xilinx-v2018.3/
/dev/uio*
devices accessible for all: vim /etc/udev/rules.d/90-uio.rules SUBSYSTEM=="uio", MODE=”666"
exit sudo rm -f $targetdir/usr/bin/qemu-arm-static
export targetdir=rootfs sudo cp /usr/bin/qemu-arm-static $targetdir/usr/bin sudo chroot $targetdir
Do what you need and
exit sudo rm -f $targetdir/usr/bin/qemu-arm-static