mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: LKML <linux-kernel@vger.kernel.org>, linux-arch@vger.kernel.org
Cc: Mike Frysinger <vapier@gentoo.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH 12/14] kbuild: add support for squashing uid/gid in gen_initramfs_list.sh
Date: Fri, 18 May 2007 09:00:18 +0200	[thread overview]
Message-ID: <20070518070018.GL12284@uranus.ravnborg.org> (raw)
In-Reply-To: <20070518064126.GA12193@uranus.ravnborg.org>

>From 2ecaa761242e76780a35647f3d3749ee6d04d618 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Thu, 10 May 2007 22:44:28 -0700
Subject: [PATCH 12/14] kbuild: add support for squashing uid/gid in gen_initramfs_list.sh

Sometimes it is useful to squash all uid's/gid's to 0:0 regardless of
current owner.  For example, in build systems that get run as arbitrary
users (uClinux-dist).  This adds a special "squash" keyword so you can do
'-g squash -u squash' and have ownership squashed to root.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
 scripts/gen_initramfs_list.sh |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/scripts/gen_initramfs_list.sh b/scripts/gen_initramfs_list.sh
index 683eb12..684fb9c 100644
--- a/scripts/gen_initramfs_list.sh
+++ b/scripts/gen_initramfs_list.sh
@@ -19,11 +19,11 @@ $0 [-o <file>] [-u <uid>] [-g <gid>] {-d | <cpio_source>} ...
 	-o <file>      Create gzipped initramfs file named <file> using
 		       gen_init_cpio and gzip
 	-u <uid>       User ID to map to user ID 0 (root).
-		       <uid> is only meaningful if <cpio_source>
-		       is a directory.
+		       <uid> is only meaningful if <cpio_source> is a
+		       directory.  "squash" forces all files to uid 0.
 	-g <gid>       Group ID to map to group ID 0 (root).
-		       <gid> is only meaningful if <cpio_source>
-		       is a directory.
+		       <gid> is only meaningful if <cpio_source> is a
+		       directory.  "squash" forces all files to gid 0.
 	<cpio_source>  File list or directory for cpio archive.
 		       If <cpio_source> is a .cpio file it will be used
 		       as direct input to initramfs.
@@ -113,8 +113,8 @@ parse() {
 	local gid="$4"
 	local ftype=$(filetype "${location}")
 	# remap uid/gid to 0 if necessary
-	[ "$uid" -eq "$root_uid" ] && uid=0
-	[ "$gid" -eq "$root_gid" ] && gid=0
+	[ "$root_uid" = "squash" ] && uid=0 || [ "$uid" -eq "$root_uid" ] && uid=0
+	[ "$root_gid" = "squash" ] && gid=0 || [ "$gid" -eq "$root_gid" ] && gid=0
 	local str="${mode} ${uid} ${gid}"
 
 	[ "${ftype}" == "invalid" ] && return 0
-- 
1.5.1.rc3.20.gaa453


  parent reply	other threads:[~2007-05-18  6:59 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-18  6:41 kbuild fixes for -rc1 (touches all arch .lds files) Sam Ravnborg
2007-05-18  6:49 ` [PATCH 01/14] kbuild: make modpost section warnings clearer Sam Ravnborg
2007-05-18  6:50   ` David Miller
2007-05-18  6:52   ` Jan Engelhardt
2007-05-18  7:12     ` Sam Ravnborg
2007-05-18  6:50 ` [PATCH 02/14] kbuild: make better section mismatch reports on i386, arm and mips Sam Ravnborg
2007-05-18  6:51 ` [PATCH 03/14] kbuild: add "Section mismatch" warning whitelist for powerpc Sam Ravnborg
2007-05-18  6:51 ` [PATCH 04/14] all-archs: consolidate .text section definition in asm-generic Sam Ravnborg
2007-05-18  6:52 ` [PATCH 05/14] all-archs: consolidate .data " Sam Ravnborg
2007-05-18  7:16   ` David Miller
2007-05-18  9:42     ` Sam Ravnborg
2007-05-18 10:21       ` David Miller
2007-05-18 10:42         ` Sam Ravnborg
2007-05-18  6:53 ` [PATCH 06/14] kbuild: introduce __init_refok/__initdata_refok to supress section mismatch warnings Sam Ravnborg
2007-05-18  9:03   ` Andreas Schwab
2007-05-18  9:21     ` Sam Ravnborg
2007-05-18  6:54 ` [PATCH 07/14] init/main: use __init_refok to fix section mismatch Sam Ravnborg
2007-05-18  6:55 ` [PATCH 08/14] mm: fix section mismatch warnings Sam Ravnborg
2007-05-18  6:56 ` [PATCH 09/14] mm/slab: fix section mismatch warning Sam Ravnborg
2007-05-18  6:57 ` [PATCH 10/14] powerpc: Fix the MODALIAS generation in modpost for of devices Sam Ravnborg
2007-05-18  6:59 ` [PATCH 11/14] kbuild: add support for reading stdin with gen_init_cpio Sam Ravnborg
2007-05-18  7:00 ` Sam Ravnborg [this message]
2007-05-18  7:01 ` [PATCH 13/14] kbuild: include limits.h in sumversion.c for PATH_MAX Sam Ravnborg
2007-05-18  7:01 ` [PATCH 14/14] kconfig: search harder for curses library in check-lxdialog.sh Sam Ravnborg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070518070018.GL12284@uranus.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vapier@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome