Teach INITRAMFS_ROOT_UID and INITRAMFS_ROOT_GID that -1 means "current user".
Showing the changes to scripts (1 of 2 files). Show all
Unified · Split
| @@ -271,10 +271,12 @@ while [ $# -gt 0 ]; do · 270 unmodified lines | ||
| 271 | 271 | case "$arg" in |
| 272 | 272 | "-u") # map $1 to uid=0 (root) |
| 273 | 273 | root_uid="$1" |
| 274 | + [ "$root_uid" = "-1" ] && root_uid=$(id -u || echo 0) | |
| 274 | 275 | shift |
| 275 | 276 | ;; |
| 276 | 277 | "-g") # map $1 to gid=0 (root) |
| 277 | 278 | root_gid="$1" |
| 279 | + [ "$root_gid" = "-1" ] && root_gid=$(id -g || echo 0) | |
| 278 | 280 | shift |
| 279 | 281 | ;; |
| 280 | 282 | "-d") # display default initramfs list |