Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean IMGB during installation #2956

Merged
merged 1 commit into from
Dec 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions pkg/mkimage-raw-efi/make-raw
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,14 @@ do_rootfs() {
esac
fi

# Copy rootfs to image A
dd if=$IMG of=$IMGFILE bs=1M conv=notrunc seek="$(( SEC_START * 512 ))" oflag=seek_bytes
if [ -n "$IMG" ]; then
# Copy rootfs
dd if="$IMG" of="$IMGFILE" bs=1M conv=notrunc seek="$(( SEC_START * 512 ))" oflag=seek_bytes
else
# clean first block of partition
# to avoid mounting of stale data
dd if=/dev/zero of="$IMGFILE" bs=512 count=1 conv=notrunc seek="$(( SEC_START * 512 ))" oflag=seek_bytes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you still use bs=512, so multiplication and "seek_bytes" flag are excessive. but this is minor

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, thank you, modified.

fi

eval $1=$(( $SEC_END + 1))
}
Expand All @@ -216,8 +222,8 @@ do_imga() {
}

do_imgb() {
# for now we are not initializing IMGB - hence passing /dev/null
do_rootfs $1 IMGB /dev/null
# for now we are wiping IMGB - hence not passing the source
do_rootfs $1 IMGB
}

do_vfat() {
Expand Down