From owner-freebsd-arm@FreeBSD.ORG Mon Dec 29 02:22:37 2014 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2D6047B5 for ; Mon, 29 Dec 2014 02:22:37 +0000 (UTC) Received: from mail-wg0-x236.google.com (mail-wg0-x236.google.com [IPv6:2a00:1450:400c:c00::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C13A96426B for ; Mon, 29 Dec 2014 02:22:31 +0000 (UTC) Received: by mail-wg0-f54.google.com with SMTP id z12so123065wgg.27 for ; Sun, 28 Dec 2014 18:22:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=oM9uq06Pm2z9xhxCVrbTovsxkgRNJeKn+lGyNf6XpWA=; b=e8qD/jPWQ/I9EOqWkvV4zowwNdnEX00GUA+iNodmW1rkAZ1kNd0Qxa1MolCCcuEWgL ZZviy9fs4V/jLbx2sgVlTKXwGqVLmA8OFseicp2gmffsEvXeOeqZAKoSiLf3j9CjyX3/ OeoFIYRT1DlC9fOR3YNJMn1U4PS3YLVwrJLrJBEQKpl/8FvbaIVfvx68T43u+3qtYsZK QzPhDRzGp4ZPrjdiGkCcjZPcVfMbRYzEVpT8MEWGN/YbHQ7kJAbACeRliErl0gR/h3QK vQag4Huyl3loXsWG9EUGrfqGWTM8jVU+jiAtoRYQ03wLwYZXufX65zzjdo/heXtPyLtY Idpg== MIME-Version: 1.0 X-Received: by 10.180.20.6 with SMTP id j6mr89249231wie.59.1419819749989; Sun, 28 Dec 2014 18:22:29 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.106.195 with HTTP; Sun, 28 Dec 2014 18:22:29 -0800 (PST) In-Reply-To: References: Date: Sun, 28 Dec 2014 18:22:29 -0800 X-Google-Sender-Auth: aOhTT69y8sUu_0CHY72ZlWF5-gQ Message-ID: Subject: Re: building a raspberry pi -head image, the dirty non-root way From: Adrian Chadd To: "freebsd-arm@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Dec 2014 02:22:37 -0000 So, I'm 98% successful after christmas. It boots fine to a login prompt and DHCP's networking. I put the whole thing up in git for people to look at and go "god damnit adrian, what the hell!" at. https://github.com/erikarn/rpi-build So, here's my experience so far: * do we have uboot usb keyboard support? that'd be nice. * do we have ubldr usb keyboard support? that'd also be nice. * the default console is the uart; is there a way to edit that in a config file in the boot partition, or are we stuck with it being something in the FFS partition? (This made debugging quite amusing, as it took me a while to remember that although I may get /some/ kernel messages on the screen, i may be actually seeing the secondary console. Grr.) * the install-as-user thing is nice, but we don't have any simple tools to modify that whole setup post-install, but before an image is generated. My build script has an install custom target which does some dirty things to populate the changes and a new metalog. Yes, it involves some reasonably clean perl code. Only because I didn't want to learn awk. * .. and we don't have any nice way of populating packages into it without root privs and chroot. Sniffle. That would be rather nice. * We don't seem to install the dtb anywhere during installworld/installkernel. There's a builddtb target, but it only sticks it in the kernel build directory. That doesn't seem to get installed in the root filesystem when doing a make installworld/installkernel. Why is that? The bits that don't work and should likely get looked at: * Some of the suid binaries aren't - eg passwd. 'su' is fine. 'passwd' isn't. It's odd, because in METALOG: ./usr/bin/passwd type=file uname=root gname=wheel mode=04555 size=7000 The difference? adrian@test-2:~/work/freebsd/head-arm/src % cat ../root/METALOG.NEW | grep 'bin/passwd ' ./usr/bin/passwd type=file uname=root gname=wheel mode=04555 size=7000 adrian@test-2:~/work/freebsd/head-arm/src % cat ../root/METALOG.NEW | grep 'bin/su ' ./usr/bin/su type=file uname=root gname=wheel mode=04555 size=14444 flags=schg .. so I'll file a PR about that and see if it's to do with the flags field or something else. Ok, so the positives. * besides warnings and the "hm, some permissions are whack" the install-as-user bits are quite nice. * I'm using an older uboot from ian - I'm going to stop doing that soon and either use his package -or- just expect the user has installed the right cross-compiler/toolchain target and will make it that way. I'm not sure yet. * makefs is quite nice - except that symlinks are owned by adrian:wheel. I really should PR that. * mkimg is really nice - Marcel, you're wonderful. It'd be nice if it could do nested partitioning without having to call itself externally and pipe data around - but it'll do for now. I have a few things I'd like to customise as part of this build script (mostly automatically adding users/groups, adding a default IP address rather than DHCP; all the crap that i'd like out of a default image generator so I can do development) but hey, here's another build script. :-) I'm not expecting anyone but me to use this. I'm hoping this stuff gets folded into nanobsd at some point as it'd be nice to use makefs / mkimg to do lifting rather than using md's and direct calls to fdisk. I also wanted to see how far along the "Don't do stuff as root" building had come - and it's quite far, so that's quite good. What we're missing are the tools /after/ this to populate it with packages and other stuff, and to be able to customise the filesystem at the same time we're customising the metalog that we feed into makefs. -adrian