initramfs-tools: sync with upstream (Debian) version: 0.99.

This commit is contained in:
Juan RP 2011-07-22 09:14:02 +02:00
parent 6c2bb0ac8e
commit deba6e1f6b
9 changed files with 83 additions and 38 deletions

View file

@ -52,7 +52,7 @@ manual_add_modules()
fi fi
mkdir -p "${DESTDIR}/$(dirname "${kmod}")" mkdir -p "${DESTDIR}/$(dirname "${kmod}")"
ln -s "${kmod}" "${DESTDIR}/$(dirname "${kmod}")" cp -pL "${kmod}" "${DESTDIR}/$(dirname "${kmod}")"
if [ "${verbose}" = "y" ]; then if [ "${verbose}" = "y" ]; then
echo "Adding module ${kmod}" echo "Adding module ${kmod}"
fi fi
@ -123,7 +123,7 @@ copy_exec() {
fi fi
[ "${verbose}" = "y" ] && echo "Adding binary ${src}" [ "${verbose}" = "y" ] && echo "Adding binary ${src}"
ln -s "${src}" "${DESTDIR}/${target}" cp -pL "${src}" "${DESTDIR}/${target}"
# Copy the dependant libraries # Copy the dependant libraries
for x in $(ldd ${src} 2>/dev/null | sed -e ' for x in $(ldd ${src} 2>/dev/null | sed -e '
@ -147,7 +147,7 @@ copy_exec() {
# FIXME inst_lib # FIXME inst_lib
mkdir -p "${DESTDIR}/${dirname}" mkdir -p "${DESTDIR}/${dirname}"
if [ ! -e "${DESTDIR}/${dirname}/${libname}" ]; then if [ ! -e "${DESTDIR}/${dirname}/${libname}" ]; then
ln -s "${x}" "${DESTDIR}/${dirname}" cp -pL "${x}" "${DESTDIR}/${dirname}"
[ "${verbose}" = "y" ] && echo "Adding library ${x}" || true [ "${verbose}" = "y" ] && echo "Adding library ${x}" || true
fi fi
done done
@ -235,7 +235,9 @@ dep_add_modules()
# recheck root device # recheck root device
if [ -z "$root" ]; then if [ -z "$root" ]; then
echo "mkinitramfs: failed to determine root device" >&2 echo "mkinitramfs: failed to determine root device" >&2
echo "mkinitramfs: workaround is MODULES=most" >&2 echo "mkinitramfs: workaround is MODULES=most, check" >&2
echo "grep -r MODULES /etc/initramfs-tools/" >&2
echo "" >&2
echo "Error please report bug on initramfs-tools" >&2 echo "Error please report bug on initramfs-tools" >&2
echo "Include the output of 'mount' and 'cat /proc/mounts'" >&2 echo "Include the output of 'mount' and 'cat /proc/mounts'" >&2
exit 1 exit 1
@ -245,10 +247,6 @@ dep_add_modules()
# most of the commands below only work with block devices. # most of the commands below only work with block devices.
if [ "${FSTYPE}" = "ubifs" ]; then if [ "${FSTYPE}" = "ubifs" ]; then
manual_add_modules "${FSTYPE}" manual_add_modules "${FSTYPE}"
# add some modules required by ubifs on which it doesn's depend
manual_add_modules deflate
manual_add_modules zlib
manual_add_modules lzo
return return
fi fi
@ -370,6 +368,7 @@ dep_add_modules()
if [ -d "${DESTDIR}/lib/modules/${version}/kernel/drivers/ide" ]; then if [ -d "${DESTDIR}/lib/modules/${version}/kernel/drivers/ide" ]; then
sys_walk_modalias ${root_dev_path} sys_walk_modalias ${root_dev_path}
manual_add_modules ide-gd_mod manual_add_modules ide-gd_mod
manual_add_modules ide-cd
fi fi
if [ -d "${DESTDIR}/lib/modules/${version}/kernel/drivers/scsi" ]; then if [ -d "${DESTDIR}/lib/modules/${version}/kernel/drivers/scsi" ]; then
@ -408,8 +407,8 @@ auto_add_modules()
{ {
case "${1:-}" in case "${1:-}" in
base) base)
for x in ehci-hcd ohci-hcd uhci-hcd usbhid xhci hid-apple \ for x in ehci-hcd ohci-hcd uhci-hcd usbhid xhci xhci-hcd \
hid-cherry hid-logitech hid-microsoft \ hid-apple hid-cherry hid-logitech hid-microsoft hid-sunplus \
btrfs ext2 ext3 ext4 ext4dev isofs jfs nfs reiserfs udf xfs \ btrfs ext2 ext3 ext4 ext4dev isofs jfs nfs reiserfs udf xfs \
af_packet atkbd i8042 virtio_pci; do af_packet atkbd i8042 virtio_pci; do
manual_add_modules "${x}" manual_add_modules "${x}"
@ -489,10 +488,14 @@ auto_add_modules()
# fixed, we need to handle those hidden dependencies. # fixed, we need to handle those hidden dependencies.
hidden_dep_add_modules() hidden_dep_add_modules()
{ {
for dep in "lib/libcrc32c crc32c"; do for dep in "lib/libcrc32c crc32c" "fs/ubifs/ubifs deflate zlib lzo"; do
set -- $dep set -- $dep
if [ -f "${DESTDIR}/lib/modules/${version}/kernel/$1.ko" ]; then if [ -f "${DESTDIR}/lib/modules/${version}/kernel/$1.ko" ]; then
manual_add_modules "$2" shift
for i in "$@" ; do
manual_add_modules "$i"
shift
done
fi fi
done done
} }

View file

@ -34,7 +34,7 @@ fi
mount -t tmpfs -o mode=0755,nosuid,nodev tmpfs /run mount -t tmpfs -o mode=0755,nosuid,nodev tmpfs /run
mkdir /run/udev mkdir /run/udev
mkdir /run/.initramfs mkdir /run/initramfs
# Set modprobe env # Set modprobe env
export MODPROBE_OPTIONS="-qb" export MODPROBE_OPTIONS="-qb"
@ -164,7 +164,7 @@ for x in $(cat /proc/cmdline); do
debug) debug)
debug=y debug=y
quiet=n quiet=n
exec >/run/.initramfs/initramfs.debug 2>&1 exec >/run/initramfs/initramfs.debug 2>&1
set -x set -x
;; ;;
debug=*) debug=*)

