37 Commits

Author SHA1 Message Date
Benjamin Drung
40694280ef update-initramfs: add -s parameter
When installing/upgrading packages (e. g. a kernel and initramfs-tools),
the same initrd is generated twice:

```
$ apt-get install --no-install-recommends -y zstd initramfs-tools linux-image-generic
[...]
Setting up initramfs-tools-core (0.145) ...
Setting up initramfs-tools (0.145) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-image-6.12.16-amd64 (6.12.16-1) ...
I: /vmlinuz.old is now a symlink to boot/vmlinuz-6.12.16-amd64
I: /initrd.img.old is now a symlink to boot/initrd.img-6.12.16-amd64
I: /vmlinuz is now a symlink to boot/vmlinuz-6.12.16-amd64
I: /initrd.img is now a symlink to boot/initrd.img-6.12.16-amd64
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-6.12.16-amd64
Setting up linux-image-amd64 (6.12.16-1) ...
Processing triggers for libc-bin (2.40-7) ...
Processing triggers for initramfs-tools (0.145) ...
update-initramfs: Generating /boot/initrd.img-6.12.16-amd64
```

Add a `-s` parameter to `update-initramfs` to set a Unix time stamp
(seconds since 1970) for the update mode. An existing initramfs will
only be updated if it is not newer than the specified Unix time stamp.

This feature is the first step to avoid generating the initrd twice.

LP: #1466965
2025-03-25 12:40:14 +01:00
Benjamin Drung
65166a6ff3 update-initramfs: add --version parameter 2025-03-24 11:30:45 +01:00
Ben Hutchings
897ab77645 update-initramfs: Make "-c -k all" options useful again
"update-initramfs -c -k all" used to re-create initramfs images if
they had been deleted without using "update-initramfs -d", as it used
the state directory to determine which kernel versions should have
them.

Since commit f39625a "update-initramfs: Make "-k all" take over other
initramfs images", it ignores the state directory and is almost
equivalent to "update-initramfs -u -k all".

Change it to operate on all installed kernel versions.  This will
ignore which kernel versions suppressed initramfs generation, but
I think it's reasonable to assume users won't use these options
if they have installed such kernels.

Closes: #926401
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-01-18 18:36:00 +00:00
Ben Hutchings
fffe514a4b update-initramfs(8): Update description of "-k all" option
Describe the new behaviour introduced by commit f39625afd6ba
"update-initramfs: Make "-k all" take over other initramfs images".

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2019-07-28 00:49:58 +01:00
Ben Hutchings
85707183a7 update-initramfs(8): Document -d option as "delete" instead of "remove"
This is mnemonic, and consistent with messages the command may output.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2019-07-28 00:49:58 +01:00
Ben Hutchings
00809d736a Make manual pages and usage messages more consistent
* Don't use angle brackets around parameters
* Show all options in manual page synopses if possible
* Make the usage summary line match the manual page synopsis,
  excluding the -h option
* List all options in usage messages
* Refer to manual pages from usage messages
* Include one blank line at start and end of usage messages

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2019-02-06 03:37:11 +00:00
Ben Hutchings
ccf07ee2f1 update-initramfs: Support --help option
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2019-02-06 03:35:49 +00:00
Ben Hutchings
66902db1a1 update-initramfs(8): Fix formatting of mode options in the synopsis
The regular/bold formatting are applied to the wrong things on this
line.  We also need braces to show where the alternate options start
and ends.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2019-02-06 03:30:08 +00:00
Ben Hutchings
4d57f637a9 mkinitramfs(8), update-initramfs(8): Fix over-indentation of options
When using inline markup, all whitespace is significant, so these
options had an extra space in front of them.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2019-02-06 03:30:06 +00:00
Ben Hutchings
b8d3d5968c Remove descriptions of removed/deprecated options from man page synopsises
I already these options from the Options sections but forgot the
Synopsis.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2019-02-06 02:29:49 +00:00
Ben Hutchings
c0ae42ba8e update-initramfs: Always take over other initramfs images
In Debian, update-initramfs has always refused to overwrite or delete
an initramfs image that it didn't create, unless the -t option is
used.  On Ubuntu, this check is apparently disabled.  The commit log
doesn't provide much of a clue as to why.  Looking at the the state of
Debian and the linux-2.6 package at the time, I think the reasoning
must have been something like:

(1) Multiple initramfs/initrd generators were available and could be
coinstalled.  The configuration file /etc/kernel-img.conf specified
which one kernel packages should invoke ("ramdisk" variable).

(2) Packages that hooked into initramfs-tools would always run update-
initramfs if it existed, and it would immediately update the
initramfs, because triggers hadn't yet been invented.

(3) To keep the alternate initramfs generators working, update-
initramfs therefore had to either (a) check the configuration file to
find out whether initramfs-tools was meant to be used, or (b) keep
track of which initramfs images it created and therefore "owned".

At this point, (1) is no longer true; the "ramdisk" variable is not
honoured and the initramfs generator to be invoked is chosen by
installing one of several conflicting packages.  I think this means
that (3) no longer follows, and whichever of the automatic initramfs
generator packages is currently installed should be considered to
"own" /boot/initrd.img-<version> for all kernel versions.

This commit only disables the checks.  The state directory and the
state updates are retained for now, in case it becomes necessary to
revert this change.

