mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-04-19 12:07:18 +00:00
Merge pull request #4218 from dhewg/pull/initramfs
linux: initramfs: use initramfs config file(s) and directory structure
This commit is contained in:
commit
62be074b78
@ -1197,6 +1197,22 @@ kernel_config_path() {
|
||||
die "ERROR: Unable to locate kernel config for ${LINUX} - looking for ${config_name}"
|
||||
}
|
||||
|
||||
kernel_initramfs_confs() {
|
||||
local config_name cfg confs
|
||||
|
||||
config_name="initramfs.${TARGET_PATCH_ARCH:-$TARGET_ARCH}.conf"
|
||||
confs="$(get_pkg_directory initramfs)/config/initramfs.conf"
|
||||
|
||||
for cfg in $PROJECT_DIR/$PROJECT/packages/initramfs/config/$config_name \
|
||||
$PROJECT_DIR/$PROJECT/devices/$DEVICE/packages/initramfs/config/$config_name \
|
||||
; do
|
||||
[[ $cfg =~ /devices//packages/ ]] && continue
|
||||
[ -f "$cfg" ] && confs+=" $cfg"
|
||||
done
|
||||
|
||||
echo "$confs"
|
||||
}
|
||||
|
||||
kernel_make() {
|
||||
(
|
||||
setup_pkg_config_host
|
||||
|
@ -1,12 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
|
||||
# Copyright (C) 2020-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
PKG_NAME="cpio"
|
||||
PKG_VERSION="2.13"
|
||||
PKG_SHA256="e87470d9c984317f658567c03bfefb6b0c829ff17dbf6b0de48d71a4c8f3db88"
|
||||
PKG_LICENSE="GPL"
|
||||
PKG_SITE="http://www.gnu.org/software/cpio/"
|
||||
PKG_URL="http://ftpmirror.gnu.org/cpio/$PKG_NAME-$PKG_VERSION.tar.gz"
|
||||
PKG_DEPENDS_HOST="toolchain:host"
|
||||
PKG_LONGDESC="A program to manage archives of files."
|
@ -6,7 +6,7 @@ PKG_NAME="linux"
|
||||
PKG_LICENSE="GPL"
|
||||
PKG_SITE="http://www.kernel.org"
|
||||
PKG_DEPENDS_HOST="ccache:host rsync:host openssl:host"
|
||||
PKG_DEPENDS_TARGET="toolchain linux:host cpio:host kmod:host xz:host keyutils $KERNEL_EXTRA_DEPENDS_TARGET"
|
||||
PKG_DEPENDS_TARGET="toolchain linux:host kmod:host xz:host keyutils $KERNEL_EXTRA_DEPENDS_TARGET"
|
||||
PKG_NEED_UNPACK="$LINUX_DEPENDS $(get_pkg_directory initramfs) $(get_pkg_variable initramfs PKG_NEED_UNPACK)"
|
||||
PKG_LONGDESC="This package contains a precompiled kernel image and the modules."
|
||||
PKG_IS_KERNEL_PKG="yes"
|
||||
@ -76,7 +76,7 @@ post_patch() {
|
||||
else
|
||||
cp $PKG_KERNEL_CFG_FILE $PKG_BUILD/.config
|
||||
|
||||
sed -i -e "s|@INITRAMFS_SOURCE@|$BUILD/image/initramfs.cpio|" $PKG_BUILD/.config
|
||||
sed -i -e "s|@INITRAMFS_SOURCE@|$(kernel_initramfs_confs) $BUILD/initramfs|" $PKG_BUILD/.config
|
||||
|
||||
# set default hostname based on $DISTRONAME
|
||||
sed -i -e "s|@DISTRONAME@|$DISTRONAME|g" $PKG_BUILD/.config
|
||||
|
7
packages/virtual/initramfs/config/initramfs.conf
Normal file
7
packages/virtual/initramfs/config/initramfs.conf
Normal file
@ -0,0 +1,7 @@
|
||||
dir /dev 0755 0 0
|
||||
nod /dev/console 0600 0 0 c 5 1
|
||||
|
||||
dir usr 0755 0 0
|
||||
slink lib usr/lib 0777 0 0
|
||||
slink bin usr/bin 0777 0 0
|
||||
slink sbin usr/sbin 0777 0 0
|
@ -8,7 +8,7 @@ PKG_LICENSE="GPL"
|
||||
PKG_SITE="http://www.openelec.tv"
|
||||
PKG_URL=""
|
||||
PKG_DEPENDS_INIT="libc:init busybox:init plymouth-lite:init util-linux:init e2fsprogs:init dosfstools:init terminus-font:init"
|
||||
PKG_DEPENDS_TARGET="toolchain fakeroot:host initramfs:init"
|
||||
PKG_DEPENDS_TARGET="toolchain initramfs:init"
|
||||
PKG_SECTION="virtual"
|
||||
PKG_LONGDESC="Metapackage for installing initramfs"
|
||||
|
||||
@ -23,21 +23,3 @@ fi
|
||||
for i in $PKG_DEPENDS_INIT; do
|
||||
PKG_NEED_UNPACK+=" $(get_pkg_directory $i)"
|
||||
done
|
||||
|
||||
post_install() {
|
||||
( cd $BUILD/initramfs
|
||||
if [ "$TARGET_ARCH" = "x86_64" ]; then
|
||||
ln -sfn /usr/lib $BUILD/initramfs/lib64
|
||||
mkdir -p $BUILD/initramfs/usr
|
||||
ln -sfn /usr/lib $BUILD/initramfs/usr/lib64
|
||||
fi
|
||||
|
||||
ln -sfn /usr/lib $BUILD/initramfs/lib
|
||||
ln -sfn /usr/bin $BUILD/initramfs/bin
|
||||
ln -sfn /usr/sbin $BUILD/initramfs/sbin
|
||||
|
||||
mkdir -p $BUILD/image/
|
||||
fakeroot -- sh -c \
|
||||
"mkdir -p dev; mknod -m 600 dev/console c 5 1; find . | cpio -H newc -ov -R 0:0 > $BUILD/image/initramfs.cpio"
|
||||
)
|
||||
}
|
||||
|
@ -0,0 +1,2 @@
|
||||
slink lib64 usr/lib 0777 0 0
|
||||
slink usr/lib64 lib 0777 0 0
|
Loading…
x
Reference in New Issue
Block a user