View file

@ -50,7 +50,7 @@ Use root=/dev/nfs for NFS to kick to in. NFSOPTS can be looked up in
.TP .TP
\fB\fI ip \fB\fI ip
tells how to configure the ip address. Allows to specify an different tells how to configure the ip address. Allows one to specify an different
NFS server than the DHCP server. See Documentation/filesystems/nfsroot.txt NFS server than the DHCP server. See Documentation/filesystems/nfsroot.txt
in any recent Linux source for details. Optional parameter for NFS root. in any recent Linux source for details. Optional parameter for NFS root.
@ -100,7 +100,7 @@ panic=<sec> is a documented security feature: it disables the debug shell.
.TP .TP
\fB\fI debug \fB\fI debug
generates lots of output. It writes a log to /dev/.initramfs/initramfs.debug. generates lots of output. It writes a log to /run/initramfs/initramfs.debug.
Instead when invoked with an arbitrary argument output is written to console. Instead when invoked with an arbitrary argument output is written to console.
Use for example "debug=vc". Use for example "debug=vc".

View file

@ -1,4 +1,4 @@
.TH INITRAMFS.CONF 5 "2010/04/05" "Linux" "initramfs.conf manual" .TH INITRAMFS.CONF 5 "2011/07/22" "Linux" "initramfs.conf manual"
.SH NAME .SH NAME
initramfs.conf \- configuration file for mkinitramfs initramfs.conf \- configuration file for mkinitramfs
@ -22,17 +22,25 @@ directly.
.TP .TP
\fB MODULES \fB MODULES
Specifies the modules for the initramfs image. Specifies the modules for the initramfs image.
Modules listed in \fI/etc/initramfs-tools/modules\fP and
\fI/usr/share/initramfs-tools/modules.d/*\fP are always included in the
initramfs, and are loaded early in the boot process.
\fIlist\fP doesn't load any additional modules at boot time, other than those
listed in the above files.
\fImost\fP adds most file system, all ata, sata, scsi and usb drivers.
\fIdep\fP tries to guess which modules are necessary for the running box and
only adds those modules.
\fInetboot\fP adds the base and network modules, but skips block devices.
The default setting is \fImost\fP. The default setting is \fImost\fP.
\fImost\fP adds most file system, all ide, sata, scsi and usb drivers.
\fIdep\fP tries to guess which modules are necessary for the running box.
\fInetboot\fP adds the base modules, network modules, but skips block devices.
\fIlist\fP includes only modules from the additional modules list to load them
early.
.TP .TP
\fB KEYMAP \fB KEYMAP
If set to 'y', the console keymap will be loaded during the initramfs stage. If set to 'y', the console keymap will be loaded during the initramfs stage.
@ -55,7 +63,7 @@ Useful to not disclose eventual keys.
.SH NFS VARIABLES .SH NFS VARIABLES
.TP .TP
\fB BOOT \fB BOOT
Allows to use an nfs drive as the root of the drive. 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). The default is to boot from \fIlocal\fP media (hard drive, USB stick).
Set to \fInfs\fP for an NFS root share. Set to \fInfs\fP for an NFS root share.

View file

@ -133,9 +133,9 @@ fi
if ! command -v "${compress}" >/dev/null 2>&1; then if ! command -v "${compress}" >/dev/null 2>&1; then
compress=gzip compress=gzip
COMPRESS=gzip
[ "${verbose}" = y ] && \ [ "${verbose}" = y ] && \
echo "No ${COMPRESS} in ${PATH}, using gzip" echo "No ${COMPRESS} in ${PATH}, using gzip"
COMPRESS=gzip
fi fi
if ! `grep -q -i ^config_rd_${COMPRESS%p} /boot/config-${version}` ; then if ! `grep -q -i ^config_rd_${COMPRESS%p} /boot/config-${version}` ; then
@ -193,7 +193,7 @@ export MODULES
# Private, used by 'catenate_cpiogz'. # Private, used by 'catenate_cpiogz'.
export __TMPCPIOGZ export __TMPCPIOGZ
for d in bin conf/conf.d etc lib/modules sbin scripts ${MODULESDIR}; do for d in bin conf/conf.d etc lib/modules run sbin scripts ${MODULESDIR}; do
mkdir -p "${DESTDIR}/${d}" mkdir -p "${DESTDIR}/${d}"
done done
@ -290,6 +290,13 @@ fi
depmod -a -b "${DESTDIR}" ${version} depmod -a -b "${DESTDIR}" ${version}
rm -f "${DESTDIR}/lib/modules/${version}"/modules.*map rm -f "${DESTDIR}/lib/modules/${version}"/modules.*map
# make sure that library search path is up to date
cp -ar /etc/ld.so.conf* "$DESTDIR"/etc/
if ! ldconfig -r "$DESTDIR" ; then
[ $(id -u) != "0" ] \
&& echo "ldconfig might need uid=0 (root) for chroot()" >&2
fi
# Apply DSDT to initramfs # Apply DSDT to initramfs
if [ -e "${CONFDIR}/DSDT.aml" ]; then if [ -e "${CONFDIR}/DSDT.aml" ]; then
copy_exec "${CONFDIR}/DSDT.aml" / copy_exec "${CONFDIR}/DSDT.aml" /
@ -303,7 +310,7 @@ fi
[ "${verbose}" = y ] && echo "Building cpio ${outfile} initramfs" [ "${verbose}" = y ] && echo "Building cpio ${outfile} initramfs"
( (
# work around lack of "set -o pipefail" for the following pipe: # work around lack of "set -o pipefail" for the following pipe:
# cd "${DESTDIR}" && find . | cpio --quiet --dereference -o -H newc | gzip >"${outfile}" || exit 1 # cd "${DESTDIR}" && find . | cpio --quiet -R 0:0 -o -H newc | gzip >"${outfile}" || exit 1
exec 3>&1 exec 3>&1
eval ` eval `
# http://cfaj.freeshell.org/shell/cus-faq-2.html # http://cfaj.freeshell.org/shell/cus-faq-2.html
@ -312,7 +319,7 @@ eval `
{ {
find . 4>&-; echo "ec1=$?;" >&4 find . 4>&-; echo "ec1=$?;" >&4
} | { } | {
cpio --quiet --dereference -o -H newc 4>&-; echo "ec2=$?;" >&4 cpio --quiet -R 0:0 -o -H newc 4>&-; echo "ec2=$?;" >&4
} | ${compress} >"${outfile}" } | ${compress} >"${outfile}"
echo "ec3=$?;" >&4 echo "ec3=$?;" >&4
` `

View file

@ -121,8 +121,8 @@ which is described in
.TP .TP
.I /etc/initramfs-tools/conf.d .I /etc/initramfs-tools/conf.d
The conf.d directory allows to hardcode bootargs at initramfs build time The conf.d directory allows one to hardcode bootargs at initramfs build time
via config snippets. This allows to set ROOT or RESUME. via config snippets. This allows one to set ROOT or RESUME.
This is especially useful for bootloaders, which do not pass an root bootarg. This is especially useful for bootloaders, which do not pass an root bootarg.
.TP .TP

View file

@ -0,0 +1,27 @@
#!/bin/sh
PREREQ=""
prereqs()
{
echo "$PREREQ"
}
case $1 in
# get pre-requisites
prereqs)
prereqs
exit 0
;;
esac
for x in $(cat /proc/cmdline); do
case ${x} in
all_generic_ide)
modprobe ata_generic all_generic_ide=1
;;
all_generic_ide=*)
if [ ${x#all_generic_ide=} ]; then
modprobe ata_generic all_generic_ide=1
fi
;;
esac
done

View file

@ -4,7 +4,7 @@
update-initramfs.conf \- configuration file for update-initramfs update-initramfs.conf \- configuration file for update-initramfs
.SH DESCRIPTION .SH DESCRIPTION
The configuration file allows to disable the update action from The configuration file allows one to disable the update action from
.B update-initramfs. .B update-initramfs.
.SH GENERAL VARIABLES .SH GENERAL VARIABLES

View file

@ -1,15 +1,15 @@
# Template file for 'initramfs-tools' # Template file for 'initramfs-tools'
pkgname=initramfs-tools pkgname=initramfs-tools
_localver=0.99.21 # This is the XBPS version _localver=100 # This is the XBPS version
_distver=0.98.8 # This should match debian version _distver=0.99 # This should match debian version
version=${_localver}.${_distver} version=${_distver}.${_localver}
build_style=custom-install build_style=custom-install
short_desc="Tools for generating an initramfs" short_desc="Tools for generating an initramfs"
maintainer="Juan RP <xtraeme@gmail.com>" maintainer="Juan RP <xtraeme@gmail.com>"
homepage="http://code.google.com/p/xbps" homepage="http://code.google.com/p/xbps"
license="GPL-2" license="GPL-2"
long_desc=" long_desc="
This package contains tools to create and boot an initramfs for packaged 2.6 This package contains tools to create and boot an initramfs for packaged
Linux kernel. The initramfs is a gzipped cpio archive. At boot time, the Linux kernel. The initramfs is a gzipped cpio archive. At boot time, the
kernel unpacks that archive into RAM, mounts and uses it as initial root kernel unpacks that archive into RAM, mounts and uses it as initial root
file system. The mounting of the real root file system occurs in early user file system. The mounting of the real root file system occurs in early user