Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added patch of Jeroen to check/save-layout workflows
- aligned the mkdir and mkvendorrpm
- Loading branch information
Showing
14 changed files
with
245 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
* finalize/Fedora/i386/17_rebuild_initramfs.sh | ||
- needs to be written, seems like RH builds rich initramfs with all modules included | ||
- be aware, recent Fedora uses dracut instead of mkinitrd | ||
- needs to be written, seems like RH builds rich initramfs with all modules included | ||
- be aware, recent Fedora uses dracut instead of mkinitrd | ||
|
||
* finalize/Gentoo/i386/17_rebuild_initramfs.sh | ||
- needs to be written, I have no idea what should be done here (since I don't have Gentoo) | ||
- needs to be written, I have no idea what should be done here (since I don't have Gentoo) | ||
|
||
* write network migration code for all other distributions | ||
- some work has been done in the meantime, but not sure if it is sufficient enough to cover all | ||
- waiting on customer feedback | ||
|
||
* support dhcp for network migration | ||
- has been added in 1.9.0 | ||
- waiting on customer feedback | ||
|
||
* prep/Linux-ia64/20_getty_or_agetty.sh might be obsolete after the USE_SERIAL_CONSOLE piece has been added and tested successfully | ||
- ia64 architecture will not support Linux anymore in future? Dropped off the list in RHEL6. | ||
|
||
* Can we drop the mkvendorrpm workflow? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Remove temporary files | ||
|
||
Log "Removing temporary files." | ||
rm $TEMP_LAYOUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Test if ORIG_LAYOUT and TEMP_LAYOUT are the same | ||
|
||
diff $ORIG_LAYOUT $TEMP_LAYOUT > /dev/null | ||
|
||
if [ $? -eq 0 ] ; then | ||
LogPrint "Disk layout is identical." | ||
else | ||
LogPrint "Disk layout has changed." | ||
fi |
5 changes: 5 additions & 0 deletions
5
usr/share/rear/layout/precompare/default/11_check_layout_file.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Check if the disk layout file exists. | ||
|
||
if [ ! -e "$ORIG_LAYOUT" ] ; then | ||
Error "Please run \"# rear savelayout\" first." | ||
fi |
9 changes: 9 additions & 0 deletions
9
usr/share/rear/layout/save/GNU/Linux/10_create_layout_file.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Create the layout file | ||
|
||
Log "Preparing layout directory." | ||
mkdir -p $VAR_DIR/layout | ||
|
||
if [ -e "$DISKLAYOUT_FILE" ] ; then | ||
Log "Removing old layout file." | ||
fi | ||
: > $DISKLAYOUT_FILE |
43 changes: 43 additions & 0 deletions
43
usr/share/rear/layout/save/GNU/Linux/20_partition_layout.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Save the partition layout | ||
|
||
LogPrint "Saving disk partitions." | ||
|
||
( | ||
# Disk sizes | ||
# format: disk <disk> <sectors> | ||
devices=() | ||
for disk in /sys/block/* ; do | ||
case $(basename $disk) in | ||
hd*|sd*|cciss*) | ||
if [ "$(cat $disk/removable)" = "1" ] ; then | ||
continue | ||
fi | ||
|
||
# fix cciss | ||
devname=$(basename $disk | tr '!' '/') | ||
devsize=$(cat $disk/size) | ||
echo "disk $devname $devsize" | ||
|
||
devices=( "${devices[@]}" "$devname" ) | ||
;; | ||
esac | ||
done | ||
|
||
# Partitions | ||
# format : part <partition size(sectors)> <partition id> | ||
for device in "${devices[@]}" ; do | ||
if [ -e /dev/$device ] ; then | ||
while read line ; do | ||
if [ -z "$(echo $line | grep start)" ] ; then | ||
continue | ||
fi | ||
|
||
psize=$(echo $line | cut -d "," -f 2 | cut -d "=" -f 2 | tr -d " ") | ||
pid=$(echo $line | cut -d "," -f 3 | cut -d "=" -f 2 | tr -d " ") | ||
|
||
echo "part $device $psize $pid" | ||
done < <(sfdisk -uS -d /dev/$device) | ||
fi | ||
done | ||
|
||
) >> $DISKLAYOUT_FILE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Save the Software RAID layout | ||
|
||
if [ -e /proc/mdstat ] && grep -q blocks /proc/mdstat ; then | ||
LogPrint "Saving Software RAID configuration." | ||
( | ||
while read array device level ndevices metadata uuid junk ; do | ||
if [ "$array" != "ARRAY" ] ; then | ||
continue | ||
fi | ||
|
||
device=$(basename $device) | ||
ndevices=$(echo "$ndevices" | cut -d "=" -f 2) | ||
uuid=$(echo "$uuid" | cut -d "=" -f 2) | ||
|
||
read jname junk jstate level devices < <(grep $device /proc/mdstat) | ||
devices=$(echo "$devices" | sed 's/\[[[:digit:]]\]//g') | ||
|
||
echo "raid $device $level $ndevices $uuid $devices" | ||
done < <(mdadm --detail --scan --config=partitions) | ||
) >> $DISKLAYOUT_FILE | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Save LVM layout | ||
|
||
LogPrint "Saving LVM layout." | ||
|
||
( | ||
## Get physical_device configuration | ||
# format: lvmdev <volume_group> <device> [<uuid>] [<size(bytes)>] | ||
lvm pvdisplay -c | while read line ; do | ||
pdev=$(echo $line | cut -d ":" -f "1") | ||
vgrp=$(echo $line | cut -d ":" -f "2") | ||
size=$(echo $line | cut -d ":" -f "3") | ||
uuid=$(echo $line | cut -d ":" -f "12") | ||
|
||
echo "lvmdev $vgrp $pdev $uuid $size" | ||
done | ||
|
||
## Get the volume group configuration | ||
# format: lvmgrp <volume_group> <extentsize> [<size(extents)>] [<size(bytes)>] | ||
lvm vgdisplay -c | while read line ; do | ||
vgrp=$(echo $line | cut -d ":" -f "1") | ||
size=$(echo $line | cut -d ":" -f "12") | ||
extentsize=$(echo $line | cut -d ":" -f "13") | ||
nrextents=$(echo $line | cut -d ":" -f "14") | ||
|
||
echo "lvmgrp $vgrp $extentsize $nrextents $size" | ||
done | ||
|
||
## Get all logical volumes | ||
# format: lvmvol <volume_group> <name> <size(extents)> [<size(bytes)>] | ||
lvm lvdisplay -c | while read line ; do | ||
lvol=$(echo $line | cut -d ":" -f "1" | cut -d "/" -f "4") | ||
vgrp=$(echo $line | cut -d ":" -f "2") | ||
size=$(echo $line | cut -d ":" -f "7") | ||
extents=$(echo $line | cut -d ":" -f "8") | ||
|
||
echo "lvmvol $vgrp $lvol $extents $size " | ||
done | ||
) >> $DISKLAYOUT_FILE |
35 changes: 35 additions & 0 deletions
35
usr/share/rear/layout/save/GNU/Linux/23_filesystem_layout.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Save Filesystem layout | ||
|
||
LogPrint "Saving Filesystem layout." | ||
|
||
( | ||
# Filesystems | ||
# format: fs <device> <mountpoint> <filesystem> [uuid=<uuid>] [label=<label>] | ||
while read line ; do | ||
if [ "${line#/}" = "$line" ] ; then | ||
continue | ||
fi | ||
|
||
device=$(echo $line | cut -d " " -f 1) | ||
mountpoint=$(echo $line | cut -d " " -f 3) | ||
fstype=$(echo $line | cut -d " " -f 5) | ||
|
||
echo -n "fs $device $mountpoint $fstype " | ||
case "$fstype" in | ||
ext*) | ||
uuid=$(tune2fs -l $device | grep UUID | cut -d ":" -f 2 | tr -d " ") | ||
label=$(e2label $device) | ||
echo -n "uuid=$uuid label=$label " | ||
;; | ||
xfs) | ||
uuid=$(xfs_admin -u $device | cut -d'=' -f 2 | tr -d " ") | ||
label=$(xfs_admin -l $device | cut -d'"' -f 2) | ||
echo -n "uuid=$uuid label=$label " | ||
;; | ||
esac | ||
|
||
# TODO: filesystem attributes | ||
|
||
echo | ||
done < <(mount) | ||
) >> $DISKLAYOUT_FILE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# checklayout-workflow.sh | ||
# | ||
# checklayout workflow for Relax & Recover | ||
# | ||
# Relax & Recover is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 2 of the License, or | ||
# (at your option) any later version. | ||
|
||
# Relax & Recover is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
|
||
# You should have received a copy of the GNU General Public License | ||
# along with Relax & Recover; if not, write to the Free Software | ||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
# | ||
# | ||
|
||
WORKFLOW_checklayout_DESCRIPTION="Check if the disk layout has changed since the last run of savelayout." | ||
WORKFLOWS=( ${WORKFLOWS[@]} checklayout ) | ||
WORKFLOW_checklayout () { | ||
ORIG_LAYOUT=$VAR_DIR/layout/disklayout.conf | ||
TEMP_LAYOUT=$VAR_DIR/layout/disklayout.conf.new | ||
|
||
SourceStage "layout/precompare" | ||
|
||
DISKLAYOUT_FILE=$TEMP_LAYOUT | ||
SourceStage "layout/save" | ||
|
||
SourceStage "layout/compare" | ||
|
||
SourceStage "layout/cleanup" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# savelayout-workflow.sh | ||
# | ||
# savelayout workflow for Relax & Recover | ||
# | ||
# Relax & Recover is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 2 of the License, or | ||
# (at your option) any later version. | ||
|
||
# Relax & Recover is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
|
||
# You should have received a copy of the GNU General Public License | ||
# along with Relax & Recover; if not, write to the Free Software | ||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
# | ||
# | ||
|
||
WORKFLOW_savelayout_DESCRIPTION="Save the disk layout of the system." | ||
WORKFLOWS=( ${WORKFLOWS[@]} savelayout ) | ||
WORKFLOW_savelayout () { | ||
DISKLAYOUT_FILE=$VAR_DIR/layout/disklayout.conf | ||
SourceStage "layout/save" | ||
} |