Skip to content

Commit

Permalink
Allows userdefined classes
Browse files Browse the repository at this point in the history
With this commit the user can add his own classes by:
- adding the class in the user_classes.conf file
- dealing with a numbered script in usercustomization/class/ folder (for example usercustomization/class/99-custom, chmod 755) to use the class
- adding all the files related to the classes in the usercustomization hierarchy

Signed-off-by: Florent CARLI <[email protected]>
  • Loading branch information
insatomcat committed Jun 17, 2024
1 parent 36c708c commit a7248fe
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ The possibles flags to create a grub menu item are:

If you want an "english, no debug, no raid, no cockpit, no kerberos, standalone" installation, then you need to uncheck everything, which will result in a fake "noflag" grub menu item being added. This is normal.

** User-defined classes **
The user can manage his own classes by:
- adding the class in the user_classes.conf file
- dealing with a numbered script in usercustomization/class/ folder (for example usercustomization/class/99-custom, chmod 755) to use the class (see srv_fai_config/class/99-seapath script for reference)
- adding all the files related to the classes in the usercustomization hierarchy (for example usercustomization/package_config/USERCLASS1)


## Build a Virtual Machine image

To build a basic VM for the SEAPATH project, simply launch the script `build_qcow2.sh` from the directory where you want the .qcow2 file to be stored (the build host must use UEFI).
Expand Down
5 changes: 4 additions & 1 deletion build_iso.sh
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,11 @@ docker cp "$wd"/build_tmp/. fai-setup:/ext/srv/fai/config/
# Stopping the container after having added stuff in it
$COMPOSECMD -f "$wd"/docker-compose.yml down

# List user defined Classes
userClasses=$(grep -Ev "^#|^$" "$wd"/user_classes.conf | tr '\n' ',' | sed -e "s/,$//")

# Creating the mirror
CLASSES="FAIBASE,DEBIAN,GRUB_EFI,SEAPATH_COMMON,${finalClasses}USERCUSTOMIZATION,LAST"
CLASSES="FAIBASE,DEBIAN,GRUB_EFI,SEAPATH_COMMON,${finalClasses}USERCUSTOMIZATION,${userClasses},LAST"
$COMPOSECMD -f "$wd"/docker-compose.yml run --rm fai-setup bash -c "\
cp /etc/fai/apt/keys/* /etc/apt/trusted.gpg.d/ &&\
fai-mirror -c $CLASSES /ext/mirror"
Expand Down
2 changes: 1 addition & 1 deletion srv_fai_config/class/98-seapath
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/bash

# do not use this if a menu will be presented
[ "$flag_menu" ] && exit 0
Expand Down
4 changes: 4 additions & 0 deletions user_classes.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# list user defined classes, one class per line
# exemple :
# USERCLASS1
# USERCLASS2

0 comments on commit a7248fe

Please sign in to comment.