diff --git a/srcpkgs/initramfs-tools/files/hook-functions b/srcpkgs/initramfs-tools/files/hook-functions index 8e0e86aa1b8..62f829678d8 100644 --- a/srcpkgs/initramfs-tools/files/hook-functions +++ b/srcpkgs/initramfs-tools/files/hook-functions @@ -52,7 +52,7 @@ manual_add_modules() fi mkdir -p "${DESTDIR}/$(dirname "${kmod}")" - ln -s "${kmod}" "${DESTDIR}/$(dirname "${kmod}")" + cp -pL "${kmod}" "${DESTDIR}/$(dirname "${kmod}")" if [ "${verbose}" = "y" ]; then echo "Adding module ${kmod}" fi @@ -123,7 +123,7 @@ copy_exec() { fi [ "${verbose}" = "y" ] && echo "Adding binary ${src}" - ln -s "${src}" "${DESTDIR}/${target}" + cp -pL "${src}" "${DESTDIR}/${target}" # Copy the dependant libraries for x in $(ldd ${src} 2>/dev/null | sed -e ' @@ -147,7 +147,7 @@ copy_exec() { # FIXME inst_lib mkdir -p "${DESTDIR}/${dirname}" if [ ! -e "${DESTDIR}/${dirname}/${libname}" ]; then - ln -s "${x}" "${DESTDIR}/${dirname}" + cp -pL "${x}" "${DESTDIR}/${dirname}" [ "${verbose}" = "y" ] && echo "Adding library ${x}" || true fi done @@ -235,7 +235,9 @@ dep_add_modules() # recheck root device if [ -z "$root" ]; then 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 "Include the output of 'mount' and 'cat /proc/mounts'" >&2 exit 1 @@ -245,10 +247,6 @@ dep_add_modules() # most of the commands below only work with block devices. if [ "${FSTYPE}" = "ubifs" ]; then 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 fi @@ -370,6 +368,7 @@ dep_add_modules() if [ -d "${DESTDIR}/lib/modules/${version}/kernel/drivers/ide" ]; then sys_walk_modalias ${root_dev_path} manual_add_modules ide-gd_mod + manual_add_modules ide-cd fi if [ -d "${DESTDIR}/lib/modules/${version}/kernel/drivers/scsi" ]; then @@ -408,8 +407,8 @@ auto_add_modules() { case "${1:-}" in base) - for x in ehci-hcd ohci-hcd uhci-hcd usbhid xhci hid-apple \ - hid-cherry hid-logitech hid-microsoft \ + for x in ehci-hcd ohci-hcd uhci-hcd usbhid xhci xhci-hcd \ + hid-apple hid-cherry hid-logitech hid-microsoft hid-sunplus \ btrfs ext2 ext3 ext4 ext4dev isofs jfs nfs reiserfs udf xfs \ af_packet atkbd i8042 virtio_pci; do manual_add_modules "${x}" @@ -489,10 +488,14 @@ auto_add_modules() # fixed, we need to handle those hidden dependencies. 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 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 done } diff --git a/srcpkgs/initramfs-tools/files/init b/srcpkgs/initramfs-tools/files/init index d88b9a0ca26..19600cdf764 100755 --- a/srcpkgs/initramfs-tools/files/init +++ b/srcpkgs/initramfs-tools/files/init @@ -34,7 +34,7 @@ fi mount -t tmpfs -o mode=0755,nosuid,nodev tmpfs /run mkdir /run/udev -mkdir /run/.initramfs +mkdir /run/initramfs # Set modprobe env export MODPROBE_OPTIONS="-qb" @@ -164,7 +164,7 @@ for x in $(cat /proc/cmdline); do debug) debug=y quiet=n - exec >/run/.initramfs/initramfs.debug 2>&1 + exec >/run/initramfs/initramfs.debug 2>&1 set -x ;; debug=*) diff --git a/srcpkgs/initramfs-tools/files/initramfs-tools.8 b/srcpkgs/initramfs-tools/files/initramfs-tools.8 index eb633c4ecf0..3809485ab2f 100644 --- a/srcpkgs/initramfs-tools/files/initramfs-tools.8 +++ b/srcpkgs/initramfs-tools/files/initramfs-tools.8 @@ -50,7 +50,7 @@ Use root=/dev/nfs for NFS to kick to in. NFSOPTS can be looked up in .TP \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 in any recent Linux source for details. Optional parameter for NFS root. @@ -100,7 +100,7 @@ panic= is a documented security feature: it disables the debug shell. .TP \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. Use for example "debug=vc". diff --git a/srcpkgs/initramfs-tools/files/initramfs.conf.5 b/srcpkgs/initramfs-tools/files/initramfs.conf.5 index 7a40cac14b0..345b909266b 100644 --- a/srcpkgs/initramfs-tools/files/initramfs.conf.5 +++ b/srcpkgs/initramfs-tools/files/initramfs.conf.5 @@ -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 initramfs.conf \- configuration file for mkinitramfs @@ -22,17 +22,25 @@ directly. .TP \fB MODULES 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. -\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 \fB KEYMAP 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 .TP \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). Set to \fInfs\fP for an NFS root share. diff --git a/srcpkgs/initramfs-tools/files/mkinitramfs b/srcpkgs/initramfs-tools/files/mkinitramfs index e4af816b085..f0c76457e5b 100755 --- a/srcpkgs/initramfs-tools/files/mkinitramfs +++ b/srcpkgs/initramfs-tools/files/mkinitramfs @@ -133,9 +133,9 @@ fi if ! command -v "${compress}" >/dev/null 2>&1; then compress=gzip - COMPRESS=gzip [ "${verbose}" = y ] && \ echo "No ${COMPRESS} in ${PATH}, using gzip" + COMPRESS=gzip fi if ! `grep -q -i ^config_rd_${COMPRESS%p} /boot/config-${version}` ; then @@ -193,7 +193,7 @@ export MODULES # Private, used by 'catenate_cpiogz'. 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}" done @@ -290,6 +290,13 @@ fi depmod -a -b "${DESTDIR}" ${version} 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 if [ -e "${CONFDIR}/DSDT.aml" ]; then copy_exec "${CONFDIR}/DSDT.aml" / @@ -303,7 +310,7 @@ fi [ "${verbose}" = y ] && echo "Building cpio ${outfile} initramfs" ( # 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 eval ` # http://cfaj.freeshell.org/shell/cus-faq-2.html @@ -312,7 +319,7 @@ eval ` { 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}" echo "ec3=$?;" >&4 ` diff --git a/srcpkgs/initramfs-tools/files/mkinitramfs.8 b/srcpkgs/initramfs-tools/files/mkinitramfs.8 index 49db6c82f84..fa2083b5ccd 100644 --- a/srcpkgs/initramfs-tools/files/mkinitramfs.8 +++ b/srcpkgs/initramfs-tools/files/mkinitramfs.8 @@ -121,8 +121,8 @@ which is described in .TP .I /etc/initramfs-tools/conf.d -The conf.d directory allows to hardcode bootargs at initramfs build time -via config snippets. This allows to set ROOT or RESUME. +The conf.d directory allows one to hardcode bootargs at initramfs build time +via config snippets. This allows one to set ROOT or RESUME. This is especially useful for bootloaders, which do not pass an root bootarg. .TP diff --git a/srcpkgs/initramfs-tools/files/scripts/init-top/all_generic_ide b/srcpkgs/initramfs-tools/files/scripts/init-top/all_generic_ide new file mode 100755 index 00000000000..e9539d8207c --- /dev/null +++ b/srcpkgs/initramfs-tools/files/scripts/init-top/all_generic_ide @@ -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 diff --git a/srcpkgs/initramfs-tools/files/update-initramfs.conf.5 b/srcpkgs/initramfs-tools/files/update-initramfs.conf.5 index 525cd648c80..bd41132ec1d 100644 --- a/srcpkgs/initramfs-tools/files/update-initramfs.conf.5 +++ b/srcpkgs/initramfs-tools/files/update-initramfs.conf.5 @@ -4,7 +4,7 @@ update-initramfs.conf \- configuration file for update-initramfs .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. .SH GENERAL VARIABLES diff --git a/srcpkgs/initramfs-tools/template b/srcpkgs/initramfs-tools/template index c8d8ea825fd..8db0b42e8f5 100644 --- a/srcpkgs/initramfs-tools/template +++ b/srcpkgs/initramfs-tools/template @@ -1,15 +1,15 @@ # Template file for 'initramfs-tools' pkgname=initramfs-tools -_localver=0.99.21 # This is the XBPS version -_distver=0.98.8 # This should match debian version -version=${_localver}.${_distver} +_localver=100 # This is the XBPS version +_distver=0.99 # This should match debian version +version=${_distver}.${_localver} build_style=custom-install short_desc="Tools for generating an initramfs" maintainer="Juan RP " homepage="http://code.google.com/p/xbps" license="GPL-2" 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 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