Skip to content

Commit

Permalink
move code block to a function
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrfai committed Mar 6, 2024
1 parent 0d7155c commit 580b5e6
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions bin/fai-cd
Original file line number Diff line number Diff line change
Expand Up @@ -188,19 +188,24 @@ create_squashfs_image() {
rmdir $tmp/$liveos $tmp/squashfs-root
}
# - - - - - - - - - - - - - - - - - - - - - - - - - -
prepare_grub_cfg() {

# prepare grub.cfg
cp $grub_config $NFSROOT/tmp/grub.cfg
# insert date into grub menu
perl -pi -e "s/_VERSIONSTRING_/ $isoversion /" $NFSROOT/tmp/grub.cfg
if [ -n "$config_space" ] || [ $configset -eq 1 ]; then
perl -pi -e "s|FAI_CONFIG_SRC=(.*?)\S+|FAI_CONFIG_SRC=$config_space|" $NFSROOT/tmp/grub.cfg
fi
}
# - - - - - - - - - - - - - - - - - - - - - - - - - -
create_grub2_image() {

mkdir -p $tmp/boot/grub

if [ -d $NFSROOT/usr/lib/grub/x86_64-efi ]; then

# prepare grub.cfg
cp $grub_config $NFSROOT/tmp/grub.cfg
# insert date into grub menu
perl -pi -e "s/_VERSIONSTRING_/ $isoversion /" $NFSROOT/tmp/grub.cfg
if [ -n "$config_space" ] || [ $configset -eq 1 ]; then
perl -pi -e "s|FAI_CONFIG_SRC=(.*?)\S+|FAI_CONFIG_SRC=$config_space|" $NFSROOT/tmp/grub.cfg
fi
prepare_grub_cfg

# create arch.efi and copy to vfat file system
TMPDIR=tmp chroot $NFSROOT grub-mkstandalone \
Expand Down

0 comments on commit 580b5e6

Please sign in to comment.