Skip to content

Commit

Permalink
Minor fixes of s390 DASD code
Browse files Browse the repository at this point in the history
- remove unused variables
- rename "junk" to more meaningful name when it contains useful data
  (addresses review comment in PR rear#2943)
- fix typo
  • Loading branch information
pcahyna committed Mar 15, 2023
1 parent 7cb0a53 commit e73edc4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
Expand Up @@ -23,9 +23,8 @@ fi

### Prepare a disk for partitioning/general usage.
create_disk() {
local component disk size label junk
local blocksize layout dasdtype dasdcyls junk2
read component disk size label junk < <(grep "^disk $1 " "$LAYOUT_FILE")
local component disk size label extrafields
read component disk size label extrafields < <(grep "^disk $1 " "$LAYOUT_FILE")

cat >> "$LAYOUT_CODE" <<EOF
Expand Down Expand Up @@ -58,8 +57,8 @@ sync
EOF

# $junk can contain useful DASD-specific fields
create_partitions "$disk" "$label" "$junk"
# $extrafields can contain useful DASD-specific fields
create_partitions "$disk" "$label" "$extrafields"

cat >> "$LAYOUT_CODE" <<EOF
# Make sure device nodes are visible (eg. in RHEL4)
Expand Down Expand Up @@ -87,7 +86,7 @@ create_partitions() {
local part disk size pstart name junk
local orig_block_size layout dasdtype dasdcyls junk2
if [ "$label" == dasd ]; then
# dasd has more fields - junk is not junk anymore
# dasd has more fields - they are all in $3 now
read orig_block_size layout dasdtype dasdcyls junk2 <<<$3
fi
while read part disk size pstart name junk ; do
Expand Down
@@ -1,6 +1,6 @@
# DASD_FORMAT_CODE is the script to recreate the dasd formatting (dasdformat.sh).

local component disk size label junk
local component disk size label extrafields
local blocksize layout dasdtype dasdcyls junk2


Expand All @@ -25,7 +25,7 @@ set -x
EOF

while read component disk size label junk; do
while read component disk size label extrafields; do
if [ "$label" == dasd ]; then
# Ignore excluded components.
# Normally they are removed in 520_exclude_components.sh,
Expand All @@ -34,8 +34,8 @@ while read component disk size label junk; do
Log "Excluding $disk from DASD reformatting."
continue
fi
# dasd has more fields - junk is not junk anymore
read blocksize layout dasdtype dasdcyls junk2 <<<$junk
# dasd has more fields - they are all in $extrafields now
read blocksize layout dasdtype dasdcyls junk2 <<<$extrafields
dasd_format_code "$disk" "$size" "$blocksize" "$layout" "$dasdtype" "$dasdcyls" >> "$DASD_FORMAT_CODE" || \
LogPrintError "Error producing DASD format code for $disk"
fi
Expand Down
2 changes: 1 addition & 1 deletion usr/share/rear/lib/layout-functions.sh
Expand Up @@ -753,7 +753,7 @@ get_dasd_cylinders() {
}

# Sometimes we know what the new device for the original device should be in a more reliable way
# than by looking at disk sizes. THis information is called "mapping hints". Let's pass them
# than by looking at disk sizes. This information is called "mapping hints". Let's pass them
# to the mapping code using the DISK_MAPPING_HINTS array. Each element of the array has the form
# "/dev/source /dev/target" (space-separated).

Expand Down

0 comments on commit e73edc4

Please sign in to comment.