ota: skeep mbr

This commit is contained in:
Pascal Vizeli 2018-08-25 07:52:46 +00:00
parent dc0f6367cb
commit 61b0b333f0
2 changed files with 4 additions and 9 deletions

View File

@ -23,11 +23,8 @@ if [ "${RAUC_SLOT_CLASS}" = "spl" ]; then
if sfdisk -dq ${DEVICE_ROOT} | grep -q 'label: gpt'; then
dd if=${RAUC_IMAGE_NAME} of=${DEVICE_ROOT} conv=notrunc bs=512 seek=2 skip=2
else
BACKUP_MBR="/tmp/mbr-backup.bin"
dd if=${DEVICE_ROOT} of=${BACKUP_MBR} bs=1 count=72 skip=440
dd if=${RAUC_IMAGE_NAME} of=${DEVICE_ROOT} conv=notrunc bs=512
dd if=${BACKUP_MBR} of=${DEVICE_ROOT} conv=notrunc bs=1 skip=440
dd if=${RAUC_IMAGE_NAME} of=${DEVICE_ROOT} conv=notrunc bs=1 count=440
dd if=${RAUC_IMAGE_NAME} of=${DEVICE_ROOT} conv=notrunc bs=512 seek=1 skip=1
fi
fi

View File

@ -277,12 +277,10 @@ function _fix_disk_spl_gpt() {
function _fix_disk_spl_mbr() {
local hdd_img="$(hassos_image_name img)"
local spl_img="$(path_spl_img)"
local backup="/tmp/mbr-backup.bin"
# backup MBR
dd if=${hdd_img} of=${backup} bs=1 count=72 skip=440
dd if=${spl_img} of=${hdd_img} conv=notrunc bs=512
dd if=${backup} of=${hdd_img} conv=notrunc bs=1 count=72 seek=440
dd if=${spl_img} of=${hdd_img} conv=notrunc bs=1 count=440
dd if=${spl_img} of=${hdd_img} conv=notrunc bs=512 seek=1 skip=1
}