Bug#339091: initramfs-tools: lacking documentation
tags 339091 - moreinfo stop maximilian attems ([EMAIL PROTECTED]) wrote: can you please confirem that your manpage was written under PUBLIC DOMAIN license as the initramfs-tools package? I hope this is sufficient: I, the creator of this work, hereby release it into the public domain. This applies worldwide where legally possible. In jurisdictions where this is not legally possible I grant anyone the right, without any conditions unless required by law, to use this work for any purpose including unrestricted redistribution, commercial use, and modification. i've included some small updates to it to match current state. as it's late please proof read too ;-) I'll try to find time to proofread it later this week. If the man page is already in the package by then I'll just file a new bug :) Re, David -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#339091: initramfs-tools: lacking documentation
tags 339091 pending thanks On Tue, 06 Dec 2005, David =?UTF-8?Q?H=C3=A4rdeman ?= wrote: I hope this is sufficient: license snipp yes! :) i've included some small updates to it to match current state. as it's late please proof read too ;-) I'll try to find time to proofread it later this week. If the man page is already in the package by then I'll just file a new bug :) it's already in the bzr public archive for next upload after 0.42. bzr branch http://debian.stro.at/bzr-test/initramfs-tools/ -- maks -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#339091: initramfs-tools: lacking documentation
tags 339091 moreinfo stop hello david, On Mon, 14 Nov 2005, David Härdeman wrote: Since the HACKING file included with the initramfs-tools package isn't very helpful, I've attached a stab at a man page giving a brief introduction to writing initramfs-tools scripts. very nice indeed thanks! Feel free to proofread, alter and possibly add it to the package instead of the HACKING file. can you please confirem that your manpage was written under PUBLIC DOMAIN license as the initramfs-tools package? i've included some small updates to it to match current state. as it's late please proof read too ;-) regards -- maks .TH INITRAMFS-TOOLS 8 Date: 2005/12/06 mkinitramfs script overview .SH NAME initramfs-tools \- an introduction to writing scripts for mkinitramfs .SH DESCRIPTION initramfs-tools has one main script and two different sets of subscripts which will be used during different phases of execution. Each of these will be discussed separately below with the help of an imaginary tool which performs a frobnication of a lvm partition prior to mounting the root partition. .SS Hook scripts These are used when an initramfs image is created and not included in the image itself. They can however cause files to be included in the image. .SS Boot scripts These are included in the initramfs image and normally executed during kernel boot in the early user-space before the root partition has been mounted. .SH INIT SCRIPT The script which is executed first and is in charge of running all other scripts can be found in /usr/share/initramfs-tools/init. It takes a number of arguments which influence the boot procedure: .SS Boot options .TP \fB \fI init the binary to hand over execution to on the root fs after the initramfs scripts are done. .TP \fB \fI root the device node to mount as the rootfs. .TP \fB \fI nfsroot can be either auto to try to get the relevant information from DHCP or a string of the form NFSSERVER:NFSPATH .TP \fB \fI boot either local or nfs (affects which initramfs scripts are run, see the Subdirectories section under boot scripts). .TP \fB \fI resume device node which holds the result of a previous suspension using swsusp (usually the swap partition). .TP \fB \fI quiet reduces the amount of text output to the console during boot .TP \fB \fI ro mounts the rootfs read-only .TP \fB \fI rw mounts the rootfs read-write .TP \fB \fI debug generates lots of output to /tmp/initramfs.debug .TP \fB \fI break spawns a shell in the initramfs image at chosen run-time .SH HOOK SCRIPTS Hooks can be found in two places: /usr/share/initramfs-tools/hooks and /etc/mkinitramfs/hooks. They are executed during generation of the initramfs-image and are responsible for including all the necessary components in the image itself. No guarantees are made as to the order in which the different scripts are executed unless the prereqs are setup in the script. .SS Header In order to support prereqs, each script should begin with the following lines: .RS .nf #!/bin/sh PREREQ= prereqs() { echo $PREREQ } case $1 in prereqs) prereqs exit 0 ;; esac . /usr/share/initramfs-tools/hook-functions # Begin real processing below this line .fi .RE For example, if you are writing a new hook script which relies on lvm, the line starting with PREREQ should be changed to PREREQ=lvm which will ensure that the lvm hook script is run before your custom script. .SS Help functions /usr/share/initramfs-tools/hook-functions contains a number of functions which deal with some common tasks in a hook script: .TP \fB \fI manual_add_modules adds a module (and any modules which it depends on) to the initramfs image. .RS .PP .B Example: manual_add_modules reiserfs .RE .TP \fB \fI add_modules_from_file reads a file containing a list of modules (one per line) to be added to the initramfs image. The file can contain comments (lines starting with #) and arguments to the modules by writing the arguments on the same line as the name of the module. .RS .PP .B Example: add_modules_from_file /tmp/modlist .RE .TP \fB \fI force_load adds a module (and its dependencies) to the initramfs image and also unconditionally loads the module during boot. Also supports passing arguments to the module by listing them after the module name. .RS .PP .B Example: force_load cdrom debug=1 .RE .TP \fB \fI copy_modules_dir copies an entire module directory from /lib/modules/KERNELVERSION/ into the initramfs image. .RS .PP .B Example: copy_modules_dir kernel/drivers/pci/foobar .RE .SS Including binaries If you need to copy binaries to the initramfs module, a command like this should be used: .PP .RS copy_exec /sbin/mdadm ${DESTDIR}/sbin .RE mkinitramfs will automatically detect which libraries the executable depends on and copy them to the initramfs. This means that most executables, unless compiled with klibc, will automatically include glibc in the image which will increase its size by several hundred
Bug#339091: initramfs-tools: lacking documentation
Package: initramfs-tools Severity: minor Tags: patch Since the HACKING file included with the initramfs-tools package isn't very helpful, I've attached a stab at a man page giving a brief introduction to writing initramfs-tools scripts. Feel free to proofread, alter and possibly add it to the package instead of the HACKING file. Re, David .TH MKINITRAMFS_SCRIPTS 8 Date: 2005/11/14 mkinitramfs script overview .SH NAME mkinitramfs_scripts \- an introduction to writing scripts for initramfs-tools .SH DESCRIPTION initramfs-tools has one main script and two different sets of subscripts which will be used during different phases of execution. Each of these will be discussed separately below with the help of an imaginary tool which performs a frobnication of a lvm partition prior to mounting the root partition. .SS Hook scripts These are used when an initramfs image is created and not included in the image itself. They can however cause files to be included in the image. .SS Boot scripts These are included in the initramfs image and normally executed during kernel boot in the early user-space before the root partition has been mounted. .SH INIT SCRIPT The script which is executed first and is in charge of running all other scripts can be found in /usr/share/initramfs-tools/init. It takes a number of arguments which influence the boot procedure: .SS Boot options .TP \fB \fI init the binary to hand over execution to on the root fs after the initramfs scripts are done. .TP \fB \fI root the device node to mount as the rootfs. .TP \fB \fI nfsroot can be either auto to try to get the relevant information from DHCP or a string of the form NFSSERVER:NFSPATH .TP \fB \fI boot either local or nfs (affects which initramfs scripts are run, see the Subdirectories section under boot scripts). .TP \fB \fI resume device node which holds the result of a previous suspension using swsusp (usually the swap partition). .TP \fB \fI quiet reduces the amount of text output to the console during boot .TP \fB \fI ro mounts the rootfs read-only .TP \fB \fI rw mounts the rootfs read-write .TP \fB \fI debug generates lots of output to /tmp/initramfs.debug .TP \fB \fI break spawns a shell in the initramfs image before init-premount scripts are run .SH HOOK SCRIPTS Hooks can be found in two places: /usr/share/initramfs-tools/hooks and /etc/mkinitramfs/hooks. They are executed during generation of the initramfs-image and are responsible for including all the necessary components in the image itself. No guarantees are made as to the order in which the different scripts are executed unless the prereqs are setup in the script. .SS Header In order to support prereqs, each script should begin with the following lines: .RS .nf #!/bin/sh PREREQ= prereqs() { echo $PREREQ } case $1 in prereqs) prereqs exit 0 ;; esac . /usr/share/initramfs-tools/hook-functions # Begin real processing below this line .fi .RE For example, if you are writing a new hook script which relies on lvm, the line starting with PREREQ should be changed to PREREQ=lvm which will ensure that the lvm hook script is run before your custom script. .SS Help functions /usr/share/initramfs-tools/hook-functions contains a number of functions which deal with some common tasks in a hook script: .TP \fB \fI manual_add_modules adds a module (and any modules which it depends on) to the initramfs image. .RS .PP .B Example: manual_add_modules reiserfs .RE .TP \fB \fI add_modules_from_file reads a file containing a list of modules (one per line) to be added to the initramfs image. The file can contain comments (lines starting with #) and arguments to the modules by writing the arguments on the same line as the name of the module. .RS .PP .B Example: add_modules_from_file /tmp/modlist .RE .TP \fB \fI force_load adds a module (and its dependencies) to the initramfs image and also unconditionally loads the module during boot. Also supports passing arguments to the module by listing them after the module name. .RS .PP .B Example: force_load cdrom debug=1 .RE .TP \fB \fI copy_modules_dir copies an entire module directory from /lib/modules/KERNELVERSION/ into the initramfs image. .RS .PP .B Example: copy_modules_dir kernel/drivers/pci/foobar .RE .SS Including binaries If you need to copy binaries to the initramfs module, a command like this should be used: .PP .RS cp /sbin/mdadm ${DESTDIR}/sbin .RE mkinitramfs will automatically detect which libraries the executable depends on and copy them to the initramfs. This means that most executables, unless compiled with klibc, will automatically include glibc in the image which will increase its size by several hundred kilobytes. .SH BOOT SCRIPTS Similarly to hook scripts, boot scripts can be found in two places /usr/share/initramfs-tools/scripts/ and /etc/mkinitramfs/scripts/. There are a number of subdirectories to these two directories which control the