diff --git a/doc/helper_functions.7.md b/doc/helper_functions.7.md new file mode 100644 index 0000000..bf01c52 --- /dev/null +++ b/doc/helper_functions.7.md @@ -0,0 +1,54 @@ +helper functions +================ + +you can find useful helper functions in `libdevuansdk/zlibs/helpers`. they are +intended to help you with writing wrappers, as well as making my job easier +within developing libdevuansdk. some of these functions are required for +libdevuansdk to properly work as well. + + +## build_image_dist() +this function is kind of a wrapper function, mostly used in `arm-sdk` to build a +complete "dd-able" image from start to end. to run, it requires `$arch`, +`$size`, `$parted_type`, `$workdir`, and `$strapdir` to be declared. as well as +`$parted_root`, `$parted_boot` if `$parted_type=dos`, or `$gpt_root`, +`$gpt_boot` if `$parted_type=gpt`. see `creating_wrappers(7)` for insight on +these variables. + +the workflow of this function is bootstrapping a complete rootfs, creating a raw +image, installing/compiling a kernel, rsyncing everything to the raw image, and +finally, compressing the raw image. + + +## devprocsys() +this function is a simple helper function that takes two arguments: `watdo` and +`werdo`. it mounts or umounts `/sys`, `/dev`, `/dev/pts`, and `procfs` where you +tell it to. for example: + +``` +devprocsys mount $strapdir +devprocsys umount $strapdir +``` + + +## findloopmapp() +this functions takes the raw image and finds a free loopdevice for it to be +mounted. it calls `losetup(8)` and `kpartx(8)`. + + +## qemu_install_user() +helper function to install the userspace qemu to `$strapdir`. + + +## dpkgdivert() +this one takes two arguments, `watdo` and `werdo` (much like `devprocsys`). it +will create a dpkg diversion in the place you tell it to and remove invoke-rc.d +so that apt doesn't autostart daemons when they are installed. + + +## enablessh() +this function will allow root login with password in the bootstrapped rootfs. + + +## silly() +a funny function printing out random messages. diff --git a/doc/nanodoc b/doc/nanodoc index 4f904f2..4bd3c77 100755 --- a/doc/nanodoc +++ b/doc/nanodoc @@ -24,7 +24,8 @@ desc="common.lib.for.devuan.sdks" pages=" libdevuansdk.7 - configuration.7" + configuration.7 + helper_functions.7" generate_manpages() {