User Tools

Site Tools


en:bpi-r2:storage

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:bpi-r2:storage [2019/01/09 18:04]
127.0.0.1 external edit
en:bpi-r2:storage [2019/07/31 14:39] (current)
frank [preloader]
Line 4: Line 4:
  
 it looks like  /​dev/​mmcblk1,​ /​dev/​mmcblk1boot0 and /​dev/​mmcblk1boot1 are independend devices (bootx not partitions inside /​dev/​mmcblk1) it looks like  /​dev/​mmcblk1,​ /​dev/​mmcblk1boot0 and /​dev/​mmcblk1boot1 are independend devices (bootx not partitions inside /​dev/​mmcblk1)
 +
 +===== preloader =====
 +
 +{{ :​bpi-r2:​bpi-r2-preloader-ddr1600-20190722-2k.img.gz |for SD}} have to be written at 2k-offset (0x800)
 +
 +  sudo dd if=BPI-R2-EMMC-boot0-DDR1600-20190722-2k.img of=/dev/sdc bs=1k seek=2
 +
 +(SD-Card needs additional MMC_BOOT & BRLYT header, see below)
 +
 +{{ :​bpi-r2:​bpi-r2-emmc-boot0-ddr1600-20190722-0k.img.gz |for EMMC}} have to be written at 0-offset (0x0) of boot0-Partition
 +
 +  sudo dd if=BPI-R2-EMMC-boot0-DDR1600-20190722-0k.img of=/​dev/​mmcblk1boot0
 +
 +new preloaderfiles from here: https://​github.com/​BPI-SINOVOIP/​BPI-files/​tree/​master/​SD/​100MB
  
 ===== SD-Card ===== ===== SD-Card =====
