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:
parent
57cf673125
commit
297b0a3254
5 changed files with 35 additions and 36 deletions
|
@ -41,9 +41,7 @@ deploy() {
|
|||
local LINUX_CPU=$(head -1 "$CFGFILE" | cut -b 3-)
|
||||
local LINUX_TGT=$(head -2 "$CFGFILE" | tail -1 | cut -b 3-)
|
||||
|
||||
mkdir -p "$DEPLOY/boot"
|
||||
|
||||
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
|
||||
}
|
||||
|
|
|
@ -3,32 +3,25 @@ build() {
|
|||
local BUILD="$2"
|
||||
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*')
|
||||
local linux_image=$(basename $fname)
|
||||
local rootfs_image=$(basename $ROOTFS_SQFS)
|
||||
# copy additional files from this package, subsitute filenames
|
||||
local linux_image=$(basename $BUILD/vmlinuz*)
|
||||
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"
|
||||
|
||||
sed -i 's/ROOTFSFILE/'$rootfs_image'/g' "$BUILD/install.sh"
|
||||
sed -i 's/KERNELFILE/'$linux_image'/g' "$BUILD/install.sh"
|
||||
for script in install.sh genimage.sh syslinux.cfg; do
|
||||
cp "$SCRIPTDIR/pkg/release-${CFG}/$script" "$BUILD"
|
||||
|
||||
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
|
||||
sed -i 's/ROOTFSFILE/'$rootfs_image'/g' "$BUILD/$script"
|
||||
sed -i 's/KERNELFILE/'$linux_image'/g' "$BUILD/$script"
|
||||
done
|
||||
}
|
||||
|
||||
deploy() {
|
||||
|
|
|
@ -1,4 +1,2 @@
|
|||
rootfs-alix
|
||||
bbstatic
|
||||
initrd
|
||||
linux
|
||||
|
|
6
pkg/release-alix/syslinux.cfg
Normal file
6
pkg/release-alix/syslinux.cfg
Normal file
|
@ -0,0 +1,6 @@
|
|||
timeout 0
|
||||
totaltimeout 50
|
||||
default linux
|
||||
label linux
|
||||
kernel /KERNELFILE
|
||||
append root=/dev/sda1 root_sfs=/ROOTFSFILE
|
|
@ -3,20 +3,24 @@ build() {
|
|||
local BUILD="$2"
|
||||
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)
|
||||
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"
|
||||
while read pkgname; do
|
||||
if [ -e "$PKGDEPLOYDIR/$pkgname" ]; then
|
||||
cp -ru ${PKGDEPLOYDIR}/${pkgname}/* "$BUILD/boot"
|
||||
fi
|
||||
done < "$SCRIPTDIR/pkg/release-${CFG}/depends"
|
||||
|
||||
# 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}/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() {
|
||||
|
|
Loading…
Reference in a new issue