[arch-projects] [mkinitcpio][PATCH 0/10] Kill off gen_init_cpio
It's like a disease... I can't stop myself... Here's an overview of what's happening: Patch 1 deprecates our unfortunately named 'install' function, and replaces it with 'build'. Patches 2 through 5 are cleanup and refactoring of the codebase in preparation for patch 6 which introduces a new method of doing the actual initcpio creation. As I explained a few days back, we can directly use a cpio tool to create images. I've opted to use bsdcpio, which imo, has some advantages over GNU cpio: 1) it's part of libarchive. libarchive is awesome. 2) because of #1, it's already in core. 3) it has a useful farking man page instead of saying "see the info page" So what's the downside? 1) We have to dump a whole bunch of stuff in /tmp. This is as little as 3-4Mb, but might be as much as 20mb. I will likely add an option to change the location of the tmpdir. 2) add_device goes away, as we can't use mknod as non-root. This was only ever referenced in the 'base' install hook, and as explained in patch 4, we can get around this. 3) add_symlink2 goes away. No idea why this exists. No one has ever used it. 4) the -a option to mkinitcpio goes away. I don't think anyone will miss this. Patches 7, 8, and 10 aren't very interesting. patch 9 introduces a new feature to allow specifying the kernel version as a path to a kernel image, rather than an absolute version. I think this is a great thing to have as it means we can simplify the way we do kernel PKGBUILDs. The kver file can go away, as the kernel "version" will only ever have to be updated when the filename of the image changes (as we may do fairly soon). As such, this is a good opportunity to implement such a feature. I've tested this on a few of my VMs which cover: encrypt, lvm, and raid/lvm. My GitHub tree also contains some changes to some of the previous patches I've sent, as I discovered a few bugs in the course of my testing. I'm rather excited about this, as it makes mkinitcpio a lot more pleasant to use. The SSD is extremely happy: $ time ./mkinitcpio -k /boot/vmlinuz26 -g foo.img :: Begin build :: Parsing hook [base] :: Parsing hook [udev] :: Parsing hook [autodetect] :: Parsing hook [pata] :: Parsing hook [scsi] :: Parsing hook [sata] :: Parsing hook [filesystems] :: Generating module dependencies :: Generating image 'foo.img' 6463 blocks :: Image generation successful real 0m0.731s user 0m0.440s sys 0m0.159s As always, comments, criticism, and tomatos welcome. d
This is an unfortunate name clash with a common utility and should be avoided. Rename the install function to 'build' and warn the user when we discover a hook using an 'install' function. Signed-off-by: Dave Reisner <d@falconindy.com> --- install/autodetect | 2 +- install/base | 2 +- install/btrfs | 2 +- install/consolefont | 2 +- install/dmesg | 5 +++-- install/dsdt | 2 +- install/filesystems | 2 +- install/fw | 2 +- install/ide | 2 +- install/keymap | 2 +- install/memdisk | 2 +- install/net | 2 +- install/pata | 2 +- install/pcmcia | 2 +- install/resume | 3 ++- install/sata | 2 +- install/scsi | 2 +- install/sleep | 2 +- install/udev | 2 +- install/usb | 2 +- install/usbinput | 2 +- mkinitcpio | 27 ++++++++++++++++----------- 22 files changed, 40 insertions(+), 33 deletions(-) diff --git a/install/autodetect b/install/autodetect index 70fac56..118c9a5 100644 --- a/install/autodetect +++ b/install/autodetect @@ -1,6 +1,6 @@ # vim: set ft=sh: -install () +build() { MODULE_FILE="${TMPDIR}/autodetect_modules" #blegh, we'll let /tmp clean itself up diff --git a/install/base b/install/base index 4a0ff14..87d789d 100644 --- a/install/base +++ b/install/base @@ -1,6 +1,6 @@ # vim:set ft=sh: -install () +build() { add_dir "/proc" add_dir "/sys" diff --git a/install/btrfs b/install/btrfs index 60dc2ac..c156bb0 100644 --- a/install/btrfs +++ b/install/btrfs @@ -1,6 +1,6 @@ # vim:set ft=sh: -install() +build() { MODULES="$(all_modules btrfs)" BINARIES="/sbin/btrfs" diff --git a/install/consolefont b/install/consolefont index 7a3e73f..395387b 100644 --- a/install/consolefont +++ b/install/consolefont @@ -1,6 +1,6 @@ # vim: set ft=sh: -install () +build() { MODULES="" BINARIES="" diff --git a/install/dmesg b/install/dmesg index d25deba..9482874 100644 --- a/install/dmesg +++ b/install/dmesg @@ -1,5 +1,6 @@ # vim: set ft=sh: -install () + +build() { MODULES="" BINARIES="" @@ -15,4 +16,4 @@ cat<<HELPEOF with the boot process during early userspace (like when entering a passphrase). HELPEOF -} \ No newline at end of file +} diff --git a/install/dsdt b/install/dsdt index 138ee47..f1345d0 100644 --- a/install/dsdt +++ b/install/dsdt @@ -1,6 +1,6 @@ # vim: set ft=sh: -install () +build() { MODULES="" BINARIES="" diff --git a/install/filesystems b/install/filesystems index cd1a4cb..337a6a5 100644 --- a/install/filesystems +++ b/install/filesystems @@ -1,6 +1,6 @@ # vim: set ft=sh: -install () +build() { if [ "${autodetect_fs_detection_failed}" = "1" ]; then MODULES=" $(all_modules '/kernel/fs' | grep -v "nls")" diff --git a/install/fw b/install/fw index 9f4ed26..a5a77cb 100644 --- a/install/fw +++ b/install/fw @@ -1,6 +1,6 @@ # vim: set ft=sh: -install () +build() { MODULES=" $(checked_modules "/firewire/") " diff --git a/install/ide b/install/ide index f3bee4e..fa0da51 100644 --- a/install/ide +++ b/install/ide @@ -1,6 +1,6 @@ # vim: set ft=sh: -install () +build() { MODULES=" $(checked_modules "/ide/" | grep -v "legacy") "; diff --git a/install/keymap b/install/keymap index 65990dd..4038c87 100644 --- a/install/keymap +++ b/install/keymap @@ -1,6 +1,6 @@ # vim: set ft=sh: -install () +build() { MODULES="" BINARIES="" diff --git a/install/memdisk b/install/memdisk index d2a844d..69c996f 100644 --- a/install/memdisk +++ b/install/memdisk @@ -1,6 +1,6 @@ # vim:set ft=sh: -install () +build() { MODULES="phram mtdblock" BINARIES="/usr/bin/memdiskfind" diff --git a/install/net b/install/net index 6016ed5..2c816ba 100644 --- a/install/net +++ b/install/net @@ -1,6 +1,6 @@ # vim: set ft=sh: -install () +build() { MODULES="nfs $(checked_modules "/drivers/net/") " diff --git a/install/pata b/install/pata index af3c106..1d750dc 100644 --- a/install/pata +++ b/install/pata @@ -1,6 +1,6 @@ # vim: set ft=sh: -install () +build() { MODULES=" $(checked_modules "ata/pata_*") $(checked_modules "ata/ata_generic") $(checked_modules "ata/ata_piix")" diff --git a/install/pcmcia b/install/pcmcia index 8b685c5..a9920c1 100644 --- a/install/pcmcia +++ b/install/pcmcia @@ -1,6 +1,6 @@ # vim: set ft=sh: -install () +build() { MODULES=" $(checked_modules '/pcmcia/' | grep -ve 'sound' -e 'net') $(checked_modules '/ide/legacy')" MODULES=$(echo ${MODULES}) #trim whitespace diff --git a/install/resume b/install/resume index cbef453..dcf6442 100644 --- a/install/resume +++ b/install/resume @@ -1,5 +1,6 @@ # vim:set ft=sh: -install () + +build() { MODULES="" BINARIES="" diff --git a/install/sata b/install/sata index 4ed4d1c..cbd2db2 100644 --- a/install/sata +++ b/install/sata @@ -1,6 +1,6 @@ # vim: set ft=sh: -install () +build() { MODULES=" $(checked_modules "scsi/.*ata") $(checked_modules "block/sx8") $(checked_modules "scsi/ahci") $(checked_modules "scsi/pdc_adma") diff --git a/install/scsi b/install/scsi index b831b64..9a97a8c 100644 --- a/install/scsi +++ b/install/scsi @@ -1,6 +1,6 @@ # vim: set ft=sh: -install () +build() { MODULES=" $(checked_modules "/scsi/" | grep -ve "imm" -e "pdc_adma" -e "ahci" -e "ata" -e "pcmcia" -e "ide") $(checked_modules "/block/" | grep -e "cciss" -e "cpqarray" -e "DAC960") diff --git a/install/sleep b/install/sleep index a59d0c3..c7a8902 100644 --- a/install/sleep +++ b/install/sleep @@ -1,6 +1,6 @@ # vim:set ft=sh: -install () +build() { MODULES="" BINARIES="" diff --git a/install/udev b/install/udev index 33a13cc..74c9b5e 100644 --- a/install/udev +++ b/install/udev @@ -1,6 +1,6 @@ # vim:set ft=sh: -install () +build() { MODULES="" BINARIES="" diff --git a/install/usb b/install/usb index 605912c..620f695 100644 --- a/install/usb +++ b/install/usb @@ -1,6 +1,6 @@ # vim: set ft=sh: -install () +build() { MODULES=" $(checked_modules "/usb/host" | grep -ve "_cs" -e "sl811-hcd" -e "isp116x-hcd")" diff --git a/install/usbinput b/install/usbinput index 0d293ae..a90cd15 100644 --- a/install/usbinput +++ b/install/usbinput @@ -1,6 +1,6 @@ # vim: set ft=sh: -install () +build() { MODULES=" $(checked_modules "/usb/host" | grep -ve "_cs" -e "sl811-hcd" -e "isp116x-hcd") " MODULES=" $(echo ${MODULES}) $(all_modules "/hid/hid-") " diff --git a/mkinitcpio b/mkinitcpio index c6428bb..74c16e3 100755 --- a/mkinitcpio +++ b/mkinitcpio @@ -239,10 +239,8 @@ parse_hook for hook in ${HOOKS}; do in_array ${hook} ${SKIPHOOKS[@]} && continue - unset MODULES - unset BINARIES - unset FILES - install () { msg "${hook}: no install function..."; } + unset MODULES BINARIES FILES + build () { msg "${hook}: no build function..."; } # Deprecation check # A hook is considered deprecated if it is a symlink # within $INSTDIR. @@ -257,20 +255,27 @@ for hook in ${HOOKS}; do hook="${newhook}" fi fi - if grep -q "install" "${INSTDIR}/${hook}"; then - . "${INSTDIR}/${hook}" - echo ":: Parsing hook [${hook}]" + if [[ -r "${INSTDIR}/${hook}" ]]; then + . "${INSTDIR}/${hook}" + echo ":: Parsing hook [${hook}]" + if [[ $(type -t install) = 'function' ]]; then + echo " -----------------------------------------------------------------------" + echo " WARNING: Hook '$hook' uses a deprecated 'install' function. This " + echo " should be switched to a 'build' function instead." + echo " -----------------------------------------------------------------------" install - parse_hook + unset install + else + build + fi + parse_hook else - die "Hook '${hook}' can not be found." + die "Hook '${hook}' can not be found." fi done if [ "${HAS_MODULES}" = "y" ]; then echo ":: Generating module dependencies" - # unfortuate name collision between a function and utility program - unset install for mod in $(grep "file /lib/modules/${KERNELVERSION}" ${FILELIST} | cut -d' ' -f2); do install -m 644 -D "${BASEDIR}${mod}" "${TMPDIR}${mod}" done -- 1.7.5.4
On Mon, Jun 6, 2011 at 5:30 PM, Dave Reisner <d@falconindy.com> wrote:
This is an unfortunate name clash with a common utility and should be avoided. Rename the install function to 'build' and warn the user when we discover a hook using an 'install' function.
Signed-off-by: Dave Reisner <d@falconindy.com>
Ack. -t
Modify the sed filter to remove PIC addresses and ignore the first line which will always be the vdso. Also remove the tls filter, as glibc has had threaded support mainlined for many years now. If a user has a glibc this old, we don't have support for them elsewhere (udev, kernel). We also cleanup the logical flow through this function and remove a lot of cruft that would always return true, or that didn't quite make sense. Signed-off-by: Dave Reisner <d@falconindy.com> --- functions | 48 +++++++++++++++++------------------------------- 1 files changed, 17 insertions(+), 31 deletions(-) diff --git a/functions b/functions index 5551843..9adb5f8 100644 --- a/functions +++ b/functions @@ -153,7 +153,7 @@ add_file () add_symlink "${fil}" "${lnk}" fil="${lnk}" fi - if [ $# -eq 2 ]; then + if [[ $2 ]]; then dest="${2}" else dest="${fil##$BASEDIR}" @@ -223,47 +223,33 @@ add_module () add_binary () { local bin dest type lib - bin=$(which "${1}") - if [ $? -ne 0 ]; then - bin="${1}" - fi - dest="" - if [ $# -eq 2 ]; then - dest=${2} - fi + bin=$(type -P "$1") + dest=$2 - if [ ! -f "${bin}" ]; then - err "'${bin}' is not a file" + if [[ ! -f "$bin" ]]; then + err "'$bin' is not a file" return 1 fi - if [ $? -eq 0 ]; then - type=$(file -b "${bin}") - case "${type}" in - *script*) + case "$(file -b "$bin")" in + *script*) msg " adding '${type}' script, ensure proper interp exists..." - add_file "${bin}" ${dest} + add_file "$bin" $dest ;; - *executable*|*shared\ object*|*symbolic\ link*) - add_file "${bin}" ${dest} - #note, this will also handle 'not a dynamic executable' spit out by - # static binaries... the deps will produce nothing - for lib in $(ldd ${bin} 2>/dev/null | sed "s|.*=>\(.*\)|\1|"); do - if [ -n "${lib}" ]; then - #remove TLS libraries - notls=$(echo ${lib} | sed 's|/lib/tls.*/\(lib.*\)|/lib/\1|') - [ -e "${notls}" ] && lib="${notls}" - [ -f "${lib}" ] && add_file "${lib}" - fi + *executable*|*shared\ object*|*symbolic\ link*) + add_file "$bin" "$dest" + # note, this will also handle 'not a dynamic executable' spit out + # by static binaries... the deps will produce nothing + for lib in $(ldd "$bin" 2>/dev/null | sed '1d;s|.*=>\(.*\)|\1|;s/(0x[0-9a-f]\+)//'); do + [[ -f "$lib" ]] && add_file "$lib" done ;; - *) - err "unknown type '${type}' for binary '${bin}'" + *) + err "unknown type '$type' for binary '$bin'" return 1 ;; - esac - fi + esac } parse_hook () -- 1.7.5.4
On Mon, Jun 6, 2011 at 5:30 PM, Dave Reisner <d@falconindy.com> wrote:
Modify the sed filter to remove PIC addresses and ignore the first line which will always be the vdso. Also remove the tls filter, as glibc has had threaded support mainlined for many years now. If a user has a glibc this old, we don't have support for them elsewhere (udev, kernel).
We also cleanup the logical flow through this function and remove a lot of cruft that would always return true, or that didn't quite make sense.
Signed-off-by: Dave Reisner <d@falconindy.com>
Ack. -t
Simplify and fix a few bugs in the process. We rely solely on modinfo for obtaining information about module location, dependencies and firmware. Add a small wrapper function for modinfo that will always specify our $BASEDIR and $KERNELVERSION for us. Also, kill off HAS_MODULES. Since we have ADDED_MODULES, which contains all currently added modules, we can count the elements in this when it comes time to decide to create depmod files. Signed-off-by: Dave Reisner <d@falconindy.com> --- functions | 63 ++++++++++++++++++++++++++++++----------------------------- mkinitcpio | 2 +- 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/functions b/functions index 9adb5f8..1d2f2f6 100644 --- a/functions +++ b/functions @@ -39,6 +39,10 @@ in_array() { return 1 # Not Found } +kmodinfo() { + modinfo -b "$BASEDIR" -k "$KERNELVERSION" "$@" +} + auto_modules () { IFS=$'\n' read -rd '' -a mods < \ @@ -174,50 +178,47 @@ add_file () fi } -HAS_MODULES="n" declare -a ADDED_MODULES #modules are handled specially in order to enable autodetection add_module () { - local m fil path fw mod deps - m=$(get_module_name "${1}") - #find pattern - replace _ with [-_] to match either - fil="${m//_/[-_]}" + local module path fw firmware dep deps + module=${1%.ko*} #skip expensive stuff if this module has already been added - if in_array $m ${ADDED_MODULES[@]}; then - msg "module $m was already added" + if in_array $module ${ADDED_MODULES[@]}; then + msg "module $module was already added" return fi - found=0 - for path in $(find "${MODULEDIR}" -type f -name "${fil}.ko" -or -name "${fil}.ko.gz"); do - #get needed firmware files - for fw in $(/sbin/modinfo -F firmware "${path}"); do - [ -f "/lib/firmware/$fw" ] && add_file "/lib/firmware/$fw" + path=$(kmodinfo -0F filename "$module") + if [[ $path ]]; then + # get module firmware + IFS=',' read -r -d '' -a firmware < <(kmodinfo -0F firmware "$module") + for fw in "${firmware[@]}"; do + [[ -e $fw ]] && add_file "/lib/firmware/$fw" done - #get module depends - deps="$(/sbin/modinfo -F depends "${path}")" - for mod in ${deps//,/ }; do - if [ -n "${mod}" ]; then - add_module "${mod}" - fi + + # get module depends + IFS=',' read -r -d '' -a deps < <(kmodinfo -0F depends "$module") + for dep in "${deps[@]}"; do + add_module "$dep" done - HAS_MODULES="y" - ADDED_MODULES[${#ADDED_MODULES[*]}]="$m" - msg " adding module ${fil}" - add_file "${path}" && found=1 - done - if [ ${found} -eq 1 ]; then - #explicit module depends - case "$m" in - fat) add_module "nls_cp437" ;; - ocfs2) add_module "configfs" ;; - libcrc32c) add_module "crc32c"; add_module "crc32c_intel" ;; - esac + + ADDED_MODULES+=("$module") + msg " adding module $module" + add_file "$path" || return else - err "module '$m' not found" + err "module '$module' not found" + return fi + + #explicit module depends + case "$module" in + fat) add_module "nls_cp437" ;; + ocfs2) add_module "configfs" ;; + libcrc32c) add_module "crc32c"; add_module "crc32c_intel" ;; + esac } add_binary () diff --git a/mkinitcpio b/mkinitcpio index 74c16e3..22db364 100755 --- a/mkinitcpio +++ b/mkinitcpio @@ -274,7 +274,7 @@ for hook in ${HOOKS}; do fi done -if [ "${HAS_MODULES}" = "y" ]; then +if (( ${#ADDED_MODULES[*]} )); then echo ":: Generating module dependencies" for mod in $(grep "file /lib/modules/${KERNELVERSION}" ${FILELIST} | cut -d' ' -f2); do install -m 644 -D "${BASEDIR}${mod}" "${TMPDIR}${mod}" -- 1.7.5.4
On Mon, Jun 6, 2011 at 5:30 PM, Dave Reisner <d@falconindy.com> wrote:
Simplify and fix a few bugs in the process. We rely solely on modinfo for obtaining information about module location, dependencies and firmware. Add a small wrapper function for modinfo that will always specify our $BASEDIR and $KERNELVERSION for us.
Also, kill off HAS_MODULES. Since we have ADDED_MODULES, which contains all currently added modules, we can count the elements in this when it comes time to decide to create depmod files.
Signed-off-by: Dave Reisner <d@falconindy.com>
+ #explicit module depends + case "$module" in + fat) add_module "nls_cp437" ;; + ocfs2) add_module "configfs" ;; + libcrc32c) add_module "crc32c"; add_module "crc32c_intel" ;; + esac
Are these workaround for kernel bugs? Maybe a comment to explain would be in order? Is it fixed, in what version? Link to bugzilla? -t
On Mon, Jun 06, 2011 at 09:05:14PM +0200, Tom Gundersen wrote:
On Mon, Jun 6, 2011 at 5:30 PM, Dave Reisner <d@falconindy.com> wrote:
Simplify and fix a few bugs in the process. We rely solely on modinfo for obtaining information about module location, dependencies and firmware. Add a small wrapper function for modinfo that will always specify our $BASEDIR and $KERNELVERSION for us.
Also, kill off HAS_MODULES. Since we have ADDED_MODULES, which contains all currently added modules, we can count the elements in this when it comes time to decide to create depmod files.
Signed-off-by: Dave Reisner <d@falconindy.com>
+ #explicit module depends + case "$module" in + fat) add_module "nls_cp437" ;; + ocfs2) add_module "configfs" ;; + libcrc32c) add_module "crc32c"; add_module "crc32c_intel" ;; + esac
Are these workaround for kernel bugs? Maybe a comment to explain would be in order? Is it fixed, in what version? Link to bugzilla?
-t
No, these are things that intentionally a pain in the butt. In the case of libcrc32c, there's multiple providers of crc32c -- the C version as well as the intel hardware version. By putting a hard dependency on crc32c, you never get to use the hardware version (assuming your CPU supports it)[1]. Similar scenario for fat -- you need _a_ codepage, but there's no hard dependency on any particular codepage as it depends on how you mount the volume. I'm not at all familiar with the configfs requirement for ocfs2, but googling around, it seems that the two are often referred to in tandem. dave [1] http://www.mail-archive.com/linux-crypto@vger.kernel.org/msg02730.html
This was only ever used in the base layout, and it's not needed. devices will be present if we're using devtmpfs, and created for us by init if we mount on tmpfs. Also, this is part of our move towards using bsdcpio instead of gen_init_cpio, and as a side effect we can no longer support this. Any devices that need to be created should be done so by the runtime hooks, not the install time hooks. Signed-off-by: Dave Reisner <d@falconindy.com> --- functions | 17 ----------------- install/base | 5 ----- 2 files changed, 0 insertions(+), 22 deletions(-) diff --git a/functions b/functions index 1d2f2f6..48877f0 100644 --- a/functions +++ b/functions @@ -103,23 +103,6 @@ add_dir () fi } -# add_device /dev/foo type major minor [permissions] -add_device () -{ - if [ $# -ge 4 ]; then - local perms - perms="${5:-644}" - if ! grep -q "nod ${1}" "${FILELIST}"; then - add_dir $(get_dirname "${1}") - msg " adding node ${1}" - echo "nod ${1} ${perms} 0 0 ${2} ${3} ${4}" >> "${FILELIST}" - fi - else - err "invalid device node format: $@" - return 1 - fi -} - # what the hell does this do? add_symlink () { diff --git a/install/base b/install/base index 87d789d..bd1349b 100644 --- a/install/base +++ b/install/base @@ -14,11 +14,6 @@ build() add_dir "/usr/sbin" add_dir "/run" - add_device "/dev/null" c 1 3 - add_device "/dev/zero" c 1 5 - add_device "/dev/console" c 5 1 - add_device "/dev/mem" c 1 1 - add_binary /lib/initcpio/busybox /bin/busybox add_binary /sbin/modprobe add_binary /sbin/blkid -- 1.7.5.4
On Mon, Jun 6, 2011 at 5:30 PM, Dave Reisner <d@falconindy.com> wrote:
This was only ever used in the base layout, and it's not needed. devices will be present if we're using devtmpfs, and created for us by init if we mount on tmpfs.
Also, this is part of our move towards using bsdcpio instead of gen_init_cpio, and as a side effect we can no longer support this. Any devices that need to be created should be done so by the runtime hooks, not the install time hooks.
Signed-off-by: Dave Reisner <d@falconindy.com>
Ack. -t
This is never used by anything in the official repos. Kill it with fire. Signed-off-by: Dave Reisner <d@falconindy.com> --- functions | 10 ---------- 1 files changed, 0 insertions(+), 10 deletions(-) diff --git a/functions b/functions index 48877f0..9257d66 100644 --- a/functions +++ b/functions @@ -120,16 +120,6 @@ add_symlink () #fail quietly } -add_symlink2 () -{ - add_dir $(get_dirname ${1}) - add_dir $(get_dirname ${2}) - if ! grep -q "slink ${1} " "${FILELIST}"; then - msg " adding link ${1} -> ${2}" - echo "slink ${1} ${2} 777 0 0" >> "${FILELIST}" - fi -} - add_file () { local fil lnk dir dest -- 1.7.5.4
This is a departure from using gen_init_cpio, which proved to be a huge bottleneck in performance. Tests for existance change from being a call to grep, to a simple shell test. In the process, we have to modify the behavior of the -s option, and we lose the -a option. Signed-off-by: Dave Reisner <d@falconindy.com> --- functions | 41 +++++++++++++---------------- mkinitcpio | 76 ++++++++++++++++++++++++++++------------------------- mkinitcpio.5.txt | 7 +--- 3 files changed, 60 insertions(+), 64 deletions(-) diff --git a/functions b/functions index 9257d66..0871419 100644 --- a/functions +++ b/functions @@ -80,12 +80,12 @@ checked_modules () add_full_dir () { - if [ -n "${1}" -a -d "${1}" ]; then - for f in ${1}/*; do - if [ -d "${f}" ]; then - add_full_dir "${f}" + if [[ -n $1 && -d $1 ]]; then + for f in "$1"/*; do + if [[ -d "$f" ]]; then + add_full_dir "$f" else - add_file "${f}" + add_file "$f" fi done fi @@ -93,28 +93,23 @@ add_full_dir () add_dir () { - #skip root directory and "." for relative directories... i.e. /foo/bar/./blah - if [ -n "${1}" -a "${1}" != "/" -a "${1}" != "." ]; then - if ! grep -q "dir ${1} " "${FILELIST}"; then - add_dir $(get_dirname "${1}") - msg " adding dir ${1}" - echo "dir ${1} 755 0 0" >> "${FILELIST}" - fi + if [[ ! -e "$TMPDIR/root/$1" ]]; then + msg " adding dir ${1}" + command install -dm755 "$TMPDIR/root/$1" fi } -# what the hell does this do? add_symlink () { local fil dest dir - if [ -h ${1} ]; then + if [[ -h $1 ]]; then fil="${1##$BASEDIR}" dest="${2##$BASEDIR}" add_dir $(get_dirname "${dest}") add_dir $(get_dirname "${fil}") - if ! grep -q "slink ${fil} " "${FILELIST}"; then + if [[ ! -e "$TMPDIR/root/$dest" ]]; then msg " adding link ${fil} -> ${dest}" - echo "slink ${fil} ${dest} $(stat -c '%a' ${1}) 0 0" >> "${FILELIST}" + ln -s "$dest" "$TMPDIR/root/$fil" fi fi #fail quietly @@ -123,27 +118,27 @@ add_symlink () add_file () { local fil lnk dir dest - if [ -f "${1}" ]; then - fil="${1}" + if [[ -f "$1" ]]; then + fil=$1 lnk=$(readlink -f "${fil}") - if [ -n "${lnk}" ]; then + if [[ ${lnk} ]]; then add_symlink "${fil}" "${lnk}" fil="${lnk}" fi if [[ $2 ]]; then - dest="${2}" + dest=$2 else dest="${fil##$BASEDIR}" - if [ "${dest}" = "${dest#/}" ]; then + if [[ "${dest}" = "${dest#/}" ]]; then dest="/${dest}" fi fi add_dir $(get_dirname "${dest}") - if ! grep -q "file ${dest} " "${FILELIST}"; then + if [[ ! -e $TMPDIR/root/$dest ]]; then msg " adding file ${dest}" - echo "file ${dest} ${fil} $(stat -c '%a' ${fil}) 0 0" >> "${FILELIST}" + command install -Dm$(stat -c '%a' "$fil") "$fil" "$TMPDIR/root/$dest" fi else err "file '${1}' does not exist" diff --git a/mkinitcpio b/mkinitcpio index 22db364..89523d6 100755 --- a/mkinitcpio +++ b/mkinitcpio @@ -10,11 +10,11 @@ # in case of embedded spaces, quote all path names and string comparisons # +shopt -s extglob # Settings TMPDIR="$(mktemp -d /tmp/mkinitcpio.XXXXXX)" BASEDIR="" -FILELIST="${TMPDIR}/filelist" MESSAGEFILE="${TMPDIR}/message" KERNELVERSION="$(uname -r)" FUNCTIONS="functions" @@ -24,7 +24,6 @@ INSTDIR="install" MODULE_FILE="" SAVELIST="" GENIMG="" -APPEND="" PRESET="" MESSAGE="" SKIPHOOKS=() @@ -49,7 +48,7 @@ usage () echo "${APPNAME}: usage" echo " -c CONFIG Use CONFIG file. default: /etc/mkinitcpio.conf" echo " -k KERNELVERSION Use KERNELVERSION. default: $(uname -r)" - echo " -s NAME Save filelist. default: no" + echo " -s Save build directory. default: no" echo " -b BASEDIR Use BASEDIR. default: /" echo " -g IMAGE Generate a cpio image as IMAGE. default: no" echo " -a NAME Append to an existing filelist. default: no" @@ -67,7 +66,11 @@ usage () cleanup () { - [ -n "${TMPDIR}" -a -d "${TMPDIR}" ] && rm -rf ${TMPDIR} + if [[ $SAVELIST ]]; then + echo ":: build directory saved in $TMPDIR" + else + rm -rf ${TMPDIR} + fi } sighandler() { @@ -77,7 +80,7 @@ sighandler() { trap sighandler TERM INT -while getopts ':c:k:s:b:g:a:p:m:vH:LMhS:' arg; do +while getopts ':c:k:sb:g:p:m:vH:LMhS:' arg; do if [ "${OPTARG#-}" != "${OPTARG}" ]; then echo "error: optional argument to '-${arg}' begins with a '-'" echo " you probably don't want this....aborting." @@ -86,10 +89,9 @@ while getopts ':c:k:s:b:g:a:p:m:vH:LMhS:' arg; do case "${arg}" in c) CONFIG="${OPTARG}" ;; k) KERNELVERSION="${OPTARG}" ;; - s) SAVELIST="y"; FILELIST="${OPTARG}" ;; + s) SAVELIST="y"; ;; b) BASEDIR="${OPTARG}" ;; g) GENIMG="${OPTARG}" ;; - a) APPEND="y"; SAVELIST="y"; FILELIST="${OPTARG}" ;; p) PRESET="${OPTARG}" ;; m) MESSAGE="${OPTARG}" ;; v) QUIET="n" ;; @@ -185,6 +187,15 @@ BASEDIR="${BASEDIR%/}" MODULEDIR="${BASEDIR}/lib/modules/${KERNELVERSION}" +if [[ $GENIMG ]]; then + IMGPATH=$(readlink -f "$GENIMG") + if [[ -z $IMGPATH || ! -w ${IMGPATH%/*} ]]; then + echo "error: unable to write to path: '$GENIMG'" + cleanup + exit 1 + fi +fi + if [ -n "${BASEDIR}" ]; then if [ "${BASEDIR}" = "${BASEDIR#/}" ]; then BASEDIR="$(pwd)/${BASEDIR}" @@ -202,19 +213,6 @@ if [ ! -f "${CONFIG}" ]; then fi . "${CONFIG}" -if [ -f "${FILELIST}" -a -z "${APPEND}" ]; then - if [ -z "${SAVELIST}" ]; then - rm ${FILELIST} - touch "${FILELIST}" - else - echo "destination file list '${FILELIST}' exists - remove before running" - cleanup - exit 1 - fi -else - touch "${FILELIST}" -fi - BASEDIR=$(echo ${BASEDIR} | tr -s /) MODULEDIR=$(echo ${MODULEDIR} | tr -s /) @@ -276,31 +274,37 @@ done if (( ${#ADDED_MODULES[*]} )); then echo ":: Generating module dependencies" - for mod in $(grep "file /lib/modules/${KERNELVERSION}" ${FILELIST} | cut -d' ' -f2); do - install -m 644 -D "${BASEDIR}${mod}" "${TMPDIR}${mod}" - done - /sbin/depmod -b ${TMPDIR} ${KERNELVERSION} - for dmfile in modules.{dep,alias,symbols}.bin; do - add_file "${TMPDIR}/lib/modules/${KERNELVERSION}/$dmfile" "/lib/modules/${KERNELVERSION}/$dmfile" - done + /sbin/depmod -b "${TMPDIR}/root" "${KERNELVERSION}" + rm "$TMPDIR/root/lib/modules/$KERNELVERSION"/modules.!(dep.bin|alias.bin|symbols.bin) fi status=0 +declare -a pipesave if [ -n "${GENIMG}" ]; then echo ":: Generating image '${GENIMG}'" - shopt -s -o pipefail [ ${COMPRESSION} = "xz" ] && COMPRESSION_OPTIONS="${COMPRESSION_OPTIONS} --check=crc32" - if ! /sbin/gen_init_cpio ${FILELIST} | ${COMPRESSION} ${COMPRESSION_OPTIONS} > "${GENIMG}"; then - echo ":: Image generation FAILED" - status=1 - else - echo ":: Image generation successful" - status=0 + + pushd "$TMPDIR/root" >/dev/null + find . -print0 | bsdcpio -0oH newc | $COMPRESSION ${COMPRESSION_OPTIONS} > "$IMGPATH" + pipesave=("${PIPESTATUS[@]}") # save immediately + popd >/dev/null + + if (( pipesave[0] )); then + errmsg="find reported an error" + elif (( pipesave[1] )); then + errmsg="bsdcpio reported an error" + elif (( pipesave[2] )); then + errmsg="$COMPRESSION reported an error" fi - if [ -z "${SAVELIST}" ]; then - rm ${FILELIST} + if [[ $errmsg ]]; then + echo ":: Image generation FAILED ($errmsg)" + status=1 + else + echo ":: Image generation successful" + status=0 fi + else echo ":: Dry run complete, use -g IMAGE to generate a real image" fi diff --git a/mkinitcpio.5.txt b/mkinitcpio.5.txt index 1c095dc..a9128a0 100644 --- a/mkinitcpio.5.txt +++ b/mkinitcpio.5.txt @@ -21,8 +21,8 @@ Options *-k* 'kernelversion':: Use 'kernelversion'. Default is the current running kernel. -*-s* 'filelist':: - Saves a list of all the files in the initial ramdisk in 'filelist'. Default: no; This means the filelist will not be retained if this option isn't specified. Useful for debugging purposes. +*-s* ;; + Saves the build directory for the initial ramdisk. Default: no; This means the directory will not be retained if this option isn't specified. Useful for debugging purposes. *-b* 'basedir':: Use 'basedir' as a starting point for gathering information about the currently running system. Default: /. @@ -30,9 +30,6 @@ Options *-g* 'filename':: Generate a CPIO image as 'filename'. Default: no; this means nothing will be written to the filesystem unless this option is specified. -*-a* 'filelist':: - Append to an existing 'filelist'. Default no. - *-p* 'preset':: Build initial ramdisk according to specified 'preset'. Presets are found in /etc/mkinitcpio.d -- 1.7.5.4
On Mon, Jun 6, 2011 at 5:30 PM, Dave Reisner <d@falconindy.com> wrote:
This is a departure from using gen_init_cpio, which proved to be a huge bottleneck in performance. Tests for existance change from being a call to grep, to a simple shell test.
In the process, we have to modify the behavior of the -s option, and we lose the -a option.
Signed-off-by: Dave Reisner <d@falconindy.com>
Ack. Comments inline. -t
@@ -93,28 +93,23 @@ add_full_dir ()
add_dir () { - #skip root directory and "." for relative directories... i.e. /foo/bar/./blah - if [ -n "${1}" -a "${1}" != "/" -a "${1}" != "." ]; then - if ! grep -q "dir ${1} " "${FILELIST}"; then - add_dir $(get_dirname "${1}") - msg " adding dir ${1}" - echo "dir ${1} 755 0 0" >> "${FILELIST}" - fi + if [[ ! -e "$TMPDIR/root/$1" ]]; then + msg " adding dir ${1}" + command install -dm755 "$TMPDIR/root/$1" fi }
-# what the hell does this do?
Maybe an replacement comment to explain?
add_symlink () { local fil dest dir - if [ -h ${1} ]; then + if [[ -h $1 ]]; then fil="${1##$BASEDIR}" dest="${2##$BASEDIR}" add_dir $(get_dirname "${dest}") add_dir $(get_dirname "${fil}") - if ! grep -q "slink ${fil} " "${FILELIST}"; then + if [[ ! -e "$TMPDIR/root/$dest" ]]; then msg " adding link ${fil} -> ${dest}" - echo "slink ${fil} ${dest} $(stat -c '%a' ${1}) 0 0" >> "${FILELIST}" + ln -s "$dest" "$TMPDIR/root/$fil" fi fi #fail quietly
@@ -49,7 +48,7 @@ usage () echo "${APPNAME}: usage" echo " -c CONFIG Use CONFIG file. default: /etc/mkinitcpio.conf" echo " -k KERNELVERSION Use KERNELVERSION. default: $(uname -r)" - echo " -s NAME Save filelist. default: no" + echo " -s Save build directory. default: no" echo " -b BASEDIR Use BASEDIR. default: /" echo " -g IMAGE Generate a cpio image as IMAGE. default: no" echo " -a NAME Append to an existing filelist. default: no"
This should be deleted too, no?
On Mon, Jun 06, 2011 at 09:13:50PM +0200, Tom Gundersen wrote:
On Mon, Jun 6, 2011 at 5:30 PM, Dave Reisner <d@falconindy.com> wrote:
This is a departure from using gen_init_cpio, which proved to be a huge bottleneck in performance. Tests for existance change from being a call to grep, to a simple shell test.
In the process, we have to modify the behavior of the -s option, and we lose the -a option.
Signed-off-by: Dave Reisner <d@falconindy.com>
Ack. Comments inline.
-t
@@ -93,28 +93,23 @@ add_full_dir ()
add_dir () { - #skip root directory and "." for relative directories... i.e. /foo/bar/./blah - if [ -n "${1}" -a "${1}" != "/" -a "${1}" != "." ]; then - if ! grep -q "dir ${1} " "${FILELIST}"; then - add_dir $(get_dirname "${1}") - msg " adding dir ${1}" - echo "dir ${1} 755 0 0" >> "${FILELIST}" - fi + if [[ ! -e "$TMPDIR/root/$1" ]]; then + msg " adding dir ${1}" + command install -dm755 "$TMPDIR/root/$1" fi }
-# what the hell does this do?
Maybe an replacement comment to explain?
I thought it was quite obvious what it did, both before and after ;) Every function in the 'functions' file should be commented, imo, since it serves as sort of an API for install hooks. It's on my TODO list.
add_symlink () { local fil dest dir - if [ -h ${1} ]; then + if [[ -h $1 ]]; then fil="${1##$BASEDIR}" dest="${2##$BASEDIR}" add_dir $(get_dirname "${dest}") add_dir $(get_dirname "${fil}") - if ! grep -q "slink ${fil} " "${FILELIST}"; then + if [[ ! -e "$TMPDIR/root/$dest" ]]; then msg " adding link ${fil} -> ${dest}" - echo "slink ${fil} ${dest} $(stat -c '%a' ${1}) 0 0" >> "${FILELIST}" + ln -s "$dest" "$TMPDIR/root/$fil" fi fi #fail quietly
@@ -49,7 +48,7 @@ usage () echo "${APPNAME}: usage" echo " -c CONFIG Use CONFIG file. default: /etc/mkinitcpio.conf" echo " -k KERNELVERSION Use KERNELVERSION. default: $(uname -r)" - echo " -s NAME Save filelist. default: no" + echo " -s Save build directory. default: no" echo " -b BASEDIR Use BASEDIR. default: /" echo " -g IMAGE Generate a cpio image as IMAGE. default: no" echo " -a NAME Append to an existing filelist. default: no"
This should be deleted too, no?
Indeed. Thanks. d
Signed-off-by: Dave Reisner <d@falconindy.com> --- mkinitcpio.conf | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/mkinitcpio.conf b/mkinitcpio.conf index 52abd56..b1fd521 100644 --- a/mkinitcpio.conf +++ b/mkinitcpio.conf @@ -60,7 +60,8 @@ HOOKS="base udev autodetect pata scsi sata filesystems" # Use this to compress the initramfs image. With kernels earlier than # 2.6.30, only gzip is supported, which is also the default. Newer kernels # support gzip, bzip2 and lzma. Kernels 2.6.38 and later support xz -# compression. +# compression. LZO support is available by installing the 'lzop' package +# and speciofying 'lzop' as COMPRESSION. #COMPRESSION="gzip" #COMPRESSION="bzip2" #COMPRESSION="lzma" -- 1.7.5.4
On Mon, Jun 6, 2011 at 5:30 PM, Dave Reisner <d@falconindy.com> wrote:
Signed-off-by: Dave Reisner <d@falconindy.com>
Ack. -t
Signed-off-by: Dave Reisner <d@falconindy.com> --- mkinitcpio | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mkinitcpio b/mkinitcpio index 89523d6..bf9817a 100755 --- a/mkinitcpio +++ b/mkinitcpio @@ -41,7 +41,7 @@ fi # works around undetected problems like in #8448 PATH="${PATH}:/sbin:/usr/sbin" -APPNAME=$(basename "${0}") +APPNAME=${0##*/} usage () { @@ -108,7 +108,7 @@ while getopts ':c:k:sb:g:p:m:vH:LMhS:' arg; do exit 0 ;; L) echo "Available hooks: " for h in ${INSTDIR}/*; do - echo " $(basename ${h})" + echo " ${h##*/}" done cleanup exit 0 ;; @@ -213,8 +213,8 @@ if [ ! -f "${CONFIG}" ]; then fi . "${CONFIG}" -BASEDIR=$(echo ${BASEDIR} | tr -s /) -MODULEDIR=$(echo ${MODULEDIR} | tr -s /) +BASEDIR=${BASEDIR//+(\/)//} +MODULEDIR=${MODULEDIR//+(\/)//} . "${FUNCTIONS}" -- 1.7.5.4
update the example.preset to show this syntax as an alternative Signed-off-by: Dave Reisner <d@falconindy.com> --- mkinitcpio | 29 ++++++++++++++++++++++++++++- mkinitcpio.d/example.preset | 2 +- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/mkinitcpio b/mkinitcpio index bf9817a..0706d0d 100755 --- a/mkinitcpio +++ b/mkinitcpio @@ -78,6 +78,25 @@ sighandler() { exit 1 } +get_kernver() { + local kernel=$1 + + if [[ "${kernel:0:1}" != / ]]; then + echo $kernel + return 0 + fi + + [[ -r "$kernel" ]] || return 1 + + read _ kernver < <(file -b "$BASEDIR$kernel" | grep -o 'version [^ ]\+') + if [[ "$kernver" && -e "$BASEDIR/lib/modules/$kernver" ]]; then + echo "$kernver" + return 0 + fi + + return 1 +} + trap sighandler TERM INT while getopts ':c:k:sb:g:p:m:vH:LMhS:' arg; do @@ -88,7 +107,7 @@ while getopts ':c:k:sb:g:p:m:vH:LMhS:' arg; do fi case "${arg}" in c) CONFIG="${OPTARG}" ;; - k) KERNELVERSION="${OPTARG}" ;; + k) optkver=$OPTARG ;; s) SAVELIST="y"; ;; b) BASEDIR="${OPTARG}" ;; g) GENIMG="${OPTARG}" ;; @@ -120,6 +139,14 @@ while getopts ':c:k:sb:g:p:m:vH:LMhS:' arg; do done shift $((${OPTIND} - 1)) +if [[ $optkver ]]; then + if ! KERNELVERSION=$(get_kernver "$optkver"); then + echo "error: '$optkver' is an invalid kernel specifier" + cleanup + exit 1 + fi +fi + # use preset $PRESET if [ -n "${PRESET}" ]; then if [ -f "${PRESETDIR}/${PRESET}.preset" ]; then diff --git a/mkinitcpio.d/example.preset b/mkinitcpio.d/example.preset index 3fb32f1..93a8f92 100644 --- a/mkinitcpio.d/example.preset +++ b/mkinitcpio.d/example.preset @@ -7,7 +7,7 @@ PRESETS=('default' 'fallback') # note for distribution kernels: this should be in a separate file # and read like this: # . /etc/mkinitcpio.d/exmaple.kver -ALL_kver='2.6.24-ARCH' +ALL_kver='/boot/vmlinuz26' ALL_config='/etc/mkinitcpio.conf' # presetname_kver - the kernel version (omit if ALL_kver should be used) -- 1.7.5.4
On Mon, Jun 6, 2011 at 5:30 PM, Dave Reisner <d@falconindy.com> wrote:
update the example.preset to show this syntax as an alternative
Signed-off-by: Dave Reisner <d@falconindy.com>
Nice. Ack. -t
This mainly consists of removing all traces of eval and building the options into an array instead a simple variable. Signed-off-by: Dave Reisner <d@falconindy.com> --- mkinitcpio | 57 +++++++++++++++++++++++++++++++-------------------------- 1 files changed, 31 insertions(+), 26 deletions(-) diff --git a/mkinitcpio b/mkinitcpio index 0706d0d..d70914a 100755 --- a/mkinitcpio +++ b/mkinitcpio @@ -148,53 +148,58 @@ if [[ $optkver ]]; then fi # use preset $PRESET -if [ -n "${PRESET}" ]; then - if [ -f "${PRESETDIR}/${PRESET}.preset" ]; then +if [[ $PRESET ]]; then + if [[ -f "$PRESETDIR/$PRESET.preset" ]]; then # Use -b, -m and -v options specified earlier - PRESET_MKOPTS="${0}" - [ -n "${BASEDIR}" ] && PRESET_MKOPTS="${PRESET_MKOPTS} -b ${BASEDIR}" - [ -n "${MESSAGE}" ] && PRESET_MKOPTS="${PRESET_MKOPTS} -m \"${MESSAGE}\"" - [ "${QUIET}" = "n" ] && PRESET_MKOPTS="${PRESET_MKOPTS} -v" + declare -a preset_mkopts preset_cmd + [[ $BASEDIR ]] && preset_mkopts+=(-b "$BASEDIR") + [[ $MESSAGE ]] && preset_mkopts+=(-m "$MESSAGE") + [[ "$QUIET" = n ]] && preset_mkopts+=(-v) # Build all images - . ${PRESETDIR}/${PRESET}.preset - for p in ${PRESETS[@]}; do + . "$PRESETDIR/$PRESET.preset" + for p in "${PRESETS[@]}"; do echo "==> Building image \"${p}\"" - PRESET_CMD="${PRESET_MKOPTS}" + preset_cmd=("${preset_mkopts[@]}") - eval "PRESET_KVER=\"\${${p}_kver}\"" - [ -z "${PRESET_KVER}" ] && PRESET_KVER="${ALL_kver}" - eval "PRESET_CONFIG=\"\${${p}_config}\"" - [ -z "${PRESET_CONFIG}" ] && PRESET_CONFIG="${ALL_config}" - eval "PRESET_IMAGE=\"\${${p}_image}\"" - eval "PRESET_OPTIONS=\"\${${p}_options}\"" + preset_kver=${p}_kver + preset_kver=${!preset_kver:-$ALL_kver} - if [ -n "${PRESET_KVER}" ]; then - PRESET_CMD="${PRESET_CMD} -k ${PRESET_KVER}" + preset_config=${p}_config + preset_config=${!preset_config:-$ALL_config} + + preset_image=${p}_image + preset_image=${!preset_image} + + preset_options=${p}_options + preset_options=${!preset_options} + + if [[ $preset_kver ]]; then + preset_cmd+=(-k "$preset_kver") else echo "==> No kernel version specified. Skipping image \"${p}\"." continue fi - if [ -n "${PRESET_CONFIG}" ]; then - PRESET_CMD="${PRESET_CMD} -c ${PRESET_CONFIG}" + if [[ $preset_config ]]; then + preset_cmd+=(-c "$preset_config") else echo "==> No configuration file specified. Skipping image \"${p}\"." continue fi - if [ -n "${PRESET_IMAGE}" ]; then - PRESET_CMD="${PRESET_CMD} -g ${PRESET_IMAGE}" + if [[ $preset_image ]]; then + preset_cmd+=(-g "$preset_image") else echo "==> No image file specified. Skipping image \"${p}\"." continue fi - if [ -n "${PRESET_OPTIONS}" ]; then - PRESET_CMD="${PRESET_CMD} ${PRESET_OPTIONS}" + if [[ $preset_options ]]; then + preset_cmd+=($preset_options) # intentional word splitting fi - echo "==> Running command: ${PRESET_CMD}" - if eval ${PRESET_CMD}; then + echo "==> Running command: $0 ${preset_cmd[@]}" + if "$0" "${preset_cmd[@]}"; then echo "==> SUCCESS" else echo "==> FAIL" @@ -203,7 +208,7 @@ if [ -n "${PRESET}" ]; then cleanup exit 0 else - echo "Preset ${PRESET} does not exist. Exiting." + echo "Preset $PRESET does not exist. Exiting." cleanup exit 1 fi -- 1.7.5.4
On Mon, Jun 6, 2011 at 5:30 PM, Dave Reisner <d@falconindy.com> wrote:
1) We have to dump a whole bunch of stuff in /tmp. This is as little as 3-4Mb, but might be as much as 20mb. I will likely add an option to change the location of the tmpdir.
I'm sure I will regret asking, but: in what use-case is 20mb in /tmp a problem? -t
On Mon, Jun 06, 2011 at 07:48:52PM +0200, Tom Gundersen wrote:
On Mon, Jun 6, 2011 at 5:30 PM, Dave Reisner <d@falconindy.com> wrote:
1) We have to dump a whole bunch of stuff in /tmp. This is as little as 3-4Mb, but might be as much as 20mb. I will likely add an option to change the location of the tmpdir.
I'm sure I will regret asking, but: in what use-case is 20mb in /tmp a problem?
-t
I don't know, and I don't want to know. If I've learned anything in the past few months of digging into Arch, it's that I will never cease to be amazed by some of the bizzare things people will do. Just planning for the worst, really. d
participants (2)
-
Dave Reisner
-
Tom Gundersen