[Lunar-commits] <lunar-iso> Re-indented the whole installer, no code changes!

Stefan Wold ratler at lunar-linux.org
Mon Nov 18 20:27:31 CET 2013


commit e4ee756e6b26fe450459ccfb3a04a90433583123
Author: Stefan Wold <ratler at lunar-linux.org>
Date: Mon, 18 Nov 2013 11:26:51 -0800
URL: https://github.com/lunar-linux/lunar-iso/commit/e4ee756e6b26fe450459ccfb3a04a90433583123

Re-indented the whole installer, no code changes!
---
  lunar-install/sbin/lunar-install | +1385/-1385
  1 file changed, 1385 insertions(+), 1385 deletions(-)

--- a/lunar-install/sbin/lunar-install
+++ b/lunar-install/sbin/lunar-install
@@ -23,1132 +23,1132 @@ MOTD_FILE=/usr/share/lunar-install/motd
 
 pkg_avail()
 {
-	grep -q "^$1:" $PACKAGES_LIST
+  grep -q "^$1:" $PACKAGES_LIST
 }
 
 
 msgbox()
 {
-	LINES=$(( ${#1} / 55 + 7 ))
-	$DIALOG --cr-wrap --msgbox "$1" $LINES 60
+  LINES=$(( ${#1} / 55 + 7 ))
+  $DIALOG --cr-wrap --msgbox "$1" $LINES 60
 }
 
 
 inputbox()
 {
-	$DIALOG --nocancel --inputbox "$1" 0 0 "$2"
+  $DIALOG --nocancel --inputbox "$1" 0 0 "$2"
 }
 
 
 confirm()
 {
-	if [ "$CONFIRM" == "off" ]; then
-		if [ -n "$2" ]; then
-			false
-		else
-			true
-		fi
-	else
-		$DIALOG $2 --yesno "$1" 9 60
-	fi
+  if [ "$CONFIRM" == "off" ]; then
+    if [ -n "$2" ]; then
+      false
+    else
+      true
+    fi
+  else
+    $DIALOG $2 --yesno "$1" 9 60
+  fi
 }
 
 
 chroot_run()
 {
-	local RESULT
-	mount --bind /proc $TARGET/proc
-	mount --bind /dev $TARGET/dev
-	mount --bind /tmp $TARGET/tmp
-	mount --bind /sys $TARGET/sys
-	mount --bind /run $TARGET/run
-	if [ -n "$USE_SWAP" ]; then
-		chroot $TARGET swapon -a
-	fi
-	if [ -n "$USE_CLEAR" ]; then
-	    clear
-	fi
-	chroot $TARGET "$@"
-	RESULT=$?
-	if [ -n "$USE_SWAP" ]; then
-		chroot $TARGET swapoff -a
-	fi
-	umount $TARGET/run
-	umount $TARGET/sys
-	umount $TARGET/tmp
-	umount $TARGET/dev
-	umount $TARGET/proc
-
-	# debug the problem in case there is one
-	if [ $RESULT == 1 ] ; then
-	  (
-		echo ""
-		echo "ERROR: An error occurred while executing a command. The command was:"
-		echo "ERROR: \"$@\""
-		echo "ERROR: "
-		echo "ERROR: You should inspect any output above and retry the command with"
-		echo "ERROR: different input or parameters. Please report the problem if"
-		echo "ERROR: you think this error is displayed by mistake."
-		echo ""
-		echo "Press ENTER to continue"
-		read JUNK
-	  ) >&2
-	fi
-	return $RESULT
+  local RESULT
+  mount --bind /proc $TARGET/proc
+  mount --bind /dev $TARGET/dev
+  mount --bind /tmp $TARGET/tmp
+  mount --bind /sys $TARGET/sys
+  mount --bind /run $TARGET/run
+  if [ -n "$USE_SWAP" ]; then
+    chroot $TARGET swapon -a
+  fi
+  if [ -n "$USE_CLEAR" ]; then
+      clear
+  fi
+  chroot $TARGET "$@"
+  RESULT=$?
+  if [ -n "$USE_SWAP" ]; then
+    chroot $TARGET swapoff -a
+  fi
+  umount $TARGET/run
+  umount $TARGET/sys
+  umount $TARGET/tmp
+  umount $TARGET/dev
+  umount $TARGET/proc
+
+  # debug the problem in case there is one
+  if [ $RESULT == 1 ] ; then
+    (
+    echo ""
+    echo "ERROR: An error occurred while executing a command. The command was:"
+    echo "ERROR: \"$@\""
+    echo "ERROR: "
+    echo "ERROR: You should inspect any output above and retry the command with"
+    echo "ERROR: different input or parameters. Please report the problem if"
+    echo "ERROR: you think this error is displayed by mistake."
+    echo ""
+    echo "Press ENTER to continue"
+    read JUNK
+    ) >&2
+  fi
+  return $RESULT
 }
 
 
 goodbye()
 {
-	PROMPT="Reboot now?"
-	if confirm "$PROMPT" "--defaultno"; then
-		kill `jobs -p` &> /dev/null
-		shutdown -r now
-		exit 0
-	else
-		# bump the init level so we can exit safely!
-		systemctl isolate multi-user.target
-		exit 0
-	fi
+  PROMPT="Reboot now?"
+  if confirm "$PROMPT" "--defaultno"; then
+    kill `jobs -p` &> /dev/null
+    shutdown -r now
+    exit 0
+  else
+    # bump the init level so we can exit safely!
+    systemctl isolate multi-user.target
+    exit 0
+  fi
 }
 
 
 introduction()
 {
-	$DIALOG --textbox /README 0 0
-	I_OK="\\Z2"
-	if (( STEP == 1 )); then
-		(( STEP++ ))
-	fi
-	DEFAULT=C
+  $DIALOG --textbox /README 0 0
+  I_OK="\\Z2"
+  if (( STEP == 1 )); then
+    (( STEP++ ))
+  fi
+  DEFAULT=C
 }
 
 
 show_modules()
 {
-	if [ "$(pwd)" != "/lib/modules" ]; then
-		echo ".."
-		echo "Directory"
-	fi
-	for ITEM in *; do
-		case $ITEM in
-			modules.*) continue ;;
-		esac
-		/bin/echo "$ITEM"
-		if [ -d "$ITEM" ]; then
-			/bin/echo "Directory"
-		else
-			/bin/echo "Module"
-		fi
-	done
+  if [ "$(pwd)" != "/lib/modules" ]; then
+    echo ".."
+    echo "Directory"
+  fi
+  for ITEM in *; do
+    case $ITEM in
+      modules.*) continue ;;
+    esac
+    /bin/echo "$ITEM"
+    if [ -d "$ITEM" ]; then
+      /bin/echo "Directory"
+    else
+      /bin/echo "Module"
+    fi
+  done
 }
 
 
 load_module()
 {
   (
-	MODULES_ROOT="/lib/modules"
-	cd $MODULES_ROOT/$(uname -r)/kernel/drivers
-	TITLE="Module Menu"
-	HELP="Select a module to load or enter a subdirectory (pwd = $(pwd))"
-	CHOICE=""
-
-	while true; do
-		MODULES=$(show_modules $(pwd))
-		CHOICE=$($DIALOG --title "$TITLE" --cancel-label "Exit" --menu "$HELP" 0 0 0 $MODULES)
-		if [ $? != 0 ]; then
-			return
-		fi
-		if [ -f "$CHOICE" ]; then
-			MODULE=$(basename $CHOICE | sed "s/\.o$//;s/\.ko$//")
-			PARAMETERS=$(inputbox "Enter module parameters (optional)") &&
-			modprobe $MODULE $PARAMETERS
-			sleep 1
-			if ! grep -qw $MODULE /proc/modules ; then
-				msgbox "The module failed to load!"
-			else
-				block_devices init
-			fi
-		elif [ -d "$CHOICE" ]; then
-			cd "$CHOICE"
-		fi
-	done
+  MODULES_ROOT="/lib/modules"
+  cd $MODULES_ROOT/$(uname -r)/kernel/drivers
+  TITLE="Module Menu"
+  HELP="Select a module to load or enter a subdirectory (pwd = $(pwd))"
+  CHOICE=""
+
+  while true; do
+    MODULES=$(show_modules $(pwd))
+    CHOICE=$($DIALOG --title "$TITLE" --cancel-label "Exit" --menu "$HELP" 0 0 0 $MODULES)
+    if [ $? != 0 ]; then
+      return
+    fi
+    if [ -f "$CHOICE" ]; then
+      MODULE=$(basename $CHOICE | sed "s/\.o$//;s/\.ko$//")
+      PARAMETERS=$(inputbox "Enter module parameters (optional)") &&
+      modprobe $MODULE $PARAMETERS
+      sleep 1
+      if ! grep -qw $MODULE /proc/modules ; then
+        msgbox "The module failed to load!"
+      else
+        block_devices init
+      fi
+    elif [ -d "$CHOICE" ]; then
+      cd "$CHOICE"
+    fi
+  done
   )
 }
 
 
 nice_size()
 {
-	echo $1 | sed -e 's/\(.*[0-9]\)\([0-9]\)\([0-9]\)\([0-9]$\)/\1.\2KB/' -e 's/\(.*[0-9]\)\([0-9]\)\([0-9]\)\([0-9]\)\(\.[0-9]KB$\)/\1.\2MB/' -e 's/\(.*[0-9]\)\([0-9]\)\([0-9]\)\([0-9]\)\(\.[0-9]MB$\)/\1.\2GB/'
+  echo $1 | sed -e 's/\(.*[0-9]\)\([0-9]\)\([0-9]\)\([0-9]$\)/\1.\2KB/' -e 's/\(.*[0-9]\)\([0-9]\)\([0-9]\)\([0-9]\)\(\.[0-9]KB$\)/\1.\2MB/' -e 's/\(.*[0-9]\)\([0-9]\)\([0-9]\)\([0-9]\)\(\.[0-9]MB$\)/\1.\2GB/'
 }
 
 
 block_devices()
 {
-	local N DEVICE
-	# superfunction to maintain, list, edit partitions and discs
-	case $1 in
-		init)
-			# do we really need to re-do this? it's slow...
-			if [ "$(md5sum /proc/partitions)" != "$PROC_PARTITIONS_MD5" ]; then
-				# remove all old disc/part devices
-				unset DEVICES
-				# fill the list with devices
-				for DEVICE in $(list_block_devices); do
-					block_devices add $DEVICE
-				done
-				# and store the checsum for later
-				PROC_PARTITIONS_MD5="$(md5sum /proc/partitions)"
-			fi
-			;;
-		add)
-			DEVICES=( ${DEVICES[@]} $2 )
-			# add a device to the list
-			;;
-		use)
-			# tag a device as used
-			for (( N=0; N<${#DEVICES[@]} ; N++ )); do
-				if [ "$2" == "$(echo ${DEVICES[$N]} | cut -d: -f1)" ]; then
-					DEVICES[$N]="$(echo ${DEVICES[$N]} | cut -d: -f1,2):used"
-				fi
-			done
-			;;
-		free)
-			# untag a previously used device as used
-			for (( N=0; N<${#DEVICES[@]} ; N++ )); do
-				if [ "$2" == "$(echo ${DEVICES[$N]} | cut -d: -f1)" ]; then
-					DEVICES[$N]="$(echo ${DEVICES[$N]} | cut -d: -f1,2)"
-				fi
-			done
-			;;
-		list)
-			# list all unused devices of type $2
-			for (( N=0; N<${#DEVICES[@]} ; N++ )); do
-				if [ "$2" == "$(echo ${DEVICES[$N]} | cut -d: -f2)" ] &&
-						[ -z "$(echo ${DEVICES[$N]} | cut -d: -f3)" ]; then
-					echo ${DEVICES[$N]} | cut -d: -f1
-				fi
-			done
-			;;
-		listall)
-			# list all devices of type $2
-			for (( N=0; N<${#DEVICES[@]} ; N++ )); do
-				if [ "$2" == "$(echo ${DEVICES[$N]} | cut -d: -f2)" ]; then
-					echo ${DEVICES[$N]} | cut -d: -f1
-				fi
-			done
-			;;
-	esac
+  local N DEVICE
+  # superfunction to maintain, list, edit partitions and discs
+  case $1 in
+    init)
+      # do we really need to re-do this? it's slow...
+      if [ "$(md5sum /proc/partitions)" != "$PROC_PARTITIONS_MD5" ]; then
+        # remove all old disc/part devices
+        unset DEVICES
+        # fill the list with devices
+        for DEVICE in $(list_block_devices); do
+          block_devices add $DEVICE
+        done
+        # and store the checsum for later
+        PROC_PARTITIONS_MD5="$(md5sum /proc/partitions)"
+      fi
+      ;;
+    add)
+      DEVICES=( ${DEVICES[@]} $2 )
+      # add a device to the list
+      ;;
+    use)
+      # tag a device as used
+      for (( N=0; N<${#DEVICES[@]} ; N++ )); do
+        if [ "$2" == "$(echo ${DEVICES[$N]} | cut -d: -f1)" ]; then
+          DEVICES[$N]="$(echo ${DEVICES[$N]} | cut -d: -f1,2):used"
+        fi
+      done
+      ;;
+    free)
+      # untag a previously used device as used
+      for (( N=0; N<${#DEVICES[@]} ; N++ )); do
+        if [ "$2" == "$(echo ${DEVICES[$N]} | cut -d: -f1)" ]; then
+          DEVICES[$N]="$(echo ${DEVICES[$N]} | cut -d: -f1,2)"
+        fi
+      done
+      ;;
+    list)
+      # list all unused devices of type $2
+      for (( N=0; N<${#DEVICES[@]} ; N++ )); do
+        if [ "$2" == "$(echo ${DEVICES[$N]} | cut -d: -f2)" ] &&
+            [ -z "$(echo ${DEVICES[$N]} | cut -d: -f3)" ]; then
+          echo ${DEVICES[$N]} | cut -d: -f1
+        fi
+      done
+      ;;
+    listall)
+      # list all devices of type $2
+      for (( N=0; N<${#DEVICES[@]} ; N++ )); do
+        if [ "$2" == "$(echo ${DEVICES[$N]} | cut -d: -f2)" ]; then
+          echo ${DEVICES[$N]} | cut -d: -f1
+        fi
+      done
+      ;;
+  esac
 }
 
 
 list_block_devices()
 {(
-	export IFS=$' \t\n'
-	local DEVICE FDEVICE PDEVICE
+  export IFS=$' \t\n'
+  local DEVICE FDEVICE PDEVICE
 
     # Grab protected device when booting iso from other media then cdrom
     PDEVICE=$(basename `grep -v '^rootfs' /proc/mounts | fgrep -w '/' | cut -d' ' -f1` 2> /dev/null)
 
-	for DEVICE in $(tail +3 /proc/partitions | awk '{print $4}' | grep -v -e ${PDEVICE:-^$} -e loop); do
-		FDEVICE=$(lsh unmap_device /dev/$DEVICE)
-		# if the device node ends with [0-9] then it's never a disc
-		if [[ $DEVICE =~ [0-9]$ ]]; then
-			# partitions always sit on a disc - which is also listed
-			if grep -qw "${DEVICE/[0-9]*/}" /proc/partitions ; then
-				echo $FDEVICE:part
-			else
-				echo $FDEVICE:other
-			fi
-		else
-			echo $FDEVICE:disc
-		fi
-	done
-	export IFS=$'\t\n'
+  for DEVICE in $(tail +3 /proc/partitions | awk '{print $4}' | grep -v -e ${PDEVICE:-^$} -e loop); do
+    FDEVICE=$(lsh unmap_device /dev/$DEVICE)
+    # if the device node ends with [0-9] then it's never a disc
+    if [[ $DEVICE =~ [0-9]$ ]]; then
+      # partitions always sit on a disc - which is also listed
+      if grep -qw "${DEVICE/[0-9]*/}" /proc/partitions ; then
+        echo $FDEVICE:part
+      else
+        echo $FDEVICE:other
+      fi
+    else
+      echo $FDEVICE:disc
+    fi
+  done
+  export IFS=$'\t\n'
 )}
 
 
 menu_list_devices()
 {
-	local DEVICE
-	for DEVICE in $(block_devices list part; block_devices list disc ; block_devices list other); do
-		echo $DEVICE
-		echo "Block device"
-	done
+  local DEVICE
+  for DEVICE in $(block_devices list part; block_devices list disc ; block_devices list other); do
+    echo $DEVICE
+    echo "Block device"
+  done
 }
 
 menu_list_targets()
 {
-	local DEVICE FBLKS FSIZE PTYPE FSTYPE MNTPNT N
-	for DEVICE in $(block_devices listall part; block_devices listall other); do
-		if [ -e $DEVICE ]; then
-			FBLKS=$(sfdisk -s $DEVICE)
-			if (( FBLKS <= 10 )) ; then
-				# this prevents listing EXTENDED partitions
-				continue
-			fi
-			FSIZE=$(nice_size `fdisk -l $DEVICE 2>&1 | grep ^Disk | grep bytes | awk '{print $5}'`)
-			echo $DEVICE
-
-			PTYPE=$(file -Ls $DEVICE 2>&1 | cat)
-			case $PTYPE in
-			        *ext4*) PTYPE="(ext4)" ;;
-				*ext3*) PTYPE="(ext3)" ;;
-				*ext2*) PTYPE="(ext2)" ;;
-				*XFS*) PTYPE="(XFS)" ;;
-				*Minix*) PTYPE="(minix)" ;;
-				*BTRFS*) PTYPE="(btrfs)" ;;
-				*) PTYPE="(unknown)" ;;
-			esac
-
-			for (( N=0 ; N<${#PARTITIONS[@]} ; N++ )); do
-				if [ "$(echo ${PARTITIONS[$N]} | cut -d: -f1)" == "$DEVICE" ]; then
-					FSTYPE=$(echo ${PARTITIONS[$N]} | cut -d: -f3)
-					MNTPNT=$(echo ${PARTITIONS[$N]} | cut -d: -f2)
-					FSTYPE=${FSTYPE/none/swap}
-					echo "$MNTPNT partition, size $FSIZE, [$FSTYPE]"
-					continue 2
-				fi
-			done
-			echo "unassigned, size $FSIZE, $PTYPE"
-		fi
-	done
+  local DEVICE FBLKS FSIZE PTYPE FSTYPE MNTPNT N
+  for DEVICE in $(block_devices listall part; block_devices listall other); do
+    if [ -e $DEVICE ]; then
+      FBLKS=$(sfdisk -s $DEVICE)
+      if (( FBLKS <= 10 )) ; then
+        # this prevents listing EXTENDED partitions
+        continue
+      fi
+      FSIZE=$(nice_size `fdisk -l $DEVICE 2>&1 | grep ^Disk | grep bytes | awk '{print $5}'`)
+      echo $DEVICE
+
+      PTYPE=$(file -Ls $DEVICE 2>&1 | cat)
+      case $PTYPE in
+              *ext4*) PTYPE="(ext4)" ;;
+        *ext3*) PTYPE="(ext3)" ;;
+        *ext2*) PTYPE="(ext2)" ;;
+        *XFS*) PTYPE="(XFS)" ;;
+        *Minix*) PTYPE="(minix)" ;;
+        *BTRFS*) PTYPE="(btrfs)" ;;
+        *) PTYPE="(unknown)" ;;
+      esac
+
+      for (( N=0 ; N<${#PARTITIONS[@]} ; N++ )); do
+        if [ "$(echo ${PARTITIONS[$N]} | cut -d: -f1)" == "$DEVICE" ]; then
+          FSTYPE=$(echo ${PARTITIONS[$N]} | cut -d: -f3)
+          MNTPNT=$(echo ${PARTITIONS[$N]} | cut -d: -f2)
+          FSTYPE=${FSTYPE/none/swap}
+          echo "$MNTPNT partition, size $FSIZE, [$FSTYPE]"
+          continue 2
+        fi
+      done
+      echo "unassigned, size $FSIZE, $PTYPE"
+    fi
+  done
 }
 
 
 menu_select_device()
 {
-	local TITLE HELP DEVICE
-	TITLE="Device Selection Menu"
-	HELP="Please select a block device"
-	DEVICE=$($DIALOG --title "$TITLE" --cancel-label "Exit" --menu "$HELP" 0 0 0 `menu_list_devices` "New" "Add an unlisted device to this list...")
-	if [ "$DEVICE" == "New" ]; then
-		DEVICE=$(inputbox "Enter special device node" "/dev/")
-		if [ ! -b $(readlink -f $DEVICE) ]; then
-			msgbox "Device $DEVICE does not exist or is not a valid device node. Perhaps you need to load a kernel module or start a subsystem first?"
-			unset DEVICE
-		elif echo ${SPECIAL_DEVICES[@]} | grep -qw $DEVICE ; then
-			msgbox "Device $DEVICE was already added!"
-			unset DEVICE
-		else
-			block_devices add "$DEVICE:other"
-		fi
-	fi
-	echo $DEVICE
+  local TITLE HELP DEVICE
+  TITLE="Device Selection Menu"
+  HELP="Please select a block device"
+  DEVICE=$($DIALOG --title "$TITLE" --cancel-label "Exit" --menu "$HELP" 0 0 0 `menu_list_devices` "New" "Add an unlisted device to this list...")
+  if [ "$DEVICE" == "New" ]; then
+    DEVICE=$(inputbox "Enter special device node" "/dev/")
+    if [ ! -b $(readlink -f $DEVICE) ]; then
+      msgbox "Device $DEVICE does not exist or is not a valid device node. Perhaps you need to load a kernel module or start a subsystem first?"
+      unset DEVICE
+    elif echo ${SPECIAL_DEVICES[@]} | grep -qw $DEVICE ; then
+      msgbox "Device $DEVICE was already added!"
+      unset DEVICE
+    else
+      block_devices add "$DEVICE:other"
+    fi
+  fi
+  echo $DEVICE
 }
 
 
 menu_get_partition()
 {
-	local TITLE HELP PART
-	TITLE="Partition Selection Menu"
-	HELP="Please select a partition"
-	PART=$($DIALOG --title "$TITLE" --cancel-label "Exit" --menu "$HELP" 0 0 0 `menu_list_targets` "New" "Add an unlisted device to this list...")
-	if [ $? != 0 ]; then
-		return 1
-	fi
-	if [ "$PART" == "New" ]; then
-		PART=$(inputbox "Enter special device node" "/dev/")
-		if [ ! -b $(readlink -f $PART) ]; then
-			msgbox "Device $PART does not exist or is not a valid device node. Perhaps you need to load a kernel module or start a subsystem first?"
-			unset PART
-		elif echo ${SPECIAL_DEVICES[@]} | grep -qw $PART ; then
-			msgbox "Device $PART was already added!"
-			unset PART
-		else
-			block_devices add "$PART:other"
-		fi
-	fi
-	echo $PART
+  local TITLE HELP PART
+  TITLE="Partition Selection Menu"
+  HELP="Please select a partition"
+  PART=$($DIALOG --title "$TITLE" --cancel-label "Exit" --menu "$HELP" 0 0 0 `menu_list_targets` "New" "Add an unlisted device to this list...")
+  if [ $? != 0 ]; then
+    return 1
+  fi
+  if [ "$PART" == "New" ]; then
+    PART=$(inputbox "Enter special device node" "/dev/")
+    if [ ! -b $(readlink -f $PART) ]; then
+      msgbox "Device $PART does not exist or is not a valid device node. Perhaps you need to load a kernel module or start a subsystem first?"
+      unset PART
+    elif echo ${SPECIAL_DEVICES[@]} | grep -qw $PART ; then
+      msgbox "Device $PART was already added!"
+      unset PART
+    else
+      block_devices add "$PART:other"
+    fi
+  fi
+  echo $PART
 }
 
 
 menu_list_discs()
 {
-	for DISC in $(block_devices listall disc); do
-		echo $DISC
-		echo "disc"
-	done
+  for DISC in $(block_devices listall disc); do
+    echo $DISC
+    echo "disc"
+  done
 
 }
 
 
 menu_get_disc()
 {
-	TITLE="Disk Selection Menu"
-	HELP="Please select a disc"
-	$DIALOG --title "$TITLE" --menu "$HELP" 0 0 0 $(menu_list_discs)
+  TITLE="Disk Selection Menu"
+  HELP="Please select a disc"
+  $DIALOG --title "$TITLE" --menu "$HELP" 0 0 0 $(menu_list_discs)
 }
 
 
 menu_get_filesystem()
 {
-	TITLE="Filesystem Selection Menu"
-	HELP="Please select a filesystem. A '*' means that this is a journalling filesystem, which provides better data security against system crashes etc."
-
-	EXT4="Fourth Extended file system (*)"
-	BTRFS="BTree file system (*)"
-	EXT3="Third Extended file system (*)"
-	EXT2="Second Extended file system"
-	REISER="Reiserfs file system (*)"
-	XFS="XFS file system (*)"
-	JFS="JFS file system (*)"
-	SWAP="Swap (Virtual memory or paging filesystem)"
-
-	$DIALOG --title "$TITLE" --default-item "ext4" --menu "$HELP" 0 0 0 \
-	           "ext4"      "$EXT4"    \
-		   "btrfs"     "$BTRFS"   \
-		   "ext3"      "$EXT3"    \
-		   "ext2"      "$EXT2"    \
-		   "xfs"       "$XFS"     \
-		   "jfs"       "$JFS"     \
-		   "swap"      "$SWAP"
+  TITLE="Filesystem Selection Menu"
+  HELP="Please select a filesystem. A '*' means that this is a journalling filesystem, which provides better data security against system crashes etc."
+
+  EXT4="Fourth Extended file system (*)"
+  BTRFS="BTree file system (*)"
+  EXT3="Third Extended file system (*)"
+  EXT2="Second Extended file system"
+  REISER="Reiserfs file system (*)"
+  XFS="XFS file system (*)"
+  JFS="JFS file system (*)"
+  SWAP="Swap (Virtual memory or paging filesystem)"
+
+  $DIALOG --title "$TITLE" --default-item "ext4" --menu "$HELP" 0 0 0 \
+             "ext4"      "$EXT4"    \
+       "btrfs"     "$BTRFS"   \
+       "ext3"      "$EXT3"    \
+       "ext2"      "$EXT2"    \
+       "xfs"       "$XFS"     \
+       "jfs"       "$JFS"     \
+       "swap"      "$SWAP"
 }
 
 
 show_keymaps()
 {
-	KEYDIR="/usr/share/kbd/keymaps/i386"
-
-	azerty="$(ls $KEYDIR/azerty)"
-	colemak="$(ls $KEYDIR/colemak)"
-	dvorak="$(ls $KEYDIR/dvorak)"
-	fgGIod="$(ls $KEYDIR/fgGIod)"
-	olpc="$(ls $KEYDIR/olpc)"
-	qwerty="$(ls $KEYDIR/qwerty)"
-	qwertz="$(ls $KEYDIR/qwertz)"
-
-	MAP_FILES=$(echo -e "$azerty\n$colemak\n$dvorak\n$fgGIod\n$olpc\n$qwerty\n$qwertz" | sort | sed "s/\.kmap\.gz//")
-
-	for MAP in $MAP_FILES; do
-		echo $MAP
-		echo keymap
-	done
+  KEYDIR="/usr/share/kbd/keymaps/i386"
+
+  azerty="$(ls $KEYDIR/azerty)"
+  colemak="$(ls $KEYDIR/colemak)"
+  dvorak="$(ls $KEYDIR/dvorak)"
+  fgGIod="$(ls $KEYDIR/fgGIod)"
+  olpc="$(ls $KEYDIR/olpc)"
+  qwerty="$(ls $KEYDIR/qwerty)"
+  qwertz="$(ls $KEYDIR/qwertz)"
+
+  MAP_FILES=$(echo -e "$azerty\n$colemak\n$dvorak\n$fgGIod\n$olpc\n$qwerty\n$qwertz" | sort | sed "s/\.kmap\.gz//")
+
+  for MAP in $MAP_FILES; do
+    echo $MAP
+    echo keymap
+  done
 }
 
 
 keymap_menu()
 {
-	TITLE="Keymap Selection Menu"
-	HELP="Please select your preferred keymapping."
-	KEYMAPS=$(show_keymaps)
-	DEFAULT=${KEYMAP:-defkeymap}
-	KEYMAP=`$DIALOG --title "$TITLE" --default-item "$DEFAULT" --menu "$HELP" 0 0 0 $KEYMAPS`
-	if [ -n "$KEYMAP" ]; then
-		loadkeys $KEYMAP
-	fi
-	C_OK=\\Z2
-	DEFAULT=D
+  TITLE="Keymap Selection Menu"
+  HELP="Please select your preferred keymapping."
+  KEYMAPS=$(show_keymaps)
+  DEFAULT=${KEYMAP:-defkeymap}
+  KEYMAP=`$DIALOG --title "$TITLE" --default-item "$DEFAULT" --menu "$HELP" 0 0 0 $KEYMAPS`
+  if [ -n "$KEYMAP" ]; then
+    loadkeys $KEYMAP
+  fi
+  C_OK=\\Z2
+  DEFAULT=D
 }
 
 
 partition_discs()
 {
-	CFDISK="Curses based disk partition table manipulator"
-	FDISK="Partition table manipulator"
-	PARTED="Create, destroy, resize, and copy partitions"
-	HELP="Please create a boot and root partition."
-	TITLE="Partitioning Menu"
-
-	DISC=$(menu_get_disc) &&
-	case $ARCH in
-		"alpha")
-			PROG="fdisk"
-			msgbox "Your drive must be partitioned with a BSD-style partition.  At the first prompt in fdisk, type 'b'."
-			;;
-		"ppc")
-			PROG="parted"
-			msgbox "Your drive must have an Apple partition scheme and have at least one HFS partition of at least 10MB for booting.  Do not mount this partition!"
-			;;
-		*)
-			PROG=`$DIALOG --title "$TITLE" --menu "$HELP" 0 0 0  \
-			        "cfdisk"  "$CFDISK"                          \
-			        "fdisk"   "$FDISK"                           \
-			        "parted"  "$PARTED"`
-		;;
-	esac &&
-	PROMPT="Are you certain that you want to run $PROG on $DISC? (This will erase any partition selection you might have already performed)" &&
-	if confirm "$PROMPT"; then
-		unset PARTITIONS
-		$PROG $DISC
-		# regenerate list of block devices
-		block_devices init
-		if (( STEP == 3 )); then
-			(( STEP++ ))
-		fi
-		P_OK=\\Z2
-	fi
+  CFDISK="Curses based disk partition table manipulator"
+  FDISK="Partition table manipulator"
+  PARTED="Create, destroy, resize, and copy partitions"
+  HELP="Please create a boot and root partition."
+  TITLE="Partitioning Menu"
+
+  DISC=$(menu_get_disc) &&
+  case $ARCH in
+    "alpha")
+      PROG="fdisk"
+      msgbox "Your drive must be partitioned with a BSD-style partition.  At the first prompt in fdisk, type 'b'."
+      ;;
+    "ppc")
+      PROG="parted"
+      msgbox "Your drive must have an Apple partition scheme and have at least one HFS partition of at least 10MB for booting.  Do not mount this partition!"
+      ;;
+    *)
+      PROG=`$DIALOG --title "$TITLE" --menu "$HELP" 0 0 0  \
+              "cfdisk"  "$CFDISK"                          \
+              "fdisk"   "$FDISK"                           \
+              "parted"  "$PARTED"`
+    ;;
+  esac &&
+  PROMPT="Are you certain that you want to run $PROG on $DISC? (This will erase any partition selection you might have already performed)" &&
+  if confirm "$PROMPT"; then
+    unset PARTITIONS
+    $PROG $DISC
+    # regenerate list of block devices
+    block_devices init
+    if (( STEP == 3 )); then
+      (( STEP++ ))
+    fi
+    P_OK=\\Z2
+  fi
 }
 
 
 check_partition()
 {
-	PROMPT="Check for errors?"
-	case $1 in
-		ext2|ext3|ext4|swap)
-			if confirm "$PROMPT" "--defaultno"; then
-			    echo "-c";
-			fi
-			;;
-		*)
-			true
-			;;
-	esac
+  PROMPT="Check for errors?"
+  case $1 in
+    ext2|ext3|ext4|swap)
+      if confirm "$PROMPT" "--defaultno"; then
+          echo "-c";
+      fi
+      ;;
+    *)
+      true
+      ;;
+  esac
 }
 
 
 select_swap_file()
 {
-	LOCATION_PROMPT="Please enter the location for the swapfile."
-	SIZE_PROMPT="Enter the size (in MB) of the swapfile you want to generate. It is recommended make it twice the amount of physical RAM. TMPFS users will need more swap (typically 1000MB)."
-
-	SWAPFILE=$(inputbox "$LOCATION_PROMPT" "/swapfile") &&
-	if [ -n "$SWAPFILE" ]; then
-
-		# strange calc. but it ends up being ~ 2xRAM rounded up to 256MB blocks
-		SWAPSIZE=$(grep MemTotal: /proc/meminfo | awk '{print $2}' | sed 's/[0-9][0-9][0-9]$//') &&
-		(( SWAPSIZE = ( ( SWAPSIZE / 128 ) + 1 ) * 256 )) &&
-
-		SWAPSIZE=$(inputbox "$SIZE_PROMPT" "$SWAPSIZE")
-		if [ -n "$SWAPSIZE" ]; then
-			S_OK=\\Z2
-		else
-			unset SWAPFILE SWAPSIZE
-		fi
-	fi
-	if (( STEP == 5 )); then
-		(( STEP++ ))
-	fi
+  LOCATION_PROMPT="Please enter the location for the swapfile."
+  SIZE_PROMPT="Enter the size (in MB) of the swapfile you want to generate. It is recommended make it twice the amount of physical RAM. TMPFS users will need more swap (typically 1000MB)."
+
+  SWAPFILE=$(inputbox "$LOCATION_PROMPT" "/swapfile") &&
+  if [ -n "$SWAPFILE" ]; then
+
+    # strange calc. but it ends up being ~ 2xRAM rounded up to 256MB blocks
+    SWAPSIZE=$(grep MemTotal: /proc/meminfo | awk '{print $2}' | sed 's/[0-9][0-9][0-9]$//') &&
+    (( SWAPSIZE = ( ( SWAPSIZE / 128 ) + 1 ) * 256 )) &&
+
+    SWAPSIZE=$(inputbox "$SIZE_PROMPT" "$SWAPSIZE")
+    if [ -n "$SWAPSIZE" ]; then
+      S_OK=\\Z2
+    else
+      unset SWAPFILE SWAPSIZE
+    fi
+  fi
+  if (( STEP == 5 )); then
+    (( STEP++ ))
+  fi
 }
 
 
 determine_mount_opts()
 {
-	if [ "$1" == "swap" ]; then
-		echo "defaults"
-	else
-		echo "defaults"
-	fi
+  if [ "$1" == "swap" ]; then
+    echo "defaults"
+  else
+    echo "defaults"
+  fi
 }
 
 determine_fsck_pass()
 {
-	if [ "$1" == "swap" ]; then
-		echo "0"
-	else
-		if [ "$2" == "/" ]; then
-			echo "1"
-		else
-			echo "2"
-		fi
-	fi
+  if [ "$1" == "swap" ]; then
+    echo "0"
+  else
+    if [ "$2" == "/" ]; then
+      echo "1"
+    else
+      echo "2"
+    fi
+  fi
 }
 
 
 get_mount_point()
 {
-	if [ "$1" == "swap" ]; then
-		echo "swap"
-	else
-		POINT=$(inputbox "Please enter a mount point" "") &&
-		if [ -z "$POINT" -a -z "$ROOT" ]; then
-			echo "/"
-		else
-			echo "$POINT"
-		fi
-	fi
+  if [ "$1" == "swap" ]; then
+    echo "swap"
+  else
+    POINT=$(inputbox "Please enter a mount point" "") &&
+    if [ -z "$POINT" -a -z "$ROOT" ]; then
+      echo "/"
+    else
+      echo "$POINT"
+    fi
+  fi
 }
 
 
 get_raid_level()
 {
-	LEVEL=`$DIALOG --menu "Select a raid level" 0 0 0 \
-			"linear" "append discs to make one large device" \
-			"0" "Striping - increase performance" \
-			"1" "Mirrorring - 100% redundancy" \
-			"5" "Large and safe - high performance and redundancy" \
-			"6" "Extends 5 - adds more overhead but more redundancy too"`
-	echo $LEVEL
+  LEVEL=`$DIALOG --menu "Select a raid level" 0 0 0 \
+      "linear" "append discs to make one large device" \
+      "0" "Striping - increase performance" \
+      "1" "Mirrorring - 100% redundancy" \
+      "5" "Large and safe - high performance and redundancy" \
+      "6" "Extends 5 - adds more overhead but more redundancy too"`
+  echo $LEVEL
 }
 
 
 enum_discs()
 {
-	for DISC in $(echo $1 | sed 's/,/\t/g') ; do
-		echo $DISC
-		echo $2
-	done
+  for DISC in $(echo $1 | sed 's/,/\t/g') ; do
+    echo $DISC
+    echo $2
+  done
 }
 
 
 list_raid_arrays()
 {
-	for RAIDARRAY in ${RAIDARRAYS[@]}; do
-		echo $RAIDARRAY | cut -d: -f1
-		echo "level $(echo $RAIDARRAY | cut -d: -f2) raid array"
-	done
+  for RAIDARRAY in ${RAIDARRAYS[@]}; do
+    echo $RAIDARRAY | cut -d: -f1
+    echo "level $(echo $RAIDARRAY | cut -d: -f2) raid array"
+  done
 
 }
 
 
 raid_setup()
 {
-	# raid array record looks like:
-	# device:level:device,device,device:sparedevice,sparedevice,chunksize
-	# device = { md0 md1 md2 ... }
-	# level = { lineair 0 1 4 5 }
-	# device = { hda1, hdb, loop/0 md0 ... }
-	# sparedevice = { ^^device^^ }
-	# chunksize = n (kb)
-	# attempt to setup raid arrays
-	while true; do
-		RCHOICE=`$DIALOG --cancel-label "Exit" --menu "Select an option" 0 0 0 \
-			$(list_raid_arrays) \
-			"Create" "Create a new RAID array"`
-		if [ $? != 0 ] ; then
-			break
-		fi
-		case $RCHOICE in
-			md*)
-				# don't edit started arrays anymore
-				if grep -qw $RCHOICE /proc/mdstat; then
-					msgbox "RAID Array $RCHOICE is already started. You cannot edit the array anymore after starting it."
-					continue
-				fi
-				# edit the array
-				while true ;do
-					for (( N=0 ; N<${#RAIDARRAYS[@]} ; N++ )); do
-						if [ "$RCHOICE" == "$(echo ${RAIDARRAYS[$N]} | cut -d: -f1)" ]; then
-							break
-						fi
-					done
-					RAIDARRAY=${RAIDARRAYS[$N]}
-					ARRAYNAME=$(echo $RAIDARRAY | cut -d: -f1)
-					LEVEL=$(echo $RAIDARRAY | cut -d: -f2)
-					DISCS=$(echo $RAIDARRAY | cut -d: -f3)
-					SPARE=$(echo $RAIDARRAY | cut -d: -f4)
-					RRCHOICE=`$DIALOG --cancel-label "Exit" --menu "Select an option" 0 0 0 \
-						"Add disc" "Add a disk to the array" \
-						"Add spare" "Add a spare disk to the array" \
-						$([ -n "$DISCS" ] && enum_discs $DISCS "RAID array member") \
-						$([ -n "$SPARE" ] && enum_discs $SPARE "Spare disc") \
-						"start" "Initialize and start the array" \
-						`
-					if [ $? != 0 ]; then
-						break
-					fi
-					if [ "$RRCHOICE" == "Add disc" -o "$RRCHOICE" == "Add spare" ] ; then
-						NEW=$(menu_select_device)
-						if [ -n "$NEW" ]; then
-							if [ "$RRCHOICE" == "Add disc" ] ; then
-								DISCS=$(echo "$DISCS,$NEW" | sed -e 's/^,//')
-							else # if [ "$RRCHOICE" == "Add spare" ] ; then
-								SPARE=$(echo "$SPARE,$NEW" | sed -e 's/^,//')
-							fi
-							block_devices use $NEW
-							if [ "$(fdisk -l ${NEW/[0-9]*/} | sed 's/\*/ /' | grep "^$NEW" | awk '{print $5}')" != "fd" ]; then
-								msgbox "The partition type of this device is not 0xFD (Linux RAID Autodetect). You should correct this in the partition table with a partitioning tool, otherwise linux will not automatically enable this RAID array at boot."
-							fi
-						fi
-					elif [ "$RRCHOICE" == "start" ] ; then
-						# udev might fail to create these devices
-						if [ ! -b /dev/md/${ARRAYNAME/md/} ]; then
-							mkdir -p /dev/md
-							mknod -m 660 /dev/md/${ARRAYNAME/md/} b 9 ${ARRAYNAME/md/}
-							chgrp disc /dev/md/${ARRAYNAME/md/}
-							ln -s md/${ARRAYNAME/md/} /dev/$ARRAYNAME
-						fi
-						# create and start the array here in a single step
-						DISCS_A=( $(for DISC in $(echo $DISCS | sed 's/,/\t/g') ; do echo $DISC ; done) )
-						SPARE_A=( $(for DISC in $(echo $SPARE | sed 's/,/\t/g') ; do echo $DISC ; done) )
-						# note we do not force creation here
-						mdadm --create --level $LEVEL -n ${#DISCS_A[@]} -x ${#SPARE_A[@]} /dev/$ARRAYNAME ${DISCS_A[@]} ${SPARE_A[@]}
-						sleep 2
-						if ! grep -qw "^$ARRAYNAME" /proc/mdstat ; then
-
-							sleep 5
-							msgbox "Initialization and starting of the RAID array failed. You should inspect the output for errors and try manually to start the array before using it."
-						else
-							msgbox "Initialization of $ARRAYNAME succeeded. You can now use this device as a normal, unformatted partition."
-							block_devices free $ARRAYNAME
-							break
-						fi
-					else
-						# remove disc from the raid array
-						DISCS=$(echo $DISCS | sed -e "s:\\(^\\|,\\)$RRCHOICE\\(,\\|$\\):,:;s:^,::;s:,$::")
-						SPARE=$(echo $SPARE | sed -e "s:\\(^\\|,\\)$RRCHOICE\\(,\\|$\\):,:;s:^,::;s:,$::")
-						msgbox "Deleted $RRCHOICE from this RAID array."
-						block_devices free $RRCHOICE
-					fi
-					# recombine the array options
-					RAIDARRAYS[$N]="$ARRAYNAME:$LEVEL:$DISCS:$SPARE"
-				done
-				;;
-			Create)
-				ARRAY="md${#RAIDARRAYS[@]}"
-				LEVEL=$(get_raid_level)
-				if [ -n "$LEVEL" ]; then
-					RAIDARRAYS[${#RAIDARRAYS[@]}]="$ARRAY:$LEVEL::"
-					block_devices add "/dev/$ARRAY:other:used"
-				fi
-				;;
-		esac
-	done
-	DEFAULT=M
+  # raid array record looks like:
+  # device:level:device,device,device:sparedevice,sparedevice,chunksize
+  # device = { md0 md1 md2 ... }
+  # level = { lineair 0 1 4 5 }
+  # device = { hda1, hdb, loop/0 md0 ... }
+  # sparedevice = { ^^device^^ }
+  # chunksize = n (kb)
+  # attempt to setup raid arrays
+  while true; do
+    RCHOICE=`$DIALOG --cancel-label "Exit" --menu "Select an option" 0 0 0 \
+      $(list_raid_arrays) \
+      "Create" "Create a new RAID array"`
+    if [ $? != 0 ] ; then
+      break
+    fi
+    case $RCHOICE in
+      md*)
+        # don't edit started arrays anymore
+        if grep -qw $RCHOICE /proc/mdstat; then
+          msgbox "RAID Array $RCHOICE is already started. You cannot edit the array anymore after starting it."
+          continue
+        fi
+        # edit the array
+        while true ;do
+          for (( N=0 ; N<${#RAIDARRAYS[@]} ; N++ )); do
+            if [ "$RCHOICE" == "$(echo ${RAIDARRAYS[$N]} | cut -d: -f1)" ]; then
+              break
+            fi
+          done
+          RAIDARRAY=${RAIDARRAYS[$N]}
+          ARRAYNAME=$(echo $RAIDARRAY | cut -d: -f1)
+          LEVEL=$(echo $RAIDARRAY | cut -d: -f2)
+          DISCS=$(echo $RAIDARRAY | cut -d: -f3)
+          SPARE=$(echo $RAIDARRAY | cut -d: -f4)
+          RRCHOICE=`$DIALOG --cancel-label "Exit" --menu "Select an option" 0 0 0 \
+            "Add disc" "Add a disk to the array" \
+            "Add spare" "Add a spare disk to the array" \
+            $([ -n "$DISCS" ] && enum_discs $DISCS "RAID array member") \
+            $([ -n "$SPARE" ] && enum_discs $SPARE "Spare disc") \
+            "start" "Initialize and start the array" \
+            `
+          if [ $? != 0 ]; then
+            break
+          fi
+          if [ "$RRCHOICE" == "Add disc" -o "$RRCHOICE" == "Add spare" ] ; then
+            NEW=$(menu_select_device)
+            if [ -n "$NEW" ]; then
+              if [ "$RRCHOICE" == "Add disc" ] ; then
+                DISCS=$(echo "$DISCS,$NEW" | sed -e 's/^,//')
+              else # if [ "$RRCHOICE" == "Add spare" ] ; then
+                SPARE=$(echo "$SPARE,$NEW" | sed -e 's/^,//')
+              fi
+              block_devices use $NEW
+              if [ "$(fdisk -l ${NEW/[0-9]*/} | sed 's/\*/ /' | grep "^$NEW" | awk '{print $5}')" != "fd" ]; then
+                msgbox "The partition type of this device is not 0xFD (Linux RAID Autodetect). You should correct this in the partition table with a partitioning tool, otherwise linux will not automatically enable this RAID array at boot."
+              fi
+            fi
+          elif [ "$RRCHOICE" == "start" ] ; then
+            # udev might fail to create these devices
+            if [ ! -b /dev/md/${ARRAYNAME/md/} ]; then
+              mkdir -p /dev/md
+              mknod -m 660 /dev/md/${ARRAYNAME/md/} b 9 ${ARRAYNAME/md/}
+              chgrp disc /dev/md/${ARRAYNAME/md/}
+              ln -s md/${ARRAYNAME/md/} /dev/$ARRAYNAME
+            fi
+            # create and start the array here in a single step
+            DISCS_A=( $(for DISC in $(echo $DISCS | sed 's/,/\t/g') ; do echo $DISC ; done) )
+            SPARE_A=( $(for DISC in $(echo $SPARE | sed 's/,/\t/g') ; do echo $DISC ; done) )
+            # note we do not force creation here
+            mdadm --create --level $LEVEL -n ${#DISCS_A[@]} -x ${#SPARE_A[@]} /dev/$ARRAYNAME ${DISCS_A[@]} ${SPARE_A[@]}
+            sleep 2
+            if ! grep -qw "^$ARRAYNAME" /proc/mdstat ; then
+
+              sleep 5
+              msgbox "Initialization and starting of the RAID array failed. You should inspect the output for errors and try manually to start the array before using it."
+            else
+              msgbox "Initialization of $ARRAYNAME succeeded. You can now use this device as a normal, unformatted partition."
+              block_devices free $ARRAYNAME
+              break
+            fi
+          else
+            # remove disc from the raid array
+            DISCS=$(echo $DISCS | sed -e "s:\\(^\\|,\\)$RRCHOICE\\(,\\|$\\):,:;s:^,::;s:,$::")
+            SPARE=$(echo $SPARE | sed -e "s:\\(^\\|,\\)$RRCHOICE\\(,\\|$\\):,:;s:^,::;s:,$::")
+            msgbox "Deleted $RRCHOICE from this RAID array."
+            block_devices free $RRCHOICE
+          fi
+          # recombine the array options
+          RAIDARRAYS[$N]="$ARRAYNAME:$LEVEL:$DISCS:$SPARE"
+        done
+        ;;
+      Create)
+        ARRAY="md${#RAIDARRAYS[@]}"
+        LEVEL=$(get_raid_level)
+        if [ -n "$LEVEL" ]; then
+          RAIDARRAYS[${#RAIDARRAYS[@]}]="$ARRAY:$LEVEL::"
+          block_devices add "/dev/$ARRAY:other:used"
+        fi
+        ;;
+    esac
+  done
+  DEFAULT=M
 }
 
 
 menu_select_partitions()
 {
-	local PART N MNTPNT FSYS MNT_OPTS FSCK_PASS CHECK FORCE FORMAT
-	while true; do
-		PART=$(menu_get_partition)
-		# Exit pressed - leave the menu and go back up a level
-		if [ $? != 0 ]; then
-			break
-		elif [ "$PART" == "" ]; then
-			continue
-		fi
-		# scan if we are re-assigning a partition
-		for (( N=0 ; N<${#PARTITIONS[@]} ; N++ )); do
-			if [ "$(echo ${PARTITIONS[$N]} | cut -d: -f1)" == "$PART" ]; then
-				msgbox "Unassigned partition $PART. You can now change the parameters for this partition if you wish."
-				block_devices free $PART
-				unset PARTITIONS[$N]
-				continue 2
-			fi
-		done
-		FSYS=$(menu_get_filesystem)
-		if [ -z "$FSYS" ]; then
-			continue
-		fi &&
-
-		case "$FSYS" in
-		#xfs|jfs)
-		#	msgbox "Selecting XFS or JFS for your root and/or boot filesystem *requires* you to compile a kernel later on with XFS or JFS built in to the kernel. The default pre-compiled lunar-linux kernel will NOT work in your case!"
-		#	;;
-		   btrfs)
-			msgbox "Selecting btrfs as /boot is only supported with grub2, you will need to create a /boot partition and format it as ext2, ext3 or ext4 in order to use different bootloaders."
-			;;
-		    swap)
-			SWAP_ENABLED=1
-			;;
-		esac
-
-		MNTPNT=$(get_mount_point $FSYS) &&
-
-		PROMPT="$PART might already be formatted with the $FSYS filesystem and may contain data. Formatting it will destroy all the information on this partition. Are you sure you want to format it?"
-		if confirm "$PROMPT" ; then
-			FORMAT=yes
-			CHECK=$(check_partition $FSYS)
-		else
-			FORMAT=no
-		fi
-		MNT_OPTS=$(determine_mount_opts $FSYS) &&
-		if [ "$MNT_PNT" != "/" ]; then
-			MNT_PNT=${MNT_PNT%%/}
-		fi
-		FSCK_PASS=$(determine_fsck_pass $FSYS $MNTPNT) &&
-		if [ "$FSYS" == "xfs" ]; then
-			FORCE="-f"
-		elif [ "$FSYS" == "jfs" ]; then
-			FORCE="-q"
-		else
-			unset FORCE
-		fi
-
-		PARTITIONS[${#PARTITIONS[@]}]="$PART:$MNTPNT:$FSYS:$MNT_OPTS:$FSCK_PASS:$CHECK:$FORCE:$FORMAT"
-
-		if [ "$MNTPNT" == "/" ]; then
-			ROOT=$PART
-			# make sure BOOT is set to ROOT ... ->
-			if [ -z "$BOOT" ]; then
-				BOOT=$ROOT
-			fi
-		fi
-		if [ "$MNTPNT" == "/boot" ]; then
-			# ... -> except when this is a /boot partition
-			BOOT=$PART
-		fi
-		block_devices use $PART
-	done
+  local PART N MNTPNT FSYS MNT_OPTS FSCK_PASS CHECK FORCE FORMAT
+  while true; do
+    PART=$(menu_get_partition)
+    # Exit pressed - leave the menu and go back up a level
+    if [ $? != 0 ]; then
+      break
+    elif [ "$PART" == "" ]; then
+      continue
+    fi
+    # scan if we are re-assigning a partition
+    for (( N=0 ; N<${#PARTITIONS[@]} ; N++ )); do
+      if [ "$(echo ${PARTITIONS[$N]} | cut -d: -f1)" == "$PART" ]; then
+        msgbox "Unassigned partition $PART. You can now change the parameters for this partition if you wish."
+        block_devices free $PART
+        unset PARTITIONS[$N]
+        continue 2
+      fi
+    done
+    FSYS=$(menu_get_filesystem)
+    if [ -z "$FSYS" ]; then
+      continue
+    fi &&
+
+    case "$FSYS" in
+    #xfs|jfs)
+    # msgbox "Selecting XFS or JFS for your root and/or boot filesystem *requires* you to compile a kernel later on with XFS or JFS built in to the kernel. The default pre-compiled lunar-linux kernel will NOT work in your case!"
+    # ;;
+       btrfs)
+      msgbox "Selecting btrfs as /boot is only supported with grub2, you will need to create a /boot partition and format it as ext2, ext3 or ext4 in order to use different bootloaders."
+      ;;
+        swap)
+      SWAP_ENABLED=1
+      ;;
+    esac
+
+    MNTPNT=$(get_mount_point $FSYS) &&
+
+    PROMPT="$PART might already be formatted with the $FSYS filesystem and may contain data. Formatting it will destroy all the information on this partition. Are you sure you want to format it?"
+    if confirm "$PROMPT" ; then
+      FORMAT=yes
+      CHECK=$(check_partition $FSYS)
+    else
+      FORMAT=no
+    fi
+    MNT_OPTS=$(determine_mount_opts $FSYS) &&
+    if [ "$MNT_PNT" != "/" ]; then
+      MNT_PNT=${MNT_PNT%%/}
+    fi
+    FSCK_PASS=$(determine_fsck_pass $FSYS $MNTPNT) &&
+    if [ "$FSYS" == "xfs" ]; then
+      FORCE="-f"
+    elif [ "$FSYS" == "jfs" ]; then
+      FORCE="-q"
+    else
+      unset FORCE
+    fi
+
+    PARTITIONS[${#PARTITIONS[@]}]="$PART:$MNTPNT:$FSYS:$MNT_OPTS:$FSCK_PASS:$CHECK:$FORCE:$FORMAT"
+
+    if [ "$MNTPNT" == "/" ]; then
+      ROOT=$PART
+      # make sure BOOT is set to ROOT ... ->
+      if [ -z "$BOOT" ]; then
+        BOOT=$ROOT
+      fi
+    fi
+    if [ "$MNTPNT" == "/boot" ]; then
+      # ... -> except when this is a /boot partition
+      BOOT=$PART
+    fi
+    block_devices use $PART
+  done
 }
 
 
 select_partitions()
 {
-	if [ -z "$DONE_PARTITIONING" ]; then
-		if confirm "Are you done making partitions?"; then
-			DONE_PARTITIONING=1
-			case $ARCH in
-			    "alpha")
-	  	            msgbox \
+  if [ -z "$DONE_PARTITIONING" ]; then
+    if confirm "Are you done making partitions?"; then
+      DONE_PARTITIONING=1
+      case $ARCH in
+          "alpha")
+                  msgbox \
 "The partition on which the kernel is located must
 be formatted with the ext2 filesystem. Normally this
 means that your root or boot filesystem should be ext2."
-			    ;;
-			esac
-			menu_select_partitions
-		fi
-	else
-		menu_select_partitions
-	fi
-
-	if [ -n "$ROOT" ]; then
-		if (( STEP <= 4 )) ; then
-		        # Skip swapfile step if swap partition was set
-		        if [ -n "$SWAP_ENABLED" ]; then
-			        S_OK=\\Z2
-			        STEP=6
-			else
-			        S_OK=
-				STEP=5
-			fi
-		fi
-		T_OK=
-		M_OK=\\Z2
-	fi
+          ;;
+      esac
+      menu_select_partitions
+    fi
+  else
+    menu_select_partitions
+  fi
+
+  if [ -n "$ROOT" ]; then
+    if (( STEP <= 4 )) ; then
+            # Skip swapfile step if swap partition was set
+            if [ -n "$SWAP_ENABLED" ]; then
+              S_OK=\\Z2
+              STEP=6
+      else
+              S_OK=
+        STEP=5
+      fi
+    fi
+    T_OK=
+    M_OK=\\Z2
+  fi
 }
 
 
 make_lilo_conf()
 {
-	if ! pkg_avail lilo ; then
-		return
-	fi
-	if [ -e $TARGET/etc/lilo.conf ]; then
-		return
-	fi
-
-	DISC=$(echo $ROOT | sed 's/[0-9]*$//')
-	(
-		echo "# lba32"
-		echo "prompt"
-		echo "delay=100"
-		echo "timeout=100"
-		echo "install=menu"
-		echo "append=\"devfs=nomount\""
-		echo "read-only"
-		echo ""
-		if echo $BOOT | grep -q md ; then
-		    echo "boot=$BOOT"
-		    BOOTDISCS=$(mdadm --detail $BOOT | tail -n2 | awk '{print $7}')
-		    echo "raid-extra-boot=$(echo $BOOTDISCS | sed -e 's@[0-9]@@g' -e 's@\ @, at g')"
-		else
-		    echo "boot=$DISC"
-		fi
-		echo "root=$ROOT"
-		echo ""
-	) > $TARGET/etc/lilo.conf
+  if ! pkg_avail lilo ; then
+    return
+  fi
+  if [ -e $TARGET/etc/lilo.conf ]; then
+    return
+  fi
+
+  DISC=$(echo $ROOT | sed 's/[0-9]*$//')
+  (
+    echo "# lba32"
+    echo "prompt"
+    echo "delay=100"
+    echo "timeout=100"
+    echo "install=menu"
+    echo "append=\"devfs=nomount\""
+    echo "read-only"
+    echo ""
+    if echo $BOOT | grep -q md ; then
+        echo "boot=$BOOT"
+        BOOTDISCS=$(mdadm --detail $BOOT | tail -n2 | awk '{print $7}')
+        echo "raid-extra-boot=$(echo $BOOTDISCS | sed -e 's@[0-9]@@g' -e 's@\ @, at g')"
+    else
+        echo "boot=$DISC"
+    fi
+    echo "root=$ROOT"
+    echo ""
+  ) > $TARGET/etc/lilo.conf
 }
 
 
 install_grub2()
 {
-	if ! pkg_avail grub2 ; then
-		return
-	fi
+  if ! pkg_avail grub2 ; then
+    return
+  fi
 
-	DISC=$(echo $ROOT | sed 's/[0-9]*$//')
-	chroot_run grub-install $DISC
+  DISC=$(echo $ROOT | sed 's/[0-9]*$//')
+  chroot_run grub-install $DISC
 
-	echo "grub was installed on the MBR of $DISC"
-	sleep 4
+  echo "grub was installed on the MBR of $DISC"
+  sleep 4
 }
 
 
 make_grub_conf()
 {
-	if ! pkg_avail grub ; then
-		return
-	fi
-	if [ -e $TARGET/boot/grub/menu.lst ] ; then
-		return
-	fi
-
-	mkdir -p $TARGET/boot/grub
-	(
-		echo "# uncomment the following 2 lines to enable serial console booting"
-		echo "#serial --unit=0 --speed=38400 --word=8 --parity=no --stop=1"
-		echo "#terminal serial"
-		echo ""
-		echo "timeout 30"
-		echo "default 0"
-		echo "fallback 1"
-		echo "color light-gray/blue black/light-gray"
-		echo ""
-	) > $TARGET/boot/grub/menu.lst
+  if ! pkg_avail grub ; then
+    return
+  fi
+  if [ -e $TARGET/boot/grub/menu.lst ] ; then
+    return
+  fi
+
+  mkdir -p $TARGET/boot/grub
+  (
+    echo "# uncomment the following 2 lines to enable serial console booting"
+    echo "#serial --unit=0 --speed=38400 --word=8 --parity=no --stop=1"
+    echo "#terminal serial"
+    echo ""
+    echo "timeout 30"
+    echo "default 0"
+    echo "fallback 1"
+    echo "color light-gray/blue black/light-gray"
+    echo ""
+  ) > $TARGET/boot/grub/menu.lst
 }
 
 
 install_grub()
 {
-	if ! pkg_avail grub ; then
-		return
-	fi
-	# grub lives on the "/" partition unless we have a separate
-	# "/boot" partition. Hence we use $BOOT to determine the grub location.
-	GRUB_PART=$(lsh map_device_to_grub $BOOT)
-	# and we go straight to the MBR
-	GRUB_MBR=$(echo $GRUB_PART | cut -d, -f1)
-
-	(
-		echo "root ($GRUB_PART)"
-		echo "setup ($GRUB_MBR)"
-		echo "quit"
-	) | grub --no-curses
-	sleep 2
-
-	# setup details needed for frub later:
-	if [ "$BOOT" == "$ROOT" ]; then
-		GRUB_BOOT=/boot
-	else
-		GRUB_BOOT=""
-	fi
-	GRUB_ROOT="($(lsh map_device_to_grub $ROOT))"
-	export GRUB_ROOT GRUB_BOOT
-
-	echo ""
-	echo "grub should use the following parameters from now on:"
-	echo "  root   $GRUB_ROOT"
-	echo "  kernel $GRUB_BOOT/\${ image name }"
-	echo ""
-
-	echo "grub was installed on the MBR of $GRUB_MBR"
-	sleep 4
+  if ! pkg_avail grub ; then
+    return
+  fi
+  # grub lives on the "/" partition unless we have a separate
+  # "/boot" partition. Hence we use $BOOT to determine the grub location.
+  GRUB_PART=$(lsh map_device_to_grub $BOOT)
+  # and we go straight to the MBR
+  GRUB_MBR=$(echo $GRUB_PART | cut -d, -f1)
+
+  (
+    echo "root ($GRUB_PART)"
+    echo "setup ($GRUB_MBR)"
+    echo "quit"
+  ) | grub --no-curses
+  sleep 2
+
+  # setup details needed for frub later:
+  if [ "$BOOT" == "$ROOT" ]; then
+    GRUB_BOOT=/boot
+  else
+    GRUB_BOOT=""
+  fi
+  GRUB_ROOT="($(lsh map_device_to_grub $ROOT))"
+  export GRUB_ROOT GRUB_BOOT
+
+  echo ""
+  echo "grub should use the following parameters from now on:"
+  echo "  root   $GRUB_ROOT"
+  echo "  kernel $GRUB_BOOT/\${ image name }"
+  echo ""
+
+  echo "grub was installed on the MBR of $GRUB_MBR"
+  sleep 4
 }
 
 
 transfer_package()
 {
-	cd $TARGET &&
-	LINE=$(grep "^$1:" $PACKAGES_LIST)
-	MOD=$(echo $LINE | cut -d: -f1)
-	VER=$(echo $LINE | cut -d: -f4)
-	cp /var/cache/lunar/$MOD-$VER-*.tar.xz $TARGET/var/cache/lunar/
-	tar xJf $TARGET/var/cache/lunar/$MOD-$VER-*.tar.xz 2> /dev/null
-	echo $LINE >> $TARGET/var/state/lunar/packages
-	cp $TARGET/var/state/lunar/packages $TARGET/var/state/lunar/packages.backup
+  cd $TARGET &&
+  LINE=$(grep "^$1:" $PACKAGES_LIST)
+  MOD=$(echo $LINE | cut -d: -f1)
+  VER=$(echo $LINE | cut -d: -f4)
+  cp /var/cache/lunar/$MOD-$VER-*.tar.xz $TARGET/var/cache/lunar/
+  tar xJf $TARGET/var/cache/lunar/$MOD-$VER-*.tar.xz 2> /dev/null
+  echo $LINE >> $TARGET/var/state/lunar/packages
+  cp $TARGET/var/state/lunar/packages $TARGET/var/state/lunar/packages.backup
 }
 
 
 percent_msg()
 {
-	echo XXX
-	echo $(( CNT * 100 / NUM ))
-	echo "\n$((CNT+1)): $1\n"
-	echo XXX
-	(( CNT++ ))
+  echo XXX
+  echo $(( CNT * 100 / NUM ))
+  echo "\n$((CNT+1)): $1\n"
+  echo XXX
+  (( CNT++ ))
 }
 
 
 transfer()
 {
-	msgbox "You should now be ready to install lunar to your system. Lunar will now create filesystems if needed, make a swapfile if it was selected, and install all lunar packages to the newly setup system. Make sure you are done with partitioning and filesystem selection."
-	if confirm "Are you ready to install lunar?" ;  then
-		clear
-
-		ORDER=$(for (( N=0 ; N<${#PARTITIONS[@]} ; N++ )); do echo ${PARTITIONS[$N]} | cut -d: -f2 ; done | sort)
-
-		for MOUNTPOINT in $ORDER; do
-			for (( N=0 ; N<${#PARTITIONS[@]} ; N++ )); do
-				M=$(echo ${PARTITIONS[$N]} | cut -d: -f2)
-				if [ "$M" == "$MOUNTPOINT" ]; then
-					PART=$(echo ${PARTITIONS[$N]} | cut -d: -f1)
-					FSYS=$(echo ${PARTITIONS[$N]} | cut -d: -f3)
-					MNT_OPTS=$(echo ${PARTITIONS[$N]} | cut -d: -f4)
-					FSCK_PASS=$(echo ${PARTITIONS[$N]} | cut -d: -f5)
-					CHECK=$(echo ${PARTITIONS[$N]} | cut -d: -f6)
-					FORCE=$(echo ${PARTITIONS[$N]} | cut -d: -f7)
-					FORMAT=$(echo ${PARTITIONS[$N]} | cut -d: -f8)
-
-					# handle swap
-					if [ "$FSYS" == "swap" ]; then
-						echo "Setting up swap on $PART..."
-						if ! mkswap $PART ; then
-							sleep 3
-							msgbox "Problem creating swap on $PART. Installation will continue."
-						fi
-					# create the filesystems if needed for every partition
-					elif [ "$FORMAT" == "yes" ]; then
-						echo "Formatting $PART as $FSYS..."
-						if ! mkfs.$FSYS $FORCE $PART $CHECK ; then
-							sleep 3
-							msgbox "Problem creating $FSYS filesystem on $PART. Installation will continue."
-						fi
-					fi
-					# again, weed out swap first
-					if [ "$FSYS" == "swap" ]; then
+  msgbox "You should now be ready to install lunar to your system. Lunar will now create filesystems if needed, make a swapfile if it was selected, and install all lunar packages to the newly setup system. Make sure you are done with partitioning and filesystem selection."
+  if confirm "Are you ready to install lunar?" ;  then
+    clear
+
+    ORDER=$(for (( N=0 ; N<${#PARTITIONS[@]} ; N++ )); do echo ${PARTITIONS[$N]} | cut -d: -f2 ; done | sort)
+
+    for MOUNTPOINT in $ORDER; do
+      for (( N=0 ; N<${#PARTITIONS[@]} ; N++ )); do
+        M=$(echo ${PARTITIONS[$N]} | cut -d: -f2)
+        if [ "$M" == "$MOUNTPOINT" ]; then
+          PART=$(echo ${PARTITIONS[$N]} | cut -d: -f1)
+          FSYS=$(echo ${PARTITIONS[$N]} | cut -d: -f3)
+          MNT_OPTS=$(echo ${PARTITIONS[$N]} | cut -d: -f4)
+          FSCK_PASS=$(echo ${PARTITIONS[$N]} | cut -d: -f5)
+          CHECK=$(echo ${PARTITIONS[$N]} | cut -d: -f6)
+          FORCE=$(echo ${PARTITIONS[$N]} | cut -d: -f7)
+          FORMAT=$(echo ${PARTITIONS[$N]} | cut -d: -f8)
+
+          # handle swap
+          if [ "$FSYS" == "swap" ]; then
+            echo "Setting up swap on $PART..."
+            if ! mkswap $PART ; then
+              sleep 3
+              msgbox "Problem creating swap on $PART. Installation will continue."
+            fi
+          # create the filesystems if needed for every partition
+          elif [ "$FORMAT" == "yes" ]; then
+            echo "Formatting $PART as $FSYS..."
+            if ! mkfs.$FSYS $FORCE $PART $CHECK ; then
+              sleep 3
+              msgbox "Problem creating $FSYS filesystem on $PART. Installation will continue."
+            fi
+          fi
+          # again, weed out swap first
+          if [ "$FSYS" == "swap" ]; then
                                                # We need to check that the swap device wasn't added already
                                                # or we end up with double entries in fstab if more than one
                                                # swap device was added
                                                if ! echo $FSTAB | grep -q $PART; then
-						            LABEL=$(fstab_style $PART $FSYS $MOUNTPOINT)
-					         	    if swapon $PART; then
-						        	    FSTAB="$FSTAB\n$LABEL\t$MOUNTPOINT\t$FSYS\t$MNT_OPTS\t\t0 $FSCK_PASS"
-							            swapoff $PART
-						            else
-							            sleep 3
-							             msgbox "Problem mounting swap on $PART. Installation will continue."
-						            fi
+                        LABEL=$(fstab_style $PART $FSYS $MOUNTPOINT)
+                        if swapon $PART; then
+                          FSTAB="$FSTAB\n$LABEL\t$MOUNTPOINT\t$FSYS\t$MNT_OPTS\t\t0 $FSCK_PASS"
+                          swapoff $PART
+                        else
+                          sleep 3
+                           msgbox "Problem mounting swap on $PART. Installation will continue."
+                        fi
                                                 fi
-					# then try to mount normal FS's
-					else
-						if [ ! -d $TARGET$MOUNTPOINT ] ; then
-							mkdir -p $TARGET$MOUNTPOINT
-						fi
-						if [ "$MNT_OPTS" != "defaults" ]; then
-							MNTOPTARGS="-e $MNT_OPTS"
-						else
-							MNTOPTARGS=""
-						fi
-						echo "Mounting $PART as $FSYS"
-                				LABEL=$(fstab_style $PART $FSYS $MOUNTPOINT)
-						if mount -n $PART $TARGET$MOUNTPOINT -t $FSYS $MNTOPTSARGS ; then
-							FSTAB="$FSTAB\n$LABEL\t$MOUNTPOINT\t$FSYS\t$MNT_OPTS\t0 $FSCK_PASS"
-							if [ "$FSYS" == "swap" ]; then
-								umount -n $PART
-							fi
-						else
-							sleep 3
-							msgbox "Problem mounting $FSYS filesystem on $PART. Installation will continue."
-						fi
-					fi
-				fi
-			done
-		done
-
-		# last we create the swapfile on the target
-		if [ -n "$SWAPFILE" ]; then
-			mkdir -p $TARGET$(dirname $SWAPFILE) &&
-			echo "Creating a swapfile of $SWAPSIZE MB at \"$SWAPFILE\"..." &&
-			if dd if=/dev/zero of=$TARGET$SWAPFILE bs=1M count=$SWAPSIZE &&
-				    mkswap $TARGET$SWAPFILE &&
-				    chmod 000 $TARGET$SWAPFILE
-			then
-				FSTAB="$FSTAB\n$SWAPFILE\tswap\tswap\tdefaults\t\t0 0"
-			else
-				sleep 3
-				msgbox "Problem creating swapfile. Installation will continue."
-			fi
-		fi
-
-		# calculate the total so we can display progress
-		NUM=$(wc -l $PACKAGES_LIST | awk '{print $1}')
-		# add the number of times we call percent_msg, subtract 2 for lilo/grub
-		(( NUM = NUM + 10 - 2 ))
-
-		cd $TARGET
-
-		(
-			percent_msg "Creating base LSB directories"
-			mkdir -p bin boot dev etc home lib mnt media
-			mkdir -p proc root sbin srv tmp usr var opt
-			mkdir -p sys
-			if [ `arch` == "x86_64" ]; then
-				ln -sf /lib lib64
-				ln -sf /usr/lib usr/lib64
-			fi
-			mkdir -p usr/{bin,games,include,lib,libexec,local,sbin,share,src}
-			mkdir -p usr/share/{dict,doc,info,locale,man,misc,terminfo,zoneinfo}
-			mkdir -p usr/share/man/man{1,2,3,4,5,6,7,8}
-			ln -sf share/doc usr/doc
-			ln -sf share/man usr/man
-			ln -sf share/info usr/info
-			mkdir -p etc/lunar/local/depends
+          # then try to mount normal FS's
+          else
+            if [ ! -d $TARGET$MOUNTPOINT ] ; then
+              mkdir -p $TARGET$MOUNTPOINT
+            fi
+            if [ "$MNT_OPTS" != "defaults" ]; then
+              MNTOPTARGS="-e $MNT_OPTS"
+            else
+              MNTOPTARGS=""
+            fi
+            echo "Mounting $PART as $FSYS"
+                        LABEL=$(fstab_style $PART $FSYS $MOUNTPOINT)
+            if mount -n $PART $TARGET$MOUNTPOINT -t $FSYS $MNTOPTSARGS ; then
+              FSTAB="$FSTAB\n$LABEL\t$MOUNTPOINT\t$FSYS\t$MNT_OPTS\t0 $FSCK_PASS"
+              if [ "$FSYS" == "swap" ]; then
+                umount -n $PART
+              fi
+            else
+              sleep 3
+              msgbox "Problem mounting $FSYS filesystem on $PART. Installation will continue."
+            fi
+          fi
+        fi
+      done
+    done
+
+    # last we create the swapfile on the target
+    if [ -n "$SWAPFILE" ]; then
+      mkdir -p $TARGET$(dirname $SWAPFILE) &&
+      echo "Creating a swapfile of $SWAPSIZE MB at \"$SWAPFILE\"..." &&
+      if dd if=/dev/zero of=$TARGET$SWAPFILE bs=1M count=$SWAPSIZE &&
+            mkswap $TARGET$SWAPFILE &&
+            chmod 000 $TARGET$SWAPFILE
+      then
+        FSTAB="$FSTAB\n$SWAPFILE\tswap\tswap\tdefaults\t\t0 0"
+      else
+        sleep 3
+        msgbox "Problem creating swapfile. Installation will continue."
+      fi
+    fi
+
+    # calculate the total so we can display progress
+    NUM=$(wc -l $PACKAGES_LIST | awk '{print $1}')
+    # add the number of times we call percent_msg, subtract 2 for lilo/grub
+    (( NUM = NUM + 10 - 2 ))
+
+    cd $TARGET
+
+    (
+      percent_msg "Creating base LSB directories"
+      mkdir -p bin boot dev etc home lib mnt media
+      mkdir -p proc root sbin srv tmp usr var opt
+      mkdir -p sys
+      if [ `arch` == "x86_64" ]; then
+        ln -sf /lib lib64
+        ln -sf /usr/lib usr/lib64
+      fi
+      mkdir -p usr/{bin,games,include,lib,libexec,local,sbin,share,src}
+      mkdir -p usr/share/{dict,doc,info,locale,man,misc,terminfo,zoneinfo}
+      mkdir -p usr/share/man/man{1,2,3,4,5,6,7,8}
+      ln -sf share/doc usr/doc
+      ln -sf share/man usr/man
+      ln -sf share/info usr/info
+      mkdir -p etc/lunar/local/depends
                         mkdir -p run/lock
                         ln -sf ../run var/run
                         ln -sf ../run/lock var/lock
-			mkdir -p var/log/lunar/{install,md5sum,compile,queue}
-			mkdir -p var/{cache,empty,lib,log,spool,state,tmp}
-			mkdir -p var/{cache,lib,log,spool,state}/lunar
-			mkdir -p var/state/discover
-			mkdir -p var/spool/mail
-			mkdir -p media/{cdrom0,cdrom1,floppy0,floppy1,mem0,mem1}
-			chmod 0700 root
-			chmod 1777 tmp var/tmp
-
-			if [ -f /var/cache/lunar/aaa_base.tar.xz ]; then
-				percent_msg "Installing aaa_base: base directories and files"
-				tar xJf /var/cache/lunar/aaa_base.tar.xz 2> /dev/null
-			fi
-			if [ -f /var/cache/lunar/aaa_dev.tar.xz ]; then
-				percent_msg "Installing aaa_dev: device nodes"
-				tar xJf /var/cache/lunar/aaa_dev.tar.xz 2> /dev/null
-			fi
-
-			for LINE in $(cat $PACKAGES_LIST | grep -v -e '^lilo:' -e '^grub:' -e '^grub2:') ; do
-				MOD=$(echo $LINE | cut -d: -f1)
-				VER=$(echo $LINE | cut -d: -f4)
-				SIZ=$(echo $LINE | cut -d: -f5)
-				percent_msg "Installing $MOD-$VER ($SIZ)\n\n($(basename /var/cache/lunar/$MOD-$VER-*.tar.xz))"
-				transfer_package $MOD
-			done
-
-			percent_msg "Installing moonbase"
-			(
-				cd $TARGET/var/lib/lunar
-				tar xjf $MOONBASE_TAR 2> /dev/null
-				tar j --list -f $MOONBASE_TAR | sed 's:^:/var/lib/lunar/:g' > $TARGET/var/log/lunar/install/moonbase-%DATE%
-				mkdir -p moonbase/zlocal
-			)
-
-			# transfer sources
-			#percent_msg "Copying sources"
-			#cp /var/spool/lunar/* $TARGET/var/spool/lunar/
-
-			# setup list of installed packages etc.
-			percent_msg "Updating administrative files"
-			echo "moonbase:%DATE%:installed:%DATE%:37000KB" >> $TARGET/var/state/lunar/packages
-			cp $TARGET/var/state/lunar/packages $TARGET/var/state/lunar/packages.backup
-			cp /var/state/lunar/depends        $TARGET/var/state/lunar/
-			cp /var/state/lunar/depends.backup $TARGET/var/state/lunar/
-			cp /var/state/lunar/depends.cache  $TARGET/var/state/lunar/
-			cp /var/state/lunar/module.index   $TARGET/var/state/lunar/
-
-			# more moonbase related stuff
-			percent_msg "Updating moonbase plugins"
-			chroot_run lsh update_plugins
-
-			# just to make sure
-			percent_msg "Running ldconfig"
-			chroot_run ldconfig
-
-			# pass through some of the configuration at this point:
-			percent_msg "Finishing up installation"
-			chroot_run systemd-machine-id-setup 2> /dev/null
-			echo -e "KEYMAP=$KEYMAP\nFONT=$CONSOLEFONT" > $TARGET/etc/vconsole.conf
-			[ -z "$LANG" ] || chroot_run localectl --no-ask-password set-locale "LANG=$LANG"
-			[ -z "$EDITOR" ] || echo "export EDITOR=\"$EDITOR\"" > $TARGET/etc/profile.d/editor.rc
-
-			# post-first-boot message:
-			#cp /etc/init.d/lunar-install $TARGET/etc/init.d/
-			#ln -sf /etc/init.d/lunar-install $TARGET/etc/rc3.d/S99lunar-install
-			cp /README $TARGET/root/README
-			cp $MOTD_FILE $TARGET/etc/motd
-
-			# save proxies
-			if [ -n "$HPROXY" -o -n "$FPROXY" -o -n "$NPROXY" ]; then
-			(
-				echo "# these proxy settings apply to wget only"
-				[ -z "$HPROXY" ] || echo "export http_proxy=\"$HPROXY\""
-				[ -z "$FPROXY" ] || echo "export ftp_proxy=\"$FPROXY\""
-				[ -z "$NPROXY" ] || echo "export no_proxy=\"$NPROXY\""
-			) > $TARGET/etc/profile.d/proxy.rc
-			fi
-
-			if [ -e etc/fstab ]; then
-				cp etc/fstab etc/fstab-
-			fi
-
-			echo -e "$FSTAB" >> etc/fstab
-			make_lilo_conf
-			make_grub_conf
-
-			# some more missing files:
-			#cp /etc/lunar.release $TARGET/etc/
-			cp /etc/lsb-release $TARGET/etc/
-			cp /etc/issue{,.net} $TARGET/etc/
+      mkdir -p var/log/lunar/{install,md5sum,compile,queue}
+      mkdir -p var/{cache,empty,lib,log,spool,state,tmp}
+      mkdir -p var/{cache,lib,log,spool,state}/lunar
+      mkdir -p var/state/discover
+      mkdir -p var/spool/mail
+      mkdir -p media/{cdrom0,cdrom1,floppy0,floppy1,mem0,mem1}
+      chmod 0700 root
+      chmod 1777 tmp var/tmp
+
+      if [ -f /var/cache/lunar/aaa_base.tar.xz ]; then
+        percent_msg "Installing aaa_base: base directories and files"
+        tar xJf /var/cache/lunar/aaa_base.tar.xz 2> /dev/null
+      fi
+      if [ -f /var/cache/lunar/aaa_dev.tar.xz ]; then
+        percent_msg "Installing aaa_dev: device nodes"
+        tar xJf /var/cache/lunar/aaa_dev.tar.xz 2> /dev/null
+      fi
+
+      for LINE in $(cat $PACKAGES_LIST | grep -v -e '^lilo:' -e '^grub:' -e '^grub2:') ; do
+        MOD=$(echo $LINE | cut -d: -f1)
+        VER=$(echo $LINE | cut -d: -f4)
+        SIZ=$(echo $LINE | cut -d: -f5)
+        percent_msg "Installing $MOD-$VER ($SIZ)\n\n($(basename /var/cache/lunar/$MOD-$VER-*.tar.xz))"
+        transfer_package $MOD
+      done
+
+      percent_msg "Installing moonbase"
+      (
+        cd $TARGET/var/lib/lunar
+        tar xjf $MOONBASE_TAR 2> /dev/null
+        tar j --list -f $MOONBASE_TAR | sed 's:^:/var/lib/lunar/:g' > $TARGET/var/log/lunar/install/moonbase-%DATE%
+        mkdir -p moonbase/zlocal
+      )
+
+      # transfer sources
+      #percent_msg "Copying sources"
+      #cp /var/spool/lunar/* $TARGET/var/spool/lunar/
+
+      # setup list of installed packages etc.
+      percent_msg "Updating administrative files"
+      echo "moonbase:%DATE%:installed:%DATE%:37000KB" >> $TARGET/var/state/lunar/packages
+      cp $TARGET/var/state/lunar/packages $TARGET/var/state/lunar/packages.backup
+      cp /var/state/lunar/depends        $TARGET/var/state/lunar/
+      cp /var/state/lunar/depends.backup $TARGET/var/state/lunar/
+      cp /var/state/lunar/depends.cache  $TARGET/var/state/lunar/
+      cp /var/state/lunar/module.index   $TARGET/var/state/lunar/
+
+      # more moonbase related stuff
+      percent_msg "Updating moonbase plugins"
+      chroot_run lsh update_plugins
+
+      # just to make sure
+      percent_msg "Running ldconfig"
+      chroot_run ldconfig
+
+      # pass through some of the configuration at this point:
+      percent_msg "Finishing up installation"
+      chroot_run systemd-machine-id-setup 2> /dev/null
+      echo -e "KEYMAP=$KEYMAP\nFONT=$CONSOLEFONT" > $TARGET/etc/vconsole.conf
+      [ -z "$LANG" ] || chroot_run localectl --no-ask-password set-locale "LANG=$LANG"
+      [ -z "$EDITOR" ] || echo "export EDITOR=\"$EDITOR\"" > $TARGET/etc/profile.d/editor.rc
+
+      # post-first-boot message:
+      #cp /etc/init.d/lunar-install $TARGET/etc/init.d/
+      #ln -sf /etc/init.d/lunar-install $TARGET/etc/rc3.d/S99lunar-install
+      cp /README $TARGET/root/README
+      cp $MOTD_FILE $TARGET/etc/motd
+
+      # save proxies
+      if [ -n "$HPROXY" -o -n "$FPROXY" -o -n "$NPROXY" ]; then
+      (
+        echo "# these proxy settings apply to wget only"
+        [ -z "$HPROXY" ] || echo "export http_proxy=\"$HPROXY\""
+        [ -z "$FPROXY" ] || echo "export ftp_proxy=\"$FPROXY\""
+        [ -z "$NPROXY" ] || echo "export no_proxy=\"$NPROXY\""
+      ) > $TARGET/etc/profile.d/proxy.rc
+      fi
+
+      if [ -e etc/fstab ]; then
+        cp etc/fstab etc/fstab-
+      fi
+
+      echo -e "$FSTAB" >> etc/fstab
+      make_lilo_conf
+      make_grub_conf
+
+      # some more missing files:
+      #cp /etc/lunar.release $TARGET/etc/
+      cp /etc/lsb-release $TARGET/etc/
+      cp /etc/issue{,.net} $TARGET/etc/
 
       # Some sane defaults
       GCC_VER=$(chroot_run lsh installed_version gcc)
@@ -1160,73 +1160,73 @@ LUNAR_ALIAS_UDEV="systemd"
 LUNAR_ALIAS_KMOD="kmod"
 EOF
 
-			# root user skel files
-			find $TARGET/etc/skel ! -type d | xargs -i cp '{}' $TARGET/root
+      # root user skel files
+      find $TARGET/etc/skel ! -type d | xargs -i cp '{}' $TARGET/root
 
-			# initialize the new machine:
-			touch $TARGET/var/log/{btmp,utmp,wtmp,lastlog}
-			chmod 0644 $TARGET/var/log/{utmp,wtmp,lastlog}
-			chmod 0600 $TARGET/var/log/btmp
+      # initialize the new machine:
+      touch $TARGET/var/log/{btmp,utmp,wtmp,lastlog}
+      chmod 0644 $TARGET/var/log/{utmp,wtmp,lastlog}
+      chmod 0600 $TARGET/var/log/btmp
 
-		# really we are done now ;^)
-		) | $DIALOG --title " Installing Lunar-Linux " --gauge "" 10 70 0
+    # really we are done now ;^)
+    ) | $DIALOG --title " Installing Lunar-Linux " --gauge "" 10 70 0
 
-		cd /
+    cd /
 
-		if (( STEP == 6 )); then
-			(( STEP++ ))
-		fi
-		T_OK=\\Z2
-		O_OK=
-		L_OK=
-	fi
+    if (( STEP == 6 )); then
+      (( STEP++ ))
+    fi
+    T_OK=\\Z2
+    O_OK=
+    L_OK=
+  fi
 }
 
 
 shell()
 {
-	echo "Press CTRL-D or type exit to return to the installer"
-	(
-		cd
-		SHELL=/bin/bash HOME=/root /bin/bash -ls
-	)
+  echo "Press CTRL-D or type exit to return to the installer"
+  (
+    cd
+    SHELL=/bin/bash HOME=/root /bin/bash -ls
+  )
 }
 
 
 configure_proxy()
 {
-	HTTP_PROMPT="Please enter the HTTP proxy server\nExample: http://192.168.1.1:8080/"
-	FTP_PROMPT="Please enter the FTP proxy server\nExample: http://192.168.1.1:8080/"
-	NO_PROMPT="Please enter all domains/ip addresses (comma-seperated) proxy should NOT be used for:\nExample: .mit.edu,mysite.com"
-	HPROXY=`inputbox "$HTTP_PROMPT"`           &&
-	FPROXY=`inputbox "$FTP_PROMPT" "$HPROXY"`  &&
-	NPROXY=`inputbox "$NO_PROMPT"`
+  HTTP_PROMPT="Please enter the HTTP proxy server\nExample: http://192.168.1.1:8080/"
+  FTP_PROMPT="Please enter the FTP proxy server\nExample: http://192.168.1.1:8080/"
+  NO_PROMPT="Please enter all domains/ip addresses (comma-seperated) proxy should NOT be used for:\nExample: .mit.edu,mysite.com"
+  HPROXY=`inputbox "$HTTP_PROMPT"`           &&
+  FPROXY=`inputbox "$FTP_PROMPT" "$HPROXY"`  &&
+  NPROXY=`inputbox "$NO_PROMPT"`
 }
 
 
 confirm_proxy_settings()
 {
-	FINISHED=NO
-	while [ "$FINISHED" != "YES" ]; do
-		PROMPT="Are these settings correct?"
-		PROMPT="$PROMPT\nHTTP Proxy:  $HPROXY"
-		PROMPT="$PROMPT\n FTP Proxy:  $FPROXY"
-		PROMPT="$PROMPT\n  No Proxy:  $NPROXY"
-
-		if confirm "$PROMPT" "--cr-wrap"; then
-			FINISHED=YES
-		else
-			configure_proxy
-			FINISHED=NO
-		fi
-	done
+  FINISHED=NO
+  while [ "$FINISHED" != "YES" ]; do
+    PROMPT="Are these settings correct?"
+    PROMPT="$PROMPT\nHTTP Proxy:  $HPROXY"
+    PROMPT="$PROMPT\n FTP Proxy:  $FPROXY"
+    PROMPT="$PROMPT\n  No Proxy:  $NPROXY"
+
+    if confirm "$PROMPT" "--cr-wrap"; then
+      FINISHED=YES
+    else
+      configure_proxy
+      FINISHED=NO
+    fi
+  done
 }
 
 
 proxy_exit_message()
 {
-	msgbox \
-		"Your proxy configuration has been saved.
+  msgbox \
+    "Your proxy configuration has been saved.
 
 Please note that these proxy settings will only be used
 by Lunar (wget) and possibly some other command-line utilities.
@@ -1239,17 +1239,17 @@ web browser, etc..."
 
 toggle()
 {
-	if [ `eval echo \\$$1` == "on" ]; then
-		eval $1=off
-	else
-		eval $1=on
-	fi
+  if [ `eval echo \\$$1` == "on" ]; then
+    eval $1=off
+  else
+    eval $1=on
+  fi
 }
 
 fstab_style_menu()
 {
     local TITLE HELP DEFAULT STYLE FSTAB_OPTIONS
-    
+
     TITLE="Fstab Style Menu"
     HELP="Please select preferred fstab mount style"
     FSTAB_STYLE=`$DIALOG --title "$TITLE" --default-item "$FSTAB_STYLE" --cr-wrap --menu "$HELP" 0 0 0 \
@@ -1262,31 +1262,31 @@ fstab_style_menu()
 ##
 # fstab_style partition fstype mountpoint
 #
-fstab_style() 
+fstab_style()
 {
     local PART PTYPE MNTPT UUID
-    
+
     PART=$1
     PTYPE=$2
     MNTPT=$3
-    
-    case "$FSTAB_STYLE" in 
-	DEV)
-	    # Do nothing
-	    echo $PART
-	    ;;
-	LABEL)
-	    set_fs_label $PART $PTYPE $MNTPT
-	    if [ "$PTYPE" == "swap" ]; then
-		echo "LABEL=swap${PART##*/}"
-	    else
-		echo "LABEL=$MNTPT"
-	    fi
-	    ;;
-	UUID)
-	    UUID=$(blkid -s UUID -o value $PART)
-	    echo "UUID=$UUID"
-	    ;;
+
+    case "$FSTAB_STYLE" in
+  DEV)
+      # Do nothing
+      echo $PART
+      ;;
+  LABEL)
+      set_fs_label $PART $PTYPE $MNTPT
+      if [ "$PTYPE" == "swap" ]; then
+    echo "LABEL=swap${PART##*/}"
+      else
+    echo "LABEL=$MNTPT"
+      fi
+      ;;
+  UUID)
+      UUID=$(blkid -s UUID -o value $PART)
+      echo "UUID=$UUID"
+      ;;
     esac
 }
 
@@ -1295,55 +1295,55 @@ fstab_style()
 #
 set_fs_label() {
     local PART PTYPE LABEL
-    
+
     PART=$1
     PTYPE=$2
     LABEL=$3
 
     case "$PTYPE" in
-	ext*)
-	    tune2fs -L $LABEL $PART &> /dev/null
-	    ;;
-	btrfs)
-	    btrfs filesystem label $PART $LABEL &> /dev/null
-	    ;;
-	xfs)
-	    xfs_admin -L $LABEL $PART &> /dev/null
-	    ;;
-	jfs)
-	    jfs_tune -L $LABEL $PART &> /dev/null
-	    ;;
-	swap)
-	    mkswap -L swap${PART##*/} $PART &> /dev/null
-	    ;;
-    esac	
+  ext*)
+      tune2fs -L $LABEL $PART &> /dev/null
+      ;;
+  btrfs)
+      btrfs filesystem label $PART $LABEL &> /dev/null
+      ;;
+  xfs)
+      xfs_admin -L $LABEL $PART &> /dev/null
+      ;;
+  jfs)
+      jfs_tune -L $LABEL $PART &> /dev/null
+      ;;
+  swap)
+      mkswap -L swap${PART##*/} $PART &> /dev/null
+      ;;
+    esac
 }
 
 show_consolefonts()
 {
-	FONTDIR="/usr/share/kbd/consolefonts"
-	cd $FONTDIR
-	FONTS=`ls *.{psf,psfu}.gz | sed -r "s/\.psfu?\.gz//"`
-
-	for FONT in $FONTS; do
-		echo $FONT
-		echo font
-	done
+  FONTDIR="/usr/share/kbd/consolefonts"
+  cd $FONTDIR
+  FONTS=`ls *.{psf,psfu}.gz | sed -r "s/\.psfu?\.gz//"`
+
+  for FONT in $FONTS; do
+    echo $FONT
+    echo font
+  done
 }
 
 
 font_menu()
 {
-	TITLE="Console Font Selection Menu"
-	HELP="Please select your preferred console fonts."
-	FONTS=`show_consolefonts`
-	CONSOLEFONT=${CONSOLEFONT:-default8x16}
-	CONSOLEFONT=`$DIALOG --title "$TITLE" --default-item "$CONSOLEFONT" --menu "$HELP" 0 0 0 $FONTS`
-	if [ $? == 0 ]; then
-		setfont $CONSOLEFONT
-		D_OK=\\Z2
-	fi
-	DEFAULT=E
+  TITLE="Console Font Selection Menu"
+  HELP="Please select your preferred console fonts."
+  FONTS=`show_consolefonts`
+  CONSOLEFONT=${CONSOLEFONT:-default8x16}
+  CONSOLEFONT=`$DIALOG --title "$TITLE" --default-item "$CONSOLEFONT" --menu "$HELP" 0 0 0 $FONTS`
+  if [ $? == 0 ]; then
+    setfont $CONSOLEFONT
+    D_OK=\\Z2
+  fi
+  DEFAULT=E
 }
 
 
@@ -1358,445 +1358,445 @@ show_languages()
 
 lang_menu()
 {
-	TITLE="Language Selection Menu"
-	HELP="While lunar is entirely in English
+  TITLE="Language Selection Menu"
+  HELP="While lunar is entirely in English
 it is possible to change the languages of many other programs.
 Please select your preferred langauge.
 
 This process will ONLY set the LANG environment variable. Do
 not expect any changes till you finish and reboot."
 
-	LANG=${LANG:-en_US}
-	LANG=$($DIALOG --title "Language Selection Menu" --default-item "$LANG" --menu "$HELP" 0 0 0 `show_languages`)
-	if [ $? == 0 ]; then
-		export LANG
-		E_OK=\\Z2
-	fi
-	DEFAULT=J
+  LANG=${LANG:-en_US}
+  LANG=$($DIALOG --title "Language Selection Menu" --default-item "$LANG" --menu "$HELP" 0 0 0 `show_languages`)
+  if [ $? == 0 ]; then
+    export LANG
+    E_OK=\\Z2
+  fi
+  DEFAULT=J
 }
 
 
 editor_menu()
 {
-	EDITOR=${EDITOR:-vi}
-	EDITOR=`$DIALOG --title "Editor Selection Menu" --default-item "$EDITOR" --item-help --cr-wrap \
-			--menu "Not all of these editors are available right away. Some require that you compile them yourself (like emacs) or are only available on the target installation, and possibly emulated through another editor" 0 0 0 \
-			"e3"    "fully available" \
-			    "an emacs, vim, pico emulator" \
-			"emacs" "emulated on the ISO by e3, not installed" \
-			    "Richard Stallmans editor" \
-			"joe"   "fully available" \
-			    "WS compatible editor" \
-			"nano"  "fully available" \
-			    "a pico clone" \
-			"vi"    "fully available" \
-			    "vim - good old vi" \
-			"zile"  "fully available" \
-			    "an emacs clone"`
-
-	export EDITOR
-	J_OK=\\Z2
-	DEFAULT=F
+  EDITOR=${EDITOR:-vi}
+  EDITOR=`$DIALOG --title "Editor Selection Menu" --default-item "$EDITOR" --item-help --cr-wrap \
+      --menu "Not all of these editors are available right away. Some require that you compile them yourself (like emacs) or are only available on the target installation, and possibly emulated through another editor" 0 0 0 \
+      "e3"    "fully available" \
+          "an emacs, vim, pico emulator" \
+      "emacs" "emulated on the ISO by e3, not installed" \
+          "Richard Stallmans editor" \
+      "joe"   "fully available" \
+          "WS compatible editor" \
+      "nano"  "fully available" \
+          "a pico clone" \
+      "vi"    "fully available" \
+          "vim - good old vi" \
+      "zile"  "fully available" \
+          "an emacs clone"`
+
+  export EDITOR
+  J_OK=\\Z2
+  DEFAULT=F
 }
 
 
 install_kernels()
 {
-	list_precompiled_kernels()
-	{
-		local LINE
-		while read LINE; do
-			echo $LINE | cut -d: -f1
-			echo $LINE | cut -d: -f3-
-			# same text below - more space for longer description
-			echo $LINE | cut -d: -f3-
-		done < $KERNEL_LIST
-	}
-
-	list_kernel_modules()
-	{
-		local LINE
-		while read LINE; do
-		    (
-			unset MISSING
-			MODULE=$(echo $LINE | cut -d: -f2)
-			for SOURCE in $(chroot_run lvu sources $MODULE) ; do
-				if [ ! -e $TARGET/var/spool/lunar/$SOURCE ]; then
-					MISSING=yes
-				fi
-			done
-			if [ -z "$MISSING" ]; then
-				echo $LINE | cut -d: -f1
-				echo $MODULE
-				echo $LINE | cut -d: -f3-
-			fi
-		    )
-		done < $KMOD_LIST
-	}
-
-	while true ; do
+  list_precompiled_kernels()
+  {
+    local LINE
+    while read LINE; do
+      echo $LINE | cut -d: -f1
+      echo $LINE | cut -d: -f3-
+      # same text below - more space for longer description
+      echo $LINE | cut -d: -f3-
+    done < $KERNEL_LIST
+  }
+
+  list_kernel_modules()
+  {
+    local LINE
+    while read LINE; do
+        (
+      unset MISSING
+      MODULE=$(echo $LINE | cut -d: -f2)
+      for SOURCE in $(chroot_run lvu sources $MODULE) ; do
+        if [ ! -e $TARGET/var/spool/lunar/$SOURCE ]; then
+          MISSING=yes
+        fi
+      done
+      if [ -z "$MISSING" ]; then
+        echo $LINE | cut -d: -f1
+        echo $MODULE
+        echo $LINE | cut -d: -f3-
+      fi
+        )
+    done < $KMOD_LIST
+  }
+
+  while true ; do
     # Lets shortcut here, if we only have one kernel we just install it without a dialog
     KERNELS_AVAIL=$(wc -l $KERNEL_LIST | cut -d' ' -f1)
     if [[ $KERNELS_AVAIL == 1 ]]; then
       KCOMMAND="P"
     else
-		  KCOMMAND=`$DIALOG --title "Kernel selection menu" --cancel-label "Exit" --default-item "P" --item-help --menu "In order to succesfully run linux you need to install the linux kernel, the heart of the operating system. You can choose between compiling one yourself or select a precompiled modular kernel." 0 0 0 \
-		  "P" "Install a precompiled kernel" "Fast and safe: these kernels should work on almost all machines" \
-		  "C" "Compile a kernel" "Custom configure and compile one of the linux kernels"`
+      KCOMMAND=`$DIALOG --title "Kernel selection menu" --cancel-label "Exit" --default-item "P" --item-help --menu "In order to succesfully run linux you need to install the linux kernel, the heart of the operating system. You can choose between compiling one yourself or select a precompiled modular kernel." 0 0 0 \
+      "P" "Install a precompiled kernel" "Fast and safe: these kernels should work on almost all machines" \
+      "C" "Compile a kernel" "Custom configure and compile one of the linux kernels"`
     fi
 
-		if [ $? != 0 ]; then
-			return
-		fi
+    if [ $? != 0 ]; then
+      return
+    fi
 
-		case $KCOMMAND in
-			C)
-				msgbox "This option is not available from the installer."
-			;;
-			P)
+    case $KCOMMAND in
+      C)
+        msgbox "This option is not available from the installer."
+      ;;
+      P)
         # Lets shortcut here, if we only have one kernel we just install it without a dialog
         if [[ $KERNELS_AVAIL == 1 ]]; then
           CCOMMAND=$(cut -d: -f1 $KERNEL_LIST)
         else
-				  CCOMMAND=`$DIALOG --title "Kernel selection menu" --cancel-label "Exit" --item-help --menu "" 0 0 0 \
-					  $(list_precompiled_kernels)`
+          CCOMMAND=`$DIALOG --title "Kernel selection menu" --cancel-label "Exit" --item-help --menu "" 0 0 0 \
+            $(list_precompiled_kernels)`
         fi
-				if [ -f "/var/cache/lunar/$CCOMMAND.tar.xz" ]; then
+        if [ -f "/var/cache/lunar/$CCOMMAND.tar.xz" ]; then
           clear
           echo "Installing kernel, please wait..."
-					cd $TARGET && tar xJf /var/cache/lunar/$CCOMMAND.tar.xz &> /dev/null
+          cd $TARGET && tar xJf /var/cache/lunar/$CCOMMAND.tar.xz &> /dev/null
           chroot_run cp /usr/src/linux/.config /etc/lunar/local/.config.current
 
-					KVER=$(grep "^$CCOMMAND:" $KERNEL_LIST | cut -d: -f2)
-					KVER_PATCH=$(echo $KVER | cut -d . -f 3)
-					KVER_FULL=$(echo $KVER | cut -d . -f 1,2).${KVER_PATCH:-0}
-
-					# Register the kernel module as installed
-					if ! grep -q "^linux:" $TARGET/var/state/lunar/packages; then
-						echo "linux:%DATE%:installed:$KVER:101500KB" >> $TARGET/var/state/lunar/packages
-					fi
-
-					# Generate kernel install log
-					#tar -tf /var/cache/lunar/$CCOMMAND.tar.xz | sed '/^usr\/src/d;s:^:/:g' >> $TARGET/var/log/lunar/install/linux-${CCOMMAND} 2> /dev/null
-
-					# Generate kernel md5sum log
-					#cat $TARGET/var/log/lunar/install/linux-${CCOMMAND} | xargs -i md5sum {} >> $TARGET/var/log/lunar/md5sum/linux-${CCOMMAND} 2> /dev/null
-
-					# let the plugin code handle the hard work
-					chroot_run depmod
-					chroot_run lsh update_bootloader $KVER_FULL $KVER &> /dev/null
-
-					msgbox "The precompiled kernel \"$CCOMMAND\" has been installed to your system."
-					if (( STEP == 8 )); then
-						(( STEP++ ))
-					fi
-					K_OK=\\Z2
-					R_OK=
-					U_OK=
-					H_OK=
-					V_OK=
-					G_OK=
-					A_OK=
-					break
-				fi
-			;;
-		esac
-	done
+          KVER=$(grep "^$CCOMMAND:" $KERNEL_LIST | cut -d: -f2)
+          KVER_PATCH=$(echo $KVER | cut -d . -f 3)
+          KVER_FULL=$(echo $KVER | cut -d . -f 1,2).${KVER_PATCH:-0}
+
+          # Register the kernel module as installed
+          if ! grep -q "^linux:" $TARGET/var/state/lunar/packages; then
+            echo "linux:%DATE%:installed:$KVER:101500KB" >> $TARGET/var/state/lunar/packages
+          fi
+
+          # Generate kernel install log
+          #tar -tf /var/cache/lunar/$CCOMMAND.tar.xz | sed '/^usr\/src/d;s:^:/:g' >> $TARGET/var/log/lunar/install/linux-${CCOMMAND} 2> /dev/null
+
+          # Generate kernel md5sum log
+          #cat $TARGET/var/log/lunar/install/linux-${CCOMMAND} | xargs -i md5sum {} >> $TARGET/var/log/lunar/md5sum/linux-${CCOMMAND} 2> /dev/null
+
+          # let the plugin code handle the hard work
+          chroot_run depmod
+          chroot_run lsh update_bootloader $KVER_FULL $KVER &> /dev/null
+
+          msgbox "The precompiled kernel \"$CCOMMAND\" has been installed to your system."
+          if (( STEP == 8 )); then
+            (( STEP++ ))
+          fi
+          K_OK=\\Z2
+          R_OK=
+          U_OK=
+          H_OK=
+          V_OK=
+          G_OK=
+          A_OK=
+          break
+        fi
+      ;;
+    esac
+  done
 }
 
 
 install_bootloader() {
-	while true ; do
-		BCOMMAND=`$DIALOG --title "Boot loader menu" --default-item "G" --item-help --menu "You will need a boot loader to start linux automatically when your computer boots. You can chose not to install a boot loader now, or pick one of the available boot loaders and options below. You can always change to the other boot loader later." 0 0 0 \
-		$(if pkg_avail grub2 ; then echo "G" ; echo "grub2" ; echo "Install grub2 as boot loader"; fi) \
-		$(if pkg_avail grub ; then echo "B" ; echo "grub" ; echo "Install grub as boot loader"; fi) \
-		$(if pkg_avail lilo ; then echo "L" ; echo "lilo" ; echo "Install lilo as boot loader"; fi) \
-		"N" "none" "Do not install a boot loader"`
-
-		if [ $? != 0 ] ; then
-			continue
-		fi
-
-		case $BCOMMAND in
-			L)
-			BOOTLOADER=lilo
-			transfer_package $BOOTLOADER
-			chroot_run lsh update_plugin $BOOTLOADER "install"
-			msgbox "The lilo boot loader package was installed. From now on, when you add a kernel, lilo will be run after the /etc/lilo.conf configuration file has been updated. "
-		;;
-			G)
-			BOOTLOADER=grub2
-			transfer_package $BOOTLOADER
-			chroot_run lsh update_plugin $BOOTLOADER "install"
-			install_grub2
-			msgbox "The grub2 boot loader package was installed. From now on, when you add a kernel, it will be available through grub2 on boot."
-		;;
-			B)
-			BOOTLOADER=grub
-			transfer_package $BOOTLOADER
-			chroot_run lsh update_plugin $BOOTLOADER "install"
-			install_grub
-			msgbox "The grub boot loader package was installed. From now on, when you add a kernel, it will be available through grub on boot."
-		;;
-		N)
-			msgbox "Not installing a boot loader requires you to create a boot floppy, or configure your bootloader manually using another installed operating system. Lunar also does not install lilo or grub on the hard disc."
-			;;
-		esac
-
-		if (( STEP == 7 )); then
-			(( STEP++ ))
-		fi
-		L_OK=\\Z2
-		K_OK=
-		return
-	done
+  while true ; do
+    BCOMMAND=`$DIALOG --title "Boot loader menu" --default-item "G" --item-help --menu "You will need a boot loader to start linux automatically when your computer boots. You can chose not to install a boot loader now, or pick one of the available boot loaders and options below. You can always change to the other boot loader later." 0 0 0 \
+    $(if pkg_avail grub2 ; then echo "G" ; echo "grub2" ; echo "Install grub2 as boot loader"; fi) \
+    $(if pkg_avail grub ; then echo "B" ; echo "grub" ; echo "Install grub as boot loader"; fi) \
+    $(if pkg_avail lilo ; then echo "L" ; echo "lilo" ; echo "Install lilo as boot loader"; fi) \
+    "N" "none" "Do not install a boot loader"`
+
+    if [ $? != 0 ] ; then
+      continue
+    fi
+
+    case $BCOMMAND in
+      L)
+      BOOTLOADER=lilo
+      transfer_package $BOOTLOADER
+      chroot_run lsh update_plugin $BOOTLOADER "install"
+      msgbox "The lilo boot loader package was installed. From now on, when you add a kernel, lilo will be run after the /etc/lilo.conf configuration file has been updated. "
+    ;;
+      G)
+      BOOTLOADER=grub2
+      transfer_package $BOOTLOADER
+      chroot_run lsh update_plugin $BOOTLOADER "install"
+      install_grub2
+      msgbox "The grub2 boot loader package was installed. From now on, when you add a kernel, it will be available through grub2 on boot."
+    ;;
+      B)
+      BOOTLOADER=grub
+      transfer_package $BOOTLOADER
+      chroot_run lsh update_plugin $BOOTLOADER "install"
+      install_grub
+      msgbox "The grub boot loader package was installed. From now on, when you add a kernel, it will be available through grub on boot."
+    ;;
+    N)
+      msgbox "Not installing a boot loader requires you to create a boot floppy, or configure your bootloader manually using another installed operating system. Lunar also does not install lilo or grub on the hard disc."
+      ;;
+    esac
+
+    if (( STEP == 7 )); then
+      (( STEP++ ))
+    fi
+    L_OK=\\Z2
+    K_OK=
+    return
+  done
 }
 
 
 install_menu()
 {
-	if [ -z "$STEPS" ]; then
-		# the total number of steps in the installer:
-		STEPS=15
+  if [ -z "$STEPS" ]; then
+    # the total number of steps in the installer:
+    STEPS=15
 
-		SH[1]="Please read the introduction if you are new to lunar-linux.
+    SH[1]="Please read the introduction if you are new to lunar-linux.
 If you want to know more about the installation procedure
 and recent changes please visit http://lunar-linux.org/
 before proceeding."
-		SH[2]="You can now set various system defaults that
+    SH[2]="You can now set various system defaults that
 are not vital but make your linux system more friendly
 to your users."
-		SH[3]="You need to create partitions if you are installing on
+    SH[3]="You need to create partitions if you are installing on
 a new disc or in free space. If you want to delete other
 operating systems you will also need to partition your disc."
-		SH[4]="You need to mount a filesystem so that lunar can be
+    SH[4]="You need to mount a filesystem so that lunar can be
 transferred to it. Usually you make 3 to 5 separate
 partitions like /boot, /var and /usr. After mounting
 them the lunar packages can be transferred to them."
-		SH[5]="Swap is like temporary memory. It improves your
+    SH[5]="Swap is like temporary memory. It improves your
 systems performance. You can create a swapfile or
 even whole swap partitions."
-		SH[6]="During the transfer all programs and files that you
+    SH[6]="During the transfer all programs and files that you
 need to run lunar-linux will be copied to your system."
-		SH[7]="To be able to boot linux on reboot, you need to have
+    SH[7]="To be able to boot linux on reboot, you need to have
 a boot loader that loads the kernel when you power on
 your computer. Without it linux does not run."
-		SH[8]="You cannot boot linux without the kernel. You will
+    SH[8]="You cannot boot linux without the kernel. You will
 need to install at least one. You can choose between
 several factory kernels or compile one yourself."
-		SH[9]="Make sure you set good passwords, especially for
+    SH[9]="Make sure you set good passwords, especially for
 the root user. Everyone who knows this password can
 destroy your system. By default the root password is
 epmty so you should really change it"
-		SH[10]="Add normal user accounts to this system. Normal users do not have special privileges and you should not work as root all the time if not needed."
-		SH[11]="You can now set the name and domain of the machine
+    SH[10]="Add normal user accounts to this system. Normal users do not have special privileges and you should not work as root all the time if not needed."
+    SH[11]="You can now set the name and domain of the machine
 and configure it's networking connections."
-		SH[12]="By default there are no services installed and
+    SH[12]="By default there are no services installed and
 running. With this tool you can add or remove them to
 the list of startup services and enable or disable them."
-		SH[13]="If you want to run a ssh server (recommended) then
+    SH[13]="If you want to run a ssh server (recommended) then
 you must once create unique keys for this system. These
 keys are the identification of your system and make it
 recognizeable across the network."
-		SH[14]="Select the local timezone of your computer
+    SH[14]="Select the local timezone of your computer
 to make sure that applications running are using the correct
 time zone information and adjust daylight savings."
-		SH[15]="You are done! you should remove the ISO from the
+    SH[15]="You are done! you should remove the ISO from the
 cd-rom tray and reboot. See you at the login prompt!"
 
-		B_LABEL="One step back"
-		B_HELP="Go back one step in the installation procedure"
-		F_LABEL="One step forward"
-		F_HELP="Go forward one step in the installation procedure"
-
-		I_LABEL="Introduction into lunar-linux"
-		I_HELP="Read about the advantages of using Lunar Linux"
-
-		C_LABEL="Select a keyboard map"
-		C_HELP="Select keyboard map"
-		D_LABEL="Select a console font"
-		D_HELP="Select a console font"
-		E_LABEL="Set global language"
-		E_HELP="Set global language"
-		J_LABEL="Select a default editor"
-		J_HELP="Select a default editor"
-
-		P_LABEL="Partition discs"
-		P_HELP="Use fdisk or cfdisk to prepare hard drive partitions"
-		W_LABEL="Setup Linux Software RAID"
-		W_HELP="Linux software RAID can increase redundancy or speed of hard discs"
-		M_LABEL="Select target partitions"
-		M_HELP="Select target partitions for installation"
-		S_LABEL="Select a swapfile"
-		S_HELP="You don't need to setup a separate swap partition but can use a swapfile"
-		S_OK="\\Z1"
-		T_LABEL="Install lunar"
-		T_HELP="Create filesystems, swapfile and install all packages onto the target system NOW"
-		T_OK="\\Z1"
-		O_LABEL="Configure compiler optimizations"
-		O_HELP="Select architecture and optimizations"
-		O_OK="\\Z1"
-		L_LABEL="Install boot loader"
-		L_HELP="Install a boot loader to boot into Lunar"
-		L_OK="\\Z1"
-		K_LABEL="Install kernel(s)"
-		K_HELP="Install kernel(s) on the new installation"
-		K_OK="\\Z1"
-
-		R_LABEL="Set root password"
-		R_HELP="Set root password needed to access this system (the default password is empty)"
-		R_OK="\\Z1"
-		U_LABEL="Setup user accounts"
-		U_HELP="Create, edit, delete users and group accounts on the system"
-		U_OK="\\Z1"
-		H_LABEL="Setup hostname and networking"
-		H_HELP="Configure your network devices and hostname settings"
-		H_OK="\\Z1"
-		V_LABEL="Administrate services"
-		V_HELP="Configure services to start automatically at boot time"
-		V_OK="\\Z1"
-		G_LABEL="Create SSH server keys"
-		G_HELP="Generate the SSH server keys"
-		G_OK="\\Z1"
-		A_LABEL="Select a timezone"
-		A_HELP="Select a timezone"
-		A_OK="\\Z1"
-
-		X_LABEL="Exit into rescue shell or reboot"
-		X_HELP="This launches a a rescue shell or reboots your system"
-		Z_LABEL="Finished installing!"
-		Z_HELP="You're done! Now go reboot and use lunar-linux!"
-		Z_OK="\\Z0"
-
-		STEP=1
-	fi
-
-	choices()
-	{
-	  (
-		export IFS=$' \t\n'
-		for CHOICE in $@; do
-			echo $CHOICE
-			eval echo \$${CHOICE}_OK\$${CHOICE}_LABEL\\\\Z0
-			eval echo \$${CHOICE}_HELP
-		done
-		export IFS=$'\t\n'
-	  )
-	}
-
-	if [ "$GUIDE" == "off" ]; then
-		CHOICES="X I C D E J P W M S T O L K R U H V G A Z"
-		STEPHELP="Step $STEP of $STEPS:"
-	else
-		case $STEP in
-		1)  DEFAULT=I ; CHOICES="X I F" ;;
-		2)              CHOICES="B C D E J F" ;;
-		3)  DEFAULT=P ; CHOICES="B P W M F" ;;
-		4)  DEFAULT=M ; CHOICES="B P W M F" ;;
-		5)  DEFAULT=S ; CHOICES="B P W M S F" ;;
-		6)  DEFAULT=T ; CHOICES="B P W M S T F" ;;
-		7)  DEFAULT=L ; CHOICES="B O L F" ;;
-		8)  DEFAULT=K ; CHOICES="B O L K F" ;;
-		9)  DEFAULT=R ; CHOICES="B R U F" ;;
-		10) DEFAULT=U ; CHOICES="B R U F" ;;
-		11) DEFAULT=H ; CHOICES="B H F" ;;
-		12) DEFAULT=V ; CHOICES="B H V F" ;;
-		13) DEFAULT=G ; CHOICES="B H V G F" ;;
-		14) DEFAULT=A ; CHOICES="B H V G A F" ;;
-		15) DEFAULT=Z ; CHOICES="B Z"
-		esac
-	fi
-	COMMAND=`$DIALOG --title "Lunar-Linux install menu" --nocancel --default-item "$DEFAULT" --item-help --extra-button --extra-label "Settings" --colors --menu "Step $STEP of $STEPS - \n\n${SH[$STEP]}" 0 0 0 $(choices $CHOICES)`
-
-	case $? in
-		3)
-			COMMAND=S
-			while true; do
-				DEFAULT=$COMMAND
-				COMMAND=`$DIALOG --title "Settings / Special actions" \
-					--default-item "$DEFAULT" \
-					--cancel-label "Exit" \
-					--menu "Installer settings and misc. options" 0 0 0 \
-					"G" "Toggle guided menus on/off                     [$GUIDE]" \
-					"C" "Toggle asking of confirmations on/off          [$CONFIRM]" \
-					"D" "Toggle disabling the ability to perform steps  [$DISABLE]" \
+    B_LABEL="One step back"
+    B_HELP="Go back one step in the installation procedure"
+    F_LABEL="One step forward"
+    F_HELP="Go forward one step in the installation procedure"
+
+    I_LABEL="Introduction into lunar-linux"
+    I_HELP="Read about the advantages of using Lunar Linux"
+
+    C_LABEL="Select a keyboard map"
+    C_HELP="Select keyboard map"
+    D_LABEL="Select a console font"
+    D_HELP="Select a console font"
+    E_LABEL="Set global language"
+    E_HELP="Set global language"
+    J_LABEL="Select a default editor"
+    J_HELP="Select a default editor"
+
+    P_LABEL="Partition discs"
+    P_HELP="Use fdisk or cfdisk to prepare hard drive partitions"
+    W_LABEL="Setup Linux Software RAID"
+    W_HELP="Linux software RAID can increase redundancy or speed of hard discs"
+    M_LABEL="Select target partitions"
+    M_HELP="Select target partitions for installation"
+    S_LABEL="Select a swapfile"
+    S_HELP="You don't need to setup a separate swap partition but can use a swapfile"
+    S_OK="\\Z1"
+    T_LABEL="Install lunar"
+    T_HELP="Create filesystems, swapfile and install all packages onto the target system NOW"
+    T_OK="\\Z1"
+    O_LABEL="Configure compiler optimizations"
+    O_HELP="Select architecture and optimizations"
+    O_OK="\\Z1"
+    L_LABEL="Install boot loader"
+    L_HELP="Install a boot loader to boot into Lunar"
+    L_OK="\\Z1"
+    K_LABEL="Install kernel(s)"
+    K_HELP="Install kernel(s) on the new installation"
+    K_OK="\\Z1"
+
+    R_LABEL="Set root password"
+    R_HELP="Set root password needed to access this system (the default password is empty)"
+    R_OK="\\Z1"
+    U_LABEL="Setup user accounts"
+    U_HELP="Create, edit, delete users and group accounts on the system"
+    U_OK="\\Z1"
+    H_LABEL="Setup hostname and networking"
+    H_HELP="Configure your network devices and hostname settings"
+    H_OK="\\Z1"
+    V_LABEL="Administrate services"
+    V_HELP="Configure services to start automatically at boot time"
+    V_OK="\\Z1"
+    G_LABEL="Create SSH server keys"
+    G_HELP="Generate the SSH server keys"
+    G_OK="\\Z1"
+    A_LABEL="Select a timezone"
+    A_HELP="Select a timezone"
+    A_OK="\\Z1"
+
+    X_LABEL="Exit into rescue shell or reboot"
+    X_HELP="This launches a a rescue shell or reboots your system"
+    Z_LABEL="Finished installing!"
+    Z_HELP="You're done! Now go reboot and use lunar-linux!"
+    Z_OK="\\Z0"
+
+    STEP=1
+  fi
+
+  choices()
+  {
+    (
+    export IFS=$' \t\n'
+    for CHOICE in $@; do
+      echo $CHOICE
+      eval echo \$${CHOICE}_OK\$${CHOICE}_LABEL\\\\Z0
+      eval echo \$${CHOICE}_HELP
+    done
+    export IFS=$'\t\n'
+    )
+  }
+
+  if [ "$GUIDE" == "off" ]; then
+    CHOICES="X I C D E J P W M S T O L K R U H V G A Z"
+    STEPHELP="Step $STEP of $STEPS:"
+  else
+    case $STEP in
+    1)  DEFAULT=I ; CHOICES="X I F" ;;
+    2)              CHOICES="B C D E J F" ;;
+    3)  DEFAULT=P ; CHOICES="B P W M F" ;;
+    4)  DEFAULT=M ; CHOICES="B P W M F" ;;
+    5)  DEFAULT=S ; CHOICES="B P W M S F" ;;
+    6)  DEFAULT=T ; CHOICES="B P W M S T F" ;;
+    7)  DEFAULT=L ; CHOICES="B O L F" ;;
+    8)  DEFAULT=K ; CHOICES="B O L K F" ;;
+    9)  DEFAULT=R ; CHOICES="B R U F" ;;
+    10) DEFAULT=U ; CHOICES="B R U F" ;;
+    11) DEFAULT=H ; CHOICES="B H F" ;;
+    12) DEFAULT=V ; CHOICES="B H V F" ;;
+    13) DEFAULT=G ; CHOICES="B H V G F" ;;
+    14) DEFAULT=A ; CHOICES="B H V G A F" ;;
+    15) DEFAULT=Z ; CHOICES="B Z"
+    esac
+  fi
+  COMMAND=`$DIALOG --title "Lunar-Linux install menu" --nocancel --default-item "$DEFAULT" --item-help --extra-button --extra-label "Settings" --colors --menu "Step $STEP of $STEPS - \n\n${SH[$STEP]}" 0 0 0 $(choices $CHOICES)`
+
+  case $? in
+    3)
+      COMMAND=S
+      while true; do
+        DEFAULT=$COMMAND
+        COMMAND=`$DIALOG --title "Settings / Special actions" \
+          --default-item "$DEFAULT" \
+          --cancel-label "Exit" \
+          --menu "Installer settings and misc. options" 0 0 0 \
+          "G" "Toggle guided menus on/off                     [$GUIDE]" \
+          "C" "Toggle asking of confirmations on/off          [$CONFIRM]" \
+          "D" "Toggle disabling the ability to perform steps  [$DISABLE]" \
                                         "F" "Configure fstab mount style                    [$FSTAB_STYLE]" \
-					"M" "Load more kernel modules" \
-					"S" "Temporarily run a shell" \
-					"Q" "Quit the installer"`
-				if [ $? != 0 ]; then
-					return
-				fi
-				case $COMMAND in
-					G) toggle GUIDE ;;
-					C) toggle CONFIRM ;;
-					D) toggle DISABLE ;;
+          "M" "Load more kernel modules" \
+          "S" "Temporarily run a shell" \
+          "Q" "Quit the installer"`
+        if [ $? != 0 ]; then
+          return
+        fi
+        case $COMMAND in
+          G) toggle GUIDE ;;
+          C) toggle CONFIRM ;;
+          D) toggle DISABLE ;;
                                         F) fstab_style_menu ;;
-					S) shell ;;
-					M) load_module ;;
-					Q) goodbye ;;
-				esac
-			done
-		;;
-	esac
-
-	eval "TEST=\$${COMMAND}_OK"
-	if [ "$DISABLE" == "on" -a "$TEST" == "\\Z1" ]; then
-		$DIALOG --title "Cannot perform this step yet" --colors --msgbox "This action cannot be performed yet. You need to complete one of the earlier steps succesfully first before you can try this action. Please go a step back and perform all the necessary actions before trying this item again. As a guide, the actions that you have performed are \Z2colored green\Z0. The ones that you cannot perform yet are \Z1colored red\Z0." 15 65
-		return
-	fi
-
-	case $COMMAND in
-	  F)  if (( STEP < $STEPS )); then (( STEP++ )) ; fi ;;
-	  B)  if (( STEP > 0 )); then (( STEP-- )) ; fi ;;
-
-	  X)  goodbye                ;;
-	  I)  introduction           ;;
-
-	  C)  keymap_menu            ;;
-	  D)  font_menu              ;;
-	  E)  lang_menu              ;;
-	  J)  editor_menu            ;;
-
-	  P)  partition_discs        ;;
-	  W)  raid_setup             ;;
-	  M)  select_partitions      ;;
-	  S)  select_swap_file       ;;
-	  T)  transfer               ;;
-
-	  O)  chroot_run lunar optimize ;;
-	  L)  install_bootloader     ;;
-	  K)  install_kernels        ;;
-
-	  R)  USE_CLEAR=1 chroot_run passwd    ; if (( STEP ==  9 )) ; then (( STEP++ )); fi ; R_OK=\\Z2 ;;
-	  U)  chroot_run luser     ; if (( STEP == 10 )) ; then (( STEP++ )); fi ; U_OK=\\Z2 ;;
-	  H)  chroot_run lnet      ; if (( STEP == 11 )) ; then (( STEP++ )); fi ; H_OK=\\Z2 ;;
-	  V)  chroot_run lservices ; if (( STEP == 12 )) ; then (( STEP++ )); fi ; V_OK=\\Z2 ;;
-	  G)  chroot_run make -C /etc/ssh server-keys ; if (( STEP == 13 )) ; then (( STEP++ )); fi ; G_OK=\\Z2 ;;
-	  A)  chroot_run ltime     ; if (( STEP == 14 )) ; then (( STEP++ )); fi ; A_OK=\\Z2 ;;
-
-	  Z)  goodbye                ;;
-	esac
+          S) shell ;;
+          M) load_module ;;
+          Q) goodbye ;;
+        esac
+      done
+    ;;
+  esac
+
+  eval "TEST=\$${COMMAND}_OK"
+  if [ "$DISABLE" == "on" -a "$TEST" == "\\Z1" ]; then
+    $DIALOG --title "Cannot perform this step yet" --colors --msgbox "This action cannot be performed yet. You need to complete one of the earlier steps succesfully first before you can try this action. Please go a step back and perform all the necessary actions before trying this item again. As a guide, the actions that you have performed are \Z2colored green\Z0. The ones that you cannot perform yet are \Z1colored red\Z0." 15 65
+    return
+  fi
+
+  case $COMMAND in
+    F)  if (( STEP < $STEPS )); then (( STEP++ )) ; fi ;;
+    B)  if (( STEP > 0 )); then (( STEP-- )) ; fi ;;
+
+    X)  goodbye                ;;
+    I)  introduction           ;;
+
+    C)  keymap_menu            ;;
+    D)  font_menu              ;;
+    E)  lang_menu              ;;
+    J)  editor_menu            ;;
+
+    P)  partition_discs        ;;
+    W)  raid_setup             ;;
+    M)  select_partitions      ;;
+    S)  select_swap_file       ;;
+    T)  transfer               ;;
+
+    O)  chroot_run lunar optimize ;;
+    L)  install_bootloader     ;;
+    K)  install_kernels        ;;
+
+    R)  USE_CLEAR=1 chroot_run passwd    ; if (( STEP ==  9 )) ; then (( STEP++ )); fi ; R_OK=\\Z2 ;;
+    U)  chroot_run luser     ; if (( STEP == 10 )) ; then (( STEP++ )); fi ; U_OK=\\Z2 ;;
+    H)  chroot_run lnet      ; if (( STEP == 11 )) ; then (( STEP++ )); fi ; H_OK=\\Z2 ;;
+    V)  chroot_run lservices ; if (( STEP == 12 )) ; then (( STEP++ )); fi ; V_OK=\\Z2 ;;
+    G)  chroot_run make -C /etc/ssh server-keys ; if (( STEP == 13 )) ; then (( STEP++ )); fi ; G_OK=\\Z2 ;;
+    A)  chroot_run ltime     ; if (( STEP == 14 )) ; then (( STEP++ )); fi ; A_OK=\\Z2 ;;
+
+    Z)  goodbye                ;;
+  esac
 }
 
 
 main()
 {
-	export PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin"
-	# setting this var is supposed to prevent the enviro_check code now!
-	export LUNAR_INSTALL=1
+  export PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin"
+  # setting this var is supposed to prevent the enviro_check code now!
+  export LUNAR_INSTALL=1
 
-	TARGET="/mnt"
-	CONFIRM=on
-	GUIDE=on
-	DISABLE=on
-	FSTAB_STYLE="UUID"
+  TARGET="/mnt"
+  CONFIRM=on
+  GUIDE=on
+  DISABLE=on
+  FSTAB_STYLE="UUID"
 
-	block_devices init
+  block_devices init
 
-	while true; do
-		install_menu
-	done
+  while true; do
+    install_menu
+  done
 }
 
 
@@ -1822,24 +1822,24 @@ cd /
 # load modules when passed on the boot prompt$
 IFS=$' \t\n'
 for module in $(cat /proc/cmdline); do
-	if grep -q "/${module}.ko:" /lib/modules/`uname -r`/modules.dep ; then
-		modprobe $module
-	fi
+  if grep -q "/${module}.ko:" /lib/modules/`uname -r`/modules.dep ; then
+    modprobe $module
+  fi
 done
 IFS=$'\t\n'
 
 # allow custom startup scripts to run instead of the installer
 if [ -x /run.sh ]; then
-	echo ""
-	echo "  /--------------------------------------------------\\"
-	echo "  |                                                  |"
-	echo "  |  Executing /run.sh instead of the lunar-linux    |"
-	echo "  |  installer! If something goes wrong then you're  |"
-	echo "  |  on your own, sorry...                           |"
-	echo "  |                                                  |"
-	echo "  \\--------------------------------------------------/"
-	/run.sh
+  echo ""
+  echo "  /--------------------------------------------------\\"
+  echo "  |                                                  |"
+  echo "  |  Executing /run.sh instead of the lunar-linux    |"
+  echo "  |  installer! If something goes wrong then you're  |"
+  echo "  |  on your own, sorry...                           |"
+  echo "  |                                                  |"
+  echo "  \\--------------------------------------------------/"
+  /run.sh
 else
-	main
+  main
 fi
 




More information about the Lunar-commits mailing list