-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
646 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
preseed.cfg | ||
*.iso |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
RESULT_DIR=results | ||
|
||
.PHONY: packetfence-debian-installer.iso | ||
|
||
iso: | ||
echo "Building Debian installer for $(PF_VERSION)" | ||
PF_RELEASE='$(shell cat ../../conf/pf-release)' \ | ||
PF_VERSION='$(PF_VERSION)' \ | ||
./build-and-upload.sh | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf $(RESULT_DIR) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
set -o nounset -o pipefail -o errexit | ||
|
||
PF_VERSION=${PF_VERSION:-localtest} | ||
|
||
PF_RELEASE="`echo $PF_RELEASE | sed -r 's/.*\b([0-9]+\.[0-9]+)\.[0-9]+/\1/g'`" | ||
|
||
ISO_NAME=PacketFence-ISO-${PF_VERSION}.iso | ||
|
||
# upload | ||
SF_RESULT_DIR=results/sf/${PF_VERSION} | ||
PUBLIC_REPO_DIR="/home/frs/project/p/pa/packetfence/PacketFence\ ISO/${PF_VERSION}" | ||
DEPLOY_SF_USER=${DEPLOY_SF_USER:-inverse-bot,packetfence} | ||
DEPLOY_SF_HOST=${DEPLOY_SF_HOST:-frs.sourceforge.net} | ||
|
||
upload_to_sf() { | ||
# warning: slashs at end of dirs are significant for rsync | ||
local src_dir="${SF_RESULT_DIR}/" | ||
local dst_repo="${PUBLIC_REPO_DIR}/" | ||
local dst_dir="${DEPLOY_SF_USER}@${DEPLOY_SF_HOST}:${dst_repo}" | ||
declare -p src_dir dst_dir | ||
echo "rsync: $src_dir -> $dst_dir" | ||
|
||
# quotes to handle space in filename | ||
rsync -avz $src_dir "$dst_dir" | ||
} | ||
|
||
mkdir -p ${SF_RESULT_DIR} | ||
|
||
# Manifest need to be generate by hand because we modify OVF during last step | ||
echo "===> Build ISO for release $PF_RELEASE" | ||
docker run --rm -e PF_RELEASE=$PF_RELEASE -e ISO_OUT="${SF_RESULT_DIR}/${ISO_NAME}" -v `pwd`:/debian-installer debian:11 /debian-installer/create-debian-installer-docker.sh | ||
|
||
echo "===> Upload to Sourceforge" | ||
upload_to_sf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
set -o nounset -o pipefail -o errexit | ||
|
||
cd /debian-installer | ||
|
||
apt update | ||
apt install xorriso wget cpio genisoimage -yqq | ||
|
||
./create-debian-installer.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
function clean() { | ||
rm -fr isofiles/ | ||
rm -f preseed.cfg | ||
chmod a+rw $ISO_IN | ||
chmod a+rw $ISO_OUT | ||
} | ||
|
||
ISO_IN=${ISO_IN:-debian-11.2.0-amd64-netinst.iso} | ||
ISO_OUT=${ISO_OUT:-packetfence-debian-installer.iso} | ||
|
||
if ! [ -f $ISO_IN ]; then | ||
wget https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/$ISO_IN | ||
fi | ||
|
||
rm -fr isofiles/ | ||
|
||
cat preseed.cfg.tmpl | sed "s/%%PF_VERSION%%/$PF_RELEASE/g" > preseed.cfg | ||
|
||
xorriso -osirrox on -indev $ISO_IN -extract / isofiles | ||
|
||
chmod +w -R isofiles/install.amd/ | ||
gunzip isofiles/install.amd/initrd.gz | ||
echo preseed.cfg | cpio -H newc -o -A -F isofiles/install.amd/initrd | ||
gzip isofiles/install.amd/initrd | ||
chmod -w -R isofiles/install.amd/ | ||
|
||
cd isofiles | ||
chmod +w md5sum.txt | ||
find -follow -type f ! -name md5sum.txt -print0 | xargs -0 md5sum > md5sum.txt | ||
chmod -w md5sum.txt | ||
cd .. | ||
|
||
genisoimage -r -J -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o $ISO_OUT isofiles | ||
|
||
clean |
Oops, something went wrong.