Just basic identification, name and version.
---
generator/actions.ml | 4 ++++
src/guestfs-internal.h | 1 +
src/inspect-fs-unix.c | 10 ++++++++++
src/inspect-fs.c | 2 ++
src/inspect-icon.c | 1 +
src/inspect.c | 1 +
6 files changed, 19 insertions(+)
diff --git a/generator/actions.ml b/generator/actions.ml
index 35af981..26cc0da 100644
--- a/generator/actions.ml
+++ b/generator/actions.ml
@@ -1055,6 +1055,10 @@ Currently defined distros are:
=over 4
+=item \"alpinelinux\"
+
+Alpine Linux.
+
=item \"archlinux\"
Arch Linux.
diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h
index bbd7fb4..0cd7f74 100644
--- a/src/guestfs-internal.h
+++ b/src/guestfs-internal.h
@@ -552,6 +552,7 @@ enum inspect_os_distro {
OS_DISTRO_FREEBSD,
OS_DISTRO_NETBSD,
OS_DISTRO_COREOS,
+ OS_DISTRO_ALPINE_LINUX,
};
enum inspect_os_package_format {
diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c
index c9bbad9..abfa527 100644
--- a/src/inspect-fs-unix.c
+++ b/src/inspect-fs-unix.c
@@ -601,6 +601,16 @@ guestfs_int_check_linux_root (guestfs_h *g, struct inspect_fs *fs)
if (guestfs_int_parse_major_minor (g, fs) == -1)
return -1;
}
+ else if (guestfs_is_file_opts (g, "/etc/alpine-release",
+ GUESTFS_IS_FILE_OPTS_FOLLOWSYMLINKS, 1, -1) > 0) {
+ fs->distro = OS_DISTRO_ALPINE_LINUX;
+
+ if (parse_release_file (g, fs, "/etc/alpine-release") == -1)
+ return -1;
+
+ if (guestfs_int_parse_major_minor (g, fs) == -1)
+ return -1;
+ }
skip_release_checks:;
diff --git a/src/inspect-fs.c b/src/inspect-fs.c
index 073ae57..94c5bb9 100644
--- a/src/inspect-fs.c
+++ b/src/inspect-fs.c
@@ -494,6 +494,7 @@ guestfs_int_check_package_format (guestfs_h *g, struct inspect_fs
*fs)
case OS_DISTRO_FREEBSD:
case OS_DISTRO_NETBSD:
case OS_DISTRO_OPENBSD:
+ case OS_DISTRO_ALPINE_LINUX:
case OS_DISTRO_UNKNOWN:
fs->package_format = OS_PACKAGE_FORMAT_UNKNOWN;
break;
@@ -565,6 +566,7 @@ guestfs_int_check_package_management (guestfs_h *g, struct inspect_fs
*fs)
case OS_DISTRO_FREEBSD:
case OS_DISTRO_NETBSD:
case OS_DISTRO_OPENBSD:
+ case OS_DISTRO_ALPINE_LINUX:
case OS_DISTRO_UNKNOWN:
fs->package_management = OS_PACKAGE_MANAGEMENT_UNKNOWN;
break;
diff --git a/src/inspect-icon.c b/src/inspect-icon.c
index ab730b5..77256a3 100644
--- a/src/inspect-icon.c
+++ b/src/inspect-icon.c
@@ -182,6 +182,7 @@ guestfs_impl_inspect_get_icon (guestfs_h *g, const char *root, size_t
*size_r,
case OS_DISTRO_FREEBSD:
case OS_DISTRO_NETBSD:
case OS_DISTRO_OPENBSD:
+ case OS_DISTRO_ALPINE_LINUX:
case OS_DISTRO_UNKNOWN:
; /* nothing */
}
diff --git a/src/inspect.c b/src/inspect.c
index abe9087..79f674c 100644
--- a/src/inspect.c
+++ b/src/inspect.c
@@ -255,6 +255,7 @@ guestfs_impl_inspect_get_distro (guestfs_h *g, const char *root)
return NULL;
switch (fs->distro) {
+ case OS_DISTRO_ALPINE_LINUX: ret = safe_strdup (g, "alpinelinux"); break;
case OS_DISTRO_ARCHLINUX: ret = safe_strdup (g, "archlinux"); break;
case OS_DISTRO_BUILDROOT: ret = safe_strdup (g, "buildroot"); break;
case OS_DISTRO_CENTOS: ret = safe_strdup (g, "centos"); break;
--
2.1.0