config: add old kernel build capability for development
This commit is contained in:
parent
60b1c33a70
commit
04b7fe41f7
1 changed files with 40 additions and 23 deletions
|
|
@ -49,6 +49,19 @@ export UPSTREAMRELEASE=22.04
|
||||||
MIRROR=http://archive.ubuntu.com/ubuntu
|
MIRROR=http://archive.ubuntu.com/ubuntu
|
||||||
LOCALMIRROR=http://archive.trisquel.org/trisquel
|
LOCALMIRROR=http://archive.trisquel.org/trisquel
|
||||||
LOCAL_APT=`mktemp -d`
|
LOCAL_APT=`mktemp -d`
|
||||||
|
if [[ "$PACKAGE" =~ ^linux(-hwe-[0-9]+\.[0-9]+)?$ && -n "$LP_VERSION" ]]; then
|
||||||
|
# Function to truncate the version string to the major version (e.g., 6.5.0)
|
||||||
|
truncate_version() {
|
||||||
|
full_version=$1
|
||||||
|
# Match the first three components of the version (X.Y.0)
|
||||||
|
echo "$full_version" | sed -E 's/^([^_]+_[0-9]+\.[0-9]+\.0).*/\1/'
|
||||||
|
}
|
||||||
|
LP_ARCHIVE_URL="https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/${PACKAGE}/${LP_VERSION}"
|
||||||
|
TRUNCATED_VERSION=$(truncate_version "${PACKAGE}_${LP_VERSION}")
|
||||||
|
LP_TARBALL="${TRUNCATED_VERSION}.orig.tar.gz"
|
||||||
|
LP_DIFF_FILE="${PACKAGE}_${LP_VERSION}.diff.gz"
|
||||||
|
LP_DSC_FILE="${PACKAGE}_${LP_VERSION}.dsc"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "$BUILD_UNTIL" ] && (( $(echo "$BUILD_UNTIL $REVISION" | awk '{print ($1 > $2)}') )); then
|
if [ -n "$BUILD_UNTIL" ] && (( $(echo "$BUILD_UNTIL $REVISION" | awk '{print ($1 > $2)}') )); then
|
||||||
echo "Skipping build of helper with BUILD_UNTIL=$BUILD_UNTIL > REVISION=$REVISION"
|
echo "Skipping build of helper with BUILD_UNTIL=$BUILD_UNTIL > REVISION=$REVISION"
|
||||||
|
|
@ -146,6 +159,15 @@ cd PACKAGES/$PACKAGE
|
||||||
[ $UID = 0 ] && id _apt > /dev/null 2>&1 && chown _apt .
|
[ $UID = 0 ] && id _apt > /dev/null 2>&1 && chown _apt .
|
||||||
|
|
||||||
#Get package and uncompress it
|
#Get package and uncompress it
|
||||||
|
if [[ "$PACKAGE" =~ ^linux(-hwe-[0-9]+\.[0-9]+)?$ && -n "$LP_VERSION" ]]; then
|
||||||
|
for file in "${LP_TARBALL}" "${LP_DIFF_FILE}" "${LP_DSC_FILE}"; do
|
||||||
|
echo "Downloading ${file} from ${LP_ARCHIVE_URL}"
|
||||||
|
if ! wget "${LP_ARCHIVE_URL}/${file}" -O "${file}"; then
|
||||||
|
echo "Error: Failed to download ${file}."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
apt-get update -c $LOCAL_APT/etc/apt.conf
|
apt-get update -c $LOCAL_APT/etc/apt.conf
|
||||||
if [ -n "$FIXED_VER" ]; then
|
if [ -n "$FIXED_VER" ]; then
|
||||||
apt-get source --only-source $PACKAGE=$FIXED_VER --download-only -c ${LOCAL_APT}/etc/apt.conf
|
apt-get source --only-source $PACKAGE=$FIXED_VER --download-only -c ${LOCAL_APT}/etc/apt.conf
|
||||||
|
|
@ -163,6 +185,7 @@ else
|
||||||
echo WARNING! The dsc file is not gpg signed!
|
echo WARNING! The dsc file is not gpg signed!
|
||||||
[ -z "$EXTERNAL" ] && exit 1
|
[ -z "$EXTERNAL" ] && exit 1
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
dpkg-source --no-check -x --skip-patches *.dsc source
|
dpkg-source --no-check -x --skip-patches *.dsc source
|
||||||
|
|
||||||
|
|
@ -175,13 +198,6 @@ UPSTREAMVERSION=$(dpkg-parsechangelog --show-field Version)
|
||||||
[ "$REVISION" == 12.0 ] && echo Review version string generation before building t12 packages! && exit 1
|
[ "$REVISION" == 12.0 ] && echo Review version string generation before building t12 packages! && exit 1
|
||||||
export FULLVERSION=$(dpkg-parsechangelog --show-field Version)+${REVISION}trisquel${VERSION}
|
export FULLVERSION=$(dpkg-parsechangelog --show-field Version)+${REVISION}trisquel${VERSION}
|
||||||
[ "$PACKAGE" == "console-setup" ] && export FULLVERSION=$(dpkg-parsechangelog --show-field Version)-${REVISION}trisquel${VERSION}
|
[ "$PACKAGE" == "console-setup" ] && export FULLVERSION=$(dpkg-parsechangelog --show-field Version)-${REVISION}trisquel${VERSION}
|
||||||
# This is the proposed method:
|
|
||||||
#if echo $UPSTREAMVERSION | grep -q '-'; then
|
|
||||||
# export FULLVERSION=$(dpkg-parsechangelog --show-field Version)+${REVISION}trisquel${VERSION}
|
|
||||||
#else
|
|
||||||
# export FULLVERSION=$(dpkg-parsechangelog --show-field Version)-${REVISION}trisquel${VERSION}
|
|
||||||
#fi
|
|
||||||
# IMPORTANT: the build watchdog would need to be modified to match any changes done here
|
|
||||||
|
|
||||||
# Use 3.0 (native) deb source format
|
# Use 3.0 (native) deb source format
|
||||||
[ -f debian/source/format ] && echo "3 (native)" > debian/source/format
|
[ -f debian/source/format ] && echo "3 (native)" > debian/source/format
|
||||||
|
|
@ -286,3 +302,4 @@ patch_Rp1() {
|
||||||
echo "> Rolling back $(echo $1|xargs basename):"
|
echo "> Rolling back $(echo $1|xargs basename):"
|
||||||
patch --no-backup-if-mismatch -R -p1 < $1
|
patch --no-backup-if-mismatch -R -p1 < $1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue