Browse Source

Improved initramfs output format's initramfs_install_overlay() to create the directory of the file to inject if it's new

karasz/new-early
Alejandro Mery 17 years ago
parent
commit
e5439a1f56
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      target/share/initramfs.in

+ 4
- 1
target/share/initramfs.in

@ -35,7 +35,7 @@ initramfs_install_flist() {
initramfs_install_overlay() {
local overlaydir="$1" rootfs="$2"
local file= source= target= ext=
local type= mode= ref=
local type= mode= ref= targetdir=
for file in $overlaydir/*; do
source="${file##*/}"
@ -48,6 +48,7 @@ initramfs_install_overlay() {
*) type="$ext"; mode=0644 ;;
esac
target="$( echo ${source%.$ext} | tr '_%' '/_' )"
targetdir="$rootfs/$target"; targetdir="${targetdir%/*}"
;;
*) continue ;;
esac
@ -55,11 +56,13 @@ initramfs_install_overlay() {
case "$type" in
exec|txt)
echo_status "injecting $target ($type)"
mkdir -p "$targetdir"
cp -f "$file" "$rootfs/$target"
chmod $mode "$rootfs/$target"
;;
ln) ref=$( cat "$file" )
echo_status "injecting $target -> $ref"
mkdir -p "$targetdir"
ln -snf "$ref" "$rootfs/$target"
;;
patch)

Loading…
Cancel
Save