[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH v3 1/8] lib/ukboot: Implement uk_version



The ukboot library provides the function `uk_version` to print the
version of the Unikraft image.

Signed-off-by: Sharan Santhanam <sharan.santhanam@xxxxxxxxx>
---
 lib/ukboot/Makefile.uk          |  1 +
 lib/ukboot/exportsyms.uk        |  1 +
 lib/ukboot/include/uk/version.h |  6 ++++++
 lib/ukboot/version.c            | 11 +++++++++++
 4 files changed, 19 insertions(+)
 create mode 100644 lib/ukboot/include/uk/version.h
 create mode 100644 lib/ukboot/version.c

diff --git a/lib/ukboot/Makefile.uk b/lib/ukboot/Makefile.uk
index 55f205df..ea052019 100644
--- a/lib/ukboot/Makefile.uk
+++ b/lib/ukboot/Makefile.uk
@@ -4,6 +4,7 @@ CINCLUDES-$(CONFIG_LIBUKBOOT)           += 
-I$(LIBUKBOOT_BASE)/include
 CXXINCLUDES-$(CONFIG_LIBUKBOOT)        += -I$(LIBUKBOOT_BASE)/include
 
 LIBUKBOOT_SRCS-y += $(LIBUKBOOT_BASE)/boot.c
+LIBUKBOOT_SRCS-y += $(LIBUKBOOT_BASE)/version.c
 
 # The main() is in the separate library to fool the LTO. Which is
 # trying to resolve the main() function call to whatever is available
diff --git a/lib/ukboot/exportsyms.uk b/lib/ukboot/exportsyms.uk
index 3edc6c6a..4bce9274 100644
--- a/lib/ukboot/exportsyms.uk
+++ b/lib/ukboot/exportsyms.uk
@@ -1,3 +1,4 @@
 ukplat_entry_argp
 ukplat_entry
 main
+uk_version
diff --git a/lib/ukboot/include/uk/version.h b/lib/ukboot/include/uk/version.h
new file mode 100644
index 00000000..a1b31c3d
--- /dev/null
+++ b/lib/ukboot/include/uk/version.h
@@ -0,0 +1,6 @@
+#ifndef _UK_VERSION_H
+#define _UK_VERSION_H
+
+void uk_version(void);
+
+#endif /* _UK_VERSION_H */
diff --git a/lib/ukboot/version.c b/lib/ukboot/version.c
new file mode 100644
index 00000000..559e842d
--- /dev/null
+++ b/lib/ukboot/version.c
@@ -0,0 +1,11 @@
+#include <uk/version.h>
+#include <uk/essentials.h>
+#include <stdio.h>
+
+void uk_version(void)
+{
+       printf("Unikraft "
+               STRINGIFY(UK_CODENAME) " "
+               STRINGIFY(UK_FULLVERSION) "\n");
+}
+
-- 
2.20.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.