mirror of
https://github.com/pygos/build.git
synced 2024-11-22 11:09:46 +01:00
Add os-name & release
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
parent
8f030cb6ca
commit
5dd2790a67
8 changed files with 29 additions and 12 deletions
5
mk.sh
5
mk.sh
|
@ -34,6 +34,11 @@ mkdir -p "$TCDIR/$TARGET"
|
||||||
|
|
||||||
CMAKETCFILE="$TCDIR/toolchain.cmake"
|
CMAKETCFILE="$TCDIR/toolchain.cmake"
|
||||||
|
|
||||||
|
pushd "$SCRIPTDIR" > /dev/null
|
||||||
|
OS_NAME="Pygos"
|
||||||
|
OS_RELEASE=$(git describe --always --tags --broken --dirty)
|
||||||
|
popd > /dev/null
|
||||||
|
|
||||||
############################# include utilities ##############################
|
############################# include utilities ##############################
|
||||||
source "$SCRIPTDIR/util/depends.sh"
|
source "$SCRIPTDIR/util/depends.sh"
|
||||||
source "$SCRIPTDIR/util/download.sh"
|
source "$SCRIPTDIR/util/download.sh"
|
||||||
|
|
|
@ -26,6 +26,7 @@ build() {
|
||||||
|
|
||||||
sed -i "$OUTPUT/.config" -e 's,^CONFIG_CROSS_COMPILE=.*,CONFIG_CROSS_COMPILE="'$TARGET'-",'
|
sed -i "$OUTPUT/.config" -e 's,^CONFIG_CROSS_COMPILE=.*,CONFIG_CROSS_COMPILE="'$TARGET'-",'
|
||||||
sed -i "$OUTPUT/.config" -e 's,^CONFIG_INITRAMFS_SOURCE=.*,CONFIG_INITRAMFS_SOURCE="'$INITRDLIST'",'
|
sed -i "$OUTPUT/.config" -e 's,^CONFIG_INITRAMFS_SOURCE=.*,CONFIG_INITRAMFS_SOURCE="'$INITRDLIST'",'
|
||||||
|
sed -i "$OUTPUT/.config" -e 's,^CONFIG_LOCALVERSION=.*,CONFIG_LOCALVERSION="-'${OS_NAME}-${OS_RELEASE}'",'
|
||||||
make -C "$INPUT" O="$OUTPUT" ARCH="arm" CROSS_COMPILE="${TARGET}-" -j $NUMJOBS zImage dtbs
|
make -C "$INPUT" O="$OUTPUT" ARCH="arm" CROSS_COMPILE="${TARGET}-" -j $NUMJOBS zImage dtbs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@ build() {
|
||||||
make -C "$INPUT" O="$OUTPUT" ARCH="$LINUX_CPU" CROSS_COMPILE="${TARGET}-" oldconfig
|
make -C "$INPUT" O="$OUTPUT" ARCH="$LINUX_CPU" CROSS_COMPILE="${TARGET}-" oldconfig
|
||||||
sed -i "$OUTPUT/.config" -e 's,^CONFIG_CROSS_COMPILE=.*,CONFIG_CROSS_COMPILE="'$TARGET'-",'
|
sed -i "$OUTPUT/.config" -e 's,^CONFIG_CROSS_COMPILE=.*,CONFIG_CROSS_COMPILE="'$TARGET'-",'
|
||||||
sed -i "$OUTPUT/.config" -e 's,^CONFIG_INITRAMFS_SOURCE=.*,CONFIG_INITRAMFS_SOURCE="'$INITRDLIST'",'
|
sed -i "$OUTPUT/.config" -e 's,^CONFIG_INITRAMFS_SOURCE=.*,CONFIG_INITRAMFS_SOURCE="'$INITRDLIST'",'
|
||||||
|
sed -i "$OUTPUT/.config" -e 's,^CONFIG_LOCALVERSION=.*,CONFIG_LOCALVERSION="-'${OS_NAME}-${OS_RELEASE}'",'
|
||||||
make -C "$INPUT" O="$OUTPUT" ARCH="$LINUX_CPU" CROSS_COMPILE="${TARGET}-" -j $NUMJOBS $LINUX_TGT
|
make -C "$INPUT" O="$OUTPUT" ARCH="$LINUX_CPU" CROSS_COMPILE="${TARGET}-" -j $NUMJOBS $LINUX_TGT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,6 +38,6 @@ deploy() {
|
||||||
local DEPLOY="$3"
|
local DEPLOY="$3"
|
||||||
|
|
||||||
pushd $BUILD
|
pushd $BUILD
|
||||||
install -m 755 "arch/$LINUX_CPU/boot/$LINUX_TGT" "$DEPLOY/vmlinuz-$VERSION"
|
install -m 755 "arch/$LINUX_CPU/boot/$LINUX_TGT" "$DEPLOY/vmlinuz"
|
||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,8 @@ build() {
|
||||||
local BUILD="$2"
|
local BUILD="$2"
|
||||||
local DEPLOY="$3"
|
local DEPLOY="$3"
|
||||||
|
|
||||||
|
local distroname="${OS_NAME}-${OS_RELEASE}"
|
||||||
|
|
||||||
cp -R ${SOURCE}/* ${BUILD}
|
cp -R ${SOURCE}/* ${BUILD}
|
||||||
|
|
||||||
apply_patches
|
apply_patches
|
||||||
|
@ -21,7 +23,7 @@ build() {
|
||||||
make CC=${TARGET}-gcc AR=${TARGET}-ar RANLIB=${TARGET}-ranlib \
|
make CC=${TARGET}-gcc AR=${TARGET}-ar RANLIB=${TARGET}-ranlib \
|
||||||
LD=${TARGET}-ld LIBTERMCAP="-lncursesw" \
|
LD=${TARGET}-ld LIBTERMCAP="-lncursesw" \
|
||||||
SBINDIR="/bin" INCDIR="/include" LIBNAME="lib" \
|
SBINDIR="/bin" INCDIR="/include" LIBNAME="lib" \
|
||||||
DESTDIR="$DEPLOY" OS=Linux BRANDING="distroname" \
|
DESTDIR="$DEPLOY" OS=Linux BRANDING="$distroname" \
|
||||||
MKNET=no MKSELINUX=no MKSTATICLIBS=no MKSYSVINIT=yes \
|
MKNET=no MKSELINUX=no MKSTATICLIBS=no MKSYSVINIT=yes \
|
||||||
MKTERMCAP=ncurses UPREFIX="" \
|
MKTERMCAP=ncurses UPREFIX="" \
|
||||||
-j $NUMJOBS
|
-j $NUMJOBS
|
||||||
|
@ -33,8 +35,10 @@ deploy() {
|
||||||
local DEPLOY="$3"
|
local DEPLOY="$3"
|
||||||
local DEVDEPLOY="$4"
|
local DEVDEPLOY="$4"
|
||||||
|
|
||||||
|
local distroname="${OS_NAME}-${OS_RELEASE}"
|
||||||
|
|
||||||
make SBINDIR="/bin" INCDIR="/include" LIBNAME="lib" \
|
make SBINDIR="/bin" INCDIR="/include" LIBNAME="lib" \
|
||||||
DESTDIR="$DEPLOY" OS=Linux BRANDING="distroname" UPREFIX="" \
|
DESTDIR="$DEPLOY" OS=Linux BRANDING="$distroname" UPREFIX="" \
|
||||||
install
|
install
|
||||||
|
|
||||||
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
|
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
|
||||||
|
|
|
@ -5,24 +5,27 @@ build() {
|
||||||
local BUILD="$2"
|
local BUILD="$2"
|
||||||
local DEPLOY="$3"
|
local DEPLOY="$3"
|
||||||
|
|
||||||
|
mkdir -p "$BUILD/$OS_RELEASE"
|
||||||
|
|
||||||
# copy output of immediate dependencies
|
# copy output of immediate dependencies
|
||||||
for pkgname in $DEPENDS; do
|
for pkgname in $DEPENDS; do
|
||||||
if [ -e "$PKGDEPLOYDIR/$pkgname" ]; then
|
if [ -e "$PKGDEPLOYDIR/$pkgname" ]; then
|
||||||
cp -ru ${PKGDEPLOYDIR}/${pkgname}/* "$BUILD"
|
cp -ru ${PKGDEPLOYDIR}/${pkgname}/* "$BUILD/$OS_RELEASE"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# copy additional files from this package, subsitute filenames
|
# copy additional files from this package, subsitute filenames
|
||||||
local linux_image=$(basename $BUILD/vmlinuz*)
|
local linux_image="$OS_RELEASE/vmlinuz"
|
||||||
local rootfs_image="rootfs.img"
|
local rootfs_image="$OS_RELEASE/rootfs.img"
|
||||||
|
|
||||||
cp "/usr/share/syslinux/mbr.bin" "$BUILD"
|
cp "/usr/share/syslinux/mbr.bin" "$BUILD"
|
||||||
|
|
||||||
for script in install.sh genimage.sh syslinux.cfg; do
|
for script in install.sh genimage.sh syslinux.cfg; do
|
||||||
cp "$SCRIPTDIR/$PKGDIR/$PKGNAME/$script" "$BUILD"
|
cp "$SCRIPTDIR/$PKGDIR/$PKGNAME/$script" "$BUILD"
|
||||||
|
|
||||||
sed -i 's/ROOTFSFILE/'$rootfs_image'/g' "$BUILD/$script"
|
sed -i 's#ROOTFSFILE#'$rootfs_image'#g' "$BUILD/$script"
|
||||||
sed -i 's/KERNELFILE/'$linux_image'/g' "$BUILD/$script"
|
sed -i 's#KERNELFILE#'$linux_image'#g' "$BUILD/$script"
|
||||||
|
sed -i 's#VERSIONDIR#'$OS_RELEASE'#g' "$BUILD/$script"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,8 +37,7 @@ MOUNTED=1
|
||||||
|
|
||||||
syslinux --install ${LODEV}p1
|
syslinux --install ${LODEV}p1
|
||||||
cp syslinux.cfg /tmp/mnt.$$/syslinux.cfg
|
cp syslinux.cfg /tmp/mnt.$$/syslinux.cfg
|
||||||
cp ROOTFSFILE /tmp/mnt.$$/
|
cp -r VERSIONDIR /tmp/mnt.$$/
|
||||||
cp KERNELFILE /tmp/mnt.$$/
|
|
||||||
|
|
||||||
umount /tmp/mnt.$$
|
umount /tmp/mnt.$$
|
||||||
MOUNTED=0
|
MOUNTED=0
|
||||||
|
|
|
@ -47,8 +47,7 @@ MOUNTED=1
|
||||||
|
|
||||||
syslinux --install ${DEVICE}1
|
syslinux --install ${DEVICE}1
|
||||||
cp syslinux.cfg /tmp/mnt.$$/syslinux.cfg
|
cp syslinux.cfg /tmp/mnt.$$/syslinux.cfg
|
||||||
cp ROOTFSFILE /tmp/mnt.$$/
|
cp -r VERSIONDIR /tmp/mnt.$$/
|
||||||
cp KERNELFILE /tmp/mnt.$$/
|
|
||||||
|
|
||||||
umount /tmp/mnt.$$
|
umount /tmp/mnt.$$
|
||||||
MOUNTED=0
|
MOUNTED=0
|
||||||
|
|
|
@ -30,6 +30,11 @@ build() {
|
||||||
cp -ru --remove-destination ${PKGDEPLOYDIR}/${pkgname}/* "$BUILD"
|
cp -ru --remove-destination ${PKGDEPLOYDIR}/${pkgname}/* "$BUILD"
|
||||||
done < "$BUILD/etc/packages"
|
done < "$BUILD/etc/packages"
|
||||||
|
|
||||||
|
# version info
|
||||||
|
local fname=$(echo "${OS_NAME}-release" | tr '[:upper:]' '[:lower:]')
|
||||||
|
|
||||||
|
echo $OS_RELEASE > $BUILD/etc/$fname
|
||||||
|
|
||||||
# setup root home directory
|
# setup root home directory
|
||||||
cp -r "$BUILD/etc/skel" "$BUILD/root"
|
cp -r "$BUILD/etc/skel" "$BUILD/root"
|
||||||
chmod 750 "$BUILD/root"
|
chmod 750 "$BUILD/root"
|
||||||
|
|
Loading…
Reference in a new issue