1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-22 11:09:46 +01:00

Cleanup release packages

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
David Oberhollenzer 2018-01-17 00:56:06 +01:00
parent 57cf673125
commit 297b0a3254
5 changed files with 35 additions and 36 deletions

View file

@ -41,9 +41,7 @@ deploy() {
local LINUX_CPU=$(head -1 "$CFGFILE" | cut -b 3-) local LINUX_CPU=$(head -1 "$CFGFILE" | cut -b 3-)
local LINUX_TGT=$(head -2 "$CFGFILE" | tail -1 | cut -b 3-) local LINUX_TGT=$(head -2 "$CFGFILE" | tail -1 | cut -b 3-)
mkdir -p "$DEPLOY/boot"
pushd $BUILD pushd $BUILD
install -m 755 "arch/$LINUX_CPU/boot/$LINUX_TGT" "$DEPLOY/boot/vmlinuz-$VERSION" install -m 755 "arch/$LINUX_CPU/boot/$LINUX_TGT" "$DEPLOY/vmlinuz-$VERSION"
popd popd
} }

View file

@ -3,32 +3,25 @@ build() {
local BUILD="$2" local BUILD="$2"
local DEPLOY="$3" local DEPLOY="$3"
local ROOTFS_SQFS=$(find $PKGDEPLOYDIR/rootfs-${CFG}/ -name '*.img') # copy output of immediate dependencies
while read pkgname; do
if [ -e "$PKGDEPLOYDIR/$pkgname" ]; then
cp -ru ${PKGDEPLOYDIR}/${pkgname}/* "$BUILD"
fi
done < "$SCRIPTDIR/pkg/release-${CFG}/depends"
local fname=$(find $PKGDEPLOYDIR/linux/ -name 'vmlinuz*') # copy additional files from this package, subsitute filenames
local linux_image=$(basename $fname) local linux_image=$(basename $BUILD/vmlinuz*)
local rootfs_image=$(basename $ROOTFS_SQFS) local rootfs_image="rootfs.img"
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" cp "/usr/share/syslinux/mbr.bin" "$BUILD"
sed -i 's/ROOTFSFILE/'$rootfs_image'/g' "$BUILD/install.sh" for script in install.sh genimage.sh syslinux.cfg; do
sed -i 's/KERNELFILE/'$linux_image'/g' "$BUILD/install.sh" cp "$SCRIPTDIR/pkg/release-${CFG}/$script" "$BUILD"
sed -i 's/ROOTFSFILE/'$rootfs_image'/g' "$BUILD/genimage.sh" sed -i 's/ROOTFSFILE/'$rootfs_image'/g' "$BUILD/$script"
sed -i 's/KERNELFILE/'$linux_image'/g' "$BUILD/genimage.sh" sed -i 's/KERNELFILE/'$linux_image'/g' "$BUILD/$script"
done
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() { deploy() {

View file

@ -1,4 +1,2 @@
rootfs-alix rootfs-alix
bbstatic
initrd
linux linux

View file

@ -0,0 +1,6 @@
timeout 0
totaltimeout 50
default linux
label linux
kernel /KERNELFILE
append root=/dev/sda1 root_sfs=/ROOTFSFILE

View file

@ -3,20 +3,24 @@ build() {
local BUILD="$2" local BUILD="$2"
local DEPLOY="$3" local DEPLOY="$3"
local ROOTFS_SQFS=$(find $PKGDEPLOYDIR/rootfs-${CFG}/ -name '*.img') # copy output of immediate dependencies
mkdir -p "$BUILD/boot"
local rootfs_image=$(basename $ROOTFS_SQFS) while read pkgname; do
local bootdir="$BUILD/boot" if [ -e "$PKGDEPLOYDIR/$pkgname" ]; then
cp -ru ${PKGDEPLOYDIR}/${pkgname}/* "$BUILD/boot"
mkdir -p "$bootdir" fi
cp -r ${PKGDEPLOYDIR}/linux-rpi3/* "$bootdir" done < "$SCRIPTDIR/pkg/release-${CFG}/depends"
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"
# copy files from this package
cp "$SCRIPTDIR/pkg/release-${CFG}/cmdline.txt" "$BUILD/boot"
cp "$SCRIPTDIR/pkg/release-${CFG}/install.sh" "$BUILD" cp "$SCRIPTDIR/pkg/release-${CFG}/install.sh" "$BUILD"
cp "$SCRIPTDIR/pkg/release-${CFG}/genimage.sh" "$BUILD" cp "$SCRIPTDIR/pkg/release-${CFG}/genimage.sh" "$BUILD"
# substitute file names in scripts
local rootfs_image="rootfs.img"
sed -i 's/ROOTFSFILE/'$rootfs_image'/g' "$BUILD/boot/cmdline.txt"
} }
deploy() { deploy() {