[arch-projects] [PATCH 00/13] minor features and bugfixes
This is a bunch of nitpicks, but there are a few new features thrown in. Annotations along the way... Dave Reisner (13): install/consolefont: cleanup and refactor keymap/consolefont: source rc.conf properly from $BASEDIR keymap: simplify unicode detection cleanup and bashify install hooks functions: allow ignoring errors on module addition ensure local scoping of variables base: remove superfluous leading / functions: refactor get_{base,dir}name init: support breaks before and after mounting root mkinitcpio: simplify setting of SKIPHOOKS mkinitcpio: remove extra newline in errmsg init: allow /run to be mounted with exec perms add -A option for adding hooks during build functions | 47 +++++++++---- hooks/keymap | 11 +-- init | 11 ++- install/base | 4 +- install/btrfs | 15 ++-- install/consolefont | 56 ++++++++------- install/dsdt | 21 ++---- install/filesystems | 2 +- install/fw | 29 +++----- install/ide | 30 +++----- install/keymap | 24 ++++--- install/memdisk | 19 +++--- install/net | 195 +++++++++++++++++++++++++-------------------------- install/pata | 4 +- install/pcmcia | 29 ++++---- install/resume | 19 ++--- install/sata | 4 +- install/scsi | 4 +- install/sleep | 27 +++---- install/udev | 33 ++++----- install/usb | 32 ++++----- install/usbinput | 30 +++----- mkinitcpio | 21 +++--- mkinitcpio.5.txt | 5 ++ 24 files changed, 327 insertions(+), 345 deletions(-) -- 1.7.6
* Provide support for uncompressed font files as well as compressed
* Avoiding using an unnecessary temp file
* Support $BASEDIR
* Warn when no font is found
* Only add the runtime hook if a font is added
Signed-off-by: Dave Reisner
This is partially in response to FS#24685, which should hopefully cut
back on configuration duplication on non-sysvinit systems. This does,
however, also fix a bug with keymap/consolefont pulling the wrong
rc.conf when BASEDIR is not '/' or unset.
Signed-off-by: Dave Reisner
Signed-off-by: Dave Reisner
This introduces no logical code changes -- this is purely a syntactical
cleanup and standardization across the build hooks. All hooks get the
same treatment, adhering to the following style:
build() {
instructions
}
help() {
cat <
We conditionally, but naively, add modules in some of our install hooks,
but the kernel may not have these. Note that these modules can fail
silently by detecting a '?' suffix on the module name. In conjunction with
this, the add_module function now takes a flag, -t or --try, which will
ignore module not found errors from modinfo. The config file will also
support this syntax.
Signed-off-by: Dave Reisner
Also make sure that simple variables are declared as null strings.
Signed-off-by: Dave Reisner
The doubled up leading slashes annoy me in the verbose output.
Signed-off-by: Dave Reisner
From: Dave Reisner
Add in 'premount' and 'postmount' as trigger conditions, but also leave
in the old 'y' value as a synonym for premount.
Signed-off-by: Dave Reisner
Signed-off-by: Dave Reisner
Signed-off-by: Dave Reisner
We'll need this to do some shutdown magic of pivoting and umounting root
on shutdown. This is already done in initscripts.
Signed-off-by: Dave Reisner
Signed-off-by: Dave Reisner
Dave Reisner, 2011-07-23 02:21:
* Provide support for uncompressed font files as well as compressed * Avoiding using an unnecessary temp file * Support $BASEDIR * Warn when no font is found * Only add the runtime hook if a font is added
Signed-off-by: Dave Reisner
--- install/consolefont | 52 ++++++++++++++++++++++++++------------------------ 1 files changed, 27 insertions(+), 25 deletions(-) diff --git a/install/consolefont b/install/consolefont index 395387b..a0a5088 100644 --- a/install/consolefont +++ b/install/consolefont @@ -1,32 +1,34 @@ -# vim: set ft=sh: +#!/bin/bash + +build() { + local file ext
-build() -{ - MODULES="" - BINARIES="" - FILES="" - SCRIPT="consolefont" eval "$(grep -e "^CONSOLEFONT=" /etc/rc.conf)" - if [ -n "$CONSOLEFONT" ]; then - if [ -e /usr/share/kbd/consolefonts/$CONSOLEFONT.psfu.gz ]; then - CONSOLEFONT_FILE_GZ="/usr/share/kbd/consolefonts/$CONSOLEFONT.psfu.gz" - CONSOLEFONT_FILE="$(mktemp ${TMPDIR}/consolefont.psfu.XXXXXX)" - zcat ${CONSOLEFONT_FILE_GZ}> ${CONSOLEFONT_FILE} - add_file ${CONSOLEFONT_FILE} /consolefont.psfu - elif [ -e /usr/share/kbd/consolefonts/$CONSOLEFONT.psf.gz ]; then - CONSOLEFONT_FILE_GZ="/usr/share/kbd/consolefonts/$CONSOLEFONT.psf.gz" - CONSOLEFONT_FILE="$(mktemp ${TMPDIR}/consolefont.psf.XXXXXX)" - zcat ${CONSOLEFONT_FILE_GZ}> ${CONSOLEFONT_FILE} - add_file ${CONSOLEFONT_FILE} /consolefont.psf - else - echo "consolefont: Font file does not exist or does not end with .psf.gz or .psfu.gz." - fi + if [[ -n "$CONSOLEFONT" ]]; then + for file in "$BASEDIR/usr/share/kbd/consolefonts/$CONSOLEFONT".psf?(u)?(.gz); do bash: syntax error near unexpected token `(' Fix: for file in "$BASEDIR/usr/share/kbd/consolefonts/$CONSOLEFONT".psf{,u}.gz; do
+ if [[ -e $file ]]; then + [[ $file =~ psfu? ]]&& ext=${BASH_REMATCH[0]} + if [[ $file = *.gz ]]; then + gzip -cd "$file"> "$BUILDROOT/consolefont.$ext" + else + add_file "${file#$BASEDIR}" "/consolefont.$ext" + fi + SCRIPT=consolefont + return 0 + fi + done + error "consolefont: requested font not found: \`%s'" "$CONSOLEFONT" + return 1 + else + warning "consolefont: no font found in %s/etc/rc.conf" "${BASEDIR%/}" + return 1 fi }
-help () -{ -cat<
-- Kurt
Kurt J. Bosch, 2011-07-23 14:43:
Dave Reisner, 2011-07-23 02:21:
* Provide support for uncompressed font files as well as compressed * Avoiding using an unnecessary temp file * Support $BASEDIR * Warn when no font is found * Only add the runtime hook if a font is added
Signed-off-by: Dave Reisner
--- install/consolefont | 52 ++++++++++++++++++++++++++------------------------ 1 files changed, 27 insertions(+), 25 deletions(-) diff --git a/install/consolefont b/install/consolefont index 395387b..a0a5088 100644 --- a/install/consolefont +++ b/install/consolefont @@ -1,32 +1,34 @@ -# vim: set ft=sh: +#!/bin/bash + +build() { + local file ext
-build() -{ - MODULES="" - BINARIES="" - FILES="" - SCRIPT="consolefont" eval "$(grep -e "^CONSOLEFONT=" /etc/rc.conf)" - if [ -n "$CONSOLEFONT" ]; then - if [ -e /usr/share/kbd/consolefonts/$CONSOLEFONT.psfu.gz ]; then - CONSOLEFONT_FILE_GZ="/usr/share/kbd/consolefonts/$CONSOLEFONT.psfu.gz" - CONSOLEFONT_FILE="$(mktemp ${TMPDIR}/consolefont.psfu.XXXXXX)" - zcat ${CONSOLEFONT_FILE_GZ}> ${CONSOLEFONT_FILE} - add_file ${CONSOLEFONT_FILE} /consolefont.psfu - elif [ -e /usr/share/kbd/consolefonts/$CONSOLEFONT.psf.gz ]; then - CONSOLEFONT_FILE_GZ="/usr/share/kbd/consolefonts/$CONSOLEFONT.psf.gz" - CONSOLEFONT_FILE="$(mktemp ${TMPDIR}/consolefont.psf.XXXXXX)" - zcat ${CONSOLEFONT_FILE_GZ}> ${CONSOLEFONT_FILE} - add_file ${CONSOLEFONT_FILE} /consolefont.psf - else - echo "consolefont: Font file does not exist or does not end with .psf.gz or .psfu.gz." - fi + if [[ -n "$CONSOLEFONT" ]]; then + for file in "$BASEDIR/usr/share/kbd/consolefonts/$CONSOLEFONT".psf?(u)?(.gz); do bash: syntax error near unexpected token `(' Fix: for file in "$BASEDIR/usr/share/kbd/consolefonts/$CONSOLEFONT".psf{,u}.gz; do Or maybe even that was intended: for file in "$BASEDIR/usr/share/kbd/consolefonts/$CONSOLEFONT"{,.psf,.psfu}.gz; do
+ if [[ -e $file ]]; then + [[ $file =~ psfu? ]]&& ext=${BASH_REMATCH[0]} + if [[ $file = *.gz ]]; then + gzip -cd "$file"> "$BUILDROOT/consolefont.$ext" + else + add_file "${file#$BASEDIR}" "/consolefont.$ext" + fi + SCRIPT=consolefont + return 0 + fi + done + error "consolefont: requested font not found: \`%s'" "$CONSOLEFONT" + return 1 + else + warning "consolefont: no font found in %s/etc/rc.conf" "${BASEDIR%/}" + return 1 fi }
-help () -{ -cat<
-- Kurt
participants (2)
-
Dave Reisner
-
Kurt J. Bosch