Added support to install from sd cards, closes #90

This commit is contained in:
Hal Emmerich 2019-05-22 11:34:54 -05:00
parent 01368ff288
commit 96a817c86a

View File

@ -20,6 +20,17 @@
# along with PrawnOS. If not, see <https://www.gnu.org/licenses/>. # along with PrawnOS. If not, see <https://www.gnu.org/licenses/>.
RESOURCES=/InstallResources RESOURCES=/InstallResources
# Grab the boot device, which is either /dev/sda for usb or /dev/mmcblk0 for an sd card
# Grab the boot device, which is either /dev/sda for usb or /dev/mmcblk0 for an sd card
# Grab the boot device, which is either /dev/sda for usb or /dev/mmcblk0 for an sd card
# Grab the boot device, which is either /dev/sda for usb or /dev/mmcblk0 for an sd card
# Grab the boot device, which is either /dev/sda for usb or /dev/mmcblk0 for an sd card
# Grab the boot device, which is either /dev/sda for usb or /dev/mmcblk0 for an sd card
# Grab the boot device, which is either /dev/sda for usb or /dev/mmcblk0 for an sd card
# Grab the boot device, which is either /dev/sda for usb or /dev/mmcblk0 for an sd card
# Grab the boot device, which is either /dev/sda for usb or /dev/mmcblk0 for an sd card
BOOT_DEVICE=$(mount | head -n 1 | cut -d '2' -f 1)
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 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
echo echo
@ -53,7 +64,7 @@ then
fi fi
dmesg -E dmesg -E
echo Writing kernel partition echo Writing kernel partition
dd if=/dev/sda1 of=/dev/mmcblk2p1 dd if="$BOOT_DEVICE"1 of=/dev/mmcblk2p1
echo Writing Filesystem, this will take about 4 minutes... echo Writing Filesystem, this will take about 4 minutes...
mkfs.ext4 -F -b 1024 -m 0 -O ^has_journal /dev/mmcblk2p2 mkfs.ext4 -F -b 1024 -m 0 -O ^has_journal /dev/mmcblk2p2
mkdir -p /mnt/mmc/ mkdir -p /mnt/mmc/