commit 30f988fbe79552042c5afca477d2e73d0a2d3d9e
Author: Mike Kelly <mike@weatherwax.co.uk>
Date:   Tue Sep 29 11:08:39 2026 +0100

    hurd: support calls to getuid before _hurd_ports is initialised
    
    getuid() is called indirectly by libparted during file system
    bootstrap when using a gpt partitioned disk. This is within
    uuid_generate() in libuuid. Returning the root uid 0 at this time is
    appropriate as a special case.
    Message-ID: <20260929100903.196744-1-mike@weatherwax.co.uk>
    
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

diff --git a/sysdeps/mach/hurd/getuid.c b/sysdeps/mach/hurd/getuid.c
index 7de221c945..4520919934 100644
--- a/sysdeps/mach/hurd/getuid.c
+++ b/sysdeps/mach/hurd/getuid.c
@@ -27,6 +27,10 @@ __getuid (void)
   error_t err;
   uid_t uid;
 
+  if (_hurd_ports == NULL)
+    /* We are still in system bootstrap. */
+    return 0;
+
 retry:
   HURD_CRITICAL_BEGIN;
   __mutex_lock (&_hurd_id.lock);
