clean mbr section on all disks when installing os
Change-Id: I4eef54018b81ae62e4dff5cad89933537044d58f Close-Bug: 1398630
This commit is contained in:
parent
283b747cf5
commit
540ccc8256
@ -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
|
||||
|
@ -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}
|
||||
|
Loading…
x
Reference in New Issue
Block a user