Skip to content

Commit

Permalink
Merge branch 'build-v1.0.x' into 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ikwzm committed Jul 15, 2019
2 parents 1fbdbdb + 0c14ca1 commit f253e76
Show file tree
Hide file tree
Showing 80 changed files with 7,700 additions and 1,255 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.deb filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
13 changes: 5 additions & 8 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ This Repository provides a Linux Boot Image(U-boot, Kernel, Root-fs) for FPGA-So
+ Customized boot by uEnv.txt
+ Customized boot by boot.scr
+ Enable bootmenu
* Linux Kernel Version v4.14.123
* Linux Kernel Version v4.19.57
+ Available in both Xilinx-Zynq-7000 and Altera-SoC in a single image
+ Enable Device Tree Overlay
+ Enable FPGA Manager
+ Enable FPGA Bridge
+ Enable FPGA Reagion
+ Patch for issue #3(USB-HOST does not work with PYNQ-Z1)
* Debian9(stretch) Root File System
* Debian10(buster) Root File System
+ Installed build-essential
+ Installed device-tree-compiler
+ Installed ruby ruby-msgpack ruby-serialport
+ Installed python python3 python3-numpy msgpack-rpc-python
+ Installed u-boot-tools
+ Installed Other package list -> [files/dpkg-list.txt](files/dpkg-list.txt)
+ Installed Other package list -> [files/debian10-dpkg-list.txt](files/debian10-dpkg-list.txt)
* FPGA Device Drivers and Services
+ [dtbocfg (Device Tree Blob Overlay Configuration File System)](https://github.com/ikwzm/dtbocfg)
+ [fclkcfg (FPGA Clock Configuration Device Driver)](https://github.com/ikwzm/fclkcfg)
Expand All @@ -59,9 +59,6 @@ Install
Tutorial
------------------------------------------------------------------------------------

* [uio_irq_sample](doc/tutorial/uio_irq_sample.md)
* [accumulator](doc/tutorial/accumulator.md)
* [fibonacci](doc/tutorial/fibonacci.md)
* FPGA-SoC-Linux-Example-1
- [FPGA-SoC-Linux-Example-1-ZYBO](https://github.com/ikwzm/FPGA-SoC-Linux-Example-1-ZYBO)
- [FPGA-SoC-Linux-Example-1-ZYBO-Z7](https://github.com/ikwzm/FPGA-SoC-Linux-Example-1-ZYBO-Z7)
Expand All @@ -77,7 +74,7 @@ Build
* [Build U-boot for PYNQ-Z1](doc/build/u-boot-zynq-pynqz1.md)
* [Build U-boot for DE0-Nano-SoC](doc/build/u-boot-de0-nano-soc.md)
* [Build U-boot for DE10-Nano](doc/build/u-boot-de10-nano.md)
* [Build Linux Kernel](doc/build/linux-kernel-4.14.123.md)
* [Build Debian9 RootFS](doc/build/debian9-rootfs.md)
* [Build Linux Kernel](doc/build/linux-kernel-4.19.57.md)
* [Build Debian10 RootFS](doc/build/debian10-rootfs.md)
* [Build Device Drivers and Services Package](doc/build/device-drivers.md)

3 changes: 3 additions & 0 deletions debian10-rootfs-vanilla.tgz
Git LFS file not shown
3 changes: 0 additions & 3 deletions debian9-rootfs-vanilla.tgz

This file was deleted.

237 changes: 237 additions & 0 deletions doc/build/debian10-rootfs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,237 @@
### Build Debian10 RootFS

#### Setup parameters

```console
shell$ apt-get install qemu-user-static debootstrap binfmt-support
shell$ export targetdir=debian10-rootfs
shell$ export distro=buster
```

#### Build the root file system in $targetdir(=debian10-rootfs)

```console
shell$ mkdir $targetdir
shell$ sudo debootstrap --arch=armhf --foreign $distro $targetdir
shell$ sudo cp /usr/bin/qemu-arm-static $targetdir/usr/bin
shell$ sudo cp /etc/resolv.conf $targetdir/etc
shell$ sudo cp scripts/build-debian10-rootfs-with-qemu.sh $targetdir
shell$ sudo cp linux-image-4.19.57-armv7-fpga_4.19.57-armv7-fpga-0_armhf.deb $targetdir
````

#### Build debian10-rootfs with QEMU

##### Change Root to debian10-rootfs

```console
shell$ sudo chroot $targetdir
```

There are two ways

1. run build-debian10-rootfs-with-qemu.sh (easy)
2. run this chapter step-by-step (annoying)

##### Setup APT

````console
debian10-rootfs# distro=buster
debian10-rootfs# export LANG=C
debian10-rootfs# /debootstrap/debootstrap --second-stage
````

```console
debian10-rootfs# cat <<EOT > /etc/apt/sources.list
deb http://ftp.jp.debian.org/debian buster main contrib non-free
deb-src http://ftp.jp.debian.org/debian buster main contrib non-free
deb http://ftp.jp.debian.org/debian buster-updates main contrib non-free
deb-src http://ftp.jp.debian.org/debian buster-updates main contrib non-free
deb http://security.debian.org/debian-security buster/updates main contrib non-free
deb-src http://security.debian.org/debian-security buster/updates main contrib non-free
EOT
```

```console
debian10-rootfs# cat <<EOT > /etc/apt/apt.conf.d/71-no-recommends
APT::Install-Recommends "0";
APT::Install-Suggests "0";
EOT
```

```console
debian10-rootfs# apt-get update
```

##### Install applications

```console
debian10-rootfs# apt-get install -y locales dialog
debian10-rootfs# dpkg-reconfigure locales
debian10-rootfs# apt-get install -y net-tools openssh-server ntpdate resolvconf sudo less hwinfo ntp tcsh zsh file
```

##### Setup hostname

```console
debian10-rootfs# echo debian-fpga > /etc/hostname
```

##### Setup root password

```console
debian10-rootfs# passwd
```

This time, we set the "admin" at the root' password.

To be able to login as root from Zynq serial port.

```console
debian10-rootfs# cat <<EOT >> /etc/securetty
# Seral Port for Xilinx Zynq
ttyPS0
EOT
```

##### Add a new guest user

```console
debian10-rootfs# adduser fpga
```

This time, we set the "fpga" at the fpga'password.

```console
debian10-rootfs# echo "fpga ALL=(ALL:ALL) ALL" > /etc/sudoers.d/fpga
```

##### Setup sshd config

```console
debian10-rootfs# sed -i -e 's/#PasswordAuthentication/PasswordAuthentication/g' /etc/ssh/sshd_config
```

##### Setup Time Zone

```console
debian10-rootfs# dpkg-reconfigure tzdata
```

or if noninteractive set to Asia/Tokyo

```console
debian10-rootfs# echo "Asia/Tokyo" > /etc/timezone
debian10-rootfs# dpkg-reconfigure -f noninteractive tzdata
```


##### Setup fstab

```console
debian10-rootfs# cat <<EOT > /etc/fstab
/dev/mmcblk0p1 /mnt/boot auto defaults 0 0
none /config configfs defaults 0 0
EOT
````

##### Setup Network Interface

```console
debian10-rootfs# cat <<EOT > /etc/network/interfaces.d/eth0
allow-hotplug eth0
iface eth0 inet dhcp
EOT
````

##### Setup /lib/firmware

```console
debian10-rootfs# mkdir /lib/firmware
```

##### Install Wireless tools and firmware

```console
debian10-rootfs# apt-get install -y wireless-tools
debian10-rootfs# apt-get install -y wpasupplicant
debian10-rootfs# apt-get install -y firmware-realtek
debian10-rootfs# apt-get install -y firmware-ralink
```

##### Install Development applications

```console
debian10-rootfs# apt-get install -y build-essential
debian10-rootfs# apt-get install -y git
debian10-rootfs# apt-get install -y u-boot-tools
debian10-rootfs# apt-get install -y libssl-dev
debian10-rootfs# apt-get install -y socat
debian10-rootfs# apt-get install -y ruby rake ruby-msgpack ruby-serialport
debian10-rootfs# apt-get install -y python python-dev python-setuptools python-wheel python-pip
debian10-rootfs# apt-get install -y python3 python3-dev python3-setuptools python3-wheel python3-pip python3-numpy
debian10-rootfs# pip3 install msgpack-rpc-python
```

##### Install Device Tree Compiler (supported symbol version)

```console
debian10-rootfs# apt-get install -y flex bison pkg-config
debian10-rootfs# cd root
debian10-rootfs# mkdir src
debian10-rootfs# cd src
debian10-rootfs# git clone https://git.kernel.org/pub/scm/utils/dtc/dtc.git dtc
debian10-rootfs# cd dtc
debian10-rootfs# make
debian10-rootfs# make HOME=/usr/local install-bin
debian10-rootfs# cd /
```

##### Install Other applications

```console
debian10-rootfs# apt-get install -y samba
debian10-rootfs# apt-get install -y avahi-daemon
```

##### Install haveged for Linux Kernel 4.19

```console
debian10-rootfs# apt-get install -y haveged
```

##### Install Linux Modules

```console
debian10-rootfs# mkdir /mnt/boot
debian10-rootfs# dpkg -i linux-image-4.19.57-armv7-fpga_4.19.57-armv7-fpga-0_armhf.deb
```

##### Clean Cache

```console
debian10-rootfs# apt-get clean
```

##### Create Debian Package List

```console
debian10-rootfs# dpkg -l > dpkg-list.txt
```

##### Finish

```console
debian10-rootfs# exit
shell$ sudo rm -f $targetdir/usr/bin/qemu-arm-static
shell$ sudo rm -f $targetdir/build-debian10-rootfs-with-qemu.sh
shell$ sudo rm -f $targetdir/linux-image-4.19.57-armv7-fpga_4.19.57-armv7-fpga-0_armhf.deb
shell$ sudo mv $targetdir/dpkg-list.txt files/debian10-dpkg-list.txt
```

#### Build debian10-rootfs-vanilla.tgz

```console
shell$ cd $targetdir
shell$ sudo tar cfz ../debian10-rootfs-vanilla.tgz *
```

20 changes: 15 additions & 5 deletions doc/build/debian9-rootfs.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ shell$ sudo debootstrap --arch=armhf --foreign $distro $
shell$ sudo cp /usr/bin/qemu-arm-static $targetdir/usr/bin
shell$ sudo cp /etc/resolv.conf $targetdir/etc
shell$ sudo cp scripts/build-debian9-rootfs-with-qemu.sh $targetdir
shell$ sudo cp linux-image-4.14.123-armv7-fpga_4.14.123-armv7-fpga-1_armhf.deb $targetdir
shell$ sudo cp linux-image-4.19.57-armv7-fpga_4.19.57-armv7-fpga-0_armhf.deb $targetdir
````

#### Build debian9-rootfs with QEMU
Expand All @@ -26,6 +26,10 @@ shell$ sudo cp linux-image-4.14.123-armv7-fpga_4.14.123-armv7-fpga-1_armhf.deb $
```console
shell$ sudo chroot $targetdir
```
If you are using Ubuntu on WSL(Windows Subsystem for Linux) and you have a chroot failure,
please see the folowing page.

[./doc/build/debian9-rootfs-on-wsl.md](debian9-rootfs-on-wsl.md)

There are two ways

Expand Down Expand Up @@ -67,7 +71,7 @@ debian9-rootfs# apt-get update
```console
debian9-rootfs# apt-get install -y locales dialog
debian9-rootfs# dpkg-reconfigure locales
debian9-rootfs# apt-get install -y net-tools openssh-server ntpdate resolvconf sudo less hwinfo ntp tcsh zsh
debian9-rootfs# apt-get install -y net-tools popenssh-server ntpdate resolvconf sudo less hwinfo ntp tcsh zsh
```

##### Setup hostname
Expand Down Expand Up @@ -194,11 +198,17 @@ debian9-rootfs# apt-get install -y samba
debian9-rootfs# apt-get install -y avahi-daemon
```

##### Install haveged for Linux Kernel 4.19

```console
debian9-rootfs# apt-get install -y haveged
```

##### Install Linux Modules

```console
debian9-rootfs# mkdir /mnt/boot
debian9-rootfs# dpkg -i linux-image-4.14.123-armv7-fpga_4.14.123-armv7-fpga-1_armhf.deb
debian9-rootfs# dpkg -i linux-image-4.19.57-armv7-fpga_4.19.57-armv7-fpga-0_armhf.deb
```

##### Clean Cache
Expand All @@ -219,8 +229,8 @@ debian9-rootfs# dpkg -l > dpkg-list.txt
debian9-rootfs# exit
shell$ sudo rm -f $targetdir/usr/bin/qemu-arm-static
shell$ sudo rm -f $targetdir/build-debian9-rootfs-with-qemu.sh
shell$ sudo rm -f $targetdir/linux-image-4.14.123-armv7-fpga_4.14.123-armv7-fpga-1_armhf.deb
shell$ sudo mv $targetdir/dpkg-list.txt files/dpkg-list.txt
shell$ sudo rm -f $targetdir/linux-image-4.19.57-armv7-fpga_4.19.57-armv7-fpga-0_armhf.deb
shell$ sudo mv $targetdir/dpkg-list.txt files/debian9-dpkg-list.txt
```

#### Build debian9-rootfs-vanilla.tgz
Expand Down
Loading

0 comments on commit f253e76

Please sign in to comment.