Skip to content

Commit

Permalink
Merge branch 'change-documents-shell-code-block'
Browse files Browse the repository at this point in the history
  • Loading branch information
ikwzm committed Jan 12, 2018
2 parents ddd813e + 6dd7dab commit 371feec
Show file tree
Hide file tree
Showing 17 changed files with 120 additions and 120 deletions.
56 changes: 28 additions & 28 deletions doc/build/debian9-rootfs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

#### Setup parameters

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

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

```
```console
shell$ mkdir $targetdir
shell$ sudo debootstrap --arch=armhf --foreign $distro $targetdir
shell$ sudo cp /usr/bin/qemu-arm-static $targetdir/usr/bin
Expand All @@ -24,7 +24,7 @@ shell$ sudo cp linux-headers-4.12.14-armv7-fpga_4.12.14-armv7-fpga-3_armhf.deb $

##### Change Root to debian9-rootfs

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

Expand All @@ -35,13 +35,13 @@ There are two ways

##### Setup APT

````
````console
debian9-rootfs# distro=stretch
debian9-rootfs# export LANG=C
debian9-rootfs# /debootstrap/debootstrap --second-stage
````

```
```console
debian9-rootfs# cat <<EOT > /etc/apt/sources.list
deb http://ftp.jp.debian.org/debian stretch main contrib non-free
deb-src http://ftp.jp.debian.org/debian stretch main contrib non-free
Expand All @@ -52,42 +52,42 @@ deb-src http://security.debian.org/debian-security stretch/updates main contrib
EOT
```

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

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

##### Install applications

```
```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
```

##### Setup hostname

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

##### Setup root password

```
```console
debian9-rootfs# passwd
```

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

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

```
```console
debian9-rootfs# cat <<EOT >> /etc/securetty
# Seral Port for Xilinx Zynq
ttyPS0
Expand All @@ -96,39 +96,39 @@ EOT

##### Add a new guest user

```
```console
debian9-rootfs# adduser fpga
```

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

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

##### Setup sshd config

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

##### Setup Time Zone

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

or if noninteractive set to Asia/Tokyo

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


##### Setup fstab

```
```console
debian9-rootfs# cat <<EOT > /etc/fstab
/dev/mmcblk0p1 /boot auto defaults 0 0
none /config configfs defaults 0 0
Expand All @@ -137,7 +137,7 @@ EOT

##### Setup Network Interface

```
```console
debian9-rootfs# cat <<EOT > /etc/network/interfaces.d/eth0
allow-hotplug eth0
iface eth0 inet dhcp
Expand All @@ -146,13 +146,13 @@ EOT

##### Setup /lib/firmware

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

##### Install Wireless tools and firmware

```
```console
debian9-rootfs# apt-get install wireless-tools
debian9-rootfs# apt-get install wpasupplicant
debian9-rootfs# apt-get install firmware-realtek
Expand All @@ -161,7 +161,7 @@ debian9-rootfs# apt-get install firmware-ralink

##### Install Development applications

```
```console
debian9-rootfs# apt-get install -y build-essential
debian9-rootfs# apt-get install -y git
debian9-rootfs# apt-get install -y u-boot-tools
Expand All @@ -175,7 +175,7 @@ debian9-rootfs# pip3 install msgpack-rpc-python

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

```
```console
debian9-rootfs# apt-get install -y flex bison
debian9-rootfs# cd root
debian9-rootfs# mkdir src
Expand All @@ -189,14 +189,14 @@ debian9-rootfs# cd /

##### Install Other applications

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

##### Install Linux Header and Modules

```
```console
debian9-rootfs# mv boot boot.org
debian9-rootfs# mkdir boot
debian9-rootfs# dpkg -i linux-image-4.12.14-armv7-fpga_4.12.14-armv7-fpga-3_armhf.deb
Expand All @@ -208,19 +208,19 @@ debian9-rootfs# mv boot.org boot

##### Clean Cache

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

##### Create Debian Package List

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

##### Finish

```
```console
debian9-rootfs# exit
shell$ sudo rm -f $targetdir/usr/bin/qemu-arm-static
shell$ sudo rm -f $targetdir/build-debian9-rootfs-with-qemu.sh
Expand All @@ -231,7 +231,7 @@ shell$ sudo mv $targetdir/dpkg-list.txt files/dpkg-list.txt

#### Build debian9-rootfs-vanilla.tgz

```
```console
shell$ cd $targetdir
shell$ sudo tar cfz ../debian9-rootfs-vanilla.tgz *
```
Expand Down
8 changes: 4 additions & 4 deletions doc/build/device-drivers.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ There are two ways

#### Donwload Sources from github

```
```console
shell$ git clone https://github.com/ikwzm/dtbocfg
shell$ git clone https://github.com/ikwzm/fclkcfg
shell$ git clone https://github.com/ikwzm/udmabuf
Expand All @@ -16,7 +16,7 @@ shell$ git clone https://github.com/ikwzm/PTTY_AXI4

#### Copy Source Files to drivers/

```
```console
shell$ git archive --remote dtbocfg --prefix=dtbocfg/ --format=tar v0.0.3 | tar xf - -C drivers
shell$ git archive --remote fclkcfg --prefix=fclkcfg/ --format=tar v0.0.3 | tar xf - -C drivers
shell$ git archive --remote udmabuf --prefix=udmabuf/ --format=tar v0.9.0 | tar xf - -C drivers
Expand All @@ -25,14 +25,14 @@ shell$ cd PTTY_AXI4; git checkout v1.0.0; cp -r src/drivers/zptty ../drivers; cd

#### Build Device Driver debian package

```
```console
shell$ cd drivers
shell$ sudo debian/rules binary
```

