[PATCH] fai-cd using xorriso
Sander Brandenburg
sander.brandenburg at esaturnus.com
Tue Mar 4 10:53:36 CET 2014
Hi,
I'm using FAI at my employer, and I've extended fai-cd to use xorriso
to generate hybrid ISO files for booting with USB and CD. They work
for me so far. I've mostly merged grub-mkrescue's behaviour verbatimly
to fai-cd.
Note that:
1/ fai-cd will use xorriso /instead of/ genisoimage
2/ debian/control will also need to be patched to depend on xorriso
instead of genisoimage (btw, I find it unconventional that this is a
'suggests' instead of a 'depends')
Find the patch below.
Regards,
Sander Brandenburg
P.S. does everyone else also get hungry when hearing 'xorriso'? :)
--- a/bin/fai-cd
+++ b/bin/fai-cd
@@ -103,7 +103,7 @@
fi
MODULEBASE=$GRUBDIR/usr/lib/grub/
fi
- for a in $MODULEBASE/*-pc/{*.mod,efiemu??.o,cdboot.img,command.lst,moddep.lst,fs.lst,handler.lst,parttool.lst};
do
+ for a in $MODULEBASE/*-pc/{*.mod,efiemu??.o,cdboot.img,boot.img,command.lst,moddep.lst,fs.lst,handler.lst,parttool.lst};
do
[[ -e $a ]] && cp $a $tmp/boot/grub
done
rm -rf $GRUBDIR
@@ -116,6 +116,9 @@
cp -p $NFSROOT/boot/config-$kernelversion $tmp/boot/
cat $tmp/boot/grub/cdboot.img $tmp/boot/grub/core.img >
$tmp/boot/grub/eltorito.img
boot_image="boot/grub/eltorito.img"
+
+ cat $tmp/boot/grub/boot.img $tmp/boot/grub/core.img >
$tmp/boot/grub/embed.img
+ embed_image="$tmp/boot/grub/embed.img"
}
# - - - - - - - - - - - - - - - - - - - - - - - - - -
provide_memtest_boot_option() {
@@ -187,7 +190,10 @@
[ $makeiso -eq 0 ] && return
echo "Writing FAI CD-ROM image to $isoname. This may need some time."
- genisoimage --iso-level 4 -V "$vname" -A "$aname" -log-file
/dev/null -quiet -l -R -J -b "$boot_image" -no-emul-boot
-boot-load-size 4 -boot-info-table -o $isoname $tmp || die 12
"genisoimage failed."
+ xorriso -report_about HINT -as mkisofs -graft-points -b $boot_image \
+ -V "$vname" -A "$aname" \
+ -no-emul-boot -boot-info-table --embedded-boot ${embed_image}
--protective-msdos-label -o $isoname \
+ -r $tmp --sort-weight 0 / --sort-weight 1 /boot || die 12
"xorriso failed."
echo -n "ISO image size and filename: "; du -h $isoname
}
# - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -389,7 +395,7 @@
kernelversion=$(ls -tr $NFSROOT/boot/vmlinu?-* | tail -1 | sed -e
's#.*/vmlinuz-##')
faiversion=$(dpkg --root=$NFSROOT -l fai-client|awk '/fai-client/ {print $3}')
isoversion="FAI $faiversion -- build $(date '+%c')"
-vname="Fully Automatic Installation CD"
+vname="FAI_CD"
aname="Fully Automatic Installation by Thomas Lange, $isoversion"
create_grub2_image
More information about the linux-fai-devel
mailing list