* [Buildroot] buildroot with SquashFS root file system
@ 2011-12-06 15:20 Emmanuel BOUAZIZ
2011-12-06 15:56 ` Michael S. Zick
` (2 more replies)
0 siblings, 3 replies; 13+ messages in thread
From: Emmanuel BOUAZIZ @ 2011-12-06 15:20 UTC (permalink / raw)
To: buildroot
Hi,
I'm trying to run buildroot 2011.11 on an atom based board, booting via PXE.
I've selected the SquashFS 4.x root filesystem (xz compressed), bzImage as the Kernel binary format, and
syslinux/pxelinux as the bootloader.
In the system configuration, I checked "remount root filesystem read-write during boot"
In the kernel configuration, I checked Initial RAM filesystem and RAM disk support+XZ, and SquashFS/XZ filesystem support.
On the PXE server, I put these kernel parameters: append vga=0x305 fbcon=scrollback:4096k initrd=rootfs.squashfs
Here is what I get during the boot sequence:
(...)
RAMDISK: squashfs filesystem found at block 0
RAMDISK: Loading 14133KiB [1 disk] into ram disk.../
usb 1-7: new high speed USB device number 3 using ehci_hcd
VFS: Mounted root (squashfs filesystem) readonly on device 1:0
usb 2-2: new full speed USB device number 2 using uhci_hcd
can't open /dev/null: No such file or directory
can't open /dev/null: No such file or directory
can't open /dev/null: No such file or directory
can't open /dev/null: No such file or directory
can't open /dev/null: No such file or directory
can't open /dev/null: No such file or directory
Starting logging: OK
Starting mdev...
mdev: /sys/class: No such file or directory
Starting network...
hub 2-2:1.0: USB found
hub 2-2:1.0: 3 ports detected
ifup: can't open '/var/run/ifstate': Read-only file system
(...)
I get the exact same result if I try to use a cramfs instead of a SquashFS.
Oddly enough, it works perfectly with a cpio root filesystem, or when I integrate the root filesystem as an initramfs in
the kernel image.
I probably missed an important item, but can't figure which. Any help appreciated.
Thanks,
--
Emmanuel
^ permalink raw reply [flat|nested] 13+ messages in thread* [Buildroot] buildroot with SquashFS root file system
2011-12-06 15:20 [Buildroot] buildroot with SquashFS root file system Emmanuel BOUAZIZ
@ 2011-12-06 15:56 ` Michael S. Zick
2011-12-06 17:59 ` Emmanuel BOUAZIZ
2011-12-06 20:29 ` Peter Korsgaard
2011-12-13 17:18 ` Arnout Vandecappelle
2 siblings, 1 reply; 13+ messages in thread
From: Michael S. Zick @ 2011-12-06 15:56 UTC (permalink / raw)
To: buildroot
On Tue December 6 2011, Emmanuel BOUAZIZ wrote:
>
> Hi,
>
> I'm trying to run buildroot 2011.11 on an atom based board, booting via PXE.
>
> I've selected the SquashFS 4.x root filesystem (xz compressed), bzImage as the Kernel binary format, and
> syslinux/pxelinux as the bootloader.
> In the system configuration, I checked "remount root filesystem read-write during boot"
>
> In the kernel configuration, I checked Initial RAM filesystem and RAM disk support+XZ, and SquashFS/XZ filesystem support.
>
> On the PXE server, I put these kernel parameters: append vga=0x305 fbcon=scrollback:4096k initrd=rootfs.squashfs
>
> Here is what I get during the boot sequence:
>
> (...)
> RAMDISK: squashfs filesystem found at block 0
> RAMDISK: Loading 14133KiB [1 disk] into ram disk.../
> usb 1-7: new high speed USB device number 3 using ehci_hcd
> VFS: Mounted root (squashfs filesystem) readonly on device 1:0
> usb 2-2: new full speed USB device number 2 using uhci_hcd
> can't open /dev/null: No such file or directory
> can't open /dev/null: No such file or directory
> can't open /dev/null: No such file or directory
> can't open /dev/null: No such file or directory
> can't open /dev/null: No such file or directory
> can't open /dev/null: No such file or directory
> Starting logging: OK
> Starting mdev...
> mdev: /sys/class: No such file or directory
> Starting network...
> hub 2-2:1.0: USB found
> hub 2-2:1.0: 3 ports detected
> ifup: can't open '/var/run/ifstate': Read-only file system
> (...)
>
> I get the exact same result if I try to use a cramfs instead of a SquashFS.
>
> Oddly enough, it works perfectly with a cpio root filesystem, or when I integrate the root filesystem as an initramfs in
> the kernel image.
>
> I probably missed an important item, but can't figure which.
> Any help appreciated.
>
SquashFS is a read-only file system.
So which of the "device support" options did you choose?
You'll need one that puts devices in something writable, like tmpfs.
Mike
> Thanks,
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] buildroot with SquashFS root file system
2011-12-06 15:56 ` Michael S. Zick
@ 2011-12-06 17:59 ` Emmanuel BOUAZIZ
2011-12-06 18:16 ` Michael S. Zick
0 siblings, 1 reply; 13+ messages in thread
From: Emmanuel BOUAZIZ @ 2011-12-06 17:59 UTC (permalink / raw)
To: buildroot
On 12/06/2011 04:56 PM, Michael S. Zick wrote:
> SquashFS is a read-only file system.
>
> So which of the "device support" options did you choose?
> You'll need one that puts devices in something writable, like tmpfs.
>
Hi Michael,
thank you for your answer.
I'm not sure what you mean by "device support" options.
I enabled mdev and in the kernel's generic driver options, I checked "Maintain a devtmpfs filesystem to mount at /dev"
and "Automount devtmpfs at /dev after the kernel mounted the rootfs"
regards,
--
Emmanuel
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] buildroot with SquashFS root file system
2011-12-06 17:59 ` Emmanuel BOUAZIZ
@ 2011-12-06 18:16 ` Michael S. Zick
2011-12-08 10:31 ` Emmanuel BOUAZIZ
0 siblings, 1 reply; 13+ messages in thread
From: Michael S. Zick @ 2011-12-06 18:16 UTC (permalink / raw)
To: buildroot
On Tue December 6 2011, Emmanuel BOUAZIZ wrote:
>
> On 12/06/2011 04:56 PM, Michael S. Zick wrote:
> > SquashFS is a read-only file system.
> >
> > So which of the "device support" options did you choose?
> > You'll need one that puts devices in something writable, like tmpfs.
> >
> Hi Michael,
> thank you for your answer.
>
> I'm not sure what you mean by "device support" options.
>
That is what I meant. Just didn't have the right name in mind.
> I enabled mdev and in the kernel's generic driver options,
> I checked "Maintain a devtmpfs filesystem to mount at /dev"
> and "Automount devtmpfs at /dev after the kernel mounted the rootfs"
>
My next guess -
Was the kernel built by Buildroot or did you build it otherwise?
If the kernel wasn't built by Buildroot, it may not have the
required options set for tmpfs, devtmpfs, automount devtmpfs.
If built outside of Buildroot, what version kernel?
The usual thing for troubleshooting an initramFS system is:
rdinit=/bin/sh
(or whatever path/name you shell program is)
You could try that, but I expect if it can't open /dev/null
it will not be able to open /dev/console either. ;-)
Mike
> regards,
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] buildroot with SquashFS root file system
2011-12-06 18:16 ` Michael S. Zick
@ 2011-12-08 10:31 ` Emmanuel BOUAZIZ
2011-12-08 10:48 ` Peter Korsgaard
0 siblings, 1 reply; 13+ messages in thread
From: Emmanuel BOUAZIZ @ 2011-12-08 10:31 UTC (permalink / raw)
To: buildroot
On 12/06/2011 07:16 PM, Michael S. Zick wrote:
> My next guess -
>
> Was the kernel built by Buildroot or did you build it otherwise?
> If the kernel wasn't built by Buildroot, it may not have the
> required options set for tmpfs, devtmpfs, automount devtmpfs.
>
> If built outside of Buildroot, what version kernel?
>
I build the kernel using buildroot. It's version 3.1.4
On 12/06/2011 09:29 PM, Peter Korsgaard wrote:
>
> An initramfs would be a better option than initrd, but OK. Did you build
> the kernel with buildroot or manually?
>
I'll probably use the initramfs since it already works and you say it's a better option. But I'd like to make the
SquashFS work now that I've started, it's frustrating not to succeed :p
I build the kernel with buildroot, it'version 3.1.4
>
> Emmanuel> Here is what I get during the boot sequence:
>
> Emmanuel> (...)
> Emmanuel> RAMDISK: squashfs filesystem found at block 0
> Emmanuel> RAMDISK: Loading 14133KiB [1 disk] into ram disk.../
> Emmanuel> usb 1-7: new high speed USB device number 3 using ehci_hcd
> Emmanuel> VFS: Mounted root (squashfs filesystem) readonly on device 1:0
> Emmanuel> usb 2-2: new full speed USB device number 2 using uhci_hcd
> Emmanuel> can't open /dev/null: No such file or directory
> Emmanuel> can't open /dev/null: No such file or directory
> Emmanuel> can't open /dev/null: No such file or directory
> Emmanuel> can't open /dev/null: No such file or directory
> Emmanuel> can't open /dev/null: No such file or directory
> Emmanuel> can't open /dev/null: No such file or directory
>
> Do you have CONFIG_DEVTMPFS enabled in your kernel? From a quick look at
> the kernel sources (init/do_mounts_initrd.c) I see that the kernel
> doesn't mount devtmpfs automatically when an initrd is used, so you'll
> need to add a wrapper script as /linuxrc which mounts it and execs
> /sbin/init, similar to how we do it for initramfs (fs/cpio/init):
>
> # devtmpfs does not get automounted for initramfs
> /bin/mount -t devtmpfs devtmpfs /dev
> exec 0</dev/console
> exec 1>/dev/console
> exec 2>/dev/console
> exec /sbin/init $*
>
Yes it's enabled. I've put that same mechanism in squashfs (modified fs/squashfs/squashfs.mk and added fs/squashfs/init)
and added init=/init in kernel parameters but the /init script is not run.
I took a look at the possible kernel parameters and added root=/dev/ram0 rw to the kernel parameters.
Now I get a "devtmpfs: mounted" before the /init script is run, and another saying "mount: mounting devtmpfs on /dev
failed: Device or resource busy" when the /init script is run :D
So I removed the /init script, the "can't open /dev/null" problem is gone.
The only remaining problem is that the whole filesystem is read-only despite the 'rw' including /var and /tmp.
regards,
--
Emmanuel
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] buildroot with SquashFS root file system
2011-12-08 10:31 ` Emmanuel BOUAZIZ
@ 2011-12-08 10:48 ` Peter Korsgaard
2011-12-08 11:26 ` Emmanuel BOUAZIZ
0 siblings, 1 reply; 13+ messages in thread
From: Peter Korsgaard @ 2011-12-08 10:48 UTC (permalink / raw)
To: buildroot
>>>>> "Emmanuel" == Emmanuel BOUAZIZ <ebouaziz@neotion.com> writes:
Hi,
Emmanuel> Yes it's enabled. I've put that same mechanism in squashfs
Emmanuel> (modified fs/squashfs/squashfs.mk and added fs/squashfs/init)
Emmanuel> and added init=/init in kernel parameters but the /init
Emmanuel> script is not run.
Initrd uses /linuxrc, not /init.
Emmanuel> The only remaining problem is that the whole filesystem is
Emmanuel> read-only despite the 'rw' including /var and /tmp.
That's because you're using squashfs. Squashfs is a readonly
filesystem. Either move to initramfs or use ext2 in your initrd.
/tmp should be a tmpfs though (check /etc/fstab), and most of /var
symlinks to /tmp/.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] buildroot with SquashFS root file system
2011-12-08 10:48 ` Peter Korsgaard
@ 2011-12-08 11:26 ` Emmanuel BOUAZIZ
2011-12-08 14:27 ` Michael S. Zick
0 siblings, 1 reply; 13+ messages in thread
From: Emmanuel BOUAZIZ @ 2011-12-08 11:26 UTC (permalink / raw)
To: buildroot
On 12/08/2011 11:48 AM, Peter Korsgaard wrote:
> Emmanuel> The only remaining problem is that the whole filesystem is
> Emmanuel> read-only despite the 'rw' including /var and /tmp.
>
> That's because you're using squashfs. Squashfs is a readonly
> filesystem. Either move to initramfs or use ext2 in your initrd.
>
> /tmp should be a tmpfs though (check /etc/fstab), and most of /var
> symlinks to /tmp/.
>
Oh that's rigth, it's writable, I mixed with another directory that I wanted to write to (/usr/local). I mounted it as
tmpfs too and everything's fine now. Thanks a lot for your help :)
Well, I'll switch back to initramfs anyway since it's less tricky.
regards,
--
Emmanuel
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] buildroot with SquashFS root file system
2011-12-08 11:26 ` Emmanuel BOUAZIZ
@ 2011-12-08 14:27 ` Michael S. Zick
2011-12-08 17:34 ` Emmanuel BOUAZIZ
0 siblings, 1 reply; 13+ messages in thread
From: Michael S. Zick @ 2011-12-08 14:27 UTC (permalink / raw)
To: buildroot
On Thu December 8 2011, Emmanuel BOUAZIZ wrote:
>
> On 12/08/2011 11:48 AM, Peter Korsgaard wrote:
>
> > Emmanuel> The only remaining problem is that the whole filesystem is
> > Emmanuel> read-only despite the 'rw' including /var and /tmp.
> >
> > That's because you're using squashfs. Squashfs is a readonly
> > filesystem. Either move to initramfs or use ext2 in your initrd.
> >
>
> > /tmp should be a tmpfs though (check /etc/fstab), and most of /var
> > symlinks to /tmp/.
> >
>
> Oh that's rigth, it's writable, I mixed with another directory that I wanted to write to (/usr/local). I mounted it as
> tmpfs too and everything's fine now. Thanks a lot for your help :)
>
> Well, I'll switch back to initramfs anyway since it's less tricky.
>
You do not have to put your entire run-time file system in the initramfs,
only what you need to establish the full run-time file system.
I.E: Your full run-time file system can remain as a squashfs file.
You just have to provide the "init" scripting to get it loaded and
mounted while in the early user space of the initramfs.
See: EarlyUserSpace in the kernel documentation tree;
and maybe look at how some "LiveCD" systems handle the setup.
Mike
> regards,
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] buildroot with SquashFS root file system
2011-12-08 14:27 ` Michael S. Zick
@ 2011-12-08 17:34 ` Emmanuel BOUAZIZ
0 siblings, 0 replies; 13+ messages in thread
From: Emmanuel BOUAZIZ @ 2011-12-08 17:34 UTC (permalink / raw)
To: buildroot
On 12/08/2011 03:27 PM, Michael S. Zick wrote:
> You do not have to put your entire run-time file system in the initramfs,
> only what you need to establish the full run-time file system.
> I.E: Your full run-time file system can remain as a squashfs file.
> You just have to provide the "init" scripting to get it loaded and
> mounted while in the early user space of the initramfs.
>
> See: EarlyUserSpace in the kernel documentation tree;
> and maybe look at how some "LiveCD" systems handle the setup.
I'll take a look at that, thank you!
--
Emmanuel
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] buildroot with SquashFS root file system
2011-12-06 15:20 [Buildroot] buildroot with SquashFS root file system Emmanuel BOUAZIZ
2011-12-06 15:56 ` Michael S. Zick
@ 2011-12-06 20:29 ` Peter Korsgaard
2011-12-13 17:18 ` Arnout Vandecappelle
2 siblings, 0 replies; 13+ messages in thread
From: Peter Korsgaard @ 2011-12-06 20:29 UTC (permalink / raw)
To: buildroot
>>>>> "Emmanuel" == Emmanuel BOUAZIZ <ebouaziz@neotion.com> writes:
Emmanuel> Hi,
Emmanuel> I'm trying to run buildroot 2011.11 on an atom based board,
Emmanuel> booting via PXE.
Emmanuel> I've selected the SquashFS 4.x root filesystem (xz
Emmanuel> compressed), bzImage as the Kernel binary format, and
Emmanuel> syslinux/pxelinux as the bootloader.
Emmanuel> In the system configuration, I checked "remount root
Emmanuel> filesystem read-write during boot"
That doesn't make much sense for a readonly file system like squashfs.
Emmanuel> In the kernel configuration, I checked Initial RAM filesystem
Emmanuel> and RAM disk support+XZ, and SquashFS/XZ filesystem support.
Emmanuel> On the PXE server, I put these kernel parameters: append
Emmanuel> vga=0x305 fbcon=scrollback:4096k initrd=rootfs.squashfs
An initramfs would be a better option than initrd, but OK. Did you build
the kernel with buildroot or manually?
Emmanuel> Here is what I get during the boot sequence:
Emmanuel> (...)
Emmanuel> RAMDISK: squashfs filesystem found at block 0
Emmanuel> RAMDISK: Loading 14133KiB [1 disk] into ram disk.../
Emmanuel> usb 1-7: new high speed USB device number 3 using ehci_hcd
Emmanuel> VFS: Mounted root (squashfs filesystem) readonly on device 1:0
Emmanuel> usb 2-2: new full speed USB device number 2 using uhci_hcd
Emmanuel> can't open /dev/null: No such file or directory
Emmanuel> can't open /dev/null: No such file or directory
Emmanuel> can't open /dev/null: No such file or directory
Emmanuel> can't open /dev/null: No such file or directory
Emmanuel> can't open /dev/null: No such file or directory
Emmanuel> can't open /dev/null: No such file or directory
Do you have CONFIG_DEVTMPFS enabled in your kernel? From a quick look at
the kernel sources (init/do_mounts_initrd.c) I see that the kernel
doesn't mount devtmpfs automatically when an initrd is used, so you'll
need to add a wrapper script as /linuxrc which mounts it and execs
/sbin/init, similar to how we do it for initramfs (fs/cpio/init):
# devtmpfs does not get automounted for initramfs
/bin/mount -t devtmpfs devtmpfs /dev
exec 0</dev/console
exec 1>/dev/console
exec 2>/dev/console
exec /sbin/init $*
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] buildroot with SquashFS root file system
2011-12-06 15:20 [Buildroot] buildroot with SquashFS root file system Emmanuel BOUAZIZ
2011-12-06 15:56 ` Michael S. Zick
2011-12-06 20:29 ` Peter Korsgaard
@ 2011-12-13 17:18 ` Arnout Vandecappelle
2011-12-14 8:40 ` Thomas Petazzoni
2011-12-14 9:01 ` Peter Korsgaard
2 siblings, 2 replies; 13+ messages in thread
From: Arnout Vandecappelle @ 2011-12-13 17:18 UTC (permalink / raw)
To: buildroot
On Tuesday 06 December 2011 16:20:35 Emmanuel BOUAZIZ wrote:
> On the PXE server, I put these kernel parameters: append vga=0x305 fbcon=scrollback:4096k initrd=rootfs.squashfs
Hm, my assumption that you would only use an initramfs with a
cpio archive was clearly wrong. So perhaps we should execute the
ROOTFS_CPIO_ADD_INIT hook unconditionally for all filesystems?
Regards,
Arnout
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286540
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 31BB CF53 8660 6F88 345D 54CC A836 5879 20D7 CF43
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] buildroot with SquashFS root file system
2011-12-13 17:18 ` Arnout Vandecappelle
@ 2011-12-14 8:40 ` Thomas Petazzoni
2011-12-14 9:01 ` Peter Korsgaard
1 sibling, 0 replies; 13+ messages in thread
From: Thomas Petazzoni @ 2011-12-14 8:40 UTC (permalink / raw)
To: buildroot
Le Tue, 13 Dec 2011 18:18:53 +0100,
Arnout Vandecappelle <arnout@mind.be> a ?crit :
> Hm, my assumption that you would only use an initramfs with a
> cpio archive was clearly wrong. So perhaps we should execute the
> ROOTFS_CPIO_ADD_INIT hook unconditionally for all filesystems?
I'd prefer not to. I don't want this wrapper script in all filesystems
just to solve the initramfs problem, because it is useless for the
filesystem is not used as an initramfs filesystem.
Regards,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] buildroot with SquashFS root file system
2011-12-13 17:18 ` Arnout Vandecappelle
2011-12-14 8:40 ` Thomas Petazzoni
@ 2011-12-14 9:01 ` Peter Korsgaard
1 sibling, 0 replies; 13+ messages in thread
From: Peter Korsgaard @ 2011-12-14 9:01 UTC (permalink / raw)
To: buildroot
>>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:
Arnout> On Tuesday 06 December 2011 16:20:35 Emmanuel BOUAZIZ wrote:
>> On the PXE server, I put these kernel parameters: append vga=0x305 fbcon=scrollback:4096k initrd=rootfs.squashfs
Arnout> Hm, my assumption that you would only use an initramfs with a
Arnout> cpio archive was clearly wrong. So perhaps we should execute the
Arnout> ROOTFS_CPIO_ADD_INIT hook unconditionally for all filesystems?
This is initrd, not initramfs (which isn't really recommended anymore).
As far as I can see, devtmpfs does get mounted for initrd's
(init/do_mounts.c:prepare_namespace()).
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2011-12-14 9:01 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-06 15:20 [Buildroot] buildroot with SquashFS root file system Emmanuel BOUAZIZ
2011-12-06 15:56 ` Michael S. Zick
2011-12-06 17:59 ` Emmanuel BOUAZIZ
2011-12-06 18:16 ` Michael S. Zick
2011-12-08 10:31 ` Emmanuel BOUAZIZ
2011-12-08 10:48 ` Peter Korsgaard
2011-12-08 11:26 ` Emmanuel BOUAZIZ
2011-12-08 14:27 ` Michael S. Zick
2011-12-08 17:34 ` Emmanuel BOUAZIZ
2011-12-06 20:29 ` Peter Korsgaard
2011-12-13 17:18 ` Arnout Vandecappelle
2011-12-14 8:40 ` Thomas Petazzoni
2011-12-14 9:01 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox