...
 
Commits (5)
  • Ben Hutchings's avatar
    Import Debian version 0.132 · 21af342d
    Ben Hutchings authored
    initramfs-tools (0.132) unstable; urgency=medium
    
      * [4e1f80e] mkinitramfs: Don't try to remove nonexistent /var/cache/ldconfig
        (Closes: #904065)
      * [d0212d3] hook-functions: Quote exclusions in copy_modules_dir
      * [8c806b4] hook-functions: Add support for compressed module files
        (Closes: #891560)
      * [71f5d61] mkinitramfs: Create usr-merged filesystem layout
        (Closes: #874523)
      * [4c0d86c] hooks/resume: Loop over all swap devices when selecting
        automatically
      * [312393b] hooks/resume: Reject zram swap devices when selecting
        automatically (Closes: #861228)
      * [c0ae42b] update-initramfs: Always take over other initramfs images
        (Closes: #765750, #804295)
      * [f39625a] update-initramfs: Make "-k all" take over other initramfs images
      * [f273172] scripts/functions: Fix parsing of device name from ip parameter
      * [abae896] scripts/functions: Merge information from BOOTIF/DEVICE and ip
        parameters (Closes: #721088)
    
    initramfs-tools (0.131) unstable; urgency=medium
    
      [ Ben Hutchings ]
      * [34bf250] debian/control: Remove maximilian attems and Adam Conrad from
        Uploaders field
      * [5ad3976] hooks/resume: Generalise logic to replace dev name with UUID when
        RESUME=auto
      * [0170b7f] hooks/resume: Store /dev/mapper path for swap if possible when
        RESUMEauto (Closes: #883735)
      * [5bf4c29] debian/control: Point Vcs URLs to Salsa
      * [e8377b3] hooks/fsck: Fix invocation of fstype at build time.
        Thanks to Simon Tatham <anakin@pobox.com> (Closes: #865691)
      * [492763a] docs: Convert maintainer notes to Markdown format
      * [0214976] docs/maintainer-notes.md: Update references to Alioth, to Salsa
      * [b71c6c9] docs/maintainer-notes.md: Delete mention of git-core package
      * [89daebf] docs/maintainer-notes.md: Change BTS link to specify source
        package
      * [8e539dc] docs/maintainer-notes.md: Link to tracker.debian.org instead of
        PTS
      * [3f27197] docs/maintainer-notes.md: Remove stale link to Debian bug count
        graph
      * [7dece27] docs/maintainer-notes.md: Use HTTP-S for Debian wiki and popcon
        links
      * [838b6ec] docs/maintainer-notes.md: Link directly to Ubuntu bug list
      * [eaa61d4] docs/maintainer-notes.md: Add myself as co-author
      * [fa7df8f] hook-functions: Correct the comment above hidden_dep_add_modules
      * [0ffbeb9] hook-functions: Remove directory information from
        hidden_dep_add_modules
      * [78e95c1] hook-functions: Check modules.builtin in hidden_dep_add_modules
      * [976aeb9] hook-functions: Handle i8042 hidden dependency on psmouse
        (Closes: #878829)
      * [211e050] hook-functions: Handle nvme hidden dependency on vmd.
        Thanks to Mario Limonciello <Mario.Limonciello@dell.com> (Closes: #886349)
      * [28536f6] unmkinitramfs, lsinitramfs: Split multiple early initramfs
        sections (Closes: #886424)
      * [2a9d97d] debian/control: Add e2fsprogs to Depends for initramfs-tools-core
        (Closes: #887211)
      * [577c94e] initramfs.conf: Update documentation of the DEVICE variable
      * [f1cbe6f] mkinitramfs: Build reproducible images when SOURCE_DATE_EPOCH is
        set. Thanks to Chris Lamb <lamby@debian.org> (Closes: #845034)
      * [717e6bd] mkinitramfs: Exclude ldconfig auxiliary cache from initramfs
        image. Thanks to Kristian Klausen <klausenbusk@hotmail.com>
      * [8bddfe4] mkinitramfs(8): Remove description of nonexistent options
      * [ecd6ce2] mkinitramfs(8), hook-functions: Correct references to "ramdisk"
      * [63cec7b] docs: Move initramfs-tools man page to section 7
      * [562d86e] docs: Update man page header dates
      * [9bd960e] docs: Set man page header source and manual parameters correctly
      * [97cc7e7] docs: Don't package maintainer documentation in
        initramfs-tools-core
      * [4e19a6f] docs: Remove outdated "HACKING" documentation file
      * [6c02622] debian/control: Remove obsolete Breaks and Depends relations
      * [749751c] debian/control: Update Standards-Version to 4.1.5
        - Set Rules-Requires-Root: no
      * [db469f0] initramfs-tools: Override lintian warning "breaks-without-version
        upstart"
    
      [ Riku Voipio ]
      * [72b6419] auto_add_modules: add mfd for MODULES==most (Closes: #880584)
    
      [ Benjamin Drung ]
      * [7ca4d0d] Add mlx4 and mlx5 InfiniBand modules to hidden_dep_add_modules
        (Closes: #871595)
      * [df7d7e8] Add option to clear screen at the beginning (Closes: #856929)
      * [a33cb62] Fix indentation (spaces to tabs)
      * [3962c4f] Fix config directory in error message (Closes: #856589)
      * [be2b91c] Double quote to prevent globbing and word splitting
      * [ae339ff] Make size of /run configurable (Closes: #862013)
    
      [ Steve Langasek ]
      * [c198331] Skip dmsetup resume devices if they are randomly encrypted.
    
      [ Paul Menzel ]
      * [e28b865] mkinitramfs: Add LZ4 support (Closes: #893845)
      * [5091a5e] control: Remove suggestion of *lz4-tools*
    
      [ Colin Watson ]
      * [b4804dd] Only sync the filesystem containing the initramfs
        (Closes: #882380) (LP: #1667512)
    
      [ Karsten Merker ]
      * [281ad9a] Include the axp20x_usb_power module in the base modules list for
        MODULES=most (Closes: #866521)
    
      [ Ivan Kozik ]
      * [54367c0] init: export DEVICE so that when configured, it is actually set
        in configure_networking (Closes: #883664)
    21af342d
  • Matthias Klumpp's avatar
  • Matthias Klumpp's avatar
    d263ea54
  • Matthias Klumpp's avatar
    54d2ded8
  • Matthias Klumpp's avatar
    Finalize changelog for 0.132pureos1 · 60ac9eed
    Matthias Klumpp authored
    60ac9eed
> I am not sure how to modify mkinitramfs to do this automatically, maybe you know?
I need to document this more clearly, but the initramfs-tools have a collection of hooks that will solve your problem. While there's no way that Breezy could do this in the install, we could certainly include the scripts in the package (Especially if you're willing to test them to make sure they work! *g*)
There are two phases that need to be accounted for. The first is the install phase for generating the initramfs, the second is run-time phase for actually doing the needed magic.
To install the components you need, look at the scripts in /usr/share/initramfs-tools/hooks. evms and acpid are good choices. You can see a bunch of header stuff at the top that basically guarantees that things are run in the right order if they need to be. Two functions that will interest you:
copy_exec copies a binary and any libraries it depends on
manual_add_modules takes bareword module names (like fan, thermal, etc) and installs those modules and any of their dependancies into the initramfs.
The runtime phase is handled by scripts in /usr/share/initramfs-tools/scripts/ you probably want to start up at about the same point as lvm, md, and evms do, so local-top is a good directory to look in.
You can see the same sort of magic at the top of the script, although lvm and evms each require that md run first.
I hope this helps. I'll paste this text into a HACKING file on the hopes that someone will see fit to improve it. That person will probably be me, mind you... =)
Tks,
Jeff Bailey
......@@ -38,7 +38,7 @@ BUSYBOX=auto
KEYMAP=n
#
# COMPRESS: [ gzip | bzip2 | lzma | lzop | xz ]
# COMPRESS: [ gzip | bzip2 | lz4 | lzma | lzop | xz ]
#
COMPRESS=gzip
......@@ -51,7 +51,7 @@ COMPRESS=gzip
# DEVICE: ...
#
# Specify a specific network interface, like eth0
# Overridden by optional ip= bootarg
# Overridden by optional ip= or BOOTIF= bootarg
#
DEVICE=
......@@ -62,3 +62,11 @@ DEVICE=
NFSROOT=auto
#
# RUNSIZE: ...
#
# The size of the /run tmpfs mount point, like 256M or 10%
# Overridden by optional initramfs.runsize= bootarg
#
RUNSIZE=10%
/files
/*.debhelper.log
/*.substvars
/initramfs-tools/
/initramfs-tools-core/
initramfs-tools (0.130pureos2) green; urgency=medium
initramfs-tools (0.132pureos1) green; urgency=medium
* Use busybox-initramfs on PureOS
* Make busybox-initramfs a dependency, fixing kernel install
failures with cryptsetup
* Merge with Debian unstable, remaining changes:
- Don't show "Possible missing firmware" messages unless "-v" is passed
- Depend on busybox instead of just recommending it
- Update Vcs-* and Maintainer fields for PureOS
-- Matthias Klumpp <matthias.klumpp@puri.sm> Thu, 22 Mar 2018 11:04:18 +0100
-- Matthias Klumpp <matthias.klumpp@puri.sm> Sun, 02 Sep 2018 22:10:14 +0200
initramfs-tools (0.130pureos1) green; urgency=medium
initramfs-tools (0.132) unstable; urgency=medium
* Fork for PureOS.
* Don't show "Possible missing firmware" messages unless "-v" is passed to
update-initramfs. <http://tracker.pureos.net/T362>
* [4e1f80e] mkinitramfs: Don't try to remove nonexistent /var/cache/ldconfig
(Closes: #904065)
* [d0212d3] hook-functions: Quote exclusions in copy_modules_dir
* [8c806b4] hook-functions: Add support for compressed module files
(Closes: #891560)
* [71f5d61] mkinitramfs: Create usr-merged filesystem layout
(Closes: #874523)
* [4c0d86c] hooks/resume: Loop over all swap devices when selecting
automatically
* [312393b] hooks/resume: Reject zram swap devices when selecting
automatically (Closes: #861228)
* [c0ae42b] update-initramfs: Always take over other initramfs images
(Closes: #765750, #804295)
* [f39625a] update-initramfs: Make "-k all" take over other initramfs images
* [f273172] scripts/functions: Fix parsing of device name from ip parameter
* [abae896] scripts/functions: Merge information from BOOTIF/DEVICE and ip
parameters (Closes: #721088)
-- Ben Hutchings <ben@decadent.org.uk> Thu, 26 Jul 2018 01:18:39 +0800
initramfs-tools (0.131) unstable; urgency=medium
[ Ben Hutchings ]
* [34bf250] debian/control: Remove maximilian attems and Adam Conrad from
Uploaders field
* [5ad3976] hooks/resume: Generalise logic to replace dev name with UUID when
RESUME=auto
* [0170b7f] hooks/resume: Store /dev/mapper path for swap if possible when
RESUMEauto (Closes: #883735)
* [5bf4c29] debian/control: Point Vcs URLs to Salsa
* [e8377b3] hooks/fsck: Fix invocation of fstype at build time.
Thanks to Simon Tatham <anakin@pobox.com> (Closes: #865691)
* [492763a] docs: Convert maintainer notes to Markdown format
* [0214976] docs/maintainer-notes.md: Update references to Alioth, to Salsa
* [b71c6c9] docs/maintainer-notes.md: Delete mention of git-core package
* [89daebf] docs/maintainer-notes.md: Change BTS link to specify source
package
* [8e539dc] docs/maintainer-notes.md: Link to tracker.debian.org instead of
PTS
* [3f27197] docs/maintainer-notes.md: Remove stale link to Debian bug count
graph
* [7dece27] docs/maintainer-notes.md: Use HTTP-S for Debian wiki and popcon
links
* [838b6ec] docs/maintainer-notes.md: Link directly to Ubuntu bug list
* [eaa61d4] docs/maintainer-notes.md: Add myself as co-author
* [fa7df8f] hook-functions: Correct the comment above hidden_dep_add_modules
* [0ffbeb9] hook-functions: Remove directory information from
hidden_dep_add_modules
* [78e95c1] hook-functions: Check modules.builtin in hidden_dep_add_modules
* [976aeb9] hook-functions: Handle i8042 hidden dependency on psmouse
(Closes: #878829)
* [211e050] hook-functions: Handle nvme hidden dependency on vmd.
Thanks to Mario Limonciello <Mario.Limonciello@dell.com> (Closes: #886349)
* [28536f6] unmkinitramfs, lsinitramfs: Split multiple early initramfs
sections (Closes: #886424)
* [2a9d97d] debian/control: Add e2fsprogs to Depends for initramfs-tools-core
(Closes: #887211)
* [577c94e] initramfs.conf: Update documentation of the DEVICE variable
* [f1cbe6f] mkinitramfs: Build reproducible images when SOURCE_DATE_EPOCH is
set. Thanks to Chris Lamb <lamby@debian.org> (Closes: #845034)
* [717e6bd] mkinitramfs: Exclude ldconfig auxiliary cache from initramfs
image. Thanks to Kristian Klausen <klausenbusk@hotmail.com>
* [8bddfe4] mkinitramfs(8): Remove description of nonexistent options
* [ecd6ce2] mkinitramfs(8), hook-functions: Correct references to "ramdisk"
* [63cec7b] docs: Move initramfs-tools man page to section 7
* [562d86e] docs: Update man page header dates
* [9bd960e] docs: Set man page header source and manual parameters correctly
* [97cc7e7] docs: Don't package maintainer documentation in
initramfs-tools-core
* [4e19a6f] docs: Remove outdated "HACKING" documentation file
* [6c02622] debian/control: Remove obsolete Breaks and Depends relations
* [749751c] debian/control: Update Standards-Version to 4.1.5
- Set Rules-Requires-Root: no
* [db469f0] initramfs-tools: Override lintian warning "breaks-without-version
upstart"
[ Riku Voipio ]
* [72b6419] auto_add_modules: add mfd for MODULES==most (Closes: #880584)
[ Benjamin Drung ]
* [7ca4d0d] Add mlx4 and mlx5 InfiniBand modules to hidden_dep_add_modules
(Closes: #871595)
* [df7d7e8] Add option to clear screen at the beginning (Closes: #856929)
* [a33cb62] Fix indentation (spaces to tabs)
* [3962c4f] Fix config directory in error message (Closes: #856589)
* [be2b91c] Double quote to prevent globbing and word splitting
* [ae339ff] Make size of /run configurable (Closes: #862013)
[ Steve Langasek ]
* [c198331] Skip dmsetup resume devices if they are randomly encrypted.
[ Paul Menzel ]
* [e28b865] mkinitramfs: Add LZ4 support (Closes: #893845)
* [5091a5e] control: Remove suggestion of *lz4-tools*
[ Colin Watson ]
* [b4804dd] Only sync the filesystem containing the initramfs
(Closes: #882380) (LP: #1667512)
[ Karsten Merker ]
* [281ad9a] Include the axp20x_usb_power module in the base modules list for
MODULES=most (Closes: #866521)
[ Ivan Kozik ]
* [54367c0] init: export DEVICE so that when configured, it is actually set
in configure_networking (Closes: #883664)
-- Chris Lamb <chris.lamb@puri.sm> Sun, 11 Mar 2018 19:08:20 -0700
-- Ben Hutchings <ben@decadent.org.uk> Thu, 19 Jul 2018 01:06:01 +0100
initramfs-tools (0.130) unstable; urgency=medium
......
Source: initramfs-tools
Section: utils
Priority: optional
Uploaders:
Chris Lamb <chris.lamb@puri.sm>,
Matthias Klumpp <matthias.klumpp@puri.sm>,
Uploaders: Michael Prokop <mika@debian.org>, Ben Hutchings <ben@decadent.org.uk>
Maintainer: PureOS Maintainers <pureos-project@lists.puri.sm>
Build-Depends: debhelper (>= 9), bash-completion
Standards-Version: 3.9.8
Rules-Requires-Root: no
Standards-Version: 4.1.5
Vcs-Browser: https://source.puri.sm/pureos/core/initramfs-tools
Vcs-Git: https://source.puri.sm/pureos/core/initramfs-tools.git
......@@ -17,7 +16,7 @@ Depends: initramfs-tools-core (= ${binary:Version}), linux-base, ${misc:Depends}
Suggests: bash-completion
Provides: linux-initramfs-tool
Conflicts: linux-initramfs-tool, usplash (<< 0.5.50)
Breaks: cryptsetup (<< 2:1.6.6-4~), elilo (<< 3.12-3.1~), lilo (<< 22.8-8.2~), s390-tools (<< 1.8.3-2~), console-setup (<< 1.72), systemd-sysv (<< 186), lvm2 (<< 2.02.111-2.1~), initscripts (<< 2.88dsf-59.3~), upstart, e2fsprogs (<< 1.42.13)
Breaks: initscripts (<< 2.88dsf-59.3~), upstart, e2fsprogs (<< 1.42.13)
Description: generic modular initramfs generator (automation)
This package builds a bootable initramfs for Linux kernel packages. The
initramfs is loaded along with the kernel and is responsible for
......@@ -26,9 +25,9 @@ Description: generic modular initramfs generator (automation)
Package: initramfs-tools-core
Architecture: all
Multi-Arch: foreign
Depends: ${busybox:Depends}, klibc-utils (>= 2.0.4-8~), cpio, kmod | module-init-tools, udev, ${misc:Depends}
Depends: klibc-utils (>= 2.0.4-8~), cpio (>= 2.12), kmod, udev, coreutils (>= 8.24), e2fsprogs, ${misc:Depends}, ${busybox:Depends}
Suggests: bash-completion
Breaks: initramfs-tools (<< 0.121~), ${busybox:Breaks}
Breaks: initramfs-tools (<< 0.121~), ${busybox:Breaks}, busybox-initramfs (<< 1:1.27.2-3)
Replaces: initramfs-tools (<< 0.121~)
Description: generic modular initramfs generator (core tools)
This package contains the mkinitramfs program that can be used to
......
Document: initramfs-maintainer
Title: Maintainer documentation for initramfs-tools
Author: Michael Prokop
Abstract: This document describes the workflow of
the initramfs-tools maintainers.
Section: Debian
Format: HTML
Index: /usr/share/doc/initramfs-tools-core/maintainer-notes.html
Files: /usr/share/doc/initramfs-tools-core/maintainer-notes.html
HACKING
docs/maintainer-notes.html
......@@ -2,4 +2,4 @@ lsinitramfs.8
mkinitramfs.8
unmkinitramfs.8
initramfs.conf.5
initramfs-tools.8
initramfs-tools.7
# upstart will never be fixed, so it is correct to not specify a version
initramfs-tools: breaks-without-version upstart
......@@ -5,7 +5,7 @@
# On Debian we can use either busybox or busybox-static, but on Ubuntu
# and derivatives only busybox-initramfs will work.
BUSYBOX_PACKAGES := $(shell if dpkg-vendor --derives-from ubuntu || dpkg-vendor --derives-from pureos; then echo busybox-initramfs; else echo busybox busybox-static; fi)
BUSYBOX_PACKAGES := $(shell if dpkg-vendor --derives-from ubuntu; then echo busybox-initramfs; else echo busybox busybox-static; fi)
BUSYBOX_MIN_VERSION := 1:1.22.0-17~
override_dh_gencontrol:
......
......@@ -13,7 +13,7 @@
#
# DESTDIR -- The staging directory where we are building the image.
#
# see initramfs-tools(8)
# see initramfs-tools(7)
#
# List the soft prerequisites here. This is a space separated list of
......
......@@ -6,7 +6,7 @@
# The # package that owns it may opt to install it in an appropriate
# location under "/usr/share/initramfs-tools/scripts/".
#
# see initramfs-tools(8) for more details.
# see initramfs-tools(7) for more details.
#
# List the soft prerequisites here. This is a space separated list of
......
This diff is collapsed.
***
# Maintainer documentation for initramfs-tools
***
## Table of Contents
* [1. Definitions](#definitions)
* [2. Preparations](#preparations)
* [3. Workflow for daily work](#workflow)
* [3.1 Implement new features](#newfeature)
* [3.2 Merge branches](#merge)
* [3.3 Test specific branch](#test)
* [3.4 Build snapshot version](#snapshot)
* [4. Contribute](#contribute)
* [5. Release new version](#release)
* [6. Resources](#resources)
* [7. Credits](#credits)
* [8. License](#license)
***
**NOTE:** The most recent version of this document is available at
docs/maintainer-notes.md in the [the git repository](#checkout)
or online at [salsa.debian.org](https://salsa.debian.org/kernel-team/initramfs-tools/blob/master/docs/maintainer-notes.md).
***
## <a name="definitions">1. Definitions</a>
<table>
<tr><td><code><b>$mailaddress:</b></code></td><td>mailaddress of the user</td></tr>
<tr><td><code><b>$username:</b></code></td><td>name of the Salsa account</td></tr>
<tr><td><code><b>$version:</b></code></td><td>version string</td></tr>
<tr><td><code><b>$yourname:</b></code></td><td>your fullname</td></tr>
</table>
***
## <a name="preparations">2. Preparations</a>
1. Install required software:
# apt-get install git git-buildpackage dpkg-dev
1. Set environment variables (e.g. through your ~/.bashrc or ~/.zshrc) for devscripts (gbp dch):
export DEBEMAIL=$mailaddress
export DEBFULLNAME=$yourname
1. Set user name and email address for git (drop the --global option to use configuration per-repo basis):
% git config --global user.name "$yourname"
% git config --global user.email "$mailaddress"
1. <a name="checkout">Checkout repository (anonymous):</a>
% git clone https://salsa.debian.org/kernel-team/initramfs-tools.git
% cd initramfs-tools
1. Checkout repository (with developer access):
% git clone ssh://git@salsa.debian.org/kernel-team/initramfs-tools.git
% cd initramfs-tools
***
## <a name="workflow">3. Workflow for daily work</a>
### <a name="newfeature">3.1 Implement new features</a>
1. Checkout new branch and switch to it:
% git checkout -b $username/short-descr-of-new-feature
1. Hack and commit work:
% $EDITOR $somefile
% git add $somefile
% git commit -s
**NOTE:** Use 'Closes: #BUGID' for closing a bugreport and 'Thanks: Fullname
&lt;mailaddress&gt;' for giving credits in your commit message. gbp dch will use
this information for generating the changelog using the --meta option later
on.
1. Finally push your branch to Salsa:
% git push origin $username/short-descr-of-new-feature
### <a name="merge">3.2 Merge branches</a>
1. Switch to the branch you want to merge:
% git checkout $username/new-feature
1. Rebase to master:
% git rebase master
1. Switch to master branch and merge:
% git checkout master
% git merge $username/new-feature
1. Push:
% git push
1. After branch is merged delete branch on server and locally:
% git push origin :$username/short-descr-of-new-feature
% git branch -d $username/short-descr-of-new-feature
1. If a branch is removed from the server it will stay locally. You can get of
any stale remote branches locally by executing:
% git remote prune origin
### <a name="test">3.3 Test specific branch</a>
1. Checkout a specific branch iff branch is not already present locally:
% git checkout -b somename/short-descr-of-new-feature origin/somename/short-descr-of-new-feature
1. Checkout a specific branch iff branch is already present locally:
% git checkout -b somename/short-descr-of-new-feature
1. Adjust debian/changelog accordingly:
% gbp dch --debian-branch="$(git branch | awk -F\*\ '/^* / { print $2}' )" \
--since="v$(dpkg-parsechangelog | awk '/^Version:/ {print $2}')" -S --id-length=7 --meta --multimaint-merge
1. Build package:
% gbp buildpackage --git-ignore-new --git-debian-branch="$(git branch | awk -F\*\ '/^* / { print $2}' )" --post-clean
***
### <a name="snapshot">3.4 Build snapshot version</a>
1. Adjust debian/changelog accordingly:
% gbp dch --debian-branch="$(git branch | awk -F\*\ '/^* / { print $2}' )" \
--since="v$(dpkg-parsechangelog | awk '/^Version:/ {print $2}')" -S --id-length=7 --meta --multimaint-merge
1. Build package:
% gbp buildpackage --git-debian-branch="$(git branch | awk -F\*\ '/^* / { print $2}' )" --post-clean [-us -uc]
***
## <a name="contribute">4. Contribute</a>
1. Create patch:
% git format-patch -s -p origin/master
1. Send patch file(s) to maintainers via mail (requires Debian package git-email):
% git send-email --to=initramfs-tools@packages.debian.org $PATCHFILE[S]
1. The development mailinglists are [debian-kernel@lists.debian.org](mailto:debian-kernel@lists.debian.org)
and [initramfs@vger.kernel.org](mailto:initramfs@vger.kernel.org).
Discussion of features, bugs and patches are more than welcome on one
of these lists.
***
## <a name="release">5. Release new version</a>
1. Creating changelog:
% gbp dch --debian-branch master --release --since HASH
or more dynamically:
% gbp dch --meta --release --since v$(dpkg-parsechangelog | awk '/^Version:/ {print $2}') --debian-branch="$(git branch | awk -F\*\ '/^* / { print $2}' )" --id-length=7 --meta --multimaint-merge
**NOTE:** we do not use history based sorting for the changelog entries but
sort them by author.
1. Releasing:
% git commit -a -s -m "Releasing version $version."
1. Tagging:
% git tag -s v"$version" -m "release $version"
1. Pushing:
% git push
% git push --tags
1. Build in chroot and upload to ftp-master.
1. Send mail announcing the new initramfs-tools version with subject
"initramfs-tools $VERSION release" to initramfs@vger.kernel.org,
debian-kernel@lists.debian.org + kernel-team@lists.ubuntu.com - including a
shortlog (generated through "git shortlog $TAG..").
***
## <a name="resources">6. Resources</a>
* [initramfs-tools git web interface](https://salsa.debian.org/kernel-team/initramfs-tools)
* [initramfs @ debian-wiki](https://wiki.debian.org/initramfs)
* [bugreports](https://bugs.debian.org/cgi-bin/pkgreport.cgi?src=initramfs-tools;dist=unstable)
* [initramfs-tools @ tracker](https://tracker.debian.org/pkg/initramfs-tools)
* [popcon graph](https://qa.debian.org/popcon.php?package=initramfs-tools)
* [bugreports @ ubuntu](https://bugs.launchpad.net/ubuntu/+source/initramfs-tools)
* [qa page @ ubuntu](http://status.qa.ubuntu.com/qapkgstatus/initramfs-tools)
***
## <a name="credits">7. Credits</a>
* Thanks to Daniel Baumann for his "[Debian Packaging with Git](http://documentation.debian-projects.org/other/debian-packaging-git/)" which inspired this document.
***
## <a name="license">8. License</a>
* This document is licensed under GPL v2 or any later version.
***
*-- Michael Prokop &lt;[mika@debian.org](mailto:mika@debian.org)&gt;,
Ben Hutchings &lt;[ben@decadent.org.uk](mailto:ben@decadent.org.uk)&gt;*
***
......@@ -94,9 +94,9 @@ manual_add_modules()
fi
kmod_modname="${kmod##*/}"
kmod_modname="${kmod_modname%.ko}"
kmod_modname="${kmod_modname%%.*}"
if grep -q "^$kmod_modname\\>" /proc/modules "${CONFDIR}/modules"; then
echo "W: Possible missing firmware /lib/firmware/${firmware} for module $(basename ${kmod} .ko)" >&2
echo "W: Possible missing firmware /lib/firmware/${firmware} for module ${kmod_modname}" >&2
fi
continue
fi
......@@ -112,8 +112,8 @@ manual_add_modules()
}
# $1 = file type (for logging)
# $2 = file to copy to ramdisk
# $3 (optional) Name for the file on the ramdisk
# $2 = file to copy to initramfs
# $3 (optional) Name for the file on the initramfs
# Location of the image dir is assumed to be $DESTDIR
# If the target exists, we leave it and return 1.
# On any other error, we return >1.
......@@ -161,8 +161,8 @@ copy_file() {
cp -pP "${src}" "${DESTDIR}/${target}" || return $(($? + 1))
}
# $1 = executable to copy to ramdisk, with library dependencies
# $2 (optional) Name for the file on the ramdisk
# $1 = executable to copy to initramfs, with library dependencies
# $2 (optional) Name for the file on the initramfs
# Location of the image dir is assumed to be $DESTDIR
# We never overwrite the target if it exists.
copy_exec() {
......@@ -200,7 +200,7 @@ copy_exec() {
# Copy entire subtrees to the initramfs
copy_modules_dir()
{
local kmod exclude
local kmod first exclude
local modules=
local dir="$1"
shift
......@@ -214,12 +214,21 @@ copy_modules_dir()
echo "(excluding $*)"
fi
fi
while [ $# -ge 1 ]; do
exclude="${exclude:-} -name $1 -prune -o "
shift
# Build up an expression for find
first=true
for exclude in "$@"; do
# Change .ko suffix in exclusion to .ko*
if [ "${exclude%.ko}" != "${exclude}" ]; then
exclude="${exclude}*"
fi
$first && set --
set -- "$@" -name "${exclude}" -prune -o
first=false
done
for kmod in $(find "${MODULESDIR}/${dir}" ${exclude:-} -name '*.ko' -printf '%f\n'); do
modules="$modules ${kmod%.ko}"
for kmod in $(find "${MODULESDIR}/${dir}" "$@" -name '*.ko*' -printf '%f\n'); do
modules="$modules ${kmod%%.*}"
done
manual_add_modules $modules
}
......@@ -384,7 +393,7 @@ dep_add_modules_mount()
|| ! [ -b "$dev_node" ]; then
echo "mkinitramfs: failed to determine device for $dir" >&2
echo "mkinitramfs: workaround is MODULES=most, check:" >&2
echo "grep -r MODULES /etc/initramfs-tools/" >&2
echo "grep -r MODULES ${CONFDIR}" >&2
echo "" >&2
echo "Error please report bug on initramfs-tools" >&2
echo "Include the output of 'mount' and 'cat /proc/mounts'" >&2
......@@ -516,6 +525,10 @@ auto_add_modules()
copy_modules_dir kernel/drivers/usb/renesas_usbhs
# and any extcon drivers for USB
modules="$modules extcon-usb-gpio"
# Add the axp20x_usb_power power supply driver,
# required to initialize the USB host controllers
# on a number of armhf systems
modules="$modules axp20x_usb_power"
# Include all HID drivers unless we're sure they
# don't support keyboards. hid-*ff covers various
......@@ -540,6 +553,7 @@ auto_add_modules()
copy_modules_dir kernel/drivers/gpio
copy_modules_dir kernel/drivers/i2c/busses
copy_modules_dir kernel/drivers/i2c/muxes
copy_modules_dir kernel/drivers/mfd
copy_modules_dir kernel/drivers/phy
copy_modules_dir kernel/drivers/pinctrl
copy_modules_dir kernel/drivers/regulator
......@@ -572,6 +586,7 @@ auto_add_modules()
block)
copy_modules_dir kernel/drivers/block
copy_modules_dir kernel/drivers/nvme
modules="$modules vmd"
;;
ubi)
modules="$modules deflate zlib lzo ubi ubifs"
......@@ -597,23 +612,46 @@ auto_add_modules()
manual_add_modules $modules
}
# 'depmod' only looks at symbol dependencies; there is no way for
# modules to declare explicit dependencies through module information,
# so dependencies on e.g. crypto providers are hidden. Until this is
# fixed, we need to handle those hidden dependencies.
# 'depmod' only looks at symbol dependencies and the 'softdep' module
# information field; there is no way for modules to declare weaker
# dependencies (modules that *might* be needed at run-time) through
# module information, Until this is fixed, we need to handle those
# hidden dependencies.
hidden_dep_add_modules()
{
local modules=
for dep in "lib/libcrc32c crc32c" \
"fs/ubifs/ubifs deflate zlib lzo" \
"fs/btrfs/btrfs crc32c"; do
set -- $dep
if [ -f "${DESTDIR}/lib/modules/${version}/kernel/$1.ko" ]; then
shift
modules="$modules $@"
fi
done
manual_add_modules $modules
manual_add_modules $(
{
cat "${DESTDIR}/lib/modules/${version}/modules.builtin"
find "${DESTDIR}/lib/modules/${version}/kernel" -name '*.ko*'
} |
while read module; do
module="${module##*/}"
module="${module%%.*}"
case "$module" in
libcrc32c)
echo crc32c
;;
ubifs)
echo deflate zlib lzo
;;
btrfs)
echo crc32c
;;
mlx4_core)
echo mlx4_ib
;;
mlx5_core)
echo mlx5_ib
;;
i8042)
echo psmouse
;;
nvme)
echo vmd
;;
esac
done
)
}
# mkinitramfs help message
......
......@@ -59,9 +59,9 @@ get_fsck_type_fstab () {
# therefore never used at boot time
if [ "${MNT_DIR}" = "/" ] || [ "${MNT_TYPE}" = "auto" ]; then
MNT_FSNAME="$(resolve_device "${MNT_FSNAME}")"
alias fstype="/usr/lib/klibc/bin/fstype"
fstype() { "/usr/lib/klibc/bin/fstype" "$@"; }
get_fstype "${MNT_FSNAME}"
unalias fstype
unset -f fstype
else
echo "${MNT_TYPE}"
fi
......
......@@ -39,18 +39,45 @@ report_auto()
test "$RESUME" = auto || echo >&2 "I: $*"
}
# We need to be able to read the listed swap partitions
if ischroot || [ ! -r /proc/swaps ]; then
resume_auto=
else
# Try to autodetect the RESUME partition, using biggest swap?
resume_auto=$(grep ^/dev/ /proc/swaps | sort -rnk3 | head -n 1 | cut -d " " -f 1)
if [ -n "$resume_auto" ]; then
UUID=$(blkid -s UUID -o value "$resume_auto" || true)
# Try to autodetect the RESUME partition, using biggest swap device that
# is not ephemeral. We need to be able to read the listed swap partitions.
resume_auto=
if ! ischroot && [ -r /proc/swaps ]; then
for resume_auto in $(grep ^/dev/ /proc/swaps | sort -rnk3 | cut -d " " -f 1); do
ephemeral=false
dm_name="$(dmsetup info -c --noheadings -o name "$resume_auto" 2>/dev/null)"
# dm-crypt is ephemeral if the key file is /dev/urandom
if [ -n "$dm_name" ] && [ -e /etc/crypttab ]; then
while read cryptdev srcdev keyfile junk; do
if [ "$cryptdev" = "$dm_name" ] && [ "$keyfile" = /dev/urandom ]; then
ephemeral=true
fi
done < /etc/crypttab
fi
# zram is ephemeral
case "$resume_auto" in
/dev/zram*)
ephemeral=true
;;
esac
$ephemeral || break
done
if [ -n "$resume_auto" ] && ! $ephemeral; then
if [ -n "$dm_name" ]; then
resume_auto_canon="/dev/mapper/$dm_name"
elif UUID=$(blkid -s UUID -o value "$resume_auto"); then
resume_auto_canon="UUID=$UUID"
else
resume_auto_canon=
fi
report_auto "The initramfs will attempt to resume from $resume_auto"
if [ -n "$UUID" ]; then
report_auto "(UUID=$UUID)"
resume_auto="UUID=$UUID"
if [ -n "$resume_auto_canon" ]; then
report_auto "($resume_auto_canon)"
resume_auto="$resume_auto_canon"
fi
report_auto "Set the RESUME variable to override this."
fi
......
......@@ -13,15 +13,21 @@ mkdir -p /var/lock
mount -t sysfs -o nodev,noexec,nosuid sysfs /sys
mount -t proc -o nodev,noexec,nosuid proc /proc
case " $(cat /proc/cmdline) " in
*\ quiet\ *)
quiet=y
;;
*)
for x in $(cat /proc/cmdline); do
case $x in
initramfs.clear)
clear
;;
quiet)
quiet=y
;;
esac
done
if [ "$quiet" != "y" ]; then
quiet=n
echo "Loading, please wait..."
;;
esac
fi
export quiet
# Note that this only becomes /dev on the real filesystem if udev's scripts
......@@ -29,8 +35,6 @@ export quiet
mount -t devtmpfs -o nosuid,mode=0755 udev /dev
mkdir /dev/pts
mount -t devpts -o noexec,nosuid,gid=5,mode=0620 devpts /dev/pts || true
mount -t tmpfs -o "noexec,nosuid,size=10%,mode=0755" tmpfs /run
mkdir -m 0755 /run/initramfs
# Export the dpkg architecture
export DPKG_ARCH=
......@@ -45,6 +49,7 @@ export ROOTDELAY=
export ROOTFLAGS=
export ROOTFSTYPE=
export IP=
export DEVICE=
export BOOT=
export BOOTIF=
export UBIMTD=
......@@ -66,7 +71,7 @@ export fsckfix=
# Bring in the main config
. /conf/initramfs.conf
for conf in conf/conf.d/*; do
[ -f ${conf} ] && . ${conf}
[ -f "${conf}" ] && . "${conf}"
done
. /scripts/functions
......@@ -81,7 +86,7 @@ for x in $(cat /proc/cmdline); do
if [ -z "${BOOT}" ] && [ "$ROOT" = "/dev/nfs" ]; then
BOOT=nfs
fi
;;
;;
rootflags=*)
ROOTFLAGS="-o ${x#rootflags=}"
;;
......@@ -99,6 +104,9 @@ for x in $(cat /proc/cmdline); do
nfsroot=*)
NFSROOT="${x#nfsroot=}"
;;
initramfs.runsize=*)
RUNSIZE="${x#initramfs.runsize=}"
;;
ip=*)
IP="${x#ip=}"
;;
......@@ -111,7 +119,7 @@ for x in $(cat /proc/cmdline); do
resume=*)
RESUME="${x#resume=}"
case $RESUME in
UUID=*)
UUID=*)
RESUME="/dev/disk/by-uuid/${RESUME#UUID=}"
esac
;;
......@@ -142,9 +150,9 @@ for x in $(cat /proc/cmdline); do
debug=y
quiet=n
if [ -n "${netconsole}" ]; then
exec >/dev/kmsg 2>&1
log_output=/dev/kmsg
else
exec >/run/initramfs/initramfs.debug 2>&1
log_output=/run/initramfs/initramfs.debug
fi
set -x
;;
......@@ -164,7 +172,7 @@ for x in $(cat /proc/cmdline); do
;;
netconsole=*)
netconsole=${x#netconsole=}
[ "x$debug" = "xy" ] && exec >/dev/kmsg 2>&1
[ "x$debug" = "xy" ] && log_output=/dev/kmsg
;;
BOOTIF=*)
BOOTIF=${x#BOOTIF=}
......@@ -196,6 +204,14 @@ else
resume=${RESUME:-}
fi
mount -t tmpfs -o "noexec,nosuid,size=${RUNSIZE:-10%},mode=0755" tmpfs /run
mkdir -m 0755 /run/initramfs
if [ -n "$log_output" ]; then
exec >$log_output 2>&1
unset log_output
fi
maybe_break top
# Don't do log messages here to avoid confusing graphical boots
......@@ -223,7 +239,7 @@ log_begin_msg "Mounting root file system"
. /scripts/local
. /scripts/nfs
. /scripts/${BOOT}
parse_numeric ${ROOT}
parse_numeric "${ROOT}"
maybe_break mountroot
mount_top
mount_premount
......@@ -285,6 +301,7 @@ unset ROOT
unset IP
unset BOOT
unset BOOTIF
unset DEVICE
unset UBIMTD
unset blacklist
unset break
......@@ -303,6 +320,6 @@ mount -n -o move /sys ${rootmnt}/sys
mount -n -o move /proc ${rootmnt}/proc
# Chain to real filesystem
exec run-init ${drop_caps} ${rootmnt} ${init} "$@" <${rootmnt}/dev/console >${rootmnt}/dev/console 2>&1
exec run-init ${drop_caps} "${rootmnt}" "${init}" "$@" <${rootmnt}/dev/console >${rootmnt}/dev/console 2>&1
echo "Something went badly wrong in the initramfs."
panic "Please file a bug on initramfs-tools."
.TH INITRAMFS-TOOLS 8 "2010/09/23" "Linux" "mkinitramfs script overview"
.TH INITRAMFS-TOOLS 7 "2018/07/18" "initramfs\-tools" "Linux Programmer's Manual"
.SH NAME
initramfs-tools \- an introduction to writing scripts for mkinitramfs
......@@ -23,6 +23,18 @@ mount the partition with that UUID as the root filesystem.
\fB\fI init= "<path to real init>"
the binary to hand over execution to on the root fs after the initramfs scripts are done.
.TP
\fB\fI initramfs.clear
clear screen at the beginning
.TP
\fB\fI initramfs.runsize
The size of the \fI/run\fP tmpfs mount point in bytes (suffixes are supported)
or as percentage of your physical RAM. This parameter is used as the value of
the size mount option to tmpfs. See
\fBhttps://www.kernel.org/doc/Documentation/filesystems/tmpfs.txt\fR for
details. The default is 10%.
.TP
\fB\fI root= "<path to blockdevice>"
the device node to mount as the root file system.
......
.TH INITRAMFS.CONF 5 "2010/11/22" "Linux" "initramfs.conf manual"
.TH INITRAMFS.CONF 5 "2018/07/18" "initramfs\-tools" "File Formats Manual"
.SH NAME
initramfs.conf \- configuration file for mkinitramfs
......@@ -74,6 +74,15 @@ Allows one to use an nfs drive as the root of the drive.
The default is to boot from \fIlocal\fP media (hard drive, USB stick).
Set to \fInfs\fP for an NFS root share.
.TP
\fB RUNSIZE
The size of the \fI/run\fP tmpfs mount point in bytes (suffixes are supported)
or as percentage of your physical RAM. This parameter is used as the value of
the size mount option to tmpfs. See
\fBhttps://www.kernel.org/doc/Documentation/filesystems/tmpfs.txt\fR for
details. Can be overridden by an optional \fBinitramfs.runsize=\fR bootarg.
The default is 10%.
.SH VARIABLES FOR LOCAL BOOT
.TP
\fB RESUME
......@@ -87,7 +96,8 @@ Set it to \fInone\fP to disable resume from disk.
.SH VARIABLES FOR NFS BOOT
.TP
\fB DEVICE
Specifies the network interface, like eth0.
Specifies the default network interface to use, like eth0. The \fIip\fP or
\fIBOOTIF\fP bootargs may override this.
.TP
\fB ROOT
......@@ -110,6 +120,6 @@ Loosely based on mkinitrd.conf by Herbert Xu.
.SH SEE ALSO
.BR
.IR initramfs-tools (8),
.IR initramfs-tools (7),
.IR mkinitramfs (8),
.IR update-initramfs (8).
.TH LSINITRAMFS 8 "2010/06/16" "Linux" "lsinitramfs manual"
.TH LSINITRAMFS 8 "2015/12/09" "initramfs\-tools" "System Administration"
.SH NAME
lsinitramfs \- list content of an initramfs image
......@@ -48,7 +48,7 @@ and numerous others.
.SH SEE ALSO
.BR
.IR initramfs-tools (8),
.IR initramfs-tools (7),
.IR mkinitramfs (8),
.IR unmkinitramfs (8),
.IR update-initramfs (8).
......@@ -151,6 +151,8 @@ if dpkg --compare-versions "${version}" lt "2.6.38" 2>/dev/null; then
echo "linux-2.6 likely misses ${COMPRESS} support, using gzip"
fi
[ "${compress}" = gzip ] && [ -n "${SOURCE_DATE_EPOCH}" ] && compress="gzip -n"
[ "${compress}" = lz4 ] && compress="lz4 -9 -l"
[ "${compress}" = lzop ] && compress="lzop -9"
[ "${compress}" = xz ] && compress="xz --check=crc32"
......@@ -213,7 +215,13 @@ export __TMPCPIOGZ
# Private, used by 'prepend_earlyinitramfs'.
export __TMPEARLYCPIO
for d in bin conf/conf.d etc lib/modules run sbin scripts ${MODULESDIR}; do
# Create usr-merged filesystem layout, to avoid duplicates if the host
# filesystem is usr-merged.
for d in /bin /lib* /sbin; do
mkdir -p "${DESTDIR}/usr${d}"
ln -s "usr${d}" "${DESTDIR}${d}"
done
for d in conf/conf.d etc run scripts ${MODULESDIR}; do
mkdir -p "${DESTDIR}/${d}"
done
......@@ -336,6 +344,12 @@ if ! ldconfig -r "$DESTDIR" ; then
[ $(id -u) != "0" ] \
&& echo "ldconfig might need uid=0 (root) for chroot()" >&2
fi
# The auxiliary cache is not reproducible and is always invalid at boot
# (see #845034)
if [ -d "${DESTDIR}"/var/cache/ldconfig ]; then
rm -f "${DESTDIR}"/var/cache/ldconfig/aux-cache
rmdir --ignore-fail-on-non-empty "${DESTDIR}"/var/cache/ldconfig
fi
# Apply DSDT to initramfs
if [ -e "${CONFDIR}/DSDT.aml" ]; then
......@@ -372,8 +386,18 @@ fi
# preserve permissions if root builds the image, see #633582
[ "$(id -ru)" != 0 ] && cpio_owner_root="-R 0:0"
# if SOURCE_DATE_EPOCH is set, try and create a reproducible image
if [ -n "${SOURCE_DATE_EPOCH}" ]; then
# ensure that no timestamps are newer than $SOURCE_DATE_EPOCH
find "${DESTDIR}" -newermt "@${SOURCE_DATE_EPOCH}" -print0 | \
xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}"
# --reproducible requires cpio >= 2.12
cpio_reproducible="--reproducible"
fi
# work around lack of "set -o pipefail" for the following pipe:
# cd "${DESTDIR}" && find . | cpio --quiet $cpio_owner_root -o -H newc | gzip >>"${outfile}" || exit 1
# cd "${DESTDIR}" && find . | LC_ALL=C sort | cpio --quiet $cpio_owner_root $cpio_reproducible -o -H newc | gzip >>"${outfile}" || exit 1
exec 3>&1
eval `
# http://cfaj.freeshell.org/shell/cus-faq-2.html
......@@ -382,7 +406,9 @@ eval `
{
find . 4>&-; echo "ec1=$?;" >&4
} | {
cpio --quiet $cpio_owner_root -o -H newc 4>&-; echo "ec2=$?;" >&4
LC_ALL=C sort
} | {
cpio --quiet $cpio_owner_root $cpio_reproducible -o -H newc 4>&-; echo "ec2=$?;" >&4
} | ${compress} >>"${outfile}"
echo "ec3=$?;" >&4
`
......
.TH MKINITRAMFS 8 "2010/04/07" "Linux" "mkinitramfs manual"
.TH MKINITRAMFS 8 "2018/07/18" "initramfs\-tools" "System Administration"
.SH NAME
mkinitramfs \- low-level tool for generating an initramfs image
......@@ -82,16 +82,6 @@ Set the verbose mode output.
Set the kernel version of the initramfs image
(defaults to the running kernel).
.TP
\fB\-\-supported-host-version=\fIhversion
This option queries if mkinitramfs can create ramdisks on a running kernel of version
.IR hversion .
.TP
\fB\-\-supported-target-version=\fItversion
This option queries if mkinitramfs can create ramdisks for kernel version
.IR tversion .
.SH ENVIRONMENT
.B mkinitramfs
honours the
......@@ -105,6 +95,12 @@ should not be mounted with the
.B noexec
mount option.
If
.B SOURCE_DATE_EPOCH
is set,
.B mkinitramfs
attempts to generate a reproducible initramfs image.
.SH FILES
.TP
.I /etc/initramfs-tools/initramfs.conf
......@@ -153,7 +149,7 @@ Jeff Bailey <jbailey@raspberryginger.com> and numerous others.
.SH SEE ALSO
.BR
.IR initramfs.conf (5),
.IR initramfs-tools (8),
.IR initramfs-tools (7),
.IR update-initramfs (8),
.IR lsinitramfs (8),
.IR unmkinitramfs (8).
......@@ -180,6 +180,26 @@ get_fstype ()
return ${RET}
}
_handle_device_vs_ip()
{
# If the ip= parameter is present and is a colon-separated list,
# then:
# - If it specifies a device, use that in preference to any
# device name we already have
# - Otherwise, substitute in any device name we already have
local IFS=:
set -f
set -- ${IP}
set +f
if [ -n "$6" ]; then
DEVICE="$6"
elif [ $# -ge 2 ] && [ -n "${DEVICE}" ]; then
IP="$1:$2:$3:$4:$5:${DEVICE}"
shift 6 || shift $#
IP="${IP}:$*"
fi
}
configure_networking()
{
if [ -n "${BOOTIF}" ]; then
......@@ -218,6 +238,8 @@ configure_networking()
done
fi
_handle_device_vs_ip
# networking already configured thus bail out
[ -n "${DEVICE}" ] && [ -e /run/net-"${DEVICE}".conf ] && return 0
......@@ -249,18 +271,6 @@ configure_networking()
;;
*)
ipconfig -t ${ROUNDTTT} -d $IP
# grab device entry from ip option
NEW_DEVICE=${IP#*:*:*:*:*:*}
if [ "${NEW_DEVICE}" != "${IP}" ]; then
NEW_DEVICE=${NEW_DEVICE%%:*}
else
# wrong parse, possibly only a partial string
NEW_DEVICE=
fi
if [ -n "${NEW_DEVICE}" ]; then
DEVICE="${NEW_DEVICE}"
fi
;;
esac
done
......
......@@ -18,6 +18,8 @@ xcpio()
zcat "$archive"
elif xzcat -t "$archive" >/dev/null 2>&1 ; then
xzcat "$archive"
elif lz4cat -t "$archive" >/dev/null 2>&1 ; then
lz4cat "$archive"
elif bzip2 -t "$archive" >/dev/null 2>&1 ; then
bzip2 -c -d "$archive"
elif lzop -t "$archive" >/dev/null 2>&1 ; then
......@@ -53,42 +55,64 @@ splitinitramfs()
dir="$2"
shift 2
# There may be a prepended uncompressed archive. cpio
# won't tell us the true size of this so we have to
# parse the headers and padding ourselves. This is
# very roughly based on linux/lib/earlycpio.c
offset=0
count=0
start=0
while true; do
if checkzero "$initramfs" $offset; then
offset=$((offset + 4))
continue
# There may be prepended uncompressed archives. cpio
# won't tell us the true size of these so we have to
# parse the headers and padding ourselves. This is
# very roughly based on linux/lib/earlycpio.c
end=$start
while true; do
if checkzero "$initramfs" $end; then
# This is the EOF marker. There might
# be more zero padding before the next
# archive, so read through all of it.
end=$((end + 4))
while checkzero "$initramfs" $end; do
end=$((end + 4))
done
break
fi
magic="$(readhex "$initramfs" $end 6)" || break
test $magic = 070701 || test $magic = 070702 || break
namesize=0x$(readhex "$initramfs" $((end + 94)) 8)
filesize=0x$(readhex "$initramfs" $((end + 54)) 8)
end=$(((end + 110)))
end=$(((end + $namesize + 3) & ~3))
end=$(((end + $filesize + 3) & ~3))
done
if [ $end -eq $start ]; then
break
fi
magic="$(readhex "$initramfs" $offset 6)" || break
test $magic = 070701 || test $magic = 070702 || break
namesize=0x$(readhex "$initramfs" $((offset + 94)) 8)
filesize=0x$(readhex "$initramfs" $((offset + 54)) 8)
offset=$(((offset + 110)))
offset=$(((offset + $namesize + 3) & ~3))
offset=$(((offset + $filesize + 3) & ~3))
done
if [ $offset -ne 0 ]; then
# uncompressed archive
# Extract to early, early2, ... subdirectories
count=$((count + 1))
if [ $count -eq 1 ]; then
subdir=early
else
subdir=early$count
fi
dd < "$initramfs" skip=$start count=$((end - start)) iflag=skip_bytes 2> /dev/null |
(
if [ -n "$dir" ]; then
mkdir -p -- "$dir/early"
cd -- "$dir/early"
mkdir -p -- "$dir/$subdir"
cd -- "$dir/$subdir"
fi
cpio -i "$@"
) < "$initramfs"
)
start=$end
done
# main archive
if [ $end -gt 0 ]; then
# Extract to main subdirectory
subarchive=$(mktemp ${TMPDIR:-/var/tmp}/unmkinitramfs_XXXXXX)
trap "rm -f '$subarchive'" EXIT
dd < "$initramfs" bs="$offset" skip=1 2> /dev/null \
dd < "$initramfs" skip=$end iflag=skip_bytes 2> /dev/null \
> $subarchive
xcpio "$subarchive" "${dir:+$dir/main}" -i "$@"
else
# Don't use subdirectories (for backward compatibility)
xcpio "$initramfs" "$dir" -i "$@"
fi
}
......
.TH UNMKINITRAMFS 8 "2016/02/09" "Linux" "unmkinitramfs manual"
.TH UNMKINITRAMFS 8 "2016/12/15" "initramfs\-tools" "System Administration"
.SH NAME
unmkinitramfs \- extract content from an initramfs image
......@@ -48,7 +48,7 @@ and numerous others.
.SH SEE ALSO
.BR
.IR initramfs-tools (8),
.IR initramfs-tools (7),
.IR lsinitramfs (8),
.IR mkinitramfs (8),
.IR update-initramfs (8).
......@@ -47,7 +47,6 @@ Options:
-c Create a new initramfs
-u Update an existing initramfs
-d Remove an existing initramfs
-t Take over a custom initramfs with this one
-b directory Set alternate boot directory
-v Be verbose
-h This message
......@@ -79,12 +78,6 @@ verbose()
fi
}
version_exists()
{
[ -e "${STATEDIR}/${1}" ] && [ -e "${initramfs}" ]
return $?
}
set_initramfs()
{
initramfs="${BOOTDIR}/initrd.img-${version}"
......@@ -158,7 +151,7 @@ generate_initramfs()
mv -f "${initramfs}.new" "${initramfs}"
set_sha1
# Guard against an unclean shutdown
sync
sync -f "${initramfs}"
else
mkinitramfs_return="$?"
remove_initramfs_bak
......@@ -179,12 +172,6 @@ run_bootloader()
fi
}
compare_sha1()
{
sha1sum "${initramfs}" | diff "${STATEDIR}/${version}" - >/dev/null 2>&1
return $?
}
# Note that this must overwrite so that updates work.
set_sha1()
{
......@@ -215,8 +202,13 @@ ro_boot_check()
get_sorted_versions()
{
version_list="$(ls -1 "${STATEDIR}" | linux-version sort --reverse)"
version_list="$(
linux-version list |
while read version; do
test -e "${BOOTDIR}/initrd.img-$version" && echo "$version"
done |
linux-version sort --reverse
)"
verbose "Available versions: ${version_list}"
}
......@@ -264,16 +256,6 @@ create()
set_initramfs
if [ "${takeover}" = 0 ]; then
if version_exists "${version}"; then
panic "Cannot create version ${version}: already exists"
fi
if [ -e "${initramfs}" ]; then
panic "${initramfs} already exists, cannot create."
fi
fi
generate_initramfs
run_bootloader
......@@ -307,8 +289,6 @@ update()
ro_boot_check
altered_check
backup_initramfs
generate_initramfs
......@@ -326,18 +306,6 @@ delete()
set_initramfs
if [ "${takeover}" = 0 ]; then
if [ ! -e "${initramfs}" ]; then
panic "Cannot delete ${initramfs}, doesn't exist."
fi
if ! version_exists "${version}"; then
panic "Cannot delete version ${version}: Not created by this utility."
fi
fi
altered_check
echo "update-initramfs: Deleting ${initramfs}"
delete_sha1
......@@ -345,25 +313,9 @@ delete()
rm -f "${initramfs}" "${initramfs}.bak"
}
# Check for update mode on existing and modified initramfs
altered_check()
{
# No check on takeover
[ "${takeover}" = 1 ] && return 0
if [ ! -e "${initramfs}" ]; then
mild_panic "${initramfs} does not exist. Cannot update."
fi
if ! compare_sha1; then
echo "update-initramfs: ${initramfs} has been altered." >&2
mild_panic "update-initramfs: Cannot update. Override with -t option."
fi
}
# Defaults
verbose=0
yes=0
# We default to takeover=1 in Ubuntu, but not Debian
takeover=0
##
......@@ -388,7 +340,7 @@ while getopts "k:cudyvtb:h?" flag; do
yes="1"
;;
t)
takeover="1"
# accepted for compatibility, but ignored
;;
b)
BOOTDIR="${OPTARG}"
......@@ -428,9 +380,6 @@ if [ "${version}" = "all" ] \
if [ "${verbose}" = "1" ]; then
OPTS="${OPTS} -v"
fi
if [ "${takeover}" = "1" ]; then
OPTS="${OPTS} -t"
fi
if [ "${yes}" = "1" ]; then
OPTS="${OPTS} -y"
fi
......
.TH UPDATE-INITRAMFS 8 "2008/12/19" "Linux" "update\-initramfs manual"
.TH UPDATE-INITRAMFS 8 "2014/10/16" "initramfs\-tools" "System Administration"
.SH NAME
update\-initramfs \- generate an initramfs image
......@@ -53,10 +53,6 @@ This mode updates an existing initramfs.
\fB \-d
This mode removes an existing initramfs.
.TP
\fB \-t
Allows one to take over an custom initramfs with a newer one.
.TP
\fB \-v
This option increases the amount of information you are given during
......@@ -94,6 +90,6 @@ Jeff Bailey <jbailey@raspberryginger.com> and numerous others.
.SH SEE ALSO
.BR
.IR initramfs.conf (5),
.IR initramfs-tools (8),
.IR initramfs-tools (7),
.IR mkinitramfs (8),
.IR lsinitramfs (8).
.TH UPDATE-INITRAMFS.CONF 5 "2010/04/05" "Linux" "update-initramfs.conf manual"
.TH UPDATE-INITRAMFS.CONF 5 "2010/04/05" "initramfs\-tools" "File Formats Manual"
.SH NAME
update-initramfs.conf \- configuration file for update-initramfs
......@@ -30,6 +30,6 @@ Jeff Bailey <jbailey@raspberryginger.com> and numerous others.
.SH SEE ALSO
.BR
.IR initramfs.conf (5),
.IR initramfs-tools (8),
.IR initramfs-tools (7),
.IR mkinitramfs (8),
.IR update-initramfs (8).