Clarifications on fork family syscalls - no longer in process.c?

2014-02-17 Thread stl
Hello all,

I was working on the 2.6 kernel (2.6.37) and I have just downloaded
the 3.13 Linux release and noticed that sys_fork(), sys_vfork(),
sys_clone() are no longer defined in /kernel/process.c

I have done some searches into the kernel and through the changelogs
of the different versions, but was not able to conclude where the fork
syscalls are.. and if they still exist..

Has the fork procedure changed?

When the changes have been done (since which version)?

Thanks a lot for the clarifications.

Regards

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Clarifications on PFN_UP(x) macro

2013-06-04 Thread stl
Hello,
I need some clarifications concerning the macro

#define PFN_UP(x)(((x) + PAGE_SIZE-1) >> PAGE_SHIFT)

found in "pfn.h"

I suppose that its aim is to give the page frame number of the page
following the page holding the physical address x, contrary to
PFN_DOWN(x) which give the page frame number of the page holding the
address x.

Assuming that the first page has the range 0x to 0x0FFF,
the second 0x1000 to 0x1FFF and so on, it seems that there is
an issu with the starting address of each page, for example:
x = 0x1  (PFN number 10)
0x1 + 0xFFF >> 12=10, but should be 11 no?

I certainly misunderstood something.
Could someone clarify this point please?

Thanks.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Manually accessing file contents from bprm->file

2012-11-13 Thread stl
Hello,
I  am trying to boot a custom linux-2.6.37 port, but I am stuck at the
point where the kernel launches /init executable (since the initial
filesystem was mounted with initramfs support).

After investigations, it appears that a problem occurs during
prepare_binprm() function.
This function is responsible for copying the 128 bytes header of the
executable to bprm->buf.

However in my case, bprm->buf is filled with zeroes after this step.

The kernel_read() function receives bprm->buf and bprm->file as operand.

So the address in memory (in the initramfs) of the executable should be
accessible from bprm->file (file object of /init).

My question is:
How can I manually (e.g. in the debugger) access the contents of the /init
file (stored in memory, in the initramfs), from the bprm->file structure?
(I'd like to check the data structures are in good shape and correctly
point to the /init contents).

Thanks in advance for your help.
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Problem during /init execve

2012-09-25 Thread stl
> so may be its not getxattr, but inode itself is null:

No, the inode is not NULL, it has been allocated in ram at adress 0x4654a0
and most of fields have been initialized.
For example:
d_inode->i_op->setattr = 
d_inode->i_op->getattr = 

> There are other options like CONFIG_AUDIT_TREE, disable that too. Also
> make sure that initrd image has the ext2 driver compiled for this
> kernel.

I am using initramfs support to mount VFS, not init ramdisk (initrd)
If I well understand, in my case I have not to deal with precompiled
drivers.
I only provide a config file to the CONFIG_INITRAMFS_SOURCE option.


> If you are using vanilla ext2 fs and CONFIG_EXT2_FS_XATTR is set, then
> it must be initialized in static inode operations table, look at:
> ext2_file_inode_operations for files
> ext2_dir_inode_operations for dir
> ext2_special_inode_operations for special files
> ext2_fast_symlink_inode_
> operations and ext2_symlink_inode_operations
> for symlinks
> all of them are compiled and initialized with generic_getxattr if you
> compile with CONFIG_EXT2_FS_XATTR.

Indeed, I dug in the source code, I agree with this.
Unfortunalety,  when debugging, it appears that inode->i_op->getxattr
remains null.

But I am confused.. for example, what the difference (in the .config file)
between
"File systems" and "Pseudo filesystems" menus?
Because we are speaking about my VFS, so at the moment, the kind of
the filesystem is not really important for me.
What the difference if I choose ramfs instead of ext2 for example?
I have some shadow zones that make me confused..

Thanks for your help.
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Problem during /init execve

2012-09-25 Thread stl
hi,

> Does your kernel config set this option:
> CONFIG_EXT2_FS_XATTR=y

The result is the same with and without CONFIG_EXT2_FS_XATTR enabled.

> And what is the state of CONFIG_AUDIT option? Do you need Kernel Audit
> support in your environment?

CONFIG_AUDIT is disabled in my config.
A priori, I don't need it at the moment.

After searching 'getxattr' reference in my whole linux directory, .getxattr
field
should be initialized with "generic_getxattr" in ext2 and ext3 case.
Is it really what it need, or does it require something specific else?

Thanks in advance
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Problem during /init execve

2012-09-24 Thread stl
Hi
it is for the VFS, ext2 is selected in my .config.

Concerning the filesystem, if the boot hasn't crashed until the start of
/init means
that it is correclty mounted (i suppose)
In addition, the kernel does not output the well known message:
"warning: unable to open an initial console", this means that it is able to
open the /dev/console.

I used initramfs support in order to mount the VFS, by supplying a config
file to
CONFIG_INITRAMFS_SOURCE option.

However, the getattr method has been initialized, but not the getxattr.

Have you any idea  what  the problem could be?
Thanks.


2012/9/24 Mulyadi Santosa 

> Hi...
>
> On Mon, Sep 24, 2012 at 9:58 PM, stl  wrote:
> > Hello all,
> >
> > What is the purpose of the inode->i_op->getxattr method?
>
> I think it has something related to extended attribute
>
> > During the boot of linux-2.6.37 on a new architecture, it crashes in the
> > get_vfs_caps_from_disk() function because of the following security
> check,
> > (in my case, this field is ot initialized).
> >
> > if (!inode || !inode->i_op->getxattr)
> >   return -ENODATA;
>
> May I know, what's the filesystem type that code currently checks? And
> are you sure that filesystem is completely ok?
>
> --
> regards,
>
> Mulyadi Santosa
> Freelance Linux trainer and consultant
>
> blog: the-hydra.blogspot.com
> training: mulyaditraining.blogspot.com
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Problem during /init execve

2012-09-24 Thread stl
Hello all,

What is the purpose of the inode->i_op->getxattr method?

During the boot of linux-2.6.37 on a new architecture, it crashes in the
get_vfs_caps_from_disk() function because of the following security check,
(in my case, this field is ot initialized).

if (!inode || !inode->i_op->getxattr)
  return -ENODATA;

Has anyone seen anything similar before ?

Where is this method initialized?

Thanks in advance
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


getxattr field not initialized when trying to execute /init during boot

2012-09-13 Thread stl
Hello all,
I am facing a problem when trying to boot linux 2.6.37 on a new
architecture.

At the end of the boot, it tries to launch /init by executing a sys_execve()

Here is the what it does:

sys_execve()
  |-> do_execve()
 |-> prepare_binprm()
 |->security_bprm_set_creds()
|->cap_bprm_set_creds()
 |->get_file_caps()
   |->get_vfs_caps_from_disk()


In the get_vfs_caps_from_disk(), these is a verification to know if
inode->i_op->getxattr
has been initialized.

In my case, it returns and error value, because this field is not
initialized.

So I am wondering by who and where this field is initialized?
And what is the aim of getxattr?

Thanks in advance!
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Is my rootfs correctly mounted?

2012-08-30 Thread stl
And another question,
since the kernel is booting with initramfs support,
is it normal that it tries to run /init instead of bin/init or sbin/init

To be more precise, it runs this:

if (ramdisk_execute_command) {
run_init_process(ramdisk_execute_command);   <---this
printk(KERN_WARNING "Failed to execute %s\n",
ramdisk_execute_command);
}

instead of this:

run_init_process("/sbin/init");
run_init_process("/etc/init");
run_init_process("/bin/init");
run_init_process("/bin/sh");

is it normal?

Thanks!

2012/8/30 stl 

