diff --git a/gucc/include/gucc/fstab.hpp b/gucc/include/gucc/fstab.hpp index ce66954..4a41bd8 100644 --- a/gucc/include/gucc/fstab.hpp +++ b/gucc/include/gucc/fstab.hpp @@ -1,37 +1,16 @@ #ifndef FSTAB_HPP #define FSTAB_HPP -#include // for optional +#include "gucc/partition.hpp" + #include // for string #include // for string_view #include // for vector namespace gucc::fs { -struct Partition final { - std::string fstype; - std::string mountpoint; - std::string uuid_str; - std::string device; - - // mount points that will be written in fstab, - // excluding subvol={subvol name} - // if device is ssd, mount options for ssd should be appended - std::string mount_opts; - std::optional luks_mapper_name; - std::optional luks_uuid; - - /* - // subvolumes per partition - // e.g we have partition /dev/nvme0n1p1 with subvolumes: /@, /@home, /@cache - std::optional> subvols; - */ - // subvolume name if the partition is btrrfs subvolume - std::optional subvolume; -}; - // Generate fstab -auto generate_fstab(const std::vector& partitions, std::string_view root_mountpoint, std::string_view crypttab_opts) noexcept -> bool; +auto generate_fstab(const std::vector& partitions, std::string_view root_mountpoint) noexcept -> bool; // Generate fstab into string auto generate_fstab_content(const std::vector& partitions) noexcept -> std::string; diff --git a/gucc/include/gucc/partition.hpp b/gucc/include/gucc/partition.hpp new file mode 100644 index 0000000..d5bef54 --- /dev/null +++ b/gucc/include/gucc/partition.hpp @@ -0,0 +1,33 @@ +#ifndef PARTITION_HPP +#define PARTITION_HPP + +#include // for optional +#include // for string + +namespace gucc::fs { + +struct Partition final { + std::string fstype; + std::string mountpoint; + std::string uuid_str; + std::string device; + + // mount points that will be written in fstab, + // excluding subvol={subvol name} + // if device is ssd, mount options for ssd should be appended + std::string mount_opts; + std::optional luks_mapper_name; + std::optional luks_uuid; + + /* + // subvolumes per partition + // e.g we have partition /dev/nvme0n1p1 with subvolumes: /@, /@home, /@cache + std::optional> subvols; + */ + // subvolume name if the partition is btrrfs subvolume + std::optional subvolume; +}; + +} // namespace gucc::fs + +#endif // PARTITION_HPP