[systemd-devel] [PATCH v2] gpt-generator: Find device on a stateless system

Lennart Poettering lennart at poettering.net
Sun Apr 12 11:02:04 PDT 2015


On Sat, 11.04.15 01:52, Tobias Hunger (tobias.hunger at gmail.com) wrote:

> A stateless system has a tmpfs as root file system. That obviously
> does not have any block device associated with it. So try falling back
> to the device of the /usr filesystem if the root filesystem fails.

Thanks! Applied!

> ---
>  src/gpt-auto-generator/gpt-auto-generator.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c
> index 99dc50f..96a8447 100644
> --- a/src/gpt-auto-generator/gpt-auto-generator.c
> +++ b/src/gpt-auto-generator/gpt-auto-generator.c
> @@ -658,8 +658,13 @@ static int add_mounts(void) {
>          if (r < 0)
>                  return log_error_errno(r, "Failed to determine block device of root file system: %m");
>          else if (r == 0) {
> -                log_debug("Root file system not on a (single) block device.");
> -                return 0;
> +                r = get_block_device("/usr", &devno);
> +                if (r < 0)
> +                        return log_error_errno(r, "Failed to determine block device of /usr file system: %m");
> +                else if (r == 0) {
> +                        log_debug("Neither root nor /usr file system are on a (single) block device.");
> +                        return 0;
> +                }
>          }
>  
>          return enumerate_partitions(devno);
> -- 
> 2.3.5
> 
> 


Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list