initramfs-tools/update-initramfs.8
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

111 lines
2.6 KiB
Groff

.TH UPDATE-INITRAMFS 8 "2014/10/16" "initramfs\-tools" "System Administration"
.SH NAME
update\-initramfs \- generate an initramfs image
.SH SYNOPSIS
.B update\-initramfs
.RB { \-c | \-d | \-u }
.RB [ \-k
.IR version ]
.RB [ \-v ]
.RB [ \-b
.IR directory ]
.RB [ \-s
.IR timestamp ]
.br
.BR update\-initramfs " " \-\-version
.br
.BR update\-initramfs " " \-h
.SH DESCRIPTION
The
.B update\-initramfs
script manages your initramfs images on your local box.
It keeps track of the existing initramfs archives in /boot.
There are three modes of operation create, update or delete.
You must at least specify one of those modes.
The initramfs is a gzipped cpio archive.
At boot time, the kernel unpacks that archive into RAM disk, mounts and
uses it as initial root file system. All finding of the root device
happens in this early userspace.
.SH OPTIONS
.TP
\fB\-k \fI version
Set the specific kernel version for whom the initramfs will be generated.
For example the output of uname \-r for your currently running kernel.
This argument is optional for update. The default is the latest kernel version.
The use of "all" for the
.I version
string specifies that
.B update\-initramfs
should operate on all installed kernel versions (with \fB\-c\fR), or
on all installed kernel versions that already have an initramfs
(with \fB\-d\fR or \fB\-u\fR).
.TP
\fB\-c
This mode creates a new initramfs.
.TP
\fB\-u
This mode updates an existing initramfs.
.TP
\fB\-d
This mode deletes an existing initramfs.
.TP
\fB\-v
This option increases the amount of information you are given during
the chosen action.
.TP
\fB\-b \fI directory
Set an different bootdir for the image creation.
.TP
\fB-s \fI timestamp
This parameter sets 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 parameter will be ignored if set to an empty string.
.TP
\fB--version\fR
Print the version information of the underlying initrd generation tool and exit.
.TP
\fB\-h\fR, \fB--help\fR
Print a short help page describing the available options in
.B update\-initramfs.
.SH EXAMPLES
Update the initramfs of the newest kernel:
.PP
.B update\-initramfs -u
Create the initramfs for a specific kernel:
.PP
.B update\-initramfs -c -k 2.6.18-1-686
.SH FILES
/etc/initramfs-tools/update-initramfs.conf
.SH AUTHOR
The initramfs-tools are written by Maximilian Attems <maks@debian.org>,
Jeff Bailey <jbailey@raspberryginger.com> and numerous others.
.SH SEE ALSO
.BR
.IR initramfs.conf (5),
.IR initramfs-tools (7),
.IR mkinitramfs (8),
.IR lsinitramfs (8).