-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add initial support for splitting var as a separated partition #1422
base: main
Are you sure you want to change the base?
Changes from all commits
4cf381f
28d2a80
c4350d5
9a2d644
bb444be
93a4cdd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,10 +125,18 @@ IMAGE_CMD:ota:append () { | |
if [ "${APP_PRELOAD_WITHIN_OE_BUILD}" = "1" ]; then | ||
preload_apps | ||
fi | ||
|
||
# Split content /var into a separated folder so it can be consumed by WKS separately | ||
if [ "${OSTREE_SPLIT_VAR}" = "1" ]; then | ||
rm -rf ${OTA_VAR} | ||
mv ${OTA_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var ${OTA_VAR} | ||
mkdir -p ${OTA_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var | ||
fi | ||
} | ||
OTA_BOOT = "${WORKDIR}/ota-boot" | ||
do_image_ota[dirs] += "${OTA_BOOT}" | ||
do_image_ota[cleandirs] += "${OTA_BOOT}" | ||
OTA_VAR = "${WORKDIR}/ota-var" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't it be more logical and readable to place setting vars above using them? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Funny enough most tasks end up defining the variables and cleaning actions after the task itself is defined (if you see the other tasks in this class). We can probably have a separated commit to move things around if needed (here I would prefer to just add the new variable to avoid a larger diff). |
||
do_image_ota[dirs] += "${OTA_BOOT} ${OTA_VAR}" | ||
do_image_ota[cleandirs] += "${OTA_BOOT} ${OTA_VAR}" | ||
|
||
# Adapted from oe_mkext234fs in image_types.bbclass | ||
oe_mkotaespfs() { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# short-description: Create an OTA-enabled EFI disk image | ||
# long-description: Creates an OTA-enabled EFI disk image that the user | ||
# can directly dd to boot media. | ||
|
||
part /boot --source bootimg-sota-efi --sourceparams="loader=${EFI_PROVIDER}" --rootfs-dir=${WORKDIR}/ota-boot --ondisk sda --active --align 1024 --use-uuid ${OSTREE_WKS_EFI_SIZE} --label boot | ||
part / --source otaimage --ondisk sda --part-name=otaroot --fstype=ext4 --align 1024 --use-uuid | ||
part /var --source rootfs --ondisk sda --rootfs-dir=${WORKDIR}/ota-var --fstype=ext4 --part-name var --label var --part-type 0x8310 --align 4096 --use-uuid | ||
|
||
bootloader --source bootimg-sota-efi --timeout=1 --ptable gpt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using
mv
will fail if we run this task more than one time because on the second one the${OSTREE_OSNAME}/var
is clean. It should be better to copy all the files withcp -a
and we can drop themkdir
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to have the content in
${OTA_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var
after this code.But I agree we may need to move the content only once like
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OTA_SYSROOT is already defined for dir and cleandirs:
So a re-run wouldn't be an issue here.
mkdir might not necessarily be needed indeed, will check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, best to let var in deploy as that is expected by ostree when creating .ostree-selabeled during deploy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hadn't even taken into account possible dependencies that have more impact than running more than once