View: 9926|Reply: 32

Boot.scr problems on Orange Pi PC

[Copy link]

2

threads

4

posts

34

credits

Novice

Rank: 1

credits
34
Published in 2016-10-8 02:25:40 | Show all floors |Read mode
Hello everyone,
at the moment i am working on my Orange Pi PC. To compile mainline kernel + uboot(using latest linaro toolchain) is not a problem for me even not to write the bootloader. But i have a big problem to write the boot.scr for my zImage on a two partition sd card (16mb fat for kernel and dtb + rest ext4 for rootfs). I can nowhere find a working boot.cmd for my configuration and there is no proper documentation to write it for my self. To bring it to the point: Could someone help me create a working boot.scr?
Here are the contents of my scripts to build kernel + uboot + writing sd card (ill spare you the content of my boot.cmd because i triend near 20 variations) :

Script to build uboot + mainline kernel:
  1. #!/bin/sh

  2. masterfolder=/builder
  3. finalfolder=/final
  4. mountdir=/mnt/rootfs

  5. export ARCH=arm
  6. export PATH="$PATH":$masterfolder/toolchain/bin/
  7. export CROSS_COMPILE=arm-linux-gnueabihf-

  8. mkdir $finalfolder

  9. ##GettingUboot##
  10. cd $masterfolder
  11. git clone git://git.denx.de/u-boot.git mainline-uboot
  12. cd $masterfolder/mainline-uboot
  13. make CROSS_COMPILE=arm-linux-gnueabihf- orangepi_pc_defconfig
  14. #make CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
  15. make CROSS_COMPILE=arm-linux-gnueabihf-
  16. cp $masterfolder/mainline-uboot/u-boot-sunxi-with-spl.bin $finalfolder/u-boot-sunxi-with-spl.bin
  17. rm -rf $masterfolder/mainline-uboot

  18. ##Build Mainline Kernel##
  19. mkdir $finalfolder/output
  20. cd $masterfolder
  21. cp -r mainline-kernel kernelwork
  22. cd kernelwork
  23. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- sunxi_defconfig
  24. #make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
  25. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage dtbs modules
  26. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=$finalfolder/output modules_install
  27. cp $masterfolder/kernelwork/arch/arm/boot/dts/sun8i-h3-orangepi-pc.dtb $finalfolder/sun8i-h3-orangepi-pc.dtb
  28. cp $masterfolder/kernelwork/arch/arm/boot/zImage $finalfolder/zImage
  29. cd $masterfolder
  30. #rm -rf kernelwork
Copy code

Script to make Sd Card (partitions + downloading Archlinux)
  1. #!/bin/sh

  2. masterfolder=/builder
  3. finalfolder=/final
  4. sdcard=/dev/sdg
  5. mountdir=/mnt/rootfs
  6. mountdir2=/mnt/rootfs2

  7. umount $sdcard
  8. umount "$sdcard"1
  9. umount "$sdcard"2
  10. umount "$sdcard"3
  11. umount "$sdcard"4

  12. sleep 10s

  13. ##Delete MBR##
  14. dd if=/dev/zero of=$sdcard bs=1M count=8
  15. ##############

  16. sleep 2s

  17. ##Getting boot.scr##
  18. mkimage -A arm -O linux -T script -C none -n "U-Boot boot script" -d $masterfolder/boot1.txt $finalfolder/boot.scr
  19. ####################

  20. ##Build partitions##
  21. sfdisk -R $sdcard
  22. cat <<EOT | sfdisk --in-order -L -uM $sdcard
  23. 1,16,c
  24. ,,L
  25. EOT
  26. mkfs.vfat "$sdcard"1
  27. mkfs.ext4 "$sdcard"2
  28. ###################

  29. ##Mount##
  30. mkdir $mountdir
  31. mkdir $mountdir2
  32. mount "$sdcard"1 -t vfat $mountdir
  33. mount "$sdcard"2 $mountdir2
  34. #########

  35. ##Load and unpack rootfs##
  36. cd $masterfolder
  37. #wget http://archlinuxarm.org/os/ArchLinuxARM-armv7-latest.tar.gz
  38. bsdtar -xpf $masterfolder/ArchLinuxARM-armv7-latest.tar.gz -C $mountdir2
  39. sync
  40. #rm ArchLinuxARM-armv7-latest.tar.gz
  41. ##########################

  42. #RemoveBullshit#
  43. rm -rf $mountdir/boot
  44. mkdir $mountdir/boot
  45. mkdir $mountdir/boot/dtbs
  46. rm -rf "$mountdir"2/boot
  47. rm -rf "$mountdir"2/lib/modules
  48. mkdir "$mountdir"2/lib/modules
  49. ################

  50. ##Copying files##
  51. cp $finalfolder/boot.scr $mountdir/boot
  52. cp $finalfolder/zImage $mountdir/boot
  53. cp $finalfolder/sun8i-h3-orangepi-pc.dtb $mountdir/boot/dtbs/sun8i-h3-orangepi-pc.dtb
  54. cp -r $finalfolder/output/lib/modules "$mountdir2"/lib
  55. sync
  56. #################

  57. ##Unmount##
  58. umount $mountdir
  59. umount $mountdir2
  60. rm -rf $mountdir
  61. rm -rf $mountdir2
  62. #rm -rf $finaldir
  63. ###########

  64. ##Write uboot###
  65. dd if=$finalfolder/u-boot-sunxi-with-spl.bin of=$sdcard bs=1024 seek=8
  66. ###############
Copy code

Maybe you can help.  I am very Gratefull for every kind of help.
Greetings exoid

2

threads

4

posts

34

credits

Novice

Rank: 1

credits
34
 Author| Published in 2016-10-8 18:58:46 | Show all floors
After a longer searh ifound the "mainline uboot" site in the sunxi wiki. The boot.cmd works for me with one and two partitions. If someody have the same problem just write.

0

threads

5

posts

18

credits

Novice

Rank: 1

credits
18
Published in 2023-5-23 11:21:10 | Show all floors
The kernel will be loaded from the FAT partition, and the Mini Crossword root file system will be mounted from the ext4 partition.

0

threads

332

posts

914

credits

Senior member

Rank: 4

credits
914
Published in 2023-12-12 03:04:07 | Show all floors
백링크하이 exceeded my expectations. Increased organic traffic and higher revenue!

0

threads

332

posts

914

credits

Senior member

Rank: 4

credits
914
Published in 2023-12-13 19:13:41 | Show all floors
Nothing beats the privacy and convenience of a home 출장샵 session. It's a game-changer for relaxation enthusiasts!

0

threads

332

posts

914

credits

Senior member

Rank: 4

credits
914
Published in 2023-12-17 22:08:17 | Show all floors
Relaxation redefined with 인천출장마사지. Enjoy personalized massages without leaving your chosen location. Say yes to convenience and well-being.

0

threads

332

posts

914

credits

Senior member

Rank: 4

credits
914
Published in 2023-12-25 22:10:39 | Show all floors
The simplicity of무료스포츠중계is its charm. No complicated setup – just click and watch.

0

threads

332

posts

914

credits

Senior member

Rank: 4

credits
914
Published in 2024-1-7 15:26:36 | Show all floors
I've never encountered downtime issues with 누누티비 - it's reliable.
Published in 2024-1-10 19:35:47 | Show all floors
I like to recommend every subject material. It is often excellent to clear up you are going to demonstrate around thoughts out of mid but also image quality making use of this priceless subject material is rather easily accepted.        đăng ký v7sb
Published in 2024-1-12 00:00:33 | Show all floors
iCloud est utilisé à diverses fins, notamment la synchronisation des signets, de l'historique et des onglets ouverts sur vos appareils Apple exécutant Safari. Cette synchronisation vous permet de basculer en toute transparence entre votre iPhone, iPad, Mac et autres appareils Apple tout en conservant une expérience de navigation cohérente.        hebergement web cote d'ivoire
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list