InstallToInternal.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/bash
  2. #Install PrawnOS to the internal emmc, this will partition the internal emmc
  3. #and erase ALL data on it
  4. # This file is part of PrawnOS (http://www.prawnos.com)
  5. # Copyright (c) 2018 Hal Emmerich <hal@halemmerich.com>
  6. # PrawnOS is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License version 2
  8. # as published by the Free Software Foundation.
  9. # PrawnOS is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. # You should have received a copy of the GNU General Public License
  14. # along with PrawnOS. If not, see <https://www.gnu.org/licenses/>.
  15. RESOURCES=/InstallResources
  16. 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
  17. echo
  18. if [[ $REPLY =~ ^[Yy]$ ]]
  19. then
  20. echo Writing partition map
  21. sfdisk /dev/mmcblk2 < $RESOURCES/mmc.partmap
  22. echo Writing kernel partition
  23. dd if=/dev/sda1 of=/dev/mmcblk2p1
  24. echo Writing Filesystem, this will take about 4 minutes...
  25. dd if=/dev/sda2 of=/dev/mmcblk2p2 bs=50M
  26. echo Expanding Filesystem
  27. e2fsck -p -f /dev/mmcblk2p2
  28. resize2fs /dev/mmcblk2p2
  29. echo Rebooting... Please remove the usb drive once shutdown is complete
  30. reboot
  31. fi
  32. echo Exiting