Merge "clean mbr section on all disks when installing os" into dev/experimental

This commit is contained in:
Jenkins 2014-12-05 18:40:51 +00:00 committed by Gerrit Code Review
commit bc97a1b193
2 changed files with 12 additions and 0 deletions

View File

@ -43,6 +43,9 @@ let found_disk_offset=0
while [ \$disk_offset -lt \$disk_nums ]; do
let found_disk=0
disk_name=\$(basename \$1)
#if $getVar('keep_old_partitions', '0') == "0"
dd if=/dev/zero of=/dev/\${disk_name} bs=512 count=1
#end if
if [[ x"\${disk_mapping[\${disk_name}]}" == x"" ]]; then
echo "ignore disk \$1 since it is not in disk_mapping" >> /tmp/log
let disk_offset=\$disk_offset+1
@ -103,6 +106,9 @@ done
echo "clearpart --all --initlabel" > /tmp/part-include
#if $getVar('keep_old_partitions', '0') != "0"
for disk in \${sorted_disks[@]}; do
dd if=/dev/zero of=\${disk} bs=512 count=1
done
echo "only partition \$sorted_disks_str" >> /tmp/log
echo "ignoredisk --only-use=\$sorted_disks_str" >> /tmp/part-include
#end if

View File

@ -51,6 +51,9 @@ for disk in \$(list-devices disk); do
continue
fi
disk_name=\$(basename \$disk)
#if $getVar('keep_old_partitions', '0') == "0"
dd if=/dev/zero of=\$disk bs=512 count=1
#end if
eval "disk_path=\\${disk_\${disk_name}}"
if [ -z \${disk_path} ]; then
echo "ignore disk \${disk_name} since it is not in disk_mapping" >> /tmp/preseed.log
@ -129,6 +132,9 @@ done
echo "first disk \${first_disk_name}" >> /tmp/preseed.log
#if $getVar('keep_old_partitions', '0') != "0"
for disk_name in \${sorted_disks}; do
dd if=/dev/zero of=/dev/\${disk_name} bs=512 count=1
done
remove_disks=\${sorted_disks}
#else
remove_disks=\${disks}