Skip to content

Commit

Permalink
Remove need to reboot between installation and package installation
Browse files Browse the repository at this point in the history
  • Loading branch information
SolidHal committed Oct 30, 2019
1 parent 716306e commit 46ec1d2
Showing 1 changed file with 38 additions and 5 deletions.
43 changes: 38 additions & 5 deletions scripts/InstallScripts/InstallPrawnOS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,22 @@ install() {

echo Writing Filesystem, this will take about 4 minutes...
mkfs.ext4 -F -b 1024 $ROOT_PARTITION
mkdir -p /mnt/mmc/
mount $ROOT_PARTITION /mnt/mmc
rsync -ah --info=progress2 --info=name0 --numeric-ids -x / /mnt/mmc/
INSTALL_MOUNT=/mnt/install_mount
mkdir -p $INSTALL_MOUNT/
mount $ROOT_PARTITION $INSTALL_MOUNT/
rsync -ah --info=progress2 --info=name0 --numeric-ids -x / $INSTALL_MOUNT/
#Remove the live-fstab and install a base fstab
rm /mnt/mmc/etc/fstab
echo "${ROOT_PARTITION} / ext4 defaults,noatime 0 1" > /mnt/mmc/etc/fstab
rm $INSTALL_MOUNT/etc/fstab
echo "${ROOT_PARTITION} / ext4 defaults,noatime 0 1" > $INSTALL_MOUNT/etc/fstab

while true; do
read -p "Install a desktop environment and the supporting packages? [Y/n]" ins
case $ins in
[Yy]* ) install_packages $INSTALL_MOUNT; break;;
[Nn]* ) break;;
* ) echo "Please answer y or n";;
esac
done
umount $ROOT_PARTITION
echo Running fsck
e2fsck -p -f $ROOT_PARTITION
Expand Down Expand Up @@ -250,6 +260,29 @@ expand() {
#Force the filesystem to fill the new partition
resize2fs -f ${BOOT_DEVICE}2
echo "/dev/${BOOT_DEVICE}2 / ext4 defaults,noatime 0 1" > /etc/fstab
while true; do
read -p "Install a desktop environment and the supporting packages? [Y/n]" ins
case $ins in
[Yy]* ) /InstallResources/InstallPackages.sh; break;;
[Nn]* ) exit;;
* ) echo "Please answer y or n";;
esac
done


}

#Install all packages, desktop environment to target device
install_packages() {
TARGET_MOUNT=$1
echo "Installing Packages"
mount -t proc proc $TARGET_MOUNT/proc/
mount --rbind /sys $TARGET_MOUNT/sys/
mount --rbind /dev $TARGET_MOUNT/dev/
chroot $TARGET_MOUNT/ ./InstallResources/InstallPackages.sh
umount $TARGET_MOUNT/proc/
umount $TARGET_MOUNT/sys/
umount $TARGET_MOUNT/dev/

}

Expand Down

0 comments on commit 46ec1d2

Please sign in to comment.