On Wed, Nov 26, 2025 at 12:56:23AM +0800, Kang-Che Sung wrote:
> On Mon, Nov 24, 2025 at 11:29 AM Osama Abdelkader
> <[email protected]> wrote:
> >
> > Add a simple uuidgen utility that generates RFC 4122 compliant
> > UUIDs (version 4, random). Uses the existing generate_uuid()
> > function from libbb.
> >
> > Features:
> > - Generates standard format UUIDs: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
> > - RFC 4122 version 4 compliant
> > - Minimal implementation (~1.1 kb)
> > - NOFORK applet for efficiency
> 
> A simple reminder that, in Linux,
> `cat /proc/sys/kernel/random/uuid` can be an alias to uuidgen.

Thanks for the reminder! Yes, on Linux systems with /proc mounted,
"cat /proc/sys/kernel/random/uuid" can generate UUIDs.

However, there are a few cases where a standalone uuidgen applet is still
useful for BusyBox:

1. Portability:
   The /proc/sys/kernel/random/uuid interface is Linux-specific.
   BusyBox runs on platforms/environments where /proc is absent,
   read-only, or not mounted yet (initramfs, rescue shells, static
   minimal systems, Android).

2. Consistency:
   BusyBox already implements many util-linux utilities, including some
   that overlap with kernel-provided interfaces (e.g. dmesg, mount,
   fstrim, lsblk). uuidgen fills one of the remaining gaps.

3. Features:
   Using libbb's generate_uuid() ensures RFC 4122 v4 UUIDs regardless of
   kernel configuration. Some systems disable /proc/sys/kernel/random/*
   for security.

If these reasons make sense, I'm happy to revise or extend the applet as needed.

BR,
Osama
_______________________________________________
busybox mailing list
[email protected]
https://lists.busybox.net/mailman/listinfo/busybox

Reply via email to