~ubuntu-branches/ubuntu/utopic/initramfs-tools/utopic

« back to all changes in this revision

Viewing changes to mkinitramfs

  • Committer: Bazaar Package Importer
  • Author(s): Michael Prokop, Martin Michlmayr, Ferenc Wagner, Colin Watson, maximilian attems, 969f8fd, Michael Prokop
  • Date: 2010-06-18 12:28:04 UTC
  • mto: This revision was merged to the branch mainline in revision 206.
  • Revision ID: james.westby@ubuntu.com-20100618122804-ioma0owf209ecwek
Tags: 0.97
[ Martin Michlmayr ]
* [e65ee48] Produce an error when root cannot be determined with
  MODULES=dep
* [bb66fc2] hook-functions/init/scripts/local: add support for ubifs.
  (Closes: #582858) - thanks to Martin Michlmayr <tbm@cyrius.com>

[ Ferenc Wagner ]
* [1d66ae1] scripts/nfs: cleanup retry logic

[ Colin Watson ]
* [3054e3e] initramfs-tools: work around 'find -printf %Y' bug

[ maximilian attems ]
* [a8a5ce4] script: Add update-initramfs.conf to bug report
* [cc6077a] update-initramfs: Fix another unbound variable (Closes:
  #583695)
* [b1f74e6] get_fstype: reference blkid in comment - thanks to
  Christoph Anton Mitterer <calestyo@scientia.net>
* [eb93a7e] pre_mountroot(): reduce timeout to 30 seconds
* [38563fe] scripts/functions: On panic change to tty1 if chvt around
  - thanks to Colin Watson <cjwatson@ubuntu.com>
* [2031379] mkinitramfs: No point in hardcoding busybox path
* [68c87cd] mkinitramfs: check syntax of boot and hook scripts
* [ae02e4b] scripts/functions: beautify a bit reduce_satisfied()
* [22d996c] maintainer doc: use git commands without the dash
* [6147641] nfsmount: more small cleanups
* [e967b03] mkinitramfs, lsinitramfs: Better error message for
  non-GNU getopt
* Add lsinitramfs (to list content of an initramfs image) ([a39db63]
  [969f8fd] [fafede5] [2f3eb88])

[ Michael Prokop ]
* [2a8c990] hook-functions/mkinitramfs/update-initramfs: consequently
  output error messages to stderr
* [04b8619] init: display warning message if devtmpfs could not be
  mounted. - thanks to Ferenc Wagner <wferi@niif.hu>
* [60afd2a] code cleanup: drop trailing whitespaces.
* [ab28c77] code cleanup: consequently replace spaces in indentions
  with tabs to unify coding stile
* [3a02c6f] code cleanup: consequently use "W:" for warnings.
* [b1fff5e] add bash-completion for update-initramfs (Closes: #537139)
  - thanks to Stéphane Jourdois <stephane@jourdois.fr>
* [5697c3b] hook-functions: replace awk calls with sed in
  dep_add_modules() (Closes: #585991) - thanks to Thorsten Glaser
  <tg@mirbsd.de>
* [7afab22] debian/script: append /proc/mdstat (iff present) to
  bugreports
* [5b565be] scripts/functions: allow hooks to abort build (Closes:
  #396388)
* [528ba78] hook-functions: do not install ubi module by default via
  auto_add_modules()
* [ecb8416] lsinitramfs: be more defensive against cmdline options
* [2ff4ba2] scripts/functions: fix usage of test for script execution
* [74f71c9] scripts/functions: fix another sh -n usage and fix typo
* [91f5947] hook-functions: install virtio_pci module if
  /sys/bus/virtio is present and using modules=dep (Closes: #585992) -
  thanks to Vincent Danjean <vdanjean@debian.org>
* [d25f610] slightly improve manpage lsinitramfs.8
* Provide maintainer-notes.html, being "Maintainer documentation for
  initramfs-tools" ([7fc1ee5] [afafea4] [e506ee7] [d53a839] [6af23c2])

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
keep="n"
8
8
CONFDIR="/etc/initramfs-tools"
9
9
verbose="n"
10
 
# BUSYBOXDIR="/usr/lib/initramfs-tools/bin/"
11
 
export BUSYBOXDIR="/bin"
 
10
test -e /bin/busybox && BUSYBOXDIR=/bin
 
11
test -e /usr/lib/initramfs-tools/bin/busybox && BUSYBOXDIR=/usr/lib/initramfs-tools/bin
 
12
export BUSYBOXDIR
12
13
 
13
14
OPTIONS=`getopt -o c:d:ko:r:v -n "$0" -- "$@"`
14
15
 
15
16
# Check for non-GNU getopt
16
 
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
 
17
if [ $? != 0 ] ; then echo "W: non-GNU getopt" >&2 ; exit 1 ; fi
17
18
 
18
19
eval set -- "$OPTIONS"
19
20
 
69
70
                | grep '^[[:alnum:]][[:alnum:]\._-]*$' | grep -v '\.dpkg-.*$')";
70
71
done
71
72
# FIXME: deprecated those settings on mkinitramfs run
72
 
#        these conf dirs are for boot scripts and land on initramfs
 
73
#        these conf dirs are for boot scripts and land on initramfs
73
74
for i in ${EXTRA_CONF}; do
74
75
        if [ -e  ${CONFDIR}/conf.d/${i} ]; then
75
76
                . ${CONFDIR}/conf.d/${i}
148
149
[ "${compress}" = lzop ] && compress="lzop -9"
149
150
 
150
151
if [ -d "${outfile}" ]; then
151
 
        echo "${outfile} is a directory"
 
152
        echo "${outfile} is a directory" >&2
152
153
        exit 1
153
154
fi
154
155
 
198
199
# Copy the modules.order file in
199
200
if [ -f "${MODULESDIR}/modules.order" ]; then
200
201
        cp -p "${MODULESDIR}/modules.order" \
201
 
              "${DESTDIR}${MODULESDIR}/modules.order"
 
202
                "${DESTDIR}${MODULESDIR}/modules.order"
202
203
fi
203
204
 
204
205
# MODULES=list case.  Always honour.
224
225
        # nothing to add
225
226
        ;;
226
227
*)
227
 
        echo "mkinitramfs: Warning unsupported MODULES setting: ${MODULES}."
228
 
        echo "mkinitramfs: Falling back to MODULES=most."
 
228
        echo "W: mkinitramfs: unsupported MODULES setting: ${MODULES}."
 
229
        echo "W: mkinitramfs: Falling back to MODULES=most."
229
230
        auto_add_modules
230
231
        ;;
231
232
esac
266
267
fi
267
268
 
268
269
if ! command -v ldd >/dev/null 2>&1 ; then
269
 
        echo "WARNING: no ldd around - install libc-bin"
 
270
        echo "WARNING: no ldd around - install libc-bin" >&2
270
271
        exit 1
271
272
fi
272
273
 
286
287
 
287
288
# cache boot run order
288
289
if [ -n "$NOEXEC" ]; then
289
 
        echo "Warning: TMPDIR is mounted noexec, will not cache run scripts."
 
290
        echo "W: TMPDIR is mounted noexec, will not cache run scripts."
290
291
else
291
292
        for b in $(cd "${DESTDIR}/scripts" && find . -mindepth 1 -type d); do
292
293
                cache_run_scripts "${DESTDIR}" "/scripts/${b#./}"
304
305
 
305
306
# Remove any looping or broken symbolic links, since they break cpio.
306
307
[ "${verbose}" = y ] && xargs_verbose="-t"
307
 
find "${DESTDIR}" -type l -printf '%p %Y\n' | sed -n 's/ [LN]$//p' \
308
 
        | xargs ${xargs_verbose:-} -rL1 rm -f
 
308
(cd "${DESTDIR}" && find . -type l -printf '%p %Y\n' | sed -n 's/ [LN]$//p' \
 
309
        | xargs ${xargs_verbose:-} -rL1 rm -f)
309
310
 
310
311
[ "${verbose}" = y ] && echo "Building cpio ${outfile} initramfs"
311
312
(
313
314
# cd "${DESTDIR}" && find . | cpio --quiet --dereference -o -H newc | gzip >"${outfile}" || exit 1
314
315
exec 3>&1
315
316
eval `
316
 
    # http://cfaj.freeshell.org/shell/cus-faq-2.html
317
 
    exec 4>&1 >&3 3>&-
318
 
    cd  "${DESTDIR}" 
319
 
    {
320
 
        find . 4>&-; echo "ec1=$?;" >&4
321
 
    } | {
322
 
        cpio --quiet --dereference -o -H newc 4>&-; echo "ec2=$?;" >&4
323
 
    } | ${compress} >"${outfile}"
324
 
    echo "ec3=$?;" >&4
 
317
        # http://cfaj.freeshell.org/shell/cus-faq-2.html
 
318
        exec 4>&1 >&3 3>&-
 
319
        cd  "${DESTDIR}"
 
320
        {
 
321
                find . 4>&-; echo "ec1=$?;" >&4
 
322
        } | {
 
323
                cpio --quiet --dereference -o -H newc 4>&-; echo "ec2=$?;" >&4
 
324
        } | ${compress} >"${outfile}"
 
325
        echo "ec3=$?;" >&4
325
326
`
326
327
if [ "$ec1" -ne 0 ]; then exit "$ec1"; fi
327
328
if [ "$ec2" -ne 0 ]; then exit "$ec2"; fi