summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2014-10-05 10:44:01 +0200
committerPaul Kocialkowski <contact@paulk.fr>2014-10-05 10:45:23 +0200
commit0848590d8b740e312d69b4174bbd35dea6615cb0 (patch)
tree8a8e26592f615de389646938b70ecbe01c00a54b
parenta9b51345a5418d293f48bf206be841d0b66ee1e8 (diff)
downloaddevice_goldelico_gta04-0848590d8b740e312d69b4174bbd35dea6615cb0.zip
device_goldelico_gta04-0848590d8b740e312d69b4174bbd35dea6615cb0.tar.gz
device_goldelico_gta04-0848590d8b740e312d69b4174bbd35dea6615cb0.tar.bz2
replicant_gta04_install.sh: Partition size comments and various fixesHEADreplicant-4.2-0004replicant-4.2-0003replicant-4.2
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rwxr-xr-xreplicant_gta04_install.sh29
1 files changed, 16 insertions, 13 deletions
diff --git a/replicant_gta04_install.sh b/replicant_gta04_install.sh
index 278058f..ed29c73 100755
--- a/replicant_gta04_install.sh
+++ b/replicant_gta04_install.sh
@@ -2,20 +2,20 @@
# Replicant GTA04 installer
#
-# Copyright (C) 2012-2014 Paul Kocialkowski, GPLv2
-#
-# Based on mkcard.sh v0.5
-# Copyright (C) 2009 Graeme Gregory <dp@xora.org.uk>, GPLv2
-# Parts of the procudure base on the work of Denys Dmytriyenko
-# http://wiki.omap.com/index.php/MMC_Boot_Format
+# Copyright (C) 2012-2014 Paul Kocialkowski <contact@paulk.fr>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
+# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Environment
@@ -205,6 +205,8 @@ setup_drive_rescue() {
if [ -f ".drive_start_backup" ]
then
echo -n "Something went wrong, do you want to restore drive start backup? [Y/N] "
+ read confirm
+
if [ "$confirm" = "y" ] || [ "$confirm" = "Y" ]
then
dd if=".drive_start_backup" of="$DRIVE" bs=1024 count=1024
@@ -214,13 +216,14 @@ setup_drive_rescue() {
setup_drive_infos() {
DRIVE_SIZE=$( fdisk -l "$DRIVE" | grep Disk | grep bytes | awk '{print $5}' )
- DRIVE_CYLINDERS=$( echo "$DRIVE_SIZE/255/63/512" | bc )
+ # 255 heads, 63 sectors, 512 bytes/sectors
+ DRIVE_CYLINDERS=$( echo "$DRIVE_SIZE / 255 / 63 / 512" | bc )
}
setup_drive_partition() {
- boot_size=$( echo "(50 * 1024 * 1024) / ($DRIVE_SIZE/$DRIVE_CYLINDERS)" | bc )
- system_size=$( echo "(350 * 1024 * 1024) / ($DRIVE_SIZE/$DRIVE_CYLINDERS)" | bc )
- cache_size=$( echo "(100 * 1024 * 1024) / ($DRIVE_SIZE/$DRIVE_CYLINDERS)" | bc )
+ boot_size=$( echo "(50 * 1024 * 1024 * $DRIVE_CYLINDERS) / $DRIVE_SIZE" | bc )
+ system_size=$( echo "(350 * 1024 * 1024 * $DRIVE_CYLINDERS) / $DRIVE_SIZE" | bc )
+ cache_size=$( echo "(100 * 1024 * 1024 * $DRIVE_CYLINDERS) / $DRIVE_SIZE" | bc )
{
echo ",$boot_size,c,*"
@@ -230,7 +233,7 @@ setup_drive_partition() {
} | sfdisk -D -H 255 -S 63 -C "$DRIVE_CYLINDERS" "$DRIVE"
if [ $? != 0 ]
then
- drive_rescue
+ setup_drive_rescue
exit 1
fi