Line 12: Line 26:
 [[http://​forum.banana-pi.org/​t/​how-to-build-an-ubuntu-debian-sd-image-from-scratch/​6805/​8]] [[http://​forum.banana-pi.org/​t/​how-to-build-an-ubuntu-debian-sd-image-from-scratch/​6805/​8]]
  
-Step-by-Step-Guide from "​ul90"​: +[[https://​github.com/​BPI-SINOVOIP/​BPI-R2-bsp/​tree/​master/​mt-pack/​mtk/​bpi-r2/​bin|SD-Headers]] {{ :bpi-r2:​bpi-r2-head440-0k.img |}} {{ :bpi-r2:​bpi-r2-head1-512b.img |}}
-==== 1download binary files====+
  
-[[https://​github.com/​BPI-SINOVOIP/​BPI-R2-bsp/​tree/​master/​mt-pack/​mtk/​bpi-r2/​bin|SD-Headers]]+  * SDMMC_BOOT-Signatur + address of 2nd header (0x00000200) ​first 440 byte (before partitiontable):​
  
-==== 2. Create image file (8GB): ​====+  gunzip -c BPI-R2-HEAD440-0k.img.gz | dd of=/dev/loop8 bs=1024 seek=0 
 + 
 +  * BRLYT-signature + preloader-Address (0x00000800):​ 
 + 
 +  gunzip -c BPI-R2-HEAD1-512b.img.gz | dd of=/​dev/​loop8 bs=512 seek=1 
 + 
 +==== short install-guide ==== 
 + 
 +this guide is derived from user ul90 but using a fixed partition table (existing image/​sdcard) and variables for loopdevice 
 + 
 +  dd if=/​dev/​zero of=../​bpi-r2-buster.img bs=1M count=7168 
 +  loopdev=$(losetup -f) 
 +  sudo losetup ${loopdev} ../​bpi-r2-buster.img 
 +  echo $loopdev 
 +  sudo dd if=~/​Downloads/​BPI-R2-preloader-DDR1600-20190722-2k.img of=${loopdev} bs=1k seek=2 
 +  sudo dd if=~/​Downloads/​BPI-R2-HEAD440-0k.img of=${loopdev} bs=1024 seek=0 
 +  sudo dd if=~/​Downloads/​BPI-R2-HEAD1-512b.img ​ bs=512 seek=1 
 +  sudo dd if=/​path/​to/​u-boot/​u-boot.bin of=${loopdev} bs=1k seek=320 
 +  sudo sfdisk ${loopdev} < ~/​Downloads/​parttable.dat  
 +  sudo partprobe ${loopdev} 
 +  ls ${loopdev}* 
 +  sudo mkfs -t vfat ${loopdev}p1 
 +  sudo mkfs -t ext4 ${loopdev}p2 
 +  sudo fatlabel ${loopdev}p1 BPI-BOOT 
 +  sudo e2label ${loopdev}p2 BPI-ROOT 
 + 
 +install debian (from [[debian#​debootstrap|bootstrapped rootfs]]) 
 + 
 +  sudo mount ${loopdev}p2 /mnt/ 
 +  sudo cp -r debian_buster_armhf/​. /mnt/ 
 +  #install kernel-modules to same partition 
 +  kernelpack=/​path/​to/​bpi-r2_<​version>​_main.tar.gz 
 +  sudo tar -xzf ${kernelpack} -C /mnt/ --strip-components=1 BPI-ROOT 
 +  #install kernel to boot-partition 
 +  sudo umount /mnt 
 +  sudo mount ${loopdev}p1 /mnt/ 
 +  sudo tar -xzf ${kernelpack} -C /mnt/ --strip-components=1 BPI-BOOT 
 +  #maybe create a uEnv.txt 
 +  sudo umount /mnt 
 + 
 +  sudo losetup -d ${loopdev} 
 +  #now write the image to card (make sure /dev/sdc is your sdcard-device and no partition is mounted) 
 +  sudo dd if=../​bpi-r2-buster.img of=/​dev/​sdc 
 +  sync 
 + 
 + 
 +==== Step-by-Step-Guide from "​ul90"​ ==== 
 + 
 +=== 1. download binary files: === 
 + 
 +[[https://​github.com/​BPI-SINOVOIP/​BPI-R2-bsp/​tree/​master/​mt-pack/​mtk/​bpi-r2/​bin|SD-Headers]] (old not supporting full uboot-size) 
 + 
 +=== 2. Create image file (8GB): ===
  
   dd if=/​dev/​zero bs=1M count=7296 | pv | dd of=bpir2.img   dd if=/​dev/​zero bs=1M count=7296 | pv | dd of=bpir2.img
  
-==== 3. Load image as virtual drive: ​====+=== 3. Load image as virtual drive: ===
  
   losetup /dev/loop8 bpir2.img   losetup /dev/loop8 bpir2.img
  
-==== 4. Make partitions and format: ​====+=== 4. Make partitions and format: ===
  
 <code bash> <code bash>
Line 38: Line 103:
 </​code>​ </​code>​
  
-==== 5. extended boot-headers ​====+=== 5. extended boot-headers ===
  
   * SDMMC_BOOT-signature + address of 2nd header 0x00000200 (before partition-table):​   * SDMMC_BOOT-signature + address of 2nd header 0x00000200 (before partition-table):​
Line 48: Line 113:
   gunzip -c BPI-R2-HEAD1-512b.img.gz | dd of=/​dev/​loop8 bs=512 seek=1   gunzip -c BPI-R2-HEAD1-512b.img.gz | dd of=/​dev/​loop8 bs=512 seek=1
  
-==== 6. Write preloader and u-boot bootloader: ​====+=== 6. Write preloader and u-boot bootloader: ===
  
   dd if=preloader_iotg7623Np1_sd_1600M.bin of=/​dev/​loop8 bs=1024 seek=2   dd if=preloader_iotg7623Np1_sd_1600M.bin of=/​dev/​loop8 bs=1024 seek=2
   dd if=u-boot.bin of=/​dev/​loop8 bs=1024 seek=320   dd if=u-boot.bin of=/​dev/​loop8 bs=1024 seek=320
   sync   sync
-==== 7. Copy rootfs + kernel ​====+=== 7. Copy rootfs + kernel ===
  
 create bootstraped rootfs create bootstraped rootfs
Line 63: Line 128:
  
 [[Kernel#​install_kernel|Kernel]] [[Kernel#​install_kernel|Kernel]]
-==== 8. Remove loop device: ​====+=== 8. Remove loop device: ===
  
   losetup -d /dev/loop8   losetup -d /dev/loop8
 +
 ===== MMC-Utils ===== ===== MMC-Utils =====
  
en/bpi-r2/storage.1547053495.txt.gz · Last modified: 2019/01/09 18:04 by 127.0.0.1