diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-11-07 14:21:04 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-11-07 14:22:41 +0000 |
commit | 9d47853f73b5abe8c043e52fd97d629e14f67403 (patch) | |
tree | 24bfa85c75992fe425d72ea63161573db4bf21d6 /main/alpine-conf/0001-setup-disk-fix-compaq-server-disk-arrays-dev-cciss-c.patch | |
parent | 30f1ddf1f8459c98e8b0e2b73b0263f8173fba8a (diff) | |
download | aports-9d47853f73b5abe8c043e52fd97d629e14f67403.tar.bz2 aports-9d47853f73b5abe8c043e52fd97d629e14f67403.tar.xz |
main/alpine-conf: setup-disk fix for compaq cciss disks
Diffstat (limited to 'main/alpine-conf/0001-setup-disk-fix-compaq-server-disk-arrays-dev-cciss-c.patch')
-rw-r--r-- | main/alpine-conf/0001-setup-disk-fix-compaq-server-disk-arrays-dev-cciss-c.patch | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/main/alpine-conf/0001-setup-disk-fix-compaq-server-disk-arrays-dev-cciss-c.patch b/main/alpine-conf/0001-setup-disk-fix-compaq-server-disk-arrays-dev-cciss-c.patch new file mode 100644 index 0000000000..bef005ae1a --- /dev/null +++ b/main/alpine-conf/0001-setup-disk-fix-compaq-server-disk-arrays-dev-cciss-c.patch @@ -0,0 +1,58 @@ +From a8e3f8ca13a03356b89d096b25c7e9223aae89c8 Mon Sep 17 00:00:00 2001 +From: Natanael Copa <ncopa@alpinelinux.org> +Date: Mon, 7 Nov 2011 14:01:23 +0000 +Subject: [PATCH] setup-disk: fix compaq server disk arrays /dev/cciss/c0d0 + style disks + +--- + setup-disk.in | 15 +++++++++------ + 1 files changed, 9 insertions(+), 6 deletions(-) + +diff --git a/setup-disk.in b/setup-disk.in +index 33ab925..a2b610f 100644 +--- a/setup-disk.in ++++ b/setup-disk.in +@@ -292,7 +292,8 @@ find_swap_size() { + local size=$(( $memtotal_kb * 2 / 1024 )) + local disk= disksize= + for disk in $@; do +- local sysfspath=/sys/block/${disk#/dev/}/size ++ local sysfsdev=$(echo ${disk#/dev/} | sed 's:/:!:g') ++ local sysfspath=/sys/block/$sysfsdev/size + # disksize = x * 512 / (1024 * 1024) = x / 2048 + # maxsize = $disksize / 4 = x / (2048 * 4) = x / 8192 + maxsize=$(awk '{ printf "%i", $0 / 8192 }' $sysfspath ) +@@ -312,11 +313,12 @@ find_swap_size() { + + has_mounted_part() { + local p ++ local sysfsdev=$(echo ${1#/dev/} | sed 's:/:!:g') + # parse /proc/mounts for mounted devices +- for p in $(awk '$1 ~ /^\/dev\// {gsub("/dev/", "", $1); print $1}' \ ++ for p in $(awk '$1 ~ /^\/dev\// {gsub("/dev/", "", $1); gsub("/", "!", $1); print $1}' \ + /proc/mounts); do +- [ "$p" = "$1" ] && return 0 +- [ -e /sys/block/$1/$p ] && return 0 ++ [ "$p" = "$sysfsdev" ] && return 0 ++ [ -e /sys/block/$sysfsdev/$p ] && return 0 + done + return 1 + } +@@ -376,11 +378,12 @@ init_progs() { + show_disk_info() { + local disk= vendor= model= d= size= + for disk in $@; do +- d=${disk##*/} ++ local dev=${disk#/dev/} ++ d=$(echo $dev | sed 's:/:!:g') + vendor=$(cat /sys/block/$d/device/vendor 2>/dev/null) + model=$(cat /sys/block/$d/device/model 2>/dev/null) + size=$(awk '{gb = ($1 * 512)/1000000000; printf "%.1f GB\n", gb}' /sys/block/$d/size 2>/dev/null) +- echo " $d ($size $vendor $model)" ++ echo " $dev ($size $vendor $model)" + done + } + +-- +1.7.7.2 + |