remakesd

Change of makesd-partition-table

7:4135f638972c
makesd-partition-table
     1.1 --- a/makesd-partition-table	Fri May 24 23:17:38 2019 +0200
     1.2 +++ b/makesd-partition-table	Sat May 25 01:19:21 2019 +0200
     1.3 @@ -6,8 +6,11 @@
     1.4  PROGNAME=`basename "$0"`
     1.5  THISDIR=`dirname "$0"`
     1.6  
     1.7 +COMMON="$THISDIR/makesd-common"
     1.8  SFDISK="/sbin/sfdisk"
     1.9  
    1.10 +. "$COMMON"
    1.11 +
    1.12  
    1.13  
    1.14  # Cylinder size in sectors for alignment purposes.
    1.15 @@ -119,10 +122,10 @@
    1.16  partition_type()
    1.17  {
    1.18      case "$1" in
    1.19 -        ( ext[2-4]? ) echo "0x83" ;;
    1.20 -        ( swap      ) echo "0x82" ;;
    1.21 -        ( fat       ) echo "0x0c" ;;
    1.22 -        ( *         ) echo "0x83" ;;
    1.23 +        ( ext* ) echo "0x83" ;;
    1.24 +        ( swap ) echo "0x82" ;;
    1.25 +        ( fat  ) echo "0x0c" ;;
    1.26 +        ( *    ) echo "0x83" ;;
    1.27      esac
    1.28  }
    1.29  
    1.30 @@ -175,19 +178,6 @@
    1.31  
    1.32  
    1.33  
    1.34 -# Process the arguments, building a partition description.
    1.35 -
    1.36 -read_fields()
    1.37 -{
    1.38 -    OLDIFS=$IFS
    1.39 -    IFS=`echo -n '\t'` read START SIZE TYPE
    1.40 -    STATUS=$?
    1.41 -    IFS=$OLDIFS
    1.42 -    return $STATUS
    1.43 -}
    1.44 -
    1.45 -
    1.46 -
    1.47  # Emit the help message if requested.
    1.48  
    1.49  if [ "$1" = '--help' ] ; then
    1.50 @@ -224,19 +214,7 @@
    1.51  
    1.52  # Obtain details of the selected device.
    1.53  
    1.54 -if [ ! "$DEV" ] ; then
    1.55 -    cat 1>&2 <<EOF
    1.56 -No device specified. Use the DEV environment variable to indicate a device.
    1.57 -EOF
    1.58 -    exit 1
    1.59 -fi
    1.60 -
    1.61 -if [ ! -e "$DEV" ] ; then
    1.62 -    cat 1>&2 <<EOF
    1.63 -Device not found: $DEV
    1.64 -EOF
    1.65 -    exit 1
    1.66 -fi
    1.67 +check_device
    1.68  
    1.69  # Initialise sfdisk usage.
    1.70