mirror of
https://github.com/home-assistant/operating-system.git
synced 2025-07-28 15:36:29 +00:00
ota: skeep mbr
This commit is contained in:
parent
dc0f6367cb
commit
61b0b333f0
@ -23,11 +23,8 @@ if [ "${RAUC_SLOT_CLASS}" = "spl" ]; then
|
|||||||
if sfdisk -dq ${DEVICE_ROOT} | grep -q 'label: gpt'; 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
|
dd if=${RAUC_IMAGE_NAME} of=${DEVICE_ROOT} conv=notrunc bs=512 seek=2 skip=2
|
||||||
else
|
else
|
||||||
BACKUP_MBR="/tmp/mbr-backup.bin"
|
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
|
||||||
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
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -277,12 +277,10 @@ function _fix_disk_spl_gpt() {
|
|||||||
function _fix_disk_spl_mbr() {
|
function _fix_disk_spl_mbr() {
|
||||||
local hdd_img="$(hassos_image_name img)"
|
local hdd_img="$(hassos_image_name img)"
|
||||||
local spl_img="$(path_spl_img)"
|
local spl_img="$(path_spl_img)"
|
||||||
local backup="/tmp/mbr-backup.bin"
|
|
||||||
|
|
||||||
# backup MBR
|
# backup MBR
|
||||||
dd if=${hdd_img} of=${backup} bs=1 count=72 skip=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
|
dd if=${spl_img} of=${hdd_img} conv=notrunc bs=512 seek=1 skip=1
|
||||||
dd if=${backup} of=${hdd_img} conv=notrunc bs=1 count=72 seek=440
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user