mirror of
https://github.com/clearlinux/swupd-server.git
synced 2026-10-04 07:58:32 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c8ae097ed0 | ||
|
|
076a76fc4e | ||
|
|
63fb5fb61b | ||
|
|
7758a6bb77 | ||
|
|
36c4e6324f | ||
|
|
c4f61cb023 |
@@ -37,6 +37,7 @@ swupd_make_pack_SOURCES = \
|
|||||||
src/config.c \
|
src/config.c \
|
||||||
src/delta.c \
|
src/delta.c \
|
||||||
src/globals.c \
|
src/globals.c \
|
||||||
|
src/groups.c \
|
||||||
src/helpers.c \
|
src/helpers.c \
|
||||||
src/log.c \
|
src/log.c \
|
||||||
src/make_packs.c \
|
src/make_packs.c \
|
||||||
@@ -53,6 +54,7 @@ swupd_make_fullfiles_SOURCES = \
|
|||||||
src/delta.c \
|
src/delta.c \
|
||||||
src/fullfiles.c \
|
src/fullfiles.c \
|
||||||
src/globals.c \
|
src/globals.c \
|
||||||
|
src/groups.c \
|
||||||
src/helpers.c \
|
src/helpers.c \
|
||||||
src/log.c \
|
src/log.c \
|
||||||
src/make_fullfiles.c \
|
src/make_fullfiles.c \
|
||||||
|
|||||||
+2
-2
@@ -15,7 +15,7 @@ error() {
|
|||||||
# eg: all of openstack, pnp, bat, cloud stuff, non-basic scripting language bundles
|
# eg: all of openstack, pnp, bat, cloud stuff, non-basic scripting language bundles
|
||||||
${SWUPDREPO}/mk_groups_ini.sh
|
${SWUPDREPO}/mk_groups_ini.sh
|
||||||
|
|
||||||
PREVREL=`cat ${UPDATEDIR}/image/latest.version`
|
PREVREL=`cat ${UPDATEDIR}/image/LAST_VER`
|
||||||
|
|
||||||
export SWUPD_CERTS_DIR=${SWUPD_CERTS_DIR:-"/root/swupd-certs"}
|
export SWUPD_CERTS_DIR=${SWUPD_CERTS_DIR:-"/root/swupd-certs"}
|
||||||
export LEAF_KEY="leaf.key.pem"
|
export LEAF_KEY="leaf.key.pem"
|
||||||
@@ -46,7 +46,7 @@ for job in $(jobs -p); do
|
|||||||
done
|
done
|
||||||
|
|
||||||
# expose the new build to staging / testing
|
# expose the new build to staging / testing
|
||||||
echo ${VER} > ${UPDATEDIR}/image/latest.version
|
echo ${VER} > ${UPDATEDIR}/image/LAST_VER
|
||||||
|
|
||||||
STAGING_FILE="${UPDATEDIR}/www/version/formatstaging/latest"
|
STAGING_FILE="${UPDATEDIR}/www/version/formatstaging/latest"
|
||||||
if [ ! -f "${STAGING_FILE}" ]; then
|
if [ ! -f "${STAGING_FILE}" ]; then
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
# Process this file with autoconf to produce a configure script.
|
# Process this file with autoconf to produce a configure script.
|
||||||
|
|
||||||
AC_PREREQ([2.66])
|
AC_PREREQ([2.66])
|
||||||
AC_INIT(swupd-server, 3.2.6, timothy.c.pepper@linux.intel.com)
|
AC_INIT(swupd-server, 3.2.8, timothy.c.pepper@linux.intel.com)
|
||||||
AM_INIT_AUTOMAKE([foreign -Wall -W subdir-objects])
|
AM_INIT_AUTOMAKE([foreign -Wall -W subdir-objects])
|
||||||
AM_SILENT_RULES([yes])
|
AM_SILENT_RULES([yes])
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
|
|||||||
@@ -221,6 +221,7 @@ extern void read_group_file(char *filename);
|
|||||||
extern void release_group_file(void);
|
extern void release_group_file(void);
|
||||||
extern char *group_groups(char *group);
|
extern char *group_groups(char *group);
|
||||||
extern char *group_packages(char *group);
|
extern char *group_packages(char *group);
|
||||||
|
extern char *group_status(char *group);
|
||||||
extern char *next_group(void);
|
extern char *next_group(void);
|
||||||
|
|
||||||
extern void apply_heuristics(struct manifest *manifest);
|
extern void apply_heuristics(struct manifest *manifest);
|
||||||
|
|||||||
+6
-2
@@ -18,8 +18,8 @@ if [ ! -f "$SWUPD_SERVER_INI" ]; then
|
|||||||
sed -i "s|/var/lib/update|$UPDATEDIR|" $SWUPD_SERVER_INI
|
sed -i "s|/var/lib/update|$UPDATEDIR|" $SWUPD_SERVER_INI
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "$UPDATEDIR/image/latest.version" ]; then
|
if [ ! -f "$UPDATEDIR/image/LAST_VER" ]; then
|
||||||
echo "0" > $UPDATEDIR/image/latest.version
|
echo "0" > $UPDATEDIR/image/LAST_VER
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "rebuilding $SWUPD_GROUPS_INI based on $BUNDLEREPO"
|
echo "rebuilding $SWUPD_GROUPS_INI based on $BUNDLEREPO"
|
||||||
@@ -27,7 +27,11 @@ rm -f $SWUPD_GROUPS_INI
|
|||||||
|
|
||||||
for bundle in $(ls $BUNDLEREPO/bundles)
|
for bundle in $(ls $BUNDLEREPO/bundles)
|
||||||
do
|
do
|
||||||
|
status=$(awk -F: '/^# .STATUS/ {print $2}' $BUNDLEREPO/$bundle | tr -cd '[[:alnum:]]')
|
||||||
echo "[$bundle]" >> $SWUPD_GROUPS_INI
|
echo "[$bundle]" >> $SWUPD_GROUPS_INI
|
||||||
echo "group=$bundle" >> $SWUPD_GROUPS_INI
|
echo "group=$bundle" >> $SWUPD_GROUPS_INI
|
||||||
|
if [ -n "$status" ]; then
|
||||||
|
echo "status=$status" >> $SWUPD_GROUPS_INI
|
||||||
|
fi
|
||||||
echo "" >> $SWUPD_GROUPS_INI
|
echo "" >> $SWUPD_GROUPS_INI
|
||||||
done
|
done
|
||||||
|
|||||||
+3
-3
@@ -146,7 +146,7 @@ static void populate_dirs(int version)
|
|||||||
if ((access(newversiondir, F_OK | R_OK) != 0) && (version == 0)) {
|
if ((access(newversiondir, F_OK | R_OK) != 0) && (version == 0)) {
|
||||||
char *latestpath = NULL;
|
char *latestpath = NULL;
|
||||||
|
|
||||||
string_or_die(&latestpath, "%s/latest.version", image_dir);
|
string_or_die(&latestpath, "%s/LAST_VER", image_dir);
|
||||||
|
|
||||||
printf("** %s does not exist... creating and populating\n", newversiondir);
|
printf("** %s does not exist... creating and populating\n", newversiondir);
|
||||||
if (mkdir(newversiondir, 0755) != 0) {
|
if (mkdir(newversiondir, 0755) != 0) {
|
||||||
@@ -271,7 +271,7 @@ int main(int argc, char **argv)
|
|||||||
read_group_file(file_path);
|
read_group_file(file_path);
|
||||||
free(file_path);
|
free(file_path);
|
||||||
|
|
||||||
read_current_version("latest.version");
|
read_current_version("LAST_VER");
|
||||||
printf("Last processed version is %i\n", current_version);
|
printf("Last processed version is %i\n", current_version);
|
||||||
|
|
||||||
populate_dirs(newversion);
|
populate_dirs(newversion);
|
||||||
@@ -502,7 +502,7 @@ int main(int argc, char **argv)
|
|||||||
exit:
|
exit:
|
||||||
if (exit_status == EXIT_SUCCESS) {
|
if (exit_status == EXIT_SUCCESS) {
|
||||||
write_cookiecrumbs_to_download_area(newversion);
|
write_cookiecrumbs_to_download_area(newversion);
|
||||||
//write_new_version("latest.version", newversion);
|
//write_new_version("LAST_VER", newversion);
|
||||||
}
|
}
|
||||||
release_configuration_data();
|
release_configuration_data();
|
||||||
release_group_file();
|
release_group_file();
|
||||||
|
|||||||
@@ -51,6 +51,13 @@ char *group_groups(char *group)
|
|||||||
return g_key_file_get_value(groupfile, group, "groups", NULL);
|
return g_key_file_get_value(groupfile, group, "groups", NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *group_status(char *group)
|
||||||
|
{
|
||||||
|
assert(groupfile != NULL);
|
||||||
|
|
||||||
|
return g_key_file_get_value(groupfile, group, "status", NULL);
|
||||||
|
}
|
||||||
|
|
||||||
void read_group_file(char *filename)
|
void read_group_file(char *filename)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|||||||
+9
-9
@@ -44,15 +44,15 @@ static void runtime_state_heuristics(struct file *file)
|
|||||||
{
|
{
|
||||||
/* these are shipped directories that are not themselves state,
|
/* these are shipped directories that are not themselves state,
|
||||||
* rather only their contents are state */
|
* rather only their contents are state */
|
||||||
if ((strcmp(file->filename, "/usr/src/debug") == 0) ||
|
if ((strncmp(file->filename, "/usr/src/debug", 14) == 0) ||
|
||||||
(strcmp(file->filename, "/dev") == 0) ||
|
(strncmp(file->filename, "/dev", 4) == 0) ||
|
||||||
(strcmp(file->filename, "/home") == 0) ||
|
(strncmp(file->filename, "/home", 5) == 0) ||
|
||||||
(strcmp(file->filename, "/proc") == 0) ||
|
(strncmp(file->filename, "/proc", 5) == 0) ||
|
||||||
(strcmp(file->filename, "/root") == 0) ||
|
(strncmp(file->filename, "/root", 5) == 0) ||
|
||||||
(strcmp(file->filename, "/run") == 0) ||
|
(strncmp(file->filename, "/run", 4) == 0) ||
|
||||||
(strcmp(file->filename, "/sys") == 0) ||
|
(strncmp(file->filename, "/sys", 4) == 0) ||
|
||||||
(strcmp(file->filename, "/tmp") == 0) ||
|
(strncmp(file->filename, "/tmp", 4) == 0) ||
|
||||||
(strcmp(file->filename, "/var") == 0)) {
|
(strncmp(file->filename, "/var", 4) == 0)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -728,6 +728,7 @@ static int write_manifest_plain(struct manifest *manifest)
|
|||||||
char *base = NULL, *dir;
|
char *base = NULL, *dir;
|
||||||
char *conf = config_output_dir();
|
char *conf = config_output_dir();
|
||||||
char *filename = NULL;
|
char *filename = NULL;
|
||||||
|
char *status = NULL;
|
||||||
char *submanifest_filename = NULL;
|
char *submanifest_filename = NULL;
|
||||||
char *manifest_tempdir = NULL;
|
char *manifest_tempdir = NULL;
|
||||||
char *tempmanifest = NULL;
|
char *tempmanifest = NULL;
|
||||||
@@ -762,6 +763,10 @@ static int write_manifest_plain(struct manifest *manifest)
|
|||||||
compute_content_size(manifest);
|
compute_content_size(manifest);
|
||||||
fprintf(out, "contentsize:\t%llu\n", (long long unsigned int)manifest->contentsize);
|
fprintf(out, "contentsize:\t%llu\n", (long long unsigned int)manifest->contentsize);
|
||||||
includes = manifest->includes;
|
includes = manifest->includes;
|
||||||
|
status = group_status(manifest->component);
|
||||||
|
if (status) {
|
||||||
|
fprintf(out, "status:\t%s\n", status);
|
||||||
|
}
|
||||||
while (includes) {
|
while (includes) {
|
||||||
struct manifest *sub = includes->data;
|
struct manifest *sub = includes->data;
|
||||||
includes = g_list_next(includes);
|
includes = g_list_next(includes);
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ init_server_ini() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
set_latest_ver() {
|
set_latest_ver() {
|
||||||
echo "$1" > $DIR/image/latest.version
|
echo "$1" > $DIR/image/LAST_VER
|
||||||
}
|
}
|
||||||
|
|
||||||
init_groups_ini() {
|
init_groups_ini() {
|
||||||
@@ -35,6 +35,7 @@ init_groups_ini() {
|
|||||||
cat >> $DIR/groups.ini << EOF
|
cat >> $DIR/groups.ini << EOF
|
||||||
[$bundle]
|
[$bundle]
|
||||||
group=$bundle
|
group=$bundle
|
||||||
|
status=ACTIVE
|
||||||
EOF
|
EOF
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user