Closes: #765750, #804295
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2018-07-26 01:16:31 +08:00
Ben Hutchings
9bd960e4d7 docs: Set man page header source and manual parameters correctly
Set the .TH source parameter for all pages to "initramfs-tools".
Set the .TH manual parameter to a commonly used name for the man page
section.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2018-07-18 23:38:23 +01:00
Ben Hutchings
562d86ef33 docs: Update man page header dates
Set each page's date to the date of the last substantive
change, i.e. excluding cross-reference updates and spelling fixes.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2018-07-18 23:38:14 +01:00
Ben Hutchings
63cec7bb02 docs: Move initramfs-tools man page to section 7
Manual pages that describe a general topic belong in section 7, not 8.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2018-07-18 23:36:57 +01:00
Ben Hutchings
35bdb74195 Refer to lsinitramfs(8) from {initramfs-tools,mkinitramfs,update-initramfs}(8)
While we're at it, fix the rendering of 'mkinitramfs(8)' in
initramfs-tools(8).

Closes: #764020
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2014-10-16 16:30:23 +02:00
Ben Hutchings
3862d9bfd5 update-initramfs: Consistently show which options take arguments
The text in the manual page implies that -b needs an argument
but the usage summaries don't say that.

While we're at it, remove the brackets in '-k [version]', as
these suggest the version argument is optional.

Closes: #762768
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2014-10-16 16:18:03 +02:00
Michael Prokop
adce374416 docs: fix wording ("allows *one* to") to make lintian happy.
Signed-off-by: Michael Prokop <mika@debian.org>
2011-05-11 23:56:44 +02:00
e2xbegqsdyt21hfc
c5e4c28ef9 update-initramfs.8: mentions the specific conf file
adds FILES section.
2008-12-19 15:53:25 +01:00
maximilian attems
6966048d94 manpages: Set Linux as necessary OS.
thanks to jidanni@jidanni.org for pointing out the missed field.
2008-12-19 14:25:48 +01:00
maximilian attems
c9df41aa32 update-initramfs.8: List -d and mark the non-optional as such.
-d was missing in synopsis.
-c or -d or -u are not optional.
2008-12-19 01:57:01 +01:00
maximilian attems
0d2613de43 doc: fix date string of manual pages.
thanks to jidanni@jidanni.org

Signed-off-by: maximilian attems <maks@debian.org>
2008-07-04 00:10:14 +02:00
maximilian attems
701f56e007 manpages: fix hyphen-used-as-minus-sign
properly escape minus signs to make them easily pastable.
2008-03-29 12:24:22 +01:00
maximilian attems
adda784dc1 minor cleanups to get 0.87 ready:
- add changelog entries to david changes
- change to my new debian.org email adresses in manpages too
- module list is alphabetic
2007-04-16 20:05:00 +02:00
maximilian attems
abb7b4e13f whitespace policy 2006-10-13 09:11:54 +02:00
maximilian attems
849c7c5f29 - add backup handling to initramfs-tools
- allow conservative settings for skipping updated initramfs.
- debug output to screen
- parse mbr for lilo
+ small fixes
2006-10-13 08:52:12 +02:00
maximilian attems
773f7f37a7 - check for ro /boot
- allow -k all for all modes and more feedback on deleting
- small whitespace cleanup
2006-09-12 09:29:44 +02:00
maximilian attems
cf4bba337d - better nfs handling: merge vagrant branch :) + local changes
- cleanup stupid whitespace all over the place
2006-09-04 18:54:59 +02:00
maximilian attems
8761821795 - add BUSYBOX section to conf
- add myri10ge, smc911x and hptiop modules
- fix check_minkver() logic
- escape resume variables
- fix SEE ALSO section in all manpages
- source /usr/share/initramfs-tools/conf.d/* 
- check against modules.dep before running depmod
- more verbose output
- open console with -i for dash interactive
- fix resume param by LABEL or UUID
- lvm has new prereq mdadm
- update-initramfs fix -v calling
- functions/scripts replace basename usage with shell expansion
2006-07-24 09:13:28 +02:00
maximilian attems
17d01b3434 massif whitespace cleanup 2006-07-16 21:54:14 +02:00
maximilian attems
50586c0818 - rename suspend boot script in resume
- update-initramfs add -b bootdif flag
  document it
- check for noresume arg in init
2006-07-12 18:21:16 +02:00
maximilian attems
0754335a68 rephrase docs
remove cp modules from postinstall, install confdir
lots of small polishing thanks to Sesse review
don't use touch on init
2006-06-22 20:50:14 +02:00
maximilian attems
aad10a3ce2 * fix minor parsing
* add linear module
* manpage polishing
* udev_helper needs some conf sourced
2006-03-18 09:24:43 +01:00
maximilian attems
0d19ff751e add kernel-package compat stuff, behaves like mkinitramfs and adds
an sha1sum for update-initramfs.

is meant for etch release, hope we get rid afterwards.
will allow to clean up mkinitramfs from the longoption calls.
2006-02-17 21:43:38 +01:00
maximilian attems
785fb28847 highlight the mode of operation of update-initramfs 2006-02-17 10:05:12 +01:00
maximilian attems
b3fcee3438 better document the point of update-initramfs and mkinitramfs. 2006-02-14 11:22:50 +01:00
maximilian attems
6ee91456c2 add initramfs-tools.8
update manpage crossreferences
2005-12-06 10:34:22 +01:00
maximilian attems
d1373b552d add update-initramfs.8 2005-09-20 13:53:59 +02:00