#### Build Device Services debian package

```
```console
shell$ cd services
shell$ sudo debian/rules binary
```
22 changes: 11 additions & 11 deletions doc/build/linux-kernel-4.14.13.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ There are two ways

##### Clone from linux-stable.git

```
```console
shell$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.14.13-armv7-fpga
```

##### Checkout v4.14.13

```
```console
shell$ cd linux-4.14.13-armv7-fpga
shell$ git checkout -b linux-4.14.13-armv7-fpga refs/tags/v4.14.13
```
Expand All @@ -24,7 +24,7 @@ shell$ git checkout -b linux-4.14.13-armv7-fpga refs/tags/v4.14.13

##### Patch for armv7-fpga

```
```console
shell$ patch -p0 < ../files/linux-4.14.13-armv7-fpga.diff
shell$ git add --update
shell$ git add arch/arm/configs/armv7_fpga_defconfig
Expand All @@ -35,22 +35,22 @@ shell$ git commit -m "patch for armv7-fpga"

##### Patch for usb chipidea driver

```
```console
shell$ patch -p0 < ../files/linux-4.14.13-armv7-fpga-patch-usb-chipidea.diff
shell$ git add --update
shell$ git commit -m "patch for usb chipidea driver for issue #3"
```

##### Create tag and .version

```
```console
shell$ git tag -a v4.14.13-armv7-fpga -m "release v4.14.13-armv7-fpga"
shell$ echo 0 > .version
```

#### Setup for Build

````
````console
shell$ cd linux-4.14.13-armv7-fpga
shell$ export ARCH=arm
shell$ export CROSS_COMPILE=arm-linux-gnueabihf-
Expand All @@ -59,7 +59,7 @@ shell$ make armv7_fpga_defconfig

#### Build Linux Kernel and device tree

````
````console
shell$ export DTC_FLAGS=--symbols
shell$ make deb-pkg
shell$ make zynq-zybo.dtb
Expand All @@ -70,15 +70,15 @@ shell$ make socfpga_cyclone5_de0_sockit.dtb

#### Copy zImage and devicetree to target/zybo-zynq/boot/

```
```console
shell$ cp arch/arm/boot/zImage ../target/zynq-zybo/boot/zImage-4.14.13-armv7-fpga
shell$ cp arch/arm/boot/dts/zynq-zybo.dtb ../target/zynq-zybo/boot/devicetree-4.14.13-zynq-zybo.dtb
shell$ dtc -I dtb -O dts -o ../target/zynq-zybo/boot/devicetree-4.14.13-zynq-zybo.dts arch/arm/boot/dts/zynq-zybo.dtb
```

#### Copy zImage and devicetree to tareget/zybo-zynq-z7/boot/

```
```console
shell$ cp arch/arm/boot/zImage ../target/zynq-zybo-z7/boot/zImage-4.14.13-armv7-fpga
shell$ cp arch/arm/boot/dts/zynq-zybo-z7.dtb ../target/zynq-zybo-z7/boot/devicetree-4.14.13-zynq-zybo-z7.dtb
shell$ dtc -I dtb -O dts --symbols -o ../target/zynq-zybo-z7/boot/devicetree-4.14.13-zynq-zybo-z7.dts arch/arm/boot/dts/zynq-zybo-z7.dtb
Expand All @@ -87,15 +87,15 @@ shell$ dtc -I dtb -O dts --symbols -o ../target/zynq-zybo-z7/boot/devicetree-4.1

#### Copy zImage and devicetree to target/zybo-pynqz1/boot/

```
```console
shell$ cp arch/arm/boot/zImage ../target/zynq-pynqz1/boot/zImage-4.14.13-armv7-fpga
shell$ cp arch/arm/boot/dts/zynq-pynqz1.dtb ../target/zynq-pynqz1/boot/devicetree-4.14.13-zynq-pynqz1.dtb
shell$ dtc -I dtb -O dts -o ../target/zynq-pynqz1/boot/devicetree-4.14.13-zynq-pynqz1.dts arch/arm/boot/dts/zynq-pynqz1.dtb
```

#### Copy zImage and devicetree to target/de0-nano-soc/boot/

```
```console
shell$ cp arch/arm/boot/zImage ../target/de0-nano-soc/boot/zImage-4.14.13-armv7-fpga
shell$ cp arch/arm/boot/dts/socfpga_cyclone5_de0_sockit.dtb ../target/de0-nano-soc/boot/devicetree-4.14.13-socfpga.dtb
shell$ dtc -I dtb -O dts -o ../target/de0-nano-soc/boot/devicetree-4.14.13-socfpga.dts arch/arm/boot/dts/socfpga_cyclone5_de0_sockit.dtb
Expand Down
Loading

0 comments on commit 371feec

Please sign in to comment.