Browse Source

Adapted target/early/build-initramfs.in to the current function names and hooks of the initramfs output format

karasz/new-early
Alejandro Mery 17 years ago
parent
commit
7628e81215
1 changed files with 14 additions and 31 deletions
  1. +14
    -31
      target/early/build-initramfs.in

+ 14
- 31
target/early/build-initramfs.in

@ -1,29 +1,30 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
#
# Filename: target/early/build-initramfs.in
# Copyright (C) 2007 The OpenSDE Project
#
# Copyright (C) 2007 - 2008 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END ---
INITRD_POSTFLIST_HOOK='early_adjust_initrd'
INITRAMFS_POSTINSTALL_HOOK='early_adjust_initrd'
# flatten
ln -s . ${initrddir}/usr
ln -s . ${rootfs}/usr
# don't break /tmp when flattening
INITRD_FLIST_PATTERN="$INITRD_FLIST_PATTERN -e '/ usr\/tmp/d;'"
INITRAMFS_INSTALL_PATTERN="$INITRD_FLIST_PATTERN -e '/ usr\/tmp/d;'"
INITRD_EMPTY_PATTERN="-e '/\.\/rootfs/d;'"
INITRAMFS_EMPTY_PATTERN="-e '/\.\/rootfs/d;'"
initrd_flist_install_filter() {
local root="build/${SDECFG_ID}/"
# initramfs_install <pkg_name> <sandbox> <rootfs>
initramfs_install() {
local root="$2" initrddir="$3"
case "$1" in
udev) cp -a "$root/lib/udev/devices"/* "$initrddir/dev/"
return 0 ;;
@ -51,31 +52,13 @@ early_adjust_initrd() {
for x in var/state/pkgtool var/spool/{locks,mail} \
usr/{doc,info,man,opt,spool} etc/{rc.d/,}init.d usr
do
rm ${initrddir}/$x
rm ${rootfs}/$x
done
mkdir "${initrddir}/rootfs"
mkdir "${rootfs}/rootfs"
# HACK: bb's modprobe needs insmod on PATH, but udev clears it
# HACK: additionaly bb's modprobe doesn't handle MODALIAS properly
# HACK: so we use our own wrapper on top of bb's
rm ${initrddir}/sbin/modprobe
for x in $( ls -1 target/$target/initrd/*.exec 2> /dev/null ); do
y="${x##*/}"; y="$( echo ${y%.exec} | tr '_%' '/_' )"
echo_status "injecting $y*"
cp -f "$x" "${initrddir}/$y"
chmod +x "${initrddir}/$y"
done
for x in $( ls -1 target/$target/initrd/*.txt 2> /dev/null ); do
y="${x##*/}"; y="$( echo ${y%.txt} | tr '_%' '/_' )"
echo_status "injecting $y"
cp -f "$x" "${initrddir}/$y"
done
for x in $( ls -1 target/$target/initrd/*.patch 2> /dev/null ); do
echo_status "$(patch -p1 -d "${initrddir}" 2>&1 < $x )"
done
rm ${rootfs}/sbin/modprobe
}

Loading…
Cancel
Save