futureproofing function names for the different initramfs systems

This commit is contained in:
HikariKnight 2023-04-09 12:55:37 +02:00
parent efd8ae0f97
commit f5116648e6
2 changed files with 18 additions and 6 deletions

View file

@ -110,10 +110,22 @@ func InitConfigs() {
// If we now have a config that exists
if _, err := os.Stat(conffile); !errors.Is(err, os.ErrNotExist) {
header := readHeader(4, sysfile)
fileio.AppendContent(header, conffile)
// TODO: Generalize this to a meta function
addModules(conffile)
switch conffile {
case config.path.ETCMODULES:
// Read the header
header := initramfs_readHeader(4, sysfile)
fileio.AppendContent(header, conffile)
// Add the modules to the config file
initramfs_addModules(conffile)
case config.path.INITRAMFS:
// Read the header
header := initramfs_readHeader(11, sysfile)
fileio.AppendContent(header, conffile)
// Add the modules to the config file
initramfs_addModules(conffile)
}
}
}