#include <EtcFstab.h>
Public Member Functions | |
| EtcFstab (const string &prefix="", bool rootMounted=true) | |
| bool | findDevice (const string &dev, FstabEntry &entry) const |
| bool | findDevice (const std::list< string > &dl, FstabEntry &entry) const |
| bool | findMount (const string &mount, FstabEntry &entry) const |
| bool | findUuidLabel (const string &uuid, const string &label, FstabEntry &entry) const |
| bool | findIdPath (const std::list< string > &id, const string &path, FstabEntry &entry) const |
| void | setDevice (const FstabEntry &entry, const string &device) |
| int | updateEntry (const string &dev, const string &mount, const string &fs, const string &opts="defaults") |
| int | updateEntry (const FstabChange &entry) |
| int | addEntry (const FstabChange &entry) |
| int | removeEntry (const FstabEntry &entry) |
| int | changeRootPrefix (const string &prfix) |
| void | getFileBasedLoops (const string &prefix, std::list< FstabEntry > &l) |
| void | getEntries (std::list< FstabEntry > &l) |
| string | addText (bool doing, bool crypto, const string &mp) |
| string | updateText (bool doing, bool crypto, const string &mp) |
| string | removeText (bool doing, bool crypto, const string &mp) |
| int | flush () |
| int | findPrefix (const AsciiFile &tab, const string &mount) |
Protected Member Functions | |
| void | readFiles () |
| AsciiFile * | findFile (const FstabEntry &e, AsciiFile *&fstab, AsciiFile *&cryptotab, int &lineno) |
| bool | findCrtab (const FstabEntry &e, const AsciiFile &crtab, int &lineno) |
| bool | findCrtab (const string &device, const AsciiFile &crtab, int &lineno) |
| void | makeStringList (const FstabEntry &e, std::list< string > &ls) |
| void | makeCrtabStringList (const FstabEntry &e, std::list< string > &ls) |
| string | updateLine (const std::list< string > &ol, const std::list< string > &nl, const string &line) |
| string | createLine (const std::list< string > &ls, unsigned fields, unsigned *flen) |
| string | createTabLine (const FstabEntry &e) |
| void | makeCrStringList (const FstabEntry &e, std::list< string > &ls) |
| string | createCrtabLine (const FstabEntry &e) |
Protected Attributes | |
| string | prefix |
| std::list< Entry > | co |
Static Protected Attributes | |
| static unsigned | fstabFields [6] = { 20, 20, 10, 21, 1, 1 } |
| static unsigned | cryptotabFields [6] = { 11, 15, 20, 10, 10, 1 } |
| static unsigned | crypttabFields [6] = { 15, 20, 10, 1 } |
Classes | |
| struct | Entry |
| EtcFstab::EtcFstab | ( | const string & | prefix = "", |
|
| bool | rootMounted = true | |||
| ) |
References readFiles(), and y2milestone.
| bool EtcFstab::findDevice | ( | const string & | dev, | |
| FstabEntry & | entry | |||
| ) | const |
| bool storage::EtcFstab::findDevice | ( | const std::list< string > & | dl, | |
| FstabEntry & | entry | |||
| ) | const |
| bool EtcFstab::findMount | ( | const string & | mount, | |
| FstabEntry & | entry | |||
| ) | const |
| bool EtcFstab::findUuidLabel | ( | const string & | uuid, | |
| const string & | label, | |||
| FstabEntry & | entry | |||
| ) | const |
| bool EtcFstab::findIdPath | ( | const std::list< string > & | id, | |
| const string & | path, | |||
| FstabEntry & | entry | |||
| ) | const |
| void EtcFstab::setDevice | ( | const FstabEntry & | entry, | |
| const string & | device | |||
| ) |
| int storage::EtcFstab::updateEntry | ( | const string & | dev, | |
| const string & | mount, | |||
| const string & | fs, | |||
| const string & | opts = "defaults" | |||
| ) |
Referenced by storage::Volume::doFstabUpdate().
| int EtcFstab::updateEntry | ( | const FstabChange & | entry | ) |
| int EtcFstab::addEntry | ( | const FstabChange & | entry | ) |
References storage::EtcFstab::Entry::ADD, co, storage::FstabChange::dentry, storage::FstabChange::mount, y2mil, and y2milestone.
Referenced by storage::Storage::addFstabEntry(), and storage::Volume::doFstabUpdate().
| int EtcFstab::removeEntry | ( | const FstabEntry & | entry | ) |
| int EtcFstab::changeRootPrefix | ( | const string & | prfix | ) |
References storage::EtcFstab::Entry::ADD, co, storage::FSTAB_CHANGE_PREFIX_IMPOSSIBLE, storage::EtcFstab::Entry::NONE, prefix, readFiles(), and y2milestone.
Referenced by storage::Storage::rootMounted().
| void storage::EtcFstab::getFileBasedLoops | ( | const string & | prefix, | |
| std::list< FstabEntry > & | l | |||
| ) |
Referenced by storage::LoopCo::getLoopData().
| void storage::EtcFstab::getEntries | ( | std::list< FstabEntry > & | l | ) |
Referenced by storage::NfsCo::getNfsData().
| string EtcFstab::addText | ( | bool | doing, | |
| bool | crypto, | |||
| const string & | mp | |||
| ) |
| string EtcFstab::updateText | ( | bool | doing, | |
| bool | crypto, | |||
| const string & | mp | |||
| ) |
References storage::_(), and storage::sformat().
Referenced by storage::Volume::doFstabUpdate(), and storage::Volume::fstabUpdateText().
| string EtcFstab::removeText | ( | bool | doing, | |
| bool | crypto, | |||
| const string & | mp | |||
| ) |
References storage::_(), and storage::sformat().
Referenced by storage::Volume::doFstabUpdate(), and storage::Volume::fstabUpdateText().
| int EtcFstab::flush | ( | ) |
References storage::EtcFstab::Entry::ADD, storage::AsciiFile::append(), storage::checkDir(), co, createCrtabLine(), storage::createPath(), createTabLine(), storage::extractNthWord(), findCrtab(), findFile(), findPrefix(), storage::FSTAB_REMOVE_ENTRY_NOT_FOUND, storage::FSTAB_UPDATE_ENTRY_NOT_FOUND, storage::AsciiFile::insert(), makeCrStringList(), makeStringList(), storage::EtcFstab::Entry::NONE, printFile(), storage::AsciiFile::remove(), storage::EtcFstab::Entry::REMOVE, storage::AsciiFile::removeIfEmpty(), storage::EtcFstab::Entry::UPDATE, storage::AsciiFile::updateFile(), updateLine(), y2milestone, and y2war.
Referenced by storage::Storage::addFstabEntry(), and storage::Volume::doFstabUpdate().
| int EtcFstab::findPrefix | ( | const AsciiFile & | tab, | |
| const string & | mount | |||
| ) |
References storage::AsciiFile::fileName(), storage::AsciiFile::find(), y2mil, and y2milestone.
Referenced by flush().
| void EtcFstab::readFiles | ( | ) | [protected] |
References storage::EtcFstab::Entry::ADD, storage::FstabEntry::calcDependent(), co, storage::FstabEntry::cr_key, storage::FstabEntry::cr_opts, storage::FstabEntry::crypto, storage::FstabEntry::cryptt, storage::FstabEntry::dentry, storage::FstabEntry::device, storage::FstabEntry::dmcrypt, storage::ENC_LUKS, storage::FstabEntry::encr, storage::FstabEntry::freq, storage::FstabEntry::fs, getline(), storage::FstabEntry::loop, storage::FstabEntry::loop_dev, storage::FstabEntry::mount, storage::EtcFstab::Entry::nnew, storage::FstabEntry::noauto, storage::EtcFstab::Entry::old, storage::FstabEntry::opts, storage::FstabEntry::passno, prefix, storage::splitString(), storage::Volume::toEncType(), y2mil, and y2milestone.
Referenced by changeRootPrefix(), and EtcFstab().
| AsciiFile * EtcFstab::findFile | ( | const FstabEntry & | e, | |
| AsciiFile *& | fstab, | |||
| AsciiFile *& | cryptotab, | |||
| int & | lineno | |||
| ) | [protected] |
References storage::FstabEntry::crypto, storage::FstabEntry::dentry, storage::FstabEntry::mount, prefix, and y2milestone.
Referenced by flush().
| bool EtcFstab::findCrtab | ( | const FstabEntry & | e, | |
| const AsciiFile & | crtab, | |||
| int & | lineno | |||
| ) | [protected] |
References storage::FstabEntry::dentry, storage::FstabEntry::device, storage::AsciiFile::find(), and y2milestone.
Referenced by flush().
| bool EtcFstab::findCrtab | ( | const string & | device, | |
| const AsciiFile & | crtab, | |||
| int & | lineno | |||
| ) | [protected] |
References storage::AsciiFile::find(), and y2milestone.
| void storage::EtcFstab::makeStringList | ( | const FstabEntry & | e, | |
| std::list< string > & | ls | |||
| ) | [protected] |
Referenced by createTabLine(), and flush().
| void storage::EtcFstab::makeCrtabStringList | ( | const FstabEntry & | e, | |
| std::list< string > & | ls | |||
| ) | [protected] |
| string storage::EtcFstab::updateLine | ( | const std::list< string > & | ol, | |
| const std::list< string > & | nl, | |||
| const string & | line | |||
| ) | [protected] |
Referenced by flush().
| string storage::EtcFstab::createLine | ( | const std::list< string > & | ls, | |
| unsigned | fields, | |||
| unsigned * | flen | |||
| ) | [protected] |
Referenced by createCrtabLine(), and createTabLine().
| string EtcFstab::createTabLine | ( | const FstabEntry & | e | ) | [protected] |
References createLine(), storage::FstabEntry::crypto, cryptotabFields, storage::FstabEntry::dentry, fstabFields, storage::lengthof(), makeStringList(), storage::FstabEntry::mount, y2mil, and y2milestone.
Referenced by flush().
| void storage::EtcFstab::makeCrStringList | ( | const FstabEntry & | e, | |
| std::list< string > & | ls | |||
| ) | [protected] |
Referenced by createCrtabLine(), and flush().
| string EtcFstab::createCrtabLine | ( | const FstabEntry & | e | ) | [protected] |
References createLine(), crypttabFields, storage::FstabEntry::dentry, storage::FstabEntry::device, storage::lengthof(), makeCrStringList(), storage::FstabEntry::mount, and y2milestone.
Referenced by flush().
unsigned EtcFstab::fstabFields = { 20, 20, 10, 21, 1, 1 } [static, protected] |
Referenced by createTabLine().
unsigned EtcFstab::cryptotabFields = { 11, 15, 20, 10, 10, 1 } [static, protected] |
Referenced by createTabLine().
unsigned EtcFstab::crypttabFields = { 15, 20, 10, 1 } [static, protected] |
Referenced by createCrtabLine().
string storage::EtcFstab::prefix [protected] |
Referenced by changeRootPrefix(), findFile(), and readFiles().
std::list<Entry> storage::EtcFstab::co [protected] |
Referenced by addEntry(), changeRootPrefix(), findDevice(), findIdPath(), findMount(), findUuidLabel(), flush(), readFiles(), removeEntry(), setDevice(), and updateEntry().
1.5.5