InstallToInternal.sh 860 B

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. #Install PrawnOS to the internal emmc, this will partition the internal emmc
  3. #and erase ALL data on it
  4. RESOURCES=/InstallResources
  5. read -p "This will ERASE ALL DATA ON THE INTERNAL STORAGE (EMMC) and reboot when finished, do you want to continue? [Y/n]" -n 1 -r
  6. echo
  7. if [[ $REPLY =~ ^[Yy]$ ]]
  8. then
  9. echo Writing partition map
  10. sfdisk /dev/mmcblk2 < $RESOURCES/mmc.partmap
  11. echo Writing kernel partition
  12. dd if=/dev/sda1 of=/dev/mmcblk2p1
  13. echo Writing Filesystem, this will take a moment...
  14. #Set the post install script to run after reboot
  15. ./$RESOURCES/runonce.sh $RESOURCES/InstallPackages.sh
  16. dd if=/dev/sda2 of=/dev/mmcblk2p2 bs=50M
  17. echo Expanding Filesystem
  18. e2fsck -p /dev/mmcblk2p2
  19. resize2fs /dev/mmcblk2p2
  20. echo Rebooting... Please remove the usb drive once shutdown is complete
  21. fi
  22. echo Exiting