> Thanks Rahul for your very quick answer.
> Glad to hear this.
> So, when does the message "VFS: Mounted root" appear?
> Maybe when using init ramdisk (initrd) support?
>
>
>
>
> 2012/8/30 Rahul Bedarkar 
>
>> yes root file system is mounted correctly. It is just it didn't find init.
>>
>> On Thu, Aug 30, 2012 at 8:10 PM, stl  wrote:
>> > Hello all,
>> > if I try to boot Linux 2.6.37 by supplying a configuration file to the
>> > kernel to create initramfs_data.cpio,
>> > (without any compression), is it normal that the kernel doesn't print
>> the
>> > well known message:
>> >
>> > VFS: Mounted root ( filesystem)
>> >
>> > even if the boot reaches the point where it tries to run init
>> executable?
>> > Does it mean that my rootfs is not correctly mounted?
>> >
>> > Here is the kernel output printed during the boot:
>> >
>> > <5>[0.00] Linux version 2.6.37+ (gcc version 4.6.3 20120816
>> (GCC) )
>> > #57 Thu Aug 30 12:00:00 CEST 2012
>> > [0.00] Built 1 zonelists in Zone order, mobility grouping off.
>> > Total pages: 2032
>> > [0.00] Kernel command line:
>> > [0.00] PID hash table entries: 32 (order: -5, 128 bytes)
>> > [0.00] Dentry cache hash table entries: 1024 (order: 0, 4096
>> bytes)
>> > [0.00] Inode-cache hash table entries: 1024 (order: 0, 4096
>> bytes)
>> > [0.00] Memory: 7656k/8196k available (1098k kernel code, 536k
>> > reserved, 2096117k data, 12k init)
>> > [0.00] SLUB: Genslabs=15, HWalign=16, Order=0-3, MinObjects=0,
>> > CPUs=1, Nodes=1
>> > [0.00] NR_IRQS:64
>> > [0.00] Timer start: timer interrupt every 10 ms
>> > [0.00] console [ttyS0] enabled
>> > [42949372.98] Calibrating delay loop... 0.00 BogoMIPS (lpj=0)
>> > [42949373.18] pid_max: default: 32768 minimum: 301
>> > [42949373.20] Security Framework initialized
>> > [42949373.21] Mount-cache hash table entries: 512
>> > [42949373.26] khelper used greatest stack depth: 7548 bytes left
>> > [42949373.34] kworker/u:0 used greatest stack depth: 7324 bytes left
>> > [42949373.50] bio: create slab  at 0
>> > [42949373.63] kworker/u:0 used greatest stack depth: 7260 bytes left
>> > [42949374.63] kworker/u:0 used greatest stack depth: 7180 bytes left
>> > [42949375.25] VFS: Disk quotas dquot_6.5.2
>> > [42949375.27] Dquot-cache hash table entries: 1024 (order 0, 4096
>> bytes)
>> > [42949375.39] msgmni has been set to 16
>> > [42949375.42] Block layer SCSI generic (bsg) driver version 0.4
>> loaded
>> > (major 253)
>> > [42949375.43] io scheduler noop registered
>> > [42949375.44] io scheduler deadline registered
>> > [42949375.46] io scheduler cfq registered (default)
>> > [42949375.49] Architecture Specific Serial Driver
>> > [42949375.50] ttyS0 at MMIO 0x40001000 (irq = 5) is a arch_uart
>> > [42949375.70] loop: module loaded
>> > [42949375.72] mice: PS/2 mouse device common for all mice
>> > [42949375.78] [ cut here ]
>> > [42949375.80] WARNING: at fs/proc/generic.c:589 .LBE364+0x0/0x2()
>> > [42949375.81] proc_dir_entry '/proc/schedstat' already registered
>> > [42949375.82] Modules linked in:
>> > [42949375.83] ---[ end trace 31baa4bbf69a8bbc ]---
>> > [42949375.85] Failed to execute /init
>> > [42949375.87] Kernel panic - not syncing: No init found.  Try
>> passing
>> > init= option to kernel. See Linux Documentation/init.txt for guidance.
>> >
>> > In my opinion, it seems to be correct because the following message
>> doesn't
>> > appear:
>> >
>> > Warning: unable to open an initial console
>> >
>> > This means that the file /dev/console has been found, so that the
>> rootfs has
>> > been correctly mounted, isn't it?
>> >
>> >
>> > Thanks in advance for your help!
>> >
>> >
>> > ___
>> > Kernelnewbies mailing list
>> > Kernelnewbies@kernelnewbies.org
>> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>> >
>>
>
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Is my rootfs correctly mounted?

2012-08-30 Thread stl
Thanks Rahul for your very quick answer.
Glad to hear this.
So, when does the message "VFS: Mounted root" appear?
Maybe when using init ramdisk (initrd) support?



2012/8/30 Rahul Bedarkar 

