mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 13:16:41 +00:00
create_installstick: quote tests and some more variables
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
701aa86cd6
commit
ec843def64
@ -59,11 +59,11 @@ echo "#########################################################"
|
|||||||
# check MD5 sums
|
# check MD5 sums
|
||||||
echo "checking MD5 sum..."
|
echo "checking MD5 sum..."
|
||||||
md5sum -c target/KERNEL.md5
|
md5sum -c target/KERNEL.md5
|
||||||
MD5_ERROR=$?
|
MD5_ERROR="$?"
|
||||||
md5sum -c target/SYSTEM.md5
|
md5sum -c target/SYSTEM.md5
|
||||||
MD5_ERROR=$?
|
MD5_ERROR="$?"
|
||||||
|
|
||||||
if [ $MD5_ERROR = 1 ]; then
|
if [ "$MD5_ERROR" = "1" ]; then
|
||||||
echo "#########################################################"
|
echo "#########################################################"
|
||||||
echo "# #"
|
echo "# #"
|
||||||
echo "# OpenELEC.tv failed md5 check - Installation will quit #"
|
echo "# OpenELEC.tv failed md5 check - Installation will quit #"
|
||||||
@ -76,37 +76,37 @@ if [ $MD5_ERROR = 1 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# (TODO) umount anything
|
# (TODO) umount anything
|
||||||
umount $PART
|
umount "$PART"
|
||||||
|
|
||||||
# remove any partition on your drive
|
# remove any partition on your drive
|
||||||
echo "writing new disklabel on $DISK (remove any partition)..."
|
echo "writing new disklabel on $DISK (remove any partition)..."
|
||||||
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 one partition
|
||||||
echo "create an partition on $DISK..."
|
echo "create an 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 "make 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 partitiontable
|
||||||
echo "tell kernel we have a new partitiontable..."
|
echo "tell kernel we have a new partitiontable..."
|
||||||
partprobe $DISK
|
partprobe "$DISK"
|
||||||
|
|
||||||
# make filesystem
|
# make filesystem
|
||||||
echo "make filesystem on $PART..."
|
echo "make filesystem on $PART..."
|
||||||
mkfs.vfat $PART -n INSTALL
|
mkfs.vfat "$PART" -n INSTALL
|
||||||
|
|
||||||
# install syslinux
|
# install syslinux
|
||||||
echo "install syslinux to $PART..."
|
echo "install 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 to /tmp/usb_install..."
|
||||||
mkdir -p /tmp/usb_install
|
mkdir -p /tmp/usb_install
|
||||||
mount $PART /tmp/usb_install
|
mount "$PART" /tmp/usb_install
|
||||||
|
|
||||||
# copy files
|
# copy files
|
||||||
echo "copy files to $PART..."
|
echo "copy files to $PART..."
|
||||||
@ -122,10 +122,10 @@ fi
|
|||||||
|
|
||||||
# unmount partition
|
# unmount partition
|
||||||
echo "unmounting partition $PART..."
|
echo "unmounting partition $PART..."
|
||||||
umount $PART
|
umount "$PART"
|
||||||
|
|
||||||
# cleaning
|
# cleaning
|
||||||
echo "cleaning tempdir..."
|
echo "cleaning tempdir..."
|
||||||
rmdir /tmp/usb_install
|
rmdir /tmp/usb_install
|
||||||
|
|
||||||
echo "...ready"
|
echo "...ready"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user