From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#22050: [PATCH v4 1/2] linux-boot: Add make-static-device-nodes. Date: Fri, 15 Dec 2017 23:37:19 +0100 Message-ID: <876097fwio.fsf@gnu.org> References: <20171213223240.605-1-dannym@scratchpost.org> <20171214195636.787-1-dannym@scratchpost.org> <20171214195636.787-2-dannym@scratchpost.org> <87374cmipa.fsf@gnu.org> <20171215182717.478928f4@scratchpost.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47999) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePycI-00088D-G0 for bug-guix@gnu.org; Fri, 15 Dec 2017 17:38:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePycE-00018e-I7 for bug-guix@gnu.org; Fri, 15 Dec 2017 17:38:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:55764) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ePycE-00018G-CV for bug-guix@gnu.org; Fri, 15 Dec 2017 17:38:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ePycE-0003y0-2l for bug-guix@gnu.org; Fri, 15 Dec 2017 17:38:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <20171215182717.478928f4@scratchpost.org> (Danny Milosavljevic's message of "Fri, 15 Dec 2017 18:27:17 +0100") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Danny Milosavljevic Cc: 22050@debbugs.gnu.org Danny Milosavljevic skribis: > Hi Ludo, > > On Fri, 15 Dec 2017 10:41:37 +0100 > ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > >> This looks good, but would it be enough to do: >>=20 >> (mkdir-p (dirname (string-append "/dev/" name))) > > mkdir permission needs to be specified to be #o755. > > I've seen some variants in guix - but they are all buried somewhere deep: > > ./gnu/services/cups.scm: (define (mkdir-p/perms directory owner pe= rms) > ./gnu/services/dns.scm: (define (mkdir-p/perms directory owner perms) > ./gnu/services/mail.scm: (define (mkdir-p/perms directory owner perm= s) > ./guix/build/utils.scm:(define (mkdir-p dir) > ./guix/build/graft.scm:(define* (mkdir-p* dir #:optional (mode #o755)) Oh, I didn=E2=80=99t think we had this many variants. > I don't feel good relying on magical unspecified permissions in code requ= ired to boot the system. I think mkdir-p itself subtracts the umask or som= ething. Is the umask guaranteed to be 0 at the point of usage of make-stat= ic-device-nodes ? I=E2=80=99m not 100% sure. You could set =E2=80=98umask=E2=80=99 explicitl= y given that it=E2=80=99s single-threaded and all at this point, but it=E2=80=99s probably clearer to explicitly specify the mode like you did initially. So I guess you can forget my comment and apply the original variant (or perhaps explicitly copy =E2=80=98mkdir-p/perms=E2=80=99 so we can find it m= ore easily when we factorize!). Thanks for explaining! Ludo=E2=80=99.