> yes root file system is mounted correctly. It is just it didn't find init.
>
> On Thu, Aug 30, 2012 at 8:10 PM, stl  wrote:
> > Hello all,
> > if I try to boot Linux 2.6.37 by supplying a configuration file to the
> > kernel to create initramfs_data.cpio,
> > (without any compression), is it normal that the kernel doesn't print the
> > well known message:
> >
> > VFS: Mounted root ( filesystem)
> >
> > even if the boot reaches the point where it tries to run init executable?
> > Does it mean that my rootfs is not correctly mounted?
> >
> > Here is the kernel output printed during the boot:
> >
> > <5>[0.00] Linux version 2.6.37+ (gcc version 4.6.3 20120816
> (GCC) )
> > #57 Thu Aug 30 12:00:00 CEST 2012
> > [0.00] Built 1 zonelists in Zone order, mobility grouping off.
> > Total pages: 2032
> > [0.00] Kernel command line:
> > [0.00] PID hash table entries: 32 (order: -5, 128 bytes)
> > [0.00] Dentry cache hash table entries: 1024 (order: 0, 4096
> bytes)
> > [0.00] Inode-cache hash table entries: 1024 (order: 0, 4096
> bytes)
> > [0.00] Memory: 7656k/8196k available (1098k kernel code, 536k
> > reserved, 2096117k data, 12k init)
> > [0.00] SLUB: Genslabs=15, HWalign=16, Order=0-3, MinObjects=0,
> > CPUs=1, Nodes=1
> > [0.00] NR_IRQS:64
> > [0.00] Timer start: timer interrupt every 10 ms
> > [0.00] console [ttyS0] enabled
> > [42949372.98] Calibrating delay loop... 0.00 BogoMIPS (lpj=0)
> > [42949373.18] pid_max: default: 32768 minimum: 301
> > [42949373.20] Security Framework initialized
> > [42949373.21] Mount-cache hash table entries: 512
> > [42949373.26] khelper used greatest stack depth: 7548 bytes left
> > [42949373.34] kworker/u:0 used greatest stack depth: 7324 bytes left
> > [42949373.50] bio: create slab  at 0
> > [42949373.63] kworker/u:0 used greatest stack depth: 7260 bytes left
> > [42949374.63] kworker/u:0 used greatest stack depth: 7180 bytes left
> > [42949375.25] VFS: Disk quotas dquot_6.5.2
> > [42949375.27] Dquot-cache hash table entries: 1024 (order 0, 4096
> bytes)
> > [42949375.39] msgmni has been set to 16
> > [42949375.42] Block layer SCSI generic (bsg) driver version 0.4
> loaded
> > (major 253)
> > [42949375.43] io scheduler noop registered
> > [42949375.44] io scheduler deadline registered
> > [42949375.46] io scheduler cfq registered (default)
> > [42949375.49] Architecture Specific Serial Driver
> > [42949375.50] ttyS0 at MMIO 0x40001000 (irq = 5) is a arch_uart
> > [42949375.70] loop: module loaded
> > [42949375.72] mice: PS/2 mouse device common for all mice
> > [42949375.78] [ cut here ]
> > [42949375.80] WARNING: at fs/proc/generic.c:589 .LBE364+0x0/0x2()
> > [42949375.81] proc_dir_entry '/proc/schedstat' already registered
> > [42949375.82] Modules linked in:
> > [42949375.83] ---[ end trace 31baa4bbf69a8bbc ]---
> > [42949375.85] Failed to execute /init
> > [42949375.87] Kernel panic - not syncing: No init found.  Try passing
> > init= option to kernel. See Linux Documentation/init.txt for guidance.
> >
> > In my opinion, it seems to be correct because the following message
> doesn't
> > appear:
> >
> > Warning: unable to open an initial console
> >
> > This means that the file /dev/console has been found, so that the rootfs
> has
> > been correctly mounted, isn't it?
> >
> >
> > Thanks in advance for your help!
> >
> >
> > ___
> > Kernelnewbies mailing list
> > Kernelnewbies@kernelnewbies.org
> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> >
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Is my rootfs correctly mounted?

2012-08-30 Thread stl
Hello all,
if I try to boot Linux 2.6.37 by supplying a configuration file to the
kernel to create initramfs_data.cpio,
(without any compression), is it normal that the kernel doesn't print the
well known message:

VFS: Mounted root ( filesystem)

even if the boot reaches the point where it tries to run init executable?
Does it mean that my rootfs is not correctly mounted?

Here is the kernel output printed during the boot:

