1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-05-17 03:06:12 +02:00

Generate a package for initrd

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
This commit is contained in:
David Oberhollenzer 2019-02-04 18:32:29 +01:00
parent d2432c1d1e
commit 8483823e81
4 changed files with 31 additions and 22 deletions

View file

@ -1,35 +1,25 @@
DEPENDS="bbstatic"
build() {
return
local INPUT="$1"
local DEPLOY="$2"
mkdir -p ./{dev,lib,bin,sys,proc,newroot,images}
pkg install -omLD -r "$PKGBUILDDIR" -R "$REPODIR" $DEPENDS
}
deploy() {
local INPUT="$1"
local DEPLOY="$2"
cp "$SCRIPTDIR/pkg/initrd/initrd.skel" "$DEPLOY/init"
chmod +x "$DEPLOY/init"
cp $SCRIPTDIR/pkg/initrd/*.{desc,files} "$DEPLOY"
mkdir -p $DEPLOY/{dev,lib,bin,sys,proc,newroot,images}
pkg install -R "$REPODIR" -r "$PKGBUILDDIR" -l -F pkg $DEPENDS \
>> "$DEPLOY/initrd.files"
cat > "$DEPLOY/initrd.list" <<_EOF
dir /dev 0755 0 0
dir /lib 0775 0 0
dir /bin 0775 0 0
dir /sys 0775 0 0
dir /proc 0775 0 0
dir /newroot 0775 0 0
dir /images 0775 0 0
slink /sbin /bin 0777 0 0
nod /dev/console 600 0 0 c 5 1
file /init $DEPLOY/init 0775 0 0
_EOF
pkg install -om -R "$REPODIR" -r "$DEPLOY" $DEPENDS
pkg install -R "$REPODIR" -r "$DEPLOY" -l \
-F initrd $DEPENDS >> "$DEPLOY/initrd.list"
echo "file init 0775 0 0 $SCRIPTDIR/pkg/$PKGNAME/initrd.skel" \
>> "$DEPLOY/initrd.files"
}
check_update() {

1
pkg/initrd/initrd.desc Normal file
View file

@ -0,0 +1 @@
name initrd

9
pkg/initrd/initrd.files Normal file
View file

@ -0,0 +1,9 @@
dir dev 0755 0 0
dir lib 0775 0 0
dir bin 0775 0 0
dir sys 0775 0 0
dir proc 0775 0 0
dir newroot 0775 0 0
dir images 0775 0 0
slink sbin 0777 0 0 bin
nod dev/console 600 0 0 c 5 1

View file

@ -32,9 +32,16 @@ prepare() {
}
build() {
local INITRDLIST="$PKGDEPLOYDIR/initrd/initrd.list"
local SOURCE="$1"
local DEPLOY="$2"
local INITRDDIR="$DEPLOY/initrd"
local INITRDLIST="$INITRDDIR/initrd.list"
local LINUX_CPU=$(get_linux_cpu)
pkg install -omLD -R "$REPODIR" -r "$INITRDDIR" initrd
pkg install -R "$REPODIR" -r "$INITRDDIR" -l -F initrd initrd > "$INITRDLIST"
export KBUILD_OUTPUT="$PKGBUILDDIR"
make -C "$1" O="$PKGBUILDDIR" ARCH="$LINUX_CPU" CROSS_COMPILE="${TARGET}-" mrproper
@ -44,6 +51,8 @@ build() {
sed -i "$PKGBUILDDIR/.config" -e 's,^CONFIG_LOCALVERSION=.*,CONFIG_LOCALVERSION="-'${OS_NAME}-${OS_RELEASE}'",'
make -C "$1" O="$PKGBUILDDIR" ARCH="$LINUX_CPU" CROSS_COMPILE="${TARGET}-" oldconfig
make -C "$1" O="$PKGBUILDDIR" ARCH="$LINUX_CPU" CROSS_COMPILE="${TARGET}-" -j $NUMJOBS $LINUX_TGT
rm -rf "$INITRDDIR"
}
deploy() {