Cosmetic fixes to the create_installstick script

Fix alignments, make sure all messages are correct, consistent and
precise enough to be well understood.
This commit is contained in:
Matthias Saou 2011-12-23 12:01:37 +01:00
parent f2f9eaadf5
commit 03c108f038

View File

@ -66,7 +66,7 @@ echo "#########################################################"
echo "# #" echo "# #"
echo "# OpenELEC.tv missing tool - Installation will quit #" echo "# OpenELEC.tv missing tool - Installation will quit #"
echo "# #" echo "# #"
echo "# We can't find the required tool \"syslinux\" #" echo "# We can't find the required tool \"syslinux\" #"
echo "# on your system. #" echo "# on your system. #"
echo "# Please install it via your package manager. #" echo "# Please install it via your package manager. #"
echo "# #" echo "# #"
@ -82,17 +82,17 @@ echo "#########################################################"
echo "# #" echo "# #"
echo "# OpenELEC.tv missing tool - Installation will quit #" echo "# OpenELEC.tv missing tool - Installation will quit #"
echo "# #" echo "# #"
echo "# We can't find the required tool \"mcopy\" #" echo "# We can't find the required tool \"mcopy\" #"
echo "# on your system. #" echo "# on your system. #"
echo "# Please install it via your package manager. #" echo "# Please install it via your package manager. #"
echo "# NOTE: Some distributions call this package #" echo "# NOTE: Some distributions call this package #"
echo "# \"mtools\". #" echo "# \"mtools\". #"
echo "# #" echo "# #"
echo "#########################################################" echo "#########################################################"
exit 1 exit 1
fi fi
# this is needed to partion the stick # this is needed to partion the drive
which parted > /dev/null which parted > /dev/null
if [ "$?" = "1" ]; then if [ "$?" = "1" ]; then
clear clear
@ -100,7 +100,7 @@ echo "#########################################################"
echo "# #" echo "# #"
echo "# OpenELEC.tv missing tool - Installation will quit #" echo "# OpenELEC.tv missing tool - Installation will quit #"
echo "# #" echo "# #"
echo "# We can't find the required tool \"parted\" #" echo "# We can't find the required tool \"parted\" #"
echo "# on your system. #" echo "# on your system. #"
echo "# Please install it via your package manager. #" echo "# Please install it via your package manager. #"
echo "# #" echo "# #"
@ -136,46 +136,46 @@ echo "#########################################################"
md5sumFailed md5sumFailed
fi fi
# (TODO) umount anything # (TODO) umount everything (if more than one partition)
umount "$PART" umount "$PART"
# remove any partition on your drive # remove all partitions from the drive
echo "writing new disklabel on $DISK (remove any partition)..." echo "writing new disklabel on $DISK (removing all partitions)..."
dd if=/dev/zero of="$DISK" bs=4096 count=1024 dd if=/dev/zero of="$DISK" bs=4096 count=1024
parted -s "$DISK" mklabel msdos parted -s "$DISK" mklabel msdos
# create one partition # create a single partition
echo "create an partition on $DISK..." echo "creating a partition on $DISK..."
parted -s "$DISK" unit cyl mkpart primary fat32 -- 0 -0 parted -s "$DISK" unit cyl mkpart primary fat32 -- 0 -0
# make partition active (bootable) # make partition active (bootable)
echo "make partition active..." echo "marking partition active..."
parted -s "$DISK" set 1 boot on parted -s "$DISK" set 1 boot on
# tell kernel we have a new partitiontable # tell kernel we have a new partition table
echo "tell kernel we have a new partitiontable..." echo "telling kernel we have a new partition table..."
partprobe "$DISK" partprobe "$DISK"
# make filesystem # create filesystem
echo "make filesystem on $PART..." echo "creating filesystem on $PART..."
mkfs.vfat "$PART" -n OpenELEC mkfs.vfat "$PART" -n OpenELEC
# install syslinux # install syslinux
echo "install syslinux to $PART..." echo "installing syslinux to $PART..."
syslinux -f "$PART" syslinux -f "$PART"
# mount partition # mount partition
echo "mounting partition $PART to /tmp/usb_install..." echo "mounting partition $PART on /tmp/usb_install..."
mkdir -p /tmp/usb_install mkdir -p /tmp/usb_install
mount "$PART" /tmp/usb_install mount "$PART" /tmp/usb_install
# find UUID # find UUID
echo -n "finding UUID from $PART ..." echo -n "finding partition UUID for $PART ..."
UUID=`blkid $PART -s UUID -o value` UUID=`blkid $PART -s UUID -o value`
echo "$UUID" echo "$UUID"
# create bootloader # create bootloader configuration
echo "create bootloader..." echo "creating bootloader configuration..."
echo "DEFAULT linux" > /tmp/usb_install/syslinux.cfg echo "DEFAULT linux" > /tmp/usb_install/syslinux.cfg
echo "PROMPT 0" >> /tmp/usb_install/syslinux.cfg echo "PROMPT 0" >> /tmp/usb_install/syslinux.cfg
@ -185,7 +185,7 @@ echo "#########################################################"
echo " APPEND boot=UUID=$UUID installer quiet" >> /tmp/usb_install/syslinux.cfg echo " APPEND boot=UUID=$UUID installer quiet" >> /tmp/usb_install/syslinux.cfg
# copy files # copy files
echo "copy files to $PART..." echo "copying files to $PART..."
cp target/KERNEL /tmp/usb_install cp target/KERNEL /tmp/usb_install
cp target/KERNEL.md5 /tmp/usb_install cp target/KERNEL.md5 /tmp/usb_install
cp target/SYSTEM /tmp/usb_install cp target/SYSTEM /tmp/usb_install
@ -197,7 +197,7 @@ echo "#########################################################"
cp README /tmp/usb_install cp README /tmp/usb_install
cp RELEASE /tmp/usb_install cp RELEASE /tmp/usb_install
# syncing disk # sync disk
echo "syncing disk..." echo "syncing disk..."
sync sync
@ -212,7 +212,7 @@ echo "#########################################################"
elif [ -f /usr/share/syslinux/mbr.bin ]; then elif [ -f /usr/share/syslinux/mbr.bin ]; then
MBR="/usr/share/syslinux/mbr.bin" # example: fedora MBR="/usr/share/syslinux/mbr.bin" # example: fedora
else else
echo "Can't find mbr.bin on Host OS" echo "Can't find syslinux's mbr.bin on Host OS"
fi fi
if [ -n "$MBR" ]; then if [ -n "$MBR" ]; then
@ -227,4 +227,4 @@ echo "#########################################################"
echo "cleaning tempdir..." echo "cleaning tempdir..."
rmdir /tmp/usb_install rmdir /tmp/usb_install
echo "...finished installation" echo "...installation finished"