summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Bächler <thomas@archlinux.org>2011-06-27 10:18:41 +0200
committerThomas Bächler <thomas@archlinux.org>2011-06-27 10:18:41 +0200
commita5eb24e544576b23e842874f510c2a7811e95ea3 (patch)
tree6aa89315786f91eb86292a95ae1c1408027b0a4a
parentec8151237b99dc28a6efd155c571d9204cb436c5 (diff)
parentf09aff2cec29806356b800e1c13b711668b1fc26 (diff)
downloadmkinitcpio-a5eb24e544576b23e842874f510c2a7811e95ea3.tar.gz
mkinitcpio-a5eb24e544576b23e842874f510c2a7811e95ea3.tar.xz
Merge branch 'working'
-rw-r--r--functions12
-rw-r--r--install/base4
-rwxr-xr-xmkinitcpio7
3 files changed, 12 insertions, 11 deletions
diff --git a/functions b/functions
index ee6921c..9c095bc 100644
--- a/functions
+++ b/functions
@@ -182,7 +182,7 @@ add_module() {
# get module firmware
while read -r -d '' fw; do
if [[ -e "$BASEDIR/lib/firmware/$fw" ]]; then
- add_file "$BASEDIR/lib/firmware/$fw"
+ add_file "/lib/firmware/$fw"
fi
done < <(kmodinfo -0F firmware "$module")
@@ -193,7 +193,7 @@ add_module() {
done
ADDED_MODULES+=("${module//-/_}")
- add_file "$path" || return
+ add_file "${path#$BASEDIR}" || return
else
error "module '$module' not found"
return 1
@@ -221,7 +221,7 @@ _add_file() {
[[ -e "$BUILDROOT$1" ]] && return $EEXIST
(( QUIET )) || plain "adding file: %s" "$1"
- install -Dm$3 "$2" "$BUILDROOT$1"
+ command install -Dm$3 "$2" "$BUILDROOT$1"
}
_add_dir() {
@@ -265,7 +265,7 @@ add_binary() {
mode=$(stat -c %a "$binary")
# always add the binary itself
- _add_file "${dest#$BASEDIR}" "${binary#$BASEDIR}" "$mode"
+ _add_file "${dest#$BASEDIR}" "$binary" "$mode"
$LD_SO --verify "$binary" &>/dev/null || return # not a binary!
@@ -278,9 +278,9 @@ add_binary() {
if [[ ! -L $sodep ]]; then
_add_file "$sodep" "$BASEDIR$sodep" "$(stat -c %a "$sodep")"
else
- resolved=$(readlink -e "$basedir$sodep")
+ resolved=$(readlink -e "$BASEDIR$sodep")
dirname=${resolved%/*}
- _add_dir "${dirname#$basedir}" 755
+ _add_dir "${dirname#$BASEDIR}" 755
_add_symlink "$sodep" "${resolved#$BASEDIR}"
_add_file "${resolved#$BASEDIR}" "$resolved" 755
fi
diff --git a/install/base b/install/base
index d5fcef7..446167c 100644
--- a/install/base
+++ b/install/base
@@ -11,8 +11,10 @@ build() {
add_file "/lib/initcpio/init_functions" "/init_functions"
add_file "/lib/initcpio/init" "/init"
- add_file "$CONFIG" "/config"
add_file "/etc/modprobe.d/usb-load-ehci-first.conf"
+
+ # private API call is required here
+ _add_file "/config" "$CONFIG" 644
}
help() {
diff --git a/mkinitcpio b/mkinitcpio
index 7a30be0..459c828 100755
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -209,7 +209,7 @@ if [[ $PRESET ]]; then
preset_config=${p}_config
if [[ ${!preset_config:-$ALL_config} ]]; then
- preset_cmd+=(-c "${!preset_config:-$ALL_config}")
+ preset_cmd+=(-c "$BASEDIR${!preset_config:-$ALL_config}")
else
warning "No configuration file specified. Skipping image '%s'" "$p"
continue
@@ -306,9 +306,8 @@ if (( ${#LD_SO[*]} != 1 )); then # uh oh...
fi
resolved=$(readlink -e "$LD_SO")
-_add_dir "${resolved%/*}" 755
-_add_symlink "${LD_SO#$BASEDIR}" "${resolved#$BASEDIR}"
-_add_file "${resolved#$BASEDIR}" "${resolved#$BASEDIR}" 755
+_add_file "${resolved#$BASEDIR}" "$resolved" 755
+_add_symlink "${LD_SO#$BASEDIR}" "$resolved"
unset resolved
for hook in ${HOOKS}; do