Browse Source

Stefan Fiedler:


			
			
				rocklinux
			
			
		
Stefan Fiedler 16 years ago
parent
commit
9aadf588f6
4 changed files with 23 additions and 18 deletions
  1. +1
    -0
      package/base/installer/installer.desc
  2. +1
    -1
      package/base/installer/parse-config
  3. +14
    -13
      package/base/installer/stone_mod_install_filesystems.sh
  4. +7
    -4
      package/base/mdadm/stone_mod_install_filesystems_mdadm.sh

+ 1
- 0
package/base/installer/installer.desc

@ -31,6 +31,7 @@
[M] Benjamin Schieder <blindcoder@rocklinux.org>
[C] base/system
[F] CORE
[L] GPL
[S] Alpha

+ 1
- 1
package/base/installer/parse-config

@ -1,5 +1,5 @@
stone_mod_install_installer(){
for x in $( cd ${confdir} ; echo stone_mod_install*.sh ) ; do
for x in $( cd ${confdir} ; echo stone_mod_*.sh ) ; do
[ -e "${confdir}/${x}" ] || continue
cp -v ${confdir}/${x} ${root}/etc/stone.d/${x#stone_}
done

+ 14
- 13
package/base/installer/stone_mod_install_filesystems.sh

@ -142,12 +142,14 @@ main_setup_filesystems_add_part(){
local disk="${1}"
local size="${2}"
local tmp="$(mktemp)"
disktype "${disk}" > "${tmp}"
if [ -z "${size}" ] ; then
read a b c d e g h < <( grep ^Block\ device "${tmp}" )
size="${g#(}"
if [ -z "${size}" ] ; then
size="$( blockdev --getsize64 ${disk} )"
fi
disktype "${disk}" > "${tmp}"
read fstype rest < <( grep " file system" "${tmp}" )
grep -q "^Linux swap" "${tmp}" && fstype="Swap"
grep -q 'RAID set UUID' "${tmp}" && fstype="RAID"
fstype="${fstype:-Unknown}"
@ -189,31 +191,30 @@ main_setup_filesystems() {
for disk in /dev/disk/by-id/* ; do
type="${disk##*/}"
type="${type%%-*}"
if [ "${type}" == "ata" -o "${type}" == "usb" ] ; then
if [ "${type}" == "ata" -o "${type}" == "usb" -o "${type}" == "sata" -o "${type}" == "scsi" ] ; then
tmp="$(mktemp)"
disktype "${disk}" > "${tmp}"
[ -f "${tmp}" ] || smartctl -d ata -i "${disk}" > "${tmp}"
if [ "${type}" == "ata" ] ; then
read a b model < <( grep ^Device\ Model "${tmp}" )
read a b serial < <( grep ^Serial\ Number "${tmp}" )
type="ATA"
if [ "${type}" == "ata" -o "${type}" == "sata" -o "${type}" == "scsi" ] ; then
hdparm -i "${disk}" >> "${tmp}"
model="$(sed -e"s:Model=*\(.*\), FwRev.*:\1:p ; d" < ${tmp})"
serial="$(sed -e"s:.*SerialNo=*\(.*\):\1:p ; d" < ${tmp})"
elif [ "${type}" == "usb" ] ; then
model="USB Device"
serial="${disk%-*}"
serial="${serial##*-}"
type="USB"
else
type="UNKNOWN"
unset model serial
fi
type=$( echo $type | tr '[:lower:]' '[:upper:]')
if [ "${disk%-part*}" != "${disk}" ] ; then
# is a partition
main_setup_filesystems_add_part "${disk}" ""
else
# is a disk
if [ -z "${size}" ] ; then
read a b c d e g h < <( grep ^Block\ device "${tmp}" )
size="${g#(}"
size=$( blockdev --getsize64 ${disk} )
fi
DISKS="${DISKS} '${type} Disk (${model:-Unknown Model} - ${serial:-Unknown Serial Number} - $(( ${size} / 1024 / 1024 )) MB)' 'main_edit_disk ${disk}'"
fi

+ 7
- 4
package/base/mdadm/stone_mod_install_filesystems_mdadm.sh

@ -76,7 +76,11 @@ mdadm_setup_software_raid_new(){ # {{{
gui_yesno "Really create /dev/md/${x} from disks ${selected}? All data on the disks will be deleted!"
rval=${?}
if [ ${rval} -eq 0 ] ; then
mdadm -C /dev/md/${x} -l ${level} -n $( wc -w <<< "${selected}" ) --auto=yes --symlink=yes $( for x in ${selected} ; do find /dev -name $x ; done )
mdadm -C /dev/md/${x} -l ${level} -n $( wc -w <<< "${selected}" ) \
--auto=yes --symlink=yes $(
for x in ${selected} ; do
find /dev -name ${x} -type b
done )
echo "Remember to recreate /etc/mdadm.conf!"
read -p "Press enter to continue"
fi
@ -142,8 +146,7 @@ mdadm_disk_detector(){
grep -q "^Linux swap" "${tmp3}" && fstype="Swap"
fstype="${fstype:-Unknown}"
read a b c d e g h < <( grep ^Block\ device "${tmp3}" )
size="${g#(}"
size="$(blockdev --getsize64 ${md})"
rm -f "${tmp3}"
fi
rm -f "${tmp2}"
@ -172,7 +175,7 @@ mdadm_disk_detector(){
else
export DISKS="${DISKS} ' Mounted on ${mountpoint}'"
fi
export DISKS="${DISKS} 'main_mount_partition \"${disk}\" \"${mountpoint:-nowhere}\" \"${fstype}\"'"
export DISKS="${DISKS} 'main_mount_partition \"${md}\" \"${mountpoint:-nowhere}\" \"${fstype}\"'"
done < "${tmp}"
rm -f "${tmp}"

Loading…
Cancel
Save