Add documentation for the modules making up supermin. This is just documentation, there is no code change. --- src/Makefile.am | 9 +++++++++ src/build.mli | 23 +++++++++++++++++++++++ src/chroot.mli | 25 +++++++++++++++++++++++++ src/dpkg.mli | 22 ++++++++++++++++++++++ src/ext2.mli | 29 +++++++++++++++++++++++++++++ src/ext2_initrd.mli | 31 +++++++++++++++++++++++++++++++ src/kernel.mli | 35 +++++++++++++++++++++++++++++++++++ src/pacman.mli | 22 ++++++++++++++++++++++ src/prepare.mli | 23 +++++++++++++++++++++++ src/rpm.mli | 22 ++++++++++++++++++++++ 10 files changed, 241 insertions(+) create mode 100644 src/build.mli create mode 100644 src/chroot.mli create mode 100644 src/dpkg.mli create mode 100644 src/ext2.mli create mode 100644 src/ext2_initrd.mli create mode 100644 src/kernel.mli create mode 100644 src/pacman.mli create mode 100644 src/prepare.mli create mode 100644 src/rpm.mli diff --git a/src/Makefile.am b/src/Makefile.am index 767117f..c0e9656 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -52,14 +52,23 @@ SOURCES = \ package_handler.ml \ package_handler.mli \ rpm.ml \ + rpm.mli \ dpkg.ml \ + dpkg.mli \ pacman.ml \ + pacman.mli \ prepare.ml \ + prepare.mli \ chroot.ml \ + chroot.mli \ kernel.ml \ + kernel.mli \ ext2_initrd.ml \ + ext2_initrd.mli \ ext2.ml \ + ext2.mli \ build.ml \ + build.mli \ supermin.ml # Can't use filter for this because of automake brokenness. diff --git a/src/build.mli b/src/build.mli new file mode 100644 index 0000000..6feb4f8 --- /dev/null +++ b/src/build.mli @@ -0,0 +1,23 @@ +(* supermin 5 + * Copyright (C) 2009-2016 Red Hat Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + *) + +(** Implements the [--build] subcommand. *) + +val build : int -> (bool * string option * Types.format * string * string option * string * bool * int64 option * bool) -> string list -> string -> unit +(** [build debug (args...) inputs outputdir] performs the + [supermin --build] subcommand. *) diff --git a/src/chroot.mli b/src/chroot.mli new file mode 100644 index 0000000..5bd81c7 --- /dev/null +++ b/src/chroot.mli @@ -0,0 +1,25 @@ +(* supermin 5 + * Copyright (C) 2009-2016 Red Hat Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + *) + +(** Implements [--build -f chroot]. *) + +val build_chroot : int -> Package_handler.file list -> string -> string option -> unit +(** [build_chroot debug files outputdir packagelist_file] copies the + list of [files] into the chroot at [outputdir]. The optional + [packagelist] controls creation of [/packagelist] within the + chroot. *) diff --git a/src/dpkg.mli b/src/dpkg.mli new file mode 100644 index 0000000..c21327c --- /dev/null +++ b/src/dpkg.mli @@ -0,0 +1,22 @@ +(* supermin 5 + * Copyright (C) 2009-2016 Red Hat Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + *) + +(** dpkg package handler + + Nothing is exported. This module registers callbacks when it + is loaded. *) diff --git a/src/ext2.mli b/src/ext2.mli new file mode 100644 index 0000000..66cf5c2 --- /dev/null +++ b/src/ext2.mli @@ -0,0 +1,29 @@ +(* supermin 5 + * Copyright (C) 2009-2016 Red Hat Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + *) + +(** Implements [--build -f chroot]. *) + +val build_ext2 : int -> string -> Package_handler.file list -> string -> string -> string -> int64 option -> string option -> unit +(** [build_ext2 debug basedir files modpath kernel_version appliance size + packagelist_file] copies all the files from [basedir] plus the + list of [files] into a newly created ext2 filesystem called [appliance]. + + Kernel modules are also copied in from the local [modpath] + to the fixed path in the appliance [/lib/modules/<kernel_version>]. + + libext2fs is used to populate the ext2 filesystem. *) diff --git a/src/ext2_initrd.mli b/src/ext2_initrd.mli new file mode 100644 index 0000000..d03ee23 --- /dev/null +++ b/src/ext2_initrd.mli @@ -0,0 +1,31 @@ +(* supermin 5 + * Copyright (C) 2009-2016 Red Hat Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + *) + +(** Implements [--build -f ext2] minimal initrd which is required + to mount the ext2 filesystem at runtime. + + See also the {!Ext2} module. *) + +val build_initrd : int -> string -> string -> string -> unit +(** [build_initrd debug tmpdir modpath initrd] creates the minimal + initrd required to mount the ext2 filesystem at runtime. + + A small, whitelisted selection of kernel modules is taken + from [modpath], just enough to mount the appliance. + + The output is the file [initrd]. *) diff --git a/src/kernel.mli b/src/kernel.mli new file mode 100644 index 0000000..36b4ab7 --- /dev/null +++ b/src/kernel.mli @@ -0,0 +1,35 @@ +(* supermin 5 + * Copyright (C) 2009-2016 Red Hat Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + *) + +(** For [--build -f ext2] this module chooses a kernel to use + and either links to it or copies it. + + See also the {!Ext2} module. *) + +val build_kernel : int -> string -> string option -> bool -> string -> string -> string * string +(** [build_kernel debug host_cpu dtb_wildcard copy_kernel kernel dtb] + chooses the kernel to use and links to it or copies it into the + appliance directory. + + The output is written to the file [kernel]. + + The function returns the [kernel_version, modpath] tuple as a + side-effect of locating the kernel. + + The [--dtb] option is also handled here, but that support is + now effectively obsolete and will be removed in future. *) diff --git a/src/pacman.mli b/src/pacman.mli new file mode 100644 index 0000000..5b9be12 --- /dev/null +++ b/src/pacman.mli @@ -0,0 +1,22 @@ +(* supermin 5 + * Copyright (C) 2009-2016 Red Hat Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + *) + +(** pacman package handler. + + Nothing is exported. This module registers callbacks when it + is loaded. *) diff --git a/src/prepare.mli b/src/prepare.mli new file mode 100644 index 0000000..404302a --- /dev/null +++ b/src/prepare.mli @@ -0,0 +1,23 @@ +(* supermin 5 + * Copyright (C) 2009-2016 Red Hat Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + *) + +(** Implements the [--prepare] subcommand. *) + +val prepare : int -> (bool * string option * Types.format * string * string option * string * bool * int64 option * bool) -> string list -> string -> unit +(** [prepare debug (args...) inputs outputdir] performs the + [supermin --prepare] subcommand. *) diff --git a/src/rpm.mli b/src/rpm.mli new file mode 100644 index 0000000..8b55ad4 --- /dev/null +++ b/src/rpm.mli @@ -0,0 +1,22 @@ +(* supermin 5 + * Copyright (C) 2009-2016 Red Hat Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + *) + +(** RPM package handler + + Nothing is exported. This module registers callbacks when it + is loaded. *) -- 2.10.2