-
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.
Merge pull request #6803 from inverse-inc/feature/debian-installer
Feature/debian installer
- Loading branch information
Showing
10 changed files
with
763 additions
and
2 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,34 @@ | ||
#!/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} | ||
|
||
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,45 @@ | ||
#!/bin/bash | ||
set -o nounset -o pipefail -o errexit | ||
|
||
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/ | ||
|
||
chmod a+w isofiles/isolinux/gtk.cfg isofiles/isolinux/drkgtk.cfg isofiles/boot/grub/grub.cfg | ||
cp gtk.cfg isofiles/isolinux/gtk.cfg | ||
cp gtk.cfg isofiles/isolinux/drkgtk.cfg | ||
cp grub.cfg isofiles/boot/grub/grub.cfg | ||
chmod 0444 isofiles/isolinux/gtk.cfg isofiles/isolinux/drkgtk.cfg isofiles/boot/grub/grub.cfg | ||
|
||
cd isofiles | ||
chmod +w md5sum.txt | ||
# The '|| echo' is there so that it always exits with 0 because find returns a non-zero status because there is debian symlink in isofiles that points to '.' | ||
find -follow -type f ! -name md5sum.txt -print0 | xargs -0 md5sum > md5sum.txt || echo | ||
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 |
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,88 @@ | ||
if loadfont $prefix/font.pf2 ; then | ||
set gfxmode=800x600 | ||
set gfxpayload=keep | ||
insmod efi_gop | ||
insmod efi_uga | ||
insmod video_bochs | ||
insmod video_cirrus | ||
insmod gfxterm | ||
insmod png | ||
terminal_output gfxterm | ||
fi | ||
|
||
if background_image /isolinux/splash.png; then | ||
set color_normal=light-gray/black | ||
set color_highlight=white/black | ||
elif background_image /splash.png; then | ||
set color_normal=light-gray/black | ||
set color_highlight=white/black | ||
else | ||
set menu_color_normal=cyan/blue | ||
set menu_color_highlight=white/blue | ||
fi | ||
|
||
insmod play | ||
play 960 440 1 0 4 440 1 | ||
set theme=/boot/grub/theme/1 | ||
menuentry --hotkey=i 'Install' { | ||
set background_color=black | ||
linux /install.amd/vmlinuz vga=788 net.ifnames=0 --- quiet | ||
initrd /install.amd/initrd.gz | ||
} | ||
submenu --hotkey=a 'Advanced options ...' { | ||
set menu_color_normal=cyan/blue | ||
set menu_color_highlight=white/blue | ||
set theme=/boot/grub/theme/1-1 | ||
set gfxpayload=keep | ||
menuentry '... Graphical expert install' { | ||
set background_color=black | ||
linux /install.amd/vmlinuz priority=low vga=788 --- | ||
initrd /install.amd/gtk/initrd.gz | ||
} | ||
menuentry '... Graphical rescue mode' { | ||
set background_color=black | ||
linux /install.amd/vmlinuz vga=788 rescue/enable=true --- quiet | ||
initrd /install.amd/gtk/initrd.gz | ||
} | ||
menuentry '... Graphical automated install' { | ||
set background_color=black | ||
linux /install.amd/vmlinuz auto=true priority=critical vga=788 --- quiet | ||
initrd /install.amd/gtk/initrd.gz | ||
} | ||
menuentry --hotkey=x '... Expert install' { | ||
set background_color=black | ||
linux /install.amd/vmlinuz priority=low vga=788 --- | ||
initrd /install.amd/initrd.gz | ||
} | ||
menuentry --hotkey=r '... Rescue mode' { | ||
set background_color=black | ||
linux /install.amd/vmlinuz vga=788 rescue/enable=true --- quiet | ||
initrd /install.amd/initrd.gz | ||
} | ||
menuentry --hotkey=a '... Automated install' { | ||
set background_color=black | ||
linux /install.amd/vmlinuz auto=true priority=critical vga=788 --- quiet | ||
initrd /install.amd/initrd.gz | ||
} | ||
submenu --hotkey=s '... Speech-enabled advanced options ...' { | ||
set menu_color_normal=cyan/blue | ||
set menu_color_highlight=white/blue | ||
set theme=/boot/grub/theme/1-1-1 | ||
set gfxpayload=keep | ||
menuentry --hotkey=x '... Expert speech install' { | ||
set background_color=black | ||
linux /install.amd/vmlinuz priority=low vga=788 speakup.synth=soft --- | ||
initrd /install.amd/gtk/initrd.gz | ||
} | ||
menuentry --hotkey=r '... Rescue speech mode' { | ||
set background_color=black | ||
linux /install.amd/vmlinuz vga=788 rescue/enable=true speakup.synth=soft --- quiet | ||
initrd /install.amd/gtk/initrd.gz | ||
} | ||
menuentry --hotkey=a '... Automated speech install' { | ||
set background_color=black | ||
linux /install.amd/vmlinuz auto=true priority=critical vga=788 speakup.synth=soft --- quiet | ||
initrd /install.amd/gtk/initrd.gz | ||
} | ||
} | ||
} |
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,7 @@ | ||
default install | ||
label install | ||
menu label ^Install PacketFence | ||
menu default | ||
kernel /install.amd/vmlinuz | ||
append vga=788 net.ifnames=0 initrd=/install.amd/initrd.gz --- quiet | ||
|
Oops, something went wrong.