Teach INITRAMFS_ROOT_UID and INITRAMFS_ROOT_GID that -1 means "current user".
Unified · Split
| @@ -271,10 +271,12 @@ while [ $# -gt 0 ]; do · 270 unmodified lines | |||
| 271 | case "$arg" in | 271 | case "$arg" in |
| 272 | "-u") # map $1 to uid=0 (root) | 272 | "-u") # map $1 to uid=0 (root) |
| 273 | root_uid="$1" | 273 | root_uid="$1" |
| 274 | [ "$root_uid" = "-1" ] && root_uid=$(id -u || echo 0) | ||
| 274 | shift | 275 | shift |
| 275 | ;; | 276 | ;; |
| 276 | "-g") # map $1 to gid=0 (root) | 277 | "-g") # map $1 to gid=0 (root) |
| 277 | root_gid="$1" | 278 | root_gid="$1" |
| 279 | [ "$root_gid" = "-1" ] && root_gid=$(id -g || echo 0) | ||
| 278 | shift | 280 | shift |
| 279 | ;; | 281 | ;; |
| 280 | "-d") # display default initramfs list | 282 | "-d") # display default initramfs list |
| @@ -36,10 +36,8 @@ config INITRAMFS_ROOT_UID · 35 unmodified lines | |||
| 36 | depends on INITRAMFS_SOURCE!="" | 36 | depends on INITRAMFS_SOURCE!="" |
| 37 | default "0" | 37 | default "0" |
| 38 | help | 38 | help |
| 39 | This setting is only meaningful if the INITRAMFS_SOURCE is | 39 | If INITRAMFS_SOURCE points to a directory, files owned by this UID |
| 40 | contains a directory. Setting this user ID (UID) to something | 40 | (-1 = current user) will be owned by root in the resulting image. |
| 41 | other than "0" will cause all files owned by that UID to be | ||
| 42 | owned by user root in the initial ramdisk image. | ||
| 43 | 41 | ||
| 44 | If you are not sure, leave it set to "0". | 42 | If you are not sure, leave it set to "0". |
| 45 | 43 | ||
| @@ -48,10 +46,8 @@ config INITRAMFS_ROOT_GID · 2 unmodified lines | |||
| 48 | depends on INITRAMFS_SOURCE!="" | 46 | depends on INITRAMFS_SOURCE!="" |
| 49 | default "0" | 47 | default "0" |
| 50 | help | 48 | help |
| 51 | This setting is only meaningful if the INITRAMFS_SOURCE is | 49 | If INITRAMFS_SOURCE points to a directory, files owned by this GID |
| 52 | contains a directory. Setting this group ID (GID) to something | 50 | (-1 = current group) will be owned by root in the resulting image. |
| 53 | other than "0" will cause all files owned by that GID to be | ||
| 54 | owned by group root in the initial ramdisk image. | ||
| 55 | 51 | ||
| 56 | If you are not sure, leave it set to "0". | 52 | If you are not sure, leave it set to "0". |
| 57 | 53 | ||