History

scripts/gen_initramfs_list.sh: teach INITRAMFS_ROOT_UID and INITRAMFS_ROOT_GID that -1 means "current user".

Teach INITRAMFS_ROOT_UID and INITRAMFS_ROOT_GID that -1 means "current user".

Rob Landley committed 9 years ago

Commit 595a22a1 parent 39229202 files · +6 −8Browse files

Unified · Split

2 files
  1. scripts/gen_initramfs_list.sh +2 −0
  2. usr/Kconfig +4 −8
scripts/gen_initramfs_list.sh+2−0
@@ -271,10 +271,12 @@ while [ $# -gt 0 ]; do · 270 unmodified lines
271271 case "$arg" in
272272 "-u") # map $1 to uid=0 (root)
273273 root_uid="$1"
274+ [ "$root_uid" = "-1" ] && root_uid=$(id -u || echo 0)
274275 shift
275276 ;;
276277 "-g") # map $1 to gid=0 (root)
277278 root_gid="$1"
279+ [ "$root_gid" = "-1" ] && root_gid=$(id -g || echo 0)
278280 shift
279281 ;;
280282 "-d") # display default initramfs list
usr/Kconfig+4−8
@@ -36,10 +36,8 @@ config INITRAMFS_ROOT_UID · 35 unmodified lines
3636 depends on INITRAMFS_SOURCE!=""
3737 default "0"
3838 help
39− This setting is only meaningful if the INITRAMFS_SOURCE is
40− contains a directory. Setting this user ID (UID) to something
41− other than "0" will cause all files owned by that UID to be
42− owned by user root in the initial ramdisk image.
39+ If INITRAMFS_SOURCE points to a directory, files owned by this UID
40+ (-1 = current user) will be owned by root in the resulting image.
4341
4442 If you are not sure, leave it set to "0".
4543
@@ -48,10 +46,8 @@ config INITRAMFS_ROOT_GID · 2 unmodified lines
4846 depends on INITRAMFS_SOURCE!=""
4947 default "0"
5048 help
51− This setting is only meaningful if the INITRAMFS_SOURCE is
52− contains a directory. Setting this group ID (GID) to something
53− other than "0" will cause all files owned by that GID to be
54− owned by group root in the initial ramdisk image.
49+ If INITRAMFS_SOURCE points to a directory, files owned by this GID
50+ (-1 = current group) will be owned by root in the resulting image.
5551
5652 If you are not sure, leave it set to "0".
5753

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t