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

[WIP] lib/deploy: Check space before copying into /boot #1830

Closed
Closed
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion src/libostree/ostree-deployment-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ G_BEGIN_DECLS
* @osname:
* @csum: OSTree checksum of tree
* @deployserial: How many times this particular csum appears in deployment list
* @bootcsum: Checksum of kernel+initramfs
* @bootcsum: Checksum of kernel+initramfs+devicetree
* @bootsize: Size in bytes of kernel+initramfs+devicetree
* @bootserial: An integer assigned to this tree per its ${bootcsum}
* @bootconfig: Bootloader configuration
* @origin: How to construct an upgraded version of this tree
Expand All @@ -47,6 +48,7 @@ struct _OstreeDeployment
char *csum;
int deployserial;
char *bootcsum;
int bootsize;
int bootserial;
OstreeBootconfigParser *bootconfig;
GKeyFile *origin;
Expand All @@ -55,5 +57,6 @@ struct _OstreeDeployment
};

void _ostree_deployment_set_bootcsum (OstreeDeployment *self, const char *bootcsum);
void _ostree_deployment_set_bootsize (OstreeDeployment *self, int bootsize);

G_END_DECLS
13 changes: 13 additions & 0 deletions src/libostree/ostree-deployment.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ ostree_deployment_get_bootcsum (OstreeDeployment *self)
return self->bootcsum;
}

int
ostree_deployment_get_bootsize (OstreeDeployment *self)
{
return self->bootsize;
}

/*
* ostree_deployment_get_osname:
* @self: Deployemnt
Expand Down Expand Up @@ -158,6 +164,13 @@ _ostree_deployment_set_bootcsum (OstreeDeployment *self,
self->bootcsum = g_strdup (bootcsum);
}

void
_ostree_deployment_set_bootsize (OstreeDeployment *self,
int bootsize)
{
self->bootsize = bootsize;
}

/**
* ostree_deployment_clone:
* @self: Deployment
Expand Down
2 changes: 2 additions & 0 deletions src/libostree/ostree-deployment.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ const char *ostree_deployment_get_csum (OstreeDeployment *self);
_OSTREE_PUBLIC
const char *ostree_deployment_get_bootcsum (OstreeDeployment *self);
_OSTREE_PUBLIC
int ostree_deployment_get_bootsize (OstreeDeployment *self);
_OSTREE_PUBLIC
int ostree_deployment_get_bootserial (OstreeDeployment *self);
_OSTREE_PUBLIC
OstreeBootconfigParser *ostree_deployment_get_bootconfig (OstreeDeployment *self);
Expand Down
Loading