Re: [RFC][Patch] Allow not mounting a root fs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Jul 7 2007 23:18, Bodo Eggert wrote:
>> >> BTW: Is it possible to mount a tmpfs on / before extracting the cpio?
>> >
>> >Not in the stock kernel.  There have been some patches floating around
>> >for that, I think.
>> 
>> What would it buy? rootfs is a tmpfs, is not it?
>
>As far as I understand, it is a ramfs aka. non-swappable tmpfs without any 
>limit and including a chance of DoSing the system.
>
>Since I'm toying with root-on-initcpio, I'm looking for things that might 
>make the task some easier.
>
>Currently I'm thinking about changing the root=initramfs to root=tmpfs and
>additionally mounting a tmpfs on / before unpacking the cpios. OTOH, this 
>seems to be a little bit messy. OTOH again, in _that_ boot code, nobody
>should complain :)

Come to speak of it, I think you can have it much easier by having the kernel
exporting the cpio image as a virtual file inside rootfs, so that you could
re-extract it inside a tmpfs. In other words:

mount -t tmpfs tmpfs /mnt;
cd /mnt;
cpio -diuv </initramfs.cpio;
#
# switch_root nukes rootfs, pivot_roots and execs some init
klibc_switch_root .; # or something like that

Of course this needs double the memory than directly mounting tmpfs as 
rootfs, but it's an idea too.


	Jan
-- 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux