correct/adapt explanations in README

This commit is contained in:
Christian Zimmermann 2020-10-03 20:02:00 +02:00
parent 18bd7fb7a4
commit 05d8f5da4d

View file

@ -8,6 +8,23 @@ The sd card contains the following:
* ext4: root (`/dev/mmcblk1p2`)
* ...
Notice that the sd-card is named `/dev/mmcblk1` in the running system on the banana pi, while it may have any name on your pc where you setup everythin (in the following `/dev/mmcblk0` is assumed).
Example formatting (last partion can be ignored, partition sizes of `mmcblk0px`, `x >= 2` may be varied):
```bash
fdisk -l /dev/mmcblk0
Festplatte /dev/mmcblk0: 14,84 GiB, 15931539456 Bytes, 31116288 Sektoren
Einheiten: Sektoren von 1 * 512 = 512 Bytes
Sektorgröße (logisch/physikalisch): 512 Bytes / 512 Bytes
E/A-Größe (minimal/optimal): 512 Bytes / 512 Bytes
Festplattenbezeichnungstyp: dos
Festplattenbezeichner: 0x54fd6008
Gerät Boot Anfang Ende Sektoren Größe Kn Typ
/dev/mmcblk0p1 204800 729087 524288 256M c W95 FAT32 (LBA)
/dev/mmcblk0p2 729088 22925311 22196224 10,6G 83 Linux
/dev/mmcblk0p3 22925312 31115263 8189952 3,9G 83 Linux
```
## Pre-Loader:
...!!!
@ -16,13 +33,14 @@ The sd card contains the following:
clone u-boot repository and compile:
```bash
cp -f u-boot/mt7623n_bpir2_defconfig ${u-boot-dir}/configs
cd ${u-boot-dir}
git clone https://gitlab.denx.de/u-boot/u-boot.git
cd u-boot
cp -f <this_repo>/u-boot/mt7623n_bpir2_defconfig configs
make CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- ARCH=arm mt7623n_bpir2_defconfig
make CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- ARCH=arm
dd if=u-boot.bin of=/dev/${sdcard} bs=1k seek=320
dd if=u-boot.bin of=/dev/mmcblk0 bs=1k seek=320
```
maybe you have to patch `${u-boot-dir}/scripts/dtc/dtc-lexer.l`; simply replace by `u-boot/dtc-lexer.l`.
maybe you have to patch `scripts/dtc/dtc-lexer.l`; simply replace by `<this_repo>/u-boot/dtc-lexer.l`.
## boot-partition:
@ -51,16 +69,13 @@ mkdir boot.setup
mount /dev/mmcblk0p1 boot.setup
cp arch/arm/boot/zImage boot.setup
cp arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dtb boot.setup/dts
mkimage -A arm -T script -C none -n "Load Kernel" -d <this_repo>/u-boot/boot.cmd boot.img
cp boot.img boot.setup
sync
umount boot.setup
rmdir boot.setup
```
`/boot.img` is created by mkimage from `u-boot/boot.cmd`:
```bash
mkimage -A arm -T script -C none -n "Load Kernel" -d u-boot/boot.cmd boot.img
```
## root-partition:
If you did no mistake so far (...) this should be the easiest part: