code.fastix.org

Dateiansicht:

Datei:Projekte -> Linux:ubuntu-for-raspberry-installer -> rpi2-create-mmcblk0.sh
md5:8ed4506fa30627793ad4cfb85d9a11fa
sha1:b2ac0f0b756606d7a5689e710be127e53378e83e
Download-Link:Download
  1. #!/usr/bin/sudo /bin/sh
  2.  
  3. set -x
  4.  
  5. if [ -z "$BUILD_HOSTNAME" ]; then
  6. . ./rpi2-settings.sh
  7. fi
  8.  
  9. umount ${INSTALL_DEVICE}p*
  10.  
  11. cat rpi2-create-fdisk-keys_with_swap | fdisk "${INSTALL_DEVICE}"
  12.  
  13. partprobe -s "${INSTALL_DEVICE}"
  14.  
  15. umount "${INSTALL_DEVICE}p1"
  16. mkfs.vfat "${INSTALL_DEVICE}p1"
  17. swapoff "${INSTALL_DEVICE}p2"
  18. mkswap    "${INSTALL_DEVICE}p2"
  19. umount "${INSTALL_DEVICE}p3"
  20. resize2fs "${INSTALL_DEVICE}p3"
  21. mkfs.ext4 "${INSTALL_DEVICE}p3"
  22.  
  23.  
  24. MOUNTDIR="$BUILDDIR/mount"
  25. mkdir -p "${MOUNTDIR}"
  26. mount "${INSTALL_DEVICE}p3" "${MOUNTDIR}"
  27. mkdir -p "${MOUNTDIR}/boot/firmware"
  28. mount "${INSTALL_DEVICE}p1" "${MOUNTDIR}/boot/firmware"
  29. rsync -a "${R}/" "${MOUNTDIR}/" 2> /dev/null
  30.  
  31. # Entladen der Mounts:
  32. sync
  33. umount "${MOUNTDIR}/boot/firmware"
  34. umount "${MOUNTDIR}"
  35.  
  36.