<5>[0.00] Linux version 2.6.37+ (gcc version 4.6.3 20120816 (GCC) )
#57 Thu Aug 30 12:00:00 CEST 2012
[0.00] Built 1 zonelists in Zone order, mobility grouping off.
Total pages: 2032
[0.00] Kernel command line:
[0.00] PID hash table entries: 32 (order: -5, 128 bytes)
[0.00] Dentry cache hash table entries: 1024 (order: 0, 4096 bytes)
[0.00] Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
[0.00] Memory: 7656k/8196k available (1098k kernel code, 536k
reserved, 2096117k data, 12k init)
[0.00] SLUB: Genslabs=15, HWalign=16, Order=0-3, MinObjects=0,
CPUs=1, Nodes=1
[0.00] NR_IRQS:64
[0.00] Timer start: timer interrupt every 10 ms
[0.00] console [ttyS0] enabled
[42949372.98] Calibrating delay loop... 0.00 BogoMIPS (lpj=0)
[42949373.18] pid_max: default: 32768 minimum: 301
[42949373.20] Security Framework initialized
[42949373.21] Mount-cache hash table entries: 512
[42949373.26] khelper used greatest stack depth: 7548 bytes left
[42949373.34] kworker/u:0 used greatest stack depth: 7324 bytes left
[42949373.50] bio: create slab  at 0
[42949373.63] kworker/u:0 used greatest stack depth: 7260 bytes left
[42949374.63] kworker/u:0 used greatest stack depth: 7180 bytes left
[42949375.25] VFS: Disk quotas dquot_6.5.2
[42949375.27] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[42949375.39] msgmni has been set to 16
[42949375.42] Block layer SCSI generic (bsg) driver version 0.4 loaded
(major 253)
[42949375.43] io scheduler noop registered
[42949375.44] io scheduler deadline registered
[42949375.46] io scheduler cfq registered (default)
[42949375.49] Architecture Specific Serial Driver
[42949375.50] ttyS0 at MMIO 0x40001000 (irq = 5) is a arch_uart
[42949375.70] loop: module loaded
[42949375.72] mice: PS/2 mouse device common for all mice
[42949375.78] [ cut here ]
[42949375.80] WARNING: at fs/proc/generic.c:589 .LBE364+0x0/0x2()
[42949375.81] proc_dir_entry '/proc/schedstat' already registered
[42949375.82] Modules linked in:
[42949375.83] ---[ end trace 31baa4bbf69a8bbc ]---
[42949375.85] Failed to execute /init
[42949375.87] Kernel panic - not syncing: No init found.  Try passing
init= option to kernel. See Linux Documentation/init.txt for guidance.

In my opinion, it seems to be correct because the following message doesn't
appear:

Warning: unable to open an initial console

This means that the file /dev/console has been found, so that the rootfs
has been correctly mounted, isn't it?


Thanks in advance for your help!
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


How is initramfs_data.cpio handled by the kernel during boot?

2012-08-23 Thread stl
Hello,
I have a question concerning initramfs support.

When the kernel is built, a initramfs_data.cpio archive is created in
linux-2.6.x/usr.
This archive can be compressed by selecting the compression type in .config
(gzip, bzip2, lzma or lzo).

When the kernel build is finished, what does this initramfs_data.cpio
become?
Is it put somewhere is vmlinux executable? If so, where?
Is it expanded in the INITRAMFS section defined in the vmlinux.lds.S

Finally, how is this cpio archive handled by the kernel?

Thanks in advance for your help.
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How to understand the macro __init?

2012-08-16 Thread stl
sorry for the wrong manipulation

(resume of the previous mail)
As explained before, the symbols and functions defined with __init are only
used during boot initialization.
Thez will never be used again.
So The entire .init section is freed, and this freed memory will become
available memory pages for the kernel.
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How to understand the macro __init?

2012-08-16 Thread stl
To be more precise, all the content of the .init section will be freed at
the end of the boot. (see vmlinux.lds.S)
This is done by the function "free_initmem()" which is an architecture
specific function defined in linux-*/arch//mm/init.c.

This function frees the memory between the symbols __init_begin and
__init_end (which need to be page-aligned).

During compilation, all symbols defined with __init macro are put in the
.init section.
As explained before, these a
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: need some clarifications concerning rootf mounting

2012-08-16 Thread stl
Thanks for your answer.

Ok, here is what I have exactly done:

- compiled with my uClibc cross-compiler a simple hello world program.
- written a basic config file in linux-2.6.37/usr, creating a dev/console,
a /init from /usr/hello and some other dirs.
- edited the .config file with CONFIG_INITRAMFS_SOURCE =
.../usr/config_file and selected CONFIG_INITRAMFS_COMPRESSION_GZIP=y
- built the kernel
- launched vmlinux and received the "kernel panic: junk in compressed
archive" error message

