From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 235991381F3 for ; Fri, 18 Oct 2013 18:20:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CBB82E0C19; Fri, 18 Oct 2013 18:20:04 +0000 (UTC) Received: from mail-we0-f176.google.com (mail-we0-f176.google.com [74.125.82.176]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 87BE4E0C0D for ; Fri, 18 Oct 2013 18:20:03 +0000 (UTC) Received: by mail-we0-f176.google.com with SMTP id w62so4083504wes.21 for ; Fri, 18 Oct 2013 11:20:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=h21bMOFG1FD710ymw9uIY8sN12eLSZgM5WoPNmVSbAE=; b=KwGvDgxMAtoq1maISfLS7aSlJU4eLCeVX/xjrLM3yz+UgdqwjK+cTfef8cAfByqCwj K2AjHQXb+o8N/zI/6Mkfqm/ndsZ7D9sTS5Vq4UHOPFzhlFYtwA3CCfOvwsO61ePBFnOu FEivoAPommkptKyI44euPDpIYN5gFSXmTIX13/+kYLBovXiEI0MF+R8eLHnrq3fbUiMt 4p6MDL1g7IRne7EvvMhU48CeRbUVrBo3IdB4VOCxwEvxYL6HG1Y/BqjTRpPTEyn20nt/ t3F+elVAtp+ZQOhJSIXwfQsbOOevQDg1rSMQIdedQhFookaX6nQTnulXAQ6Pj0q/hLuZ lq3A== X-Received: by 10.180.198.79 with SMTP id ja15mr528155wic.36.1382120402023; Fri, 18 Oct 2013 11:20:02 -0700 (PDT) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Received: by 10.194.7.37 with HTTP; Fri, 18 Oct 2013 11:19:21 -0700 (PDT) From: Francisco Ares Date: Fri, 18 Oct 2013 15:19:21 -0300 Message-ID: Subject: [gentoo-user] trying to build an embedded (x86) system almost with no tweaks To: gentoo-user Content-Type: multipart/alternative; boundary=047d7b624252997e2104e907fb94 X-Archives-Salt: b02965dd-486e-4ce4-ae14-0c0e928315af X-Archives-Hash: c9ef65afcf92457138e0e9c0ae595bcb --047d7b624252997e2104e907fb94 Content-Type: text/plain; charset=UTF-8 Hi. I am trying to build an embedded system to be deployed in a SATA flash disk, and most of the file system will be read-only. There will be a tempfs on /temp and a read-write partition for /var (in fact, a unionfs with the static part of /var and that read-write partition) and the rest of the root tree will (has to) be read-only. There is already a development system with everything working as expected on the final system. Adjusting a few files, when I try to simply put it to a squashfs, the system boots with several errors, when trying to write to "/etc" and "/var" (this last one looks obvious, but there are some init process trying to create temporary files on "/etc"). But even so, I got a prompt, this because one of these adjusted files is "/etc/inittab", where I set up "agetty" to auto-login a user. The system claims that it does not know who is this user (permissions problem, probably). Now, looking on that new issue regarding "/usr" and "/" being on a different partitions, I have found the file in "/etc/initramfs.mounts" , that claims to automagicaly mount specified fstab entries before initramfs gives way to real-root environment. So in this system, for now, there is the directory structure bellow: /.var.rw - here a r/w ext4 partition is to be mounted; /.var.ro - here there are all files and directories expected to be on a usual /var; /var - here a unionfs mount is to join the ones above The part from fstab for this is ("/.var.ro" is present on the squashfs root file system): /dev/sda2 / squashfs noatime,ro 0 1 /dev/sda3 /.var.rw ext4 noatime,defaults 0 2 none /var unionfs nonempty,cow,umask=022,dirs=/.var.rw/=rw:/.var.ro/=ro 0 0 I said it is not yet fully functional because it seems there is something wrong with permissions, because it ends up with a unknown user prompt from which I could list the root directories (something similar is being made to "/etc", so the same results): total 9,0K drwxr-xr-x 23 root root 385 Out 18 14:18 ./ drwxr-xr-x 4 root root 4,0K Set 24 09:46 ../ drwxr-xr-x 47 root root 2,6K Out 17 16:03 .etc.ro/ drwxr-xr-x 2 root root 40 Out 18 15:09 .etc.rw/ drwxr-xr-x 11 root root 262 Out 17 16:03 .var.ro/ drwxr-xr-x 6 root root 4,0K Out 18 14:33 .var.rw/ drwxr-xr-x 2 root root 1,4K Out 7 14:46 bin/ drwxr-xr-x 4 root root 1,0K Out 18 14:15 boot/ d????????? 3 root root 2,3K Ago 1 00:17 dev/ drwxr-xr-x 1 root root 2,6K Out 17 16:03 etc/ drwxr-xr-x 3 root root 54 Ago 22 07:55 home/ lrwxrwxrwx 1 root root 5 Out 7 14:05 lib -> lib64/ drwxr-xr-x 12 root root 3,2K Out 17 08:51 lib64/ drwxr-xr-x 2 root root 28 Ago 1 00:16 media/ drwxr-xr-x 2 root root 28 Ago 1 00:16 opt/ drwxr-xr-x 2 root root 3 Jul 31 22:22 proc/ drwxr-xr-x 2 root root 136 Out 18 14:18 root/ drwxr-xr-x 5 root root 120 Ago 30 08:59 run/ drwxr-xr-x 2 root root 2,9K Out 17 08:51 sbin/ drwxr-xr-x 2 root root 28 Ago 1 00:16 sys/ drwxrwxrwt 2 root root 3 Out 18 14:18 tmp/ drwxr-xr-x 13 root root 267 Out 17 11:18 usr/ d????????? 1 root root 262 Out 17 16:03 var/ Any hints? Thanks Francisco --047d7b624252997e2104e907fb94 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi.

I am trying to build an embedde= d system to be deployed in a SATA flash disk, and most of the file system w= ill be read-only.

There will be a tempfs on /temp and a read-write = partition for /var (in fact, a unionfs with the static part of /var and tha= t read-write partition) and the rest of the root tree will (has to) be read= -only.

There is already a development system with everything working as expect= ed on the final system.

Adjusting a few files, when I try to simply = put it to a squashfs, the system boots with several errors, when trying to = write to "/etc" and "/var" (this last one looks obvious= , but there are some init process trying to create temporary files on "= ;/etc").

But even so, I got a prompt, this because one of these adjusted files i= s "/etc/inittab", where I set up "agetty" to auto-login= a user. The system claims that it does not know who is this user (permissi= ons problem, probably).

Now, looking on that new issue regarding "/usr" and "/&q= uot; being on a different partitions, I have found the file in "/etc/i= nitramfs.mounts" , that claims to automagicaly mount specified fstab e= ntries before initramfs gives way to real-root environment.

So in this system, for now, there is the directory structure bellow:
/.var.rw=C2=A0 - here a r/w ext4 partiti= on is to be mounted;
/.var.ro=C2=A0 - here= there are all files and directories expected to be on a usual /var;
/var - here a unionfs mount is to join the ones above

The part from = fstab for this is ("/.var.ro" is pr= esent on the squashfs root file system):

/dev/sda2=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 squashfs=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 noatime,ro=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0 1
/dev/sda3=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 /.var.rw=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ex= t4=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 noatim= e,defaults=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= 0 2
none=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /var=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 unionfs=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 nonempty,cow,umask=3D022,dirs=3D/.var.rw/=3Drw:/.var.ro/=3Dro=C2=A0=C2=A0 0 0

I said it is not yet fully functional because it seems there is somethi= ng wrong with permissions, because it ends up with a unknown user prompt fr= om which I could list the root directories (something similar is being made= to "/etc", so the same results):

total 9,0K
drwxr-xr-x 23 root root=C2=A0 385 Out 18 14:18 ./
drwx= r-xr-x=C2=A0 4 root root 4,0K Set 24 09:46 ../
drwxr-xr-x 47 root root 2= ,6K Out 17 16:03 .etc.ro/
drwxr-xr-x=C2= =A0 2 root root=C2=A0=C2=A0 40 Out 18 15:09 .etc= .rw/
drwxr-xr-x 11 root root=C2=A0 262 Out 17 16:03 .= var.ro/
drwxr-xr-x=C2=A0 6 root root 4,0K Out 18 14:33 .var.rw/
drwxr-xr-x=C2=A0 2 root root 1,4K Out=C2=A0 7= 14:46 bin/
drwxr-xr-x=C2=A0 4 root root 1,0K Out 18 14:15 boot/
d?????????=C2=A0 3 root root 2,3K Ago=C2=A0 1 00:17 dev/
drwxr-xr-x=C2= =A0 1 root root 2,6K Out 17 16:03 etc/
drwxr-xr-x=C2=A0 3 root root=C2= =A0=C2=A0 54 Ago 22 07:55 home/
lrwxrwxrwx=C2=A0 1 root root=C2=A0=C2=A0= =C2=A0 5 Out=C2=A0 7 14:05 lib -> lib64/
drwxr-xr-x 12 root root 3,2K= Out 17 08:51 lib64/
drwxr-xr-x=C2=A0 2 root root=C2=A0=C2=A0 28 Ago=C2=A0 1 00:16 media/
drw= xr-xr-x=C2=A0 2 root root=C2=A0=C2=A0 28 Ago=C2=A0 1 00:16 opt/
drwxr-xr= -x=C2=A0 2 root root=C2=A0=C2=A0=C2=A0 3 Jul 31 22:22 proc/
drwxr-xr-x= =C2=A0 2 root root=C2=A0 136 Out 18 14:18 root/
drwxr-xr-x=C2=A0 5 root = root=C2=A0 120 Ago 30 08:59 run/
drwxr-xr-x=C2=A0 2 root root 2,9K Out 17 08:51 sbin/
drwxr-xr-x=C2=A0 2 = root root=C2=A0=C2=A0 28 Ago=C2=A0 1 00:16 sys/
drwxrwxrwt=C2=A0 2 root = root=C2=A0=C2=A0=C2=A0 3 Out 18 14:18 tmp/
drwxr-xr-x 13 root root=C2=A0= 267 Out 17 11:18 usr/
d?????????=C2=A0 1 root root=C2=A0 262 Out 17 16:= 03 var/

Any hints?

Thanks
Francisco
--047d7b624252997e2104e907fb94--