More simplifications
Submitted by: Alex Kozlov
This commit is contained in:
parent
f1bed22437
commit
56f8b30888
@ -26,25 +26,16 @@
|
||||
# $FreeBSD$
|
||||
|
||||
# Query a disk for partitions and display them
|
||||
#############################
|
||||
#############################################################################
|
||||
|
||||
. ${PROGDIR}/backend/functions.sh
|
||||
. ${PROGDIR}/backend/functions-disk.sh
|
||||
|
||||
if [ -z "${1}" ]
|
||||
then
|
||||
echo "Error: No disk specified!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -e "/dev/${1}" ]
|
||||
then
|
||||
echo "Error: Disk /dev/${1} does not exist!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DISK="${1}"
|
||||
|
||||
[ -z "${DISK}" ] && { echo 'Error: No disk specified!'; exit 1; }
|
||||
[ ! -e "/dev/${DISK}" ] && \
|
||||
{ echo "Error: Disk /dev/${DISK} does not exist!"; exit 1; }
|
||||
|
||||
get_disk_cyl "${DISK}"
|
||||
CYLS="${VAL}"
|
||||
|
||||
|
@ -28,13 +28,6 @@
|
||||
# Script which checks if we are running from install media, or real system
|
||||
#############################################################################
|
||||
|
||||
dmesg | grep "md0: Preloaded image" >/dev/null 2>/dev/null
|
||||
if [ "$?" = "0" ]
|
||||
then
|
||||
echo "INSTALL-MEDIA"
|
||||
exit 0
|
||||
else
|
||||
echo "REAL-DISK"
|
||||
exit 1
|
||||
fi
|
||||
dmesg | grep -q 'md0: Preloaded image' || { echo 'REAL-DISK'; exit 1; }
|
||||
|
||||
echo 'INSTALL-MEDIA'
|
||||
|
Loading…
Reference in New Issue
Block a user