summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bash_completion.d/initramfs-tools26
-rw-r--r--conf/update-initramfs.conf2
-rw-r--r--debian/changelog6
-rw-r--r--debian/control1
-rw-r--r--debian/copyright2
-rw-r--r--debian/initramfs-tools.install1
-rw-r--r--docs/example_hook2
-rw-r--r--hook-functions24
-rwxr-xr-xhooks/busybox10
-rwxr-xr-xhooks/klibc8
-rwxr-xr-xinit6
-rw-r--r--initramfs.conf.512
-rwxr-xr-xmkinitramfs28
-rw-r--r--scripts/functions2
-rw-r--r--scripts/local2
-rw-r--r--scripts/nfs2
-rwxr-xr-xupdate-initramfs16
17 files changed, 89 insertions, 61 deletions
diff --git a/bash_completion.d/initramfs-tools b/bash_completion.d/initramfs-tools
new file mode 100644
index 0000000..a52074f
--- /dev/null
+++ b/bash_completion.d/initramfs-tools
@@ -0,0 +1,26 @@
+# update-initramfs(8) completion
+
+_update_initramfs()
+{
+ local cur prev valid_options
+
+ # TODO: this can be "_get_comp_words_by_ref cur prev" once
+ # bash-completion >= 1.2 is available, see #537139
+ cur=$(_get_cword)
+ prev=${COMP_WORDS[COMP_CWORD-1]}
+
+ # The only option that takes an argument is -k
+ if [[ "$prev" == '-k' ]]; then
+ # Complete with kernel versions
+ _kernel_versions
+ COMPREPLY=( $( compgen -W '${COMPREPLY[@]} all' -- "$cur" ) )
+ return;
+ fi
+
+ # Complete with available options (obtained from -h)
+ valid_options=$( update-initramfs -h 2>&1 | \
+ sed -e '/^ -/!d;s/^ \(-\w\+\).*/\1/' )
+ COMPREPLY=( $( compgen -W "$valid_options" -- $cur ) )
+}
+
+complete -F _update_initramfs update-initramfs
diff --git a/conf/update-initramfs.conf b/conf/update-initramfs.conf
index 3c27473..31823e2 100644
--- a/conf/update-initramfs.conf
+++ b/conf/update-initramfs.conf
@@ -1,4 +1,4 @@
-#
+#
# Configuration file for update-initramfs(8)
#
diff --git a/debian/changelog b/debian/changelog
index b3ae973..901222a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -247,7 +247,7 @@ initramfs-tools (0.93.4) unstable; urgency=medium
* initramfs-tools.8: Convert hyphen to minus sign.
* control: bump versioned dep on debhelper.
* control: bump standards version without changes.
- * hook-functions: Fix loading of entries without newline in
+ * hook-functions: Fix loading of entries without newline in
/etc/initramfs-tools/modules. (closes: #532745)
* MODULES=most: Add virtio_net to initramfs. (closes: #533894)
@@ -537,7 +537,7 @@ initramfs-tools (0.92d) unstable; urgency=low
each message.
- initramfs-tools.preinst: Try to use UUID for resume device.
- add boot script loading ide-generic on all_generic_ide cmdline.
- Thanks Frans Pop <elendil@planet.nl> for report. (closes: #485786)
+ Thanks Frans Pop <elendil@planet.nl> for report. (closes: #485786)
* init: add possible mountroot break (closes: #488963)
* initramfs-tools.8: document UUID usage for root and all_generic_ide.
(closes: #489186)
@@ -744,7 +744,7 @@ initramfs-tools (0.90) unstable; urgency=low
-- maximilian attems <maks@debian.org> Thu, 09 Aug 2007 21:30:29 +0200
initramfs-tools (0.89) unstable; urgency=low
-
+
Release "L'\xE9lecteur c'est notoire N'a pas tout' sa raison"
[ Joey Hess ]
diff --git a/debian/control b/debian/control
index f98fdd7..30d873b 100644
--- a/debian/control
+++ b/debian/control
@@ -12,6 +12,7 @@ Package: initramfs-tools
Architecture: all
Recommends: busybox (>= 1:1.01-3) | busybox-initramfs
Depends: klibc-utils (>= 1.5.9-1), cpio, module-init-tools, udev (>= 0.086-1), findutils (>= 4.2.24), ${misc:Depends}
+Suggests: bash-completion
Provides: linux-initramfs-tool
Description: tools for generating an initramfs
This package contains tools to create and boot an initramfs for packaged 2.6
diff --git a/debian/copyright b/debian/copyright
index f84910d..9fe89c8 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -13,7 +13,7 @@ http://git.debian.org/?p=kernel/initramfs-tools.git;a=shortlog
Authors: Adam Conrad <adconrad@ubuntu.com>,
Ben Collins <bcollins@ubuntu.com>,
David Härdeman <david@hardeman.nu>,
- Jeff Bailey <jbailey@ubuntu.com>,
+ Jeff Bailey <jbailey@ubuntu.com>,
maximilian attems <maks@debian.org>,
Scott James Remnant <scott@ubuntu.com>
diff --git a/debian/initramfs-tools.install b/debian/initramfs-tools.install
index 71670ef..ebe6a14 100644
--- a/debian/initramfs-tools.install
+++ b/debian/initramfs-tools.install
@@ -11,3 +11,4 @@ update-initramfs usr/sbin
debian/script usr/share/bug/initramfs-tools
debian/lintian/initramfs-tools usr/share/lintian/overrides
kernel etc
+bash_completion.d etc
diff --git a/docs/example_hook b/docs/example_hook
index 683ddad..1f35352 100644
--- a/docs/example_hook
+++ b/docs/example_hook
@@ -12,7 +12,7 @@
# command line.
#
# DESTDIR -- The staging directory where we are building the image.
-#
+#
# see initramfs-tools(8)
#
diff --git a/hook-functions b/hook-functions
index f5da1c4..ffb6a67 100644
--- a/hook-functions
+++ b/hook-functions
@@ -3,7 +3,7 @@
catenate_cpiogz() {
# Sanity check
if [ ! -e "${1}" ]; then
- echo "W:catenate_cpiogz: arg1='${1}' does not exist." >&2
+ echo "W: catenate_cpiogz: arg1='${1}' does not exist." >&2
return
fi
@@ -29,7 +29,7 @@ add_modules_from_file()
{
# Sanity check
if [ ! -e "${1}" ]; then
- echo "W:add_modules_from_file: arg1='${1}' does not exist." >&2
+ echo "W: add_modules_from_file: arg1='${1}' does not exist." >&2
return
fi
@@ -72,7 +72,7 @@ manual_add_modules()
# /proc/modules exists
if [ ! -e /proc/modules ] ; then
continue
- fi
+ fi
if grep -q "^$(basename "${kmod}" .ko)[[:space:]]" \
/proc/modules \
@@ -127,10 +127,10 @@ copy_exec() {
# Copy the dependant libraries
for x in $(ldd ${src} 2>/dev/null | sed -e '
- /\//!d;
- /linux-gate/d;
- /=>/ {s/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/};
- s/[[:blank:]]*\([^[:blank:]]*\) (.*)/\1/' 2>/dev/null); do
+ /\//!d;
+ /linux-gate/d;
+ /=>/ {s/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/};
+ s/[[:blank:]]*\([^[:blank:]]*\) (.*)/\1/' 2>/dev/null); do
# Try to use non-optimised libraries where possible.
# We assume that all HWCAP libraries will be in tls,
@@ -166,7 +166,7 @@ copy_modules_dir()
if [ "${verbose}" = "y" ]; then
echo "Copying module directory ${dir}"
if [ $# -ge 1 ]; then
- echo "(excluding $*)"
+ echo "(excluding $*)"
fi
fi
while [ $# -ge 1 ]; do
@@ -183,7 +183,7 @@ sys_walk_mod_add()
{
local driver_path module
device_path="$1"
-
+
while [ "${device_path}" != "/sys" ]; do
sys_walk_modalias ${device_path}
driver_path="$(readlink -f ${device_path}/driver/module)"
@@ -274,7 +274,7 @@ dep_add_modules()
# lvm on md or luks on md
if [ "${block#md}" != "${block}" ]; then
block=$(grep "^${block}" /proc/mdstat | \
- awk "{gsub(/^${block} : .* (multipath|linear|raid[[:digit:]]+)\ /,\"\")};1")
+ awk "{gsub(/^${block} : .* (multipath|linear|raid[[:digit:]]+)\ /,\"\")};1")
block="${block%%\[*}"
fi
# luks or lvm on cciss or ida
@@ -531,8 +531,8 @@ check_minkver()
fi
set_initlist
for cm_x in ${initlist:-}; do
- # sed: keep last line starting with MINKVER=,
- # remove MINKVER= and trailing space
+ # sed: keep last line starting with MINKVER=,
+ # remove MINKVER= and trailing space
minver=$(sed '/^MINKVER=/!d;$!d;s/^MINKVER=//;s/[[:space:]]*$//' "${initdir}/${cm_x}")
if [ -z "${tmp}" ]; then
continue
diff --git a/hooks/busybox b/hooks/busybox
index 7845f58..1a275b7 100755
--- a/hooks/busybox
+++ b/hooks/busybox
@@ -4,15 +4,15 @@ PREREQ=""
prereqs()
{
- echo "$PREREQ"
+ echo "$PREREQ"
}
case $1 in
# get pre-requisites
prereqs)
- prereqs
- exit 0
- ;;
+ prereqs
+ exit 0
+ ;;
esac
# busybox
@@ -20,7 +20,7 @@ if [ "${BUSYBOX}" = "n" ] || [ ! -e ${BUSYBOXDIR}/busybox ]; then
# those root need busybox
eval "$(mount | awk '/ \/ / {print "r_dev=" $1; exit}')"
if [ "${r_dev#/dev/mapper/}" != "${r_dev}" ]; then
- echo "Warning: Busybox is required for successful boot!"
+ echo "W: Busybox is required for successful boot!"
fi
else
. /usr/share/initramfs-tools/hook-functions
diff --git a/hooks/klibc b/hooks/klibc
index ad0a85d..e41c631 100755
--- a/hooks/klibc
+++ b/hooks/klibc
@@ -4,15 +4,15 @@ PREREQ=""
prereqs()
{
- echo "$PREREQ"
+ echo "$PREREQ"
}
case $1 in
# get pre-requisites
prereqs)
- prereqs
- exit 0
- ;;
+ prereqs
+ exit 0
+ ;;
esac
# klibc
diff --git a/init b/init
index c838049..397a8c2 100755
--- a/init
+++ b/init
@@ -8,8 +8,8 @@ echo "Loading, please wait..."
[ -d /proc ] || mkdir /proc
[ -d /tmp ] || mkdir /tmp
mkdir -p /var/lock
-mount -t sysfs -o nodev,noexec,nosuid none /sys
-mount -t proc -o nodev,noexec,nosuid none /proc
+mount -t sysfs -o nodev,noexec,nosuid none /sys
+mount -t proc -o nodev,noexec,nosuid none /proc
# Note that this only becomes /dev on the real filesystem if udev's scripts
# are used; which they will be, but it's worth pointing out
@@ -185,7 +185,7 @@ done
if [ -n "${noresume}" ]; then
export noresume
unset resume
-else
+else
resume=${RESUME:-}
fi
diff --git a/initramfs.conf.5 b/initramfs.conf.5
index bb01f58..92c3a6d 100644
--- a/initramfs.conf.5
+++ b/initramfs.conf.5
@@ -48,12 +48,12 @@ The keymap will anyway be loaded by the initscripts later, and the packages
that might need input will normally set this variable automatically, so there
should normally be no need to set this.
-.TP
-\fB COMPRESS
-Specifies the compression method used for the initramfs image.
-.B mkinitramfs
-will default to gzip if the kernel lacks support (CONFIG_RD) or the
-corresponding userspace utility is not present.
+.TP
+\fB COMPRESS
+Specifies the compression method used for the initramfs image.
+.B mkinitramfs
+will default to gzip if the kernel lacks support (CONFIG_RD) or the
+corresponding userspace utility is not present.
.TP
\fB UMASK
diff --git a/mkinitramfs b/mkinitramfs
index 58e4c11..1c6ad28 100755
--- a/mkinitramfs
+++ b/mkinitramfs
@@ -69,7 +69,7 @@ for i in /usr/share/initramfs-tools/conf.d/* ${CONFDIR}/conf.d/*; do
| grep '^[[:alnum:]][[:alnum:]\._-]*$' | grep -v '\.dpkg-.*$')";
done
# FIXME: deprecated those settings on mkinitramfs run
-# these conf dirs are for boot scripts and land on initramfs
+# these conf dirs are for boot scripts and land on initramfs
for i in ${EXTRA_CONF}; do
if [ -e ${CONFDIR}/conf.d/${i} ]; then
. ${CONFDIR}/conf.d/${i}
@@ -198,7 +198,7 @@ done
# Copy the modules.order file in
if [ -f "${MODULESDIR}/modules.order" ]; then
cp -p "${MODULESDIR}/modules.order" \
- "${DESTDIR}${MODULESDIR}/modules.order"
+ "${DESTDIR}${MODULESDIR}/modules.order"
fi
# MODULES=list case. Always honour.
@@ -224,8 +224,8 @@ list)
# nothing to add
;;
*)
- echo "mkinitramfs: Warning unsupported MODULES setting: ${MODULES}."
- echo "mkinitramfs: Falling back to MODULES=most."
+ echo "W: mkinitramfs: unsupported MODULES setting: ${MODULES}."
+ echo "W: mkinitramfs: Falling back to MODULES=most."
auto_add_modules
;;
esac
@@ -286,7 +286,7 @@ run_scripts "${CONFDIR}"/hooks
# cache boot run order
if [ -n "$NOEXEC" ]; then
- echo "Warning: TMPDIR is mounted noexec, will not cache run scripts."
+ echo "W: TMPDIR is mounted noexec, will not cache run scripts."
else
for b in $(cd "${DESTDIR}/scripts" && find . -mindepth 1 -type d); do
cache_run_scripts "${DESTDIR}" "/scripts/${b#./}"
@@ -313,15 +313,15 @@ find "${DESTDIR}" -type l -printf '%p %Y\n' | sed -n 's/ [LN]$//p' \
# cd "${DESTDIR}" && find . | cpio --quiet --dereference -o -H newc | gzip >"${outfile}" || exit 1
exec 3>&1
eval `
- # http://cfaj.freeshell.org/shell/cus-faq-2.html
- exec 4>&1 >&3 3>&-
- cd "${DESTDIR}"
- {
- find . 4>&-; echo "ec1=$?;" >&4
- } | {
- cpio --quiet --dereference -o -H newc 4>&-; echo "ec2=$?;" >&4
- } | ${compress} >"${outfile}"
- echo "ec3=$?;" >&4
+ # http://cfaj.freeshell.org/shell/cus-faq-2.html
+ exec 4>&1 >&3 3>&-
+ cd "${DESTDIR}"
+ {
+ find . 4>&-; echo "ec1=$?;" >&4
+ } | {
+ cpio --quiet --dereference -o -H newc 4>&-; echo "ec2=$?;" >&4
+ } | ${compress} >"${outfile}"
+ echo "ec3=$?;" >&4
`
if [ "$ec1" -ne 0 ]; then exit "$ec1"; fi
if [ "$ec2" -ne 0 ]; then exit "$ec2"; fi
diff --git a/scripts/functions b/scripts/functions
index 8730d52..685642e 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -218,7 +218,7 @@ run_scripts()
{
initdir=${1}
[ ! -d ${initdir} ] && return
-
+
if [ -f ${initdir}/ORDER ]; then
. ${initdir}/ORDER
elif command -v tsort >/dev/null 2>&1; then
diff --git a/scripts/local b/scripts/local
index cca5e8d..98464f9 100644
--- a/scripts/local
+++ b/scripts/local
@@ -50,7 +50,7 @@ pre_mountroot()
# We've given up, but we'll let the user fix matters if they can
while [ ! -e "${ROOT}" ]; do
# give hint about renamed root
- case "${ROOT}" in
+ case "${ROOT}" in
/dev/hd*)
suffix="${ROOT#/dev/hd}"
major="${suffix%[[:digit:]]}"
diff --git a/scripts/nfs b/scripts/nfs
index 435d2d0..5c41573 100644
--- a/scripts/nfs
+++ b/scripts/nfs
@@ -4,7 +4,7 @@
retry_nr=0
-# parse nfs bootargs and mount nfs
+# parse nfs bootargs and mount nfs
do_nfsmount()
{
diff --git a/update-initramfs b/update-initramfs
index 53ebed2..f4323b7 100755
--- a/update-initramfs
+++ b/update-initramfs
@@ -51,14 +51,14 @@ EOF
# chroot check
chrooted()
{
- # borrowed from udev's postinst
- if [ "$(stat -c %d/%i /)" = "$(stat -Lc %d/%i /proc/1/root 2>/dev/null)" ]; then
- # the devicenumber/inode pair of / is the same as that of
- # /sbin/init's root, so we're *not* in a chroot and hence
- # return false.
- return 1
- fi
- return 0
+ # borrowed from udev's postinst
+ if [ "$(stat -c %d/%i /)" = "$(stat -Lc %d/%i /proc/1/root 2>/dev/null)" ]; then
+ # the devicenumber/inode pair of / is the same as that of
+ # /sbin/init's root, so we're *not* in a chroot and hence
+ # return false.
+ return 1
+ fi
+return 0
}
mild_panic()