Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Initramfs Questions
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
FastTurtle
Guru
Guru


Joined: 03 Sep 2002
Posts: 477
Location: Flakey Shake & Bake Caliornia, USA

PostPosted: Thu Apr 18, 2013 3:09 pm    Post subject: Initramfs Questions Reply with quote

1st:

the Initramfs guide shows using --disklabel for fstab. Is this an option passed to genkernel?

2nd:

What about using a ramdisk setup like a live-cd for the / fs instead of a drive? How would that be done?

Links and/or docs appreciated for both
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9679
Location: almost Mile High in the USA

PostPosted: Thu Apr 18, 2013 10:40 pm    Post subject: Reply with quote

Assuming this is the initramfs guide: http://en.gentoo-wiki.com/wiki/Initramfs

1. No, /etc/fstab has nothing to do with the kernel. mount(8) or busybox or other userspace applications deals with /etc/fstab.
2. Usually for livecd there's a squashfs or some other filesystem-on-file to boot off of it. An initramfs can be used to mount this file-on-filesystem via loopback. You just need to get it mounted and treat it like any other root filesystem. Creating this filesystem has its own issues because it needs to be read-only...
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
FastTurtle
Guru
Guru


Joined: 03 Sep 2002
Posts: 477
Location: Flakey Shake & Bake Caliornia, USA

PostPosted: Fri Apr 19, 2013 1:39 pm    Post subject: Reply with quote

eccerrOr:

1) Just tested the --disklabel option and yes it is a genkernel flag. This is per the Gentoo USB Guide, not the wiki page.

What I think it does is tells genkernel to use the disklabel instead of /dev/(h/s)d# and configures the init scripts to look by-label instead. This is similar to how a live-cd searches for the cdrom before it finishes booting and exactly what I need for a USB flash drive. Can't ensure the flash drive will be mounted the same way on every system that can boot it.

2) Theoretical right now but of future interest for either a live-cd or USB project.

Looking at this, it means a 3rd partition would be needed for a Live-USB version for /home.

Although the squash/cram fs would mean a bit more work, it's just about perfect from a Live-USB point of view as the OS itself can't be borked by the user. They may screw the boot up (not likely as they're usuallys not mounted). The only issue is a damaged flash drive - wear leveling pushes it to read-only mode.

The only problem I see is setting up the squash/cram fs to exclude /home while ensuring it can use all of the unused space on the drive. That's either going to be some crazy partitioning or possibly place the squash/cram into the boot partition (might be advisable as with either of them, you know exactly how large they are (Do you need /boot mounted then?) Have to think about that.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9679
Location: almost Mile High in the USA

PostPosted: Fri Apr 19, 2013 3:33 pm    Post subject: Reply with quote

Ah, I have actually never used genkernel, as it does create initramfs it can use it.

But anyway it's not absolutely necessary to use cramfs/squashfs for the system - it mostly allows more storage on the limited medium like a cdrom. But if you don't care about density, even an ext4fs on a file will work too (and can be mounted RO). It's using the "rest of the space" that can be tricky. For a livecd the main problem is that the media is read-only and there's no official place to put writable data (tmpfs or union?) but on a usb stick, there are more possibilities - you could just use that ext4 and keep home in the container, or just symlink home to a directory on the USB drive.

Did you still want the media to be readable by another OS is the question... I was tempted to build one with the whole drive ext3, as there's no need for another OS to read/write the USB stick...
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum