mirror of
https://github.com/pygos/build.git
synced 2024-12-23 23:50:51 +01:00
Add packages for release
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
parent
40fd03640c
commit
d979842663
12 changed files with 73 additions and 75 deletions
|
@ -1,30 +0,0 @@
|
|||
build_release() {
|
||||
local RELEASE_DIR="$1"
|
||||
|
||||
local ROOTFS_SQFS=$(find $PKGDEPLOYDIR/rootfs-${CFG}/ -name '*.img')
|
||||
|
||||
local fname=$(find $PKGDEPLOYDIR/linux/ -name 'vmlinuz*')
|
||||
local linux_image=$(basename $fname)
|
||||
local rootfs_image=$(basename $ROOTFS_SQFS)
|
||||
|
||||
cp -r "$fname" "$RELEASE_DIR"
|
||||
cp "$ROOTFS_SQFS" "$RELEASE_DIR"
|
||||
cp "$SCRIPTDIR/cfg/$CFG/install.sh" "$RELEASE_DIR"
|
||||
cp "$SCRIPTDIR/cfg/$CFG/genimage.sh" "$RELEASE_DIR"
|
||||
cp "/usr/share/syslinux/mbr.bin" "$RELEASE_DIR"
|
||||
|
||||
sed -i 's/ROOTFSFILE/'$rootfs_image'/g' "$RELEASE_DIR/install.sh"
|
||||
sed -i 's/KERNELFILE/'$linux_image'/g' "$RELEASE_DIR/install.sh"
|
||||
|
||||
sed -i 's/ROOTFSFILE/'$rootfs_image'/g' "$RELEASE_DIR/genimage.sh"
|
||||
sed -i 's/KERNELFILE/'$linux_image'/g' "$RELEASE_DIR/genimage.sh"
|
||||
|
||||
cat > "$RELEASE_DIR/syslinux.cfg" << _EOF
|
||||
timeout 0
|
||||
totaltimeout 50
|
||||
default linux
|
||||
label linux
|
||||
kernel /$linux_image
|
||||
append root=/dev/sda1 root_sfs=/$rootfs_image
|
||||
_EOF
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
build_release() {
|
||||
local RELEASE_DIR="$1"
|
||||
|
||||
local ROOTFS_SQFS=$(find $PKGDEPLOYDIR/rootfs-${CFG}/ -name '*.img')
|
||||
|
||||
local rootfs_image=$(basename $ROOTFS_SQFS)
|
||||
local bootdir="$RELEASE_DIR/boot"
|
||||
|
||||
mkdir -p "$bootdir"
|
||||
cp -r ${PKGDEPLOYDIR}/linux-rpi3/* "$bootdir"
|
||||
cp -r ${PKGDEPLOYDIR}/boot-rpi3/* "$bootdir"
|
||||
cp "$SCRIPTDIR/cfg/$CFG/cmdline.txt" "$bootdir"
|
||||
cp "$ROOTFS_SQFS" "$bootdir"
|
||||
sed -i 's/ROOTFSFILE/'$rootfs_image'/g' "$bootdir/cmdline.txt"
|
||||
|
||||
cp "$SCRIPTDIR/cfg/$CFG/install.sh" "$RELEASE_DIR"
|
||||
cp "$SCRIPTDIR/cfg/$CFG/genimage.sh" "$RELEASE_DIR"
|
||||
}
|
28
mk.sh
28
mk.sh
|
@ -70,8 +70,7 @@ save_toolchain
|
|||
############################### build packages ###############################
|
||||
echo "--- resolving package dependencies ---"
|
||||
|
||||
cat "$SCRIPTDIR/cfg/$CFG/PACKAGES" | sort -u > "$BUILDROOT/$CFG/rawpkg"
|
||||
|
||||
echo "release-${CFG}" > "$BUILDROOT/$CFG/rawpkg"
|
||||
dependencies "$BUILDROOT/$CFG/rawpkg" "$PACKAGELIST" "pkg"
|
||||
cat "$PACKAGELIST"
|
||||
|
||||
|
@ -92,28 +91,3 @@ while read pkg; do
|
|||
restore_toolchain
|
||||
done < "$PACKAGELIST"
|
||||
|
||||
############################## release package ###############################
|
||||
|
||||
echo "--- building release package ---"
|
||||
|
||||
RELEASEDIR="$BUILDROOT/$CFG/release-$CFG"
|
||||
|
||||
if [ -d "$RELEASEDIR" ]; then
|
||||
rm -r "$RELEASEDIR"
|
||||
fi
|
||||
|
||||
mkdir -p "$RELEASEDIR"
|
||||
|
||||
unset -f build_release
|
||||
source "$SCRIPTDIR/cfg/$CFG/release"
|
||||
|
||||
build_release "$RELEASEDIR"
|
||||
|
||||
if [ -e "${BUILDROOT}/${CFG}/release-${CFG}.tar.gz" ]; then
|
||||
rm "${BUILDROOT}/${CFG}/release-${CFG}.tar.gz"
|
||||
fi
|
||||
|
||||
pushd "$BUILDROOT/$CFG" > /dev/null
|
||||
tar czf "${BUILDROOT}/${CFG}/release-${CFG}.tar.gz" "release-${CFG}"
|
||||
popd > /dev/null
|
||||
|
||||
|
|
42
pkg/release-alix/build
Executable file
42
pkg/release-alix/build
Executable file
|
@ -0,0 +1,42 @@
|
|||
build() {
|
||||
local SOURCE="$1"
|
||||
local BUILD="$2"
|
||||
local DEPLOY="$3"
|
||||
|
||||
local ROOTFS_SQFS=$(find $PKGDEPLOYDIR/rootfs-${CFG}/ -name '*.img')
|
||||
|
||||
local fname=$(find $PKGDEPLOYDIR/linux/ -name 'vmlinuz*')
|
||||
local linux_image=$(basename $fname)
|
||||
local rootfs_image=$(basename $ROOTFS_SQFS)
|
||||
|
||||
cp -r "$fname" "$BUILD"
|
||||
cp "$ROOTFS_SQFS" "$BUILD"
|
||||
cp "$SCRIPTDIR/pkg/release-${CFG}/install.sh" "$BUILD"
|
||||
cp "$SCRIPTDIR/pkg/release-${CFG}/genimage.sh" "$BUILD"
|
||||
cp "/usr/share/syslinux/mbr.bin" "$BUILD"
|
||||
|
||||
sed -i 's/ROOTFSFILE/'$rootfs_image'/g' "$BUILD/install.sh"
|
||||
sed -i 's/KERNELFILE/'$linux_image'/g' "$BUILD/install.sh"
|
||||
|
||||
sed -i 's/ROOTFSFILE/'$rootfs_image'/g' "$BUILD/genimage.sh"
|
||||
sed -i 's/KERNELFILE/'$linux_image'/g' "$BUILD/genimage.sh"
|
||||
|
||||
cat > "$BUILD/syslinux.cfg" << _EOF
|
||||
timeout 0
|
||||
totaltimeout 50
|
||||
default linux
|
||||
label linux
|
||||
kernel /$linux_image
|
||||
append root=/dev/sda1 root_sfs=/$rootfs_image
|
||||
_EOF
|
||||
}
|
||||
|
||||
deploy() {
|
||||
local SOURCE="$1"
|
||||
local BUILD="$2"
|
||||
local DEPLOY="$3"
|
||||
|
||||
pushd "$PKGBUILDDIR" > /dev/null
|
||||
tar czf "${DEPLOY}/release-${CFG}.tar.gz" "release-${CFG}"
|
||||
popd > /dev/null
|
||||
}
|
30
pkg/release-rpi3/build
Executable file
30
pkg/release-rpi3/build
Executable file
|
@ -0,0 +1,30 @@
|
|||
build() {
|
||||
local SOURCE="$1"
|
||||
local BUILD="$2"
|
||||
local DEPLOY="$3"
|
||||
|
||||
local ROOTFS_SQFS=$(find $PKGDEPLOYDIR/rootfs-${CFG}/ -name '*.img')
|
||||
|
||||
local rootfs_image=$(basename $ROOTFS_SQFS)
|
||||
local bootdir="$BUILD/boot"
|
||||
|
||||
mkdir -p "$bootdir"
|
||||
cp -r ${PKGDEPLOYDIR}/linux-rpi3/* "$bootdir"
|
||||
cp -r ${PKGDEPLOYDIR}/boot-rpi3/* "$bootdir"
|
||||
cp "$SCRIPTDIR/pkg/release-${CFG}/cmdline.txt" "$bootdir"
|
||||
cp "$ROOTFS_SQFS" "$bootdir"
|
||||
sed -i 's/ROOTFSFILE/'$rootfs_image'/g' "$bootdir/cmdline.txt"
|
||||
|
||||
cp "$SCRIPTDIR/pkg/release-${CFG}/install.sh" "$BUILD"
|
||||
cp "$SCRIPTDIR/pkg/release-${CFG}/genimage.sh" "$BUILD"
|
||||
}
|
||||
|
||||
deploy() {
|
||||
local SOURCE="$1"
|
||||
local BUILD="$2"
|
||||
local DEPLOY="$3"
|
||||
|
||||
pushd "$PKGBUILDDIR" > /dev/null
|
||||
tar czf "${DEPLOY}/release-${CFG}.tar.gz" "release-${CFG}"
|
||||
popd > /dev/null
|
||||
}
|
Loading…
Reference in a new issue