LICK
 All Data Structures Files Functions Variables Enumerations Enumerator
Data Structures | Typedefs | Functions
menu.h File Reference

a plugin system to manage boot loader menus More...

#include "distro.h"
#include "lickdir.h"
#include "llist.h"
Include dependency graph for menu.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  menu_t
 Hooks to call boot loader menu plugins. More...
 

Typedefs

typedef int(* menu_install_f )(lickdir_t *lick)
 
typedef int(* menu_uninstall_f )(lickdir_t *lick)
 
typedef int(* menu_fix_f )(lickdir_t *lick)
 
typedef int(* menu_check_fix_f )(lickdir_t *lick)
 
typedef char *(* menu_gen_section_f )(distro_info_t *info)
 
typedef int(* menu_append_section_f )(const char *id, const char *section, lickdir_t *lick)
 
typedef int(* menu_remove_section_f )(const char *id, lickdir_t *lick)
 

Functions

menu_tnew_menu (menu_install_f i, menu_uninstall_f u, menu_fix_f f, menu_check_fix_f c, menu_gen_section_f g, menu_append_section_f a, menu_remove_section_f r)
 create a new menu More...
 
void free_menu (menu_t *m)
 frees a menu_t and all data associated with it More...
 
int install_menu (node_t *files, const char *dst, distro_t *distro, const char *id, const char *name, lickdir_t *lick, menu_t *menu)
 add an entry to a menu file More...
 
int uninstall_menu (const char *id, lickdir_t *lick, menu_t *menu)
 

Detailed Description

a plugin system to manage boot loader menus

Each boot loader has an associated menu structure. There are three parts to the menu system: 1) the distro-specific generator 2) the menu-specific generator 3) the menu-type writer

The distro-specific generator is given a list of files extracted from the given ISO, and returns what file is the kernel, the initrd, boot options, and more. The menu-specific generator is given this information and creates an entry for it's menu. Finally, this is passed to the menu-type writer, which places this entry into the menu, and removes it on uninstall.

For example, the Puppy Linux generator is given files, and will return the .../vmlinuz, .../initrd.gz and "psubdir=... pfix=..." as the kernel, initrd and boot options, respectively. This is passed to the grub4dos generator, which creates a section containing:

1 title Puppy Linux
2 kernel .../vmlinuz psubdir=... pfix=...
3 initrd .../initrd.gz
4 boot

This is then passed to the flat-menu writer, which will place it after the other entries in menu.lst.

Function Documentation

void free_menu ( menu_t m)

frees a menu_t and all data associated with it

Parameters
mthe menu to free
int install_menu ( node_t files,
const char *  dst,
distro_t distro,
const char *  id,
const char *  name,
lickdir_t lick,
menu_t menu 
)

add an entry to a menu file

Parameters
filesa list of files extracted from the ISO
dstthe destination folder
distrohandles to functions for the distribution
idthe ID of the installation
namethe human-friendly name of the installation
lickthe LICK directory
menuthe menu being used
Returns
1 on success, 0 on error
menu_t* new_menu ( menu_install_f  i,
menu_uninstall_f  u,
menu_fix_f  f,
menu_check_fix_f  c,
menu_gen_section_f  g,
menu_append_section_f  a,
menu_remove_section_f  r 
)

create a new menu

Returns
a new menu_t, with the given info filled in. Must be freed using free_menu