In the source code, initrd_start ans initrd_end appears.
if i want to use initramfs support (and not initrd support), should I do
something special in "setup_arch()" in order to initialize these symbols?

thakns in advance
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: need some clarifications concerning rootf mounting

2012-08-14 Thread stl
I have dug a little more, and if I well understand, the
initramfs_data.cpio.gz should be
expanded from __initramfs_start (defined in vmlinux.lds.S)

But when and how is it done?
And by who?
Architecture specific code? bootloader, or setup_arch() memory
initialisation function?
Or the kernel itself and automatically during kernel build? Or during boot?

In my case, the initramfs_data.cpio.gz is not present at __initramfs_start.
When the kernel tries to find the compression magic number
("decompress_method() function),
it complains and panic with the following message:

kernel panic: junk in compressed archive

(I precise that I am porting Linux-2.6.37 to a new architecture)

Thanks in advance for your help and advices.
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


need some clarifications concerning rootf mounting

2012-08-08 Thread stl
Hello all,
I need some explanations concerning the ways to mount rootf during boot.

I have read some documents (notably the very useful How to use initramfs by
Rob Landley)
and dug into the source code, but some doubts remain.

If I well understood, there is 2 differents procedures to mount the rootfs:
- using the old way: init ramdisk
- using the initramfs support (which appears to be really more efficient)

The fonction "populate_rootfs()" seems to be a crucial point of the
procedure:
it calls a first time "unpack_to_roofs()" with __initramfs_start and
__initramfs_size
as arguments, and if initrd_start is not NULL, calls one more time
"unpack_to_rootfs()"
with initrd_start and (initrd_end-initrd_start) as arguments.

What's really happening during the first unpack_to_rootfs() ?
Does the kernel unpack the iniramfs.cpio (created either by supplying a
valid cpio one
or a config file through CONFIG_INITRAMFS_SOURCE) from __initramfs_start
(defined in vmlinux.lds.S)?

If I aim to use initramfs support, should I do something with
initrd_start/end and CONFIG_BLK_DEV_RAM stuffs?

Thanks in advance for your help and clarifications.

Regards
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Kernel panic - not syncing: junk in compressed archive

2012-02-24 Thread stl
Hello all,
I'm building a linux system for a new architecture,
and I want to use initramfs support to build a filesystem.

I have seen that there are several ways to do that with initramfs.
Either the kernel will build the cpio archive for me, or I can provide an
external one with the CONFIG_INITRAMFS_SOURCE option.

An other way is to provide a configuration file to this option.

I have tried all these methods but each time, the boot stops with the
following message:

Kernel panic - not syncing: junk in compressed archive

I have googled on that but have not found relevant solution.

Does anyone know what could generally be the cause of this problem?

Thanks in advance for your help.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Problem with rootfs mounting

2011-03-21 Thread stl
Hello all,
I am porting linux-2.6.37 to a new architecture, and I am facing the
well-known problem:

VFS: Cannot open root device "(null)" or unknown-block(0,0)

When I was working on uClinux, I have seen that the vmlinux image was
concatenated with the romfs image.
The kernel was aware of the address of the magic number -rom1fs-  thanks to
the configuration
CONFIG_MTD_UCLINUX_ADDRESS= 0x . . . .   in the .config file.

But, I have not found how I can do this in Linux..
I have chosen the filesystem ROMFS in the .config file.
Where and how the romfs tree is created and included to the kernel image?

This question concerns also all the necessary user applications like "init"
and "sh".

Should I use a build system tool like Buildroot or OpenEmbedded?

 Any help will be very useful.

Thanks in advance.
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Problem with rootfs mounting

2011-03-21 Thread stl
Hello all,
I am porting linux-2.6.37 to a new architecture, and I am facing the
well-known problem:

VFS: Cannot open root device "(null)" or unknown-block(0,0)

When I was working on uClinux, the vmlinux image was concatenated with the
romfs image.
The kernel was aware of the address of the magic number -rom1fs- thanks  the
configuration
CONFIG_MTD_UCLINUX_ADDRESS= . . .  in the .config file.

But, I have not found how I can do thit in Linux..
Where and how the romfs tree is created and included to the kernel image?

This question concerns also all the necessary user applications like "init"
and "sh".


 Any help will be very useful.

Thanks in advance.
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies