Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Other Things Gentoo
  • Search

[SOLVED] openrc / baselayout-2 / udev / aoe / diskless

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
Advanced search
8 posts • Page 1 of 1
Author
Message
Moasat
n00b
n00b
Posts: 17
Joined: Sun Apr 24, 2005 9:17 pm

[SOLVED] openrc / baselayout-2 / udev / aoe / diskless

  • Quote

Post by Moasat » Tue May 10, 2011 2:07 pm

I have a diskless machine that boots over AoE. I have a custom initrd that simply discovers the aoe device, then mounts it read-only and does a chroot to it. After the upgrade to baselayout2/openrc, udev complains about not starting correctly because /dev/zero does not exist. If I interrupt the startup after udev, I see the /dev contains only very few actual devices. It seems udev started but mounted over my initial /dev that had way more devices in it.

I've tried updating udev to the latest ~amd64 but it did not help. I'm running 2.6.37-gentoo-r4 and have the deprecated sysfs options disabled. Everything worked before the upgrade so I'm not sure what might have broken.

[edit] Interrupting the startup yields a rootfs that appears to be mounted rw but when I try to edit a file, it says that it is read-only. Maybe the roots is not getting remounting properly? I have root, procfs, swap, fsck and mtab in my boot runlevel.

Can anyone offer some ideas or point to a direction to start looking? I'm really not familiar with baselayout, openrc or udev and I considered myself lucky in getting the initrd to work correctly.

Thanks for any and all suggestions.
Last edited by Moasat on Thu May 12, 2011 1:37 pm, edited 1 time in total.
Top
Ant P.
Watchman
Watchman
Posts: 6920
Joined: Sat Apr 18, 2009 7:18 pm
Contact:
Contact Ant P.
Website

  • Quote

Post by Ant P. » Tue May 10, 2011 3:19 pm

Is /etc/mtab a symlink to /proc/self/mounts? Is devtmpfs enabled in the kernel?
Top
Moasat
n00b
n00b
Posts: 17
Joined: Sun Apr 24, 2005 9:17 pm

  • Quote

Post by Moasat » Tue May 10, 2011 3:29 pm

mtab is not a symlink. devtmpfs is not enabled in the kernel. I see two options: Enable and Automount. Should both of these be on? The help for automount says something about possibly needing to mount /dev in an initramfs environment which is pretty much what I'm in.

I enabled both options and the system seems to be running correctly. (I'm testing in a VM since I don't have physical access to the hardware at the moment).

Thanks for the pointer though. I knew nothing about devtmpfs and it possibly being required for udev to work in a diskless environment.
Top
Moasat
n00b
n00b
Posts: 17
Joined: Sun Apr 24, 2005 9:17 pm

  • Quote

Post by Moasat » Thu May 12, 2011 1:37 pm

It turns out devtmpfs was not needed and actually caused some weird issues with the nvidia binary driver. When the driver loaded, it would not create the /dev/nvidia* nodes. Even creating them by hand didn't help.

I managed to get my initramfs working without requiring devtmpfs. I was using chroot at the end of the script and instead I changed it to use switch_root (and busybox). Here is the final init script for anyone interested.


#!/bin/busybox sh

# Mount /proc and /sys
/bin/echo Mounting /proc filesystem
/bin/mount -t proc none /proc

/bin/echo Mounting sysfs
/bin/mount -t sysfs none /sys

# Bring the network interface up
/bin/echo Bringing up eth0
/bin/ifconfig eth0 up
/bin/dhcpcd eth0

# Find real_root
for cmd in $(cat /proc/cmdline) ; do
case $cmd in
root=*)
REAL_ROOT=$(echo $cmd | cut -d= -f2)
;;
esac
done

/bin/echo Making AoE devices
/bin/mkdir -p /dev/etherd
/bin/aoe-mkdevs /dev/etherd
/bin/echo Telling AoE to discover.
/bin/echo omgdiscover > /dev/etherd/discover

/bin/echo "Waiting for ${REAL_ROOT} to appear"
for cc in `seq 0 300`; do
if [ -b "${REAL_ROOT}" ]; then
break
fi
/bin/sleep 0.1
done

# Wait for things to settle a bit
/bin/sleep 1

/bin/echo "Mounting ${REAL_ROOT}"
/bin/mount -o ro ${REAL_ROOT} /sysroot

if [ "$?" -ne "0" ]; then
echo "Error mounting root"
echo "I'm going to try rebooting"
/bin/shutdown -r now
exit 1
fi

/bin/echo Creating ramdisks
mount -n -t tmpfs tmpfs /sysroot/tmp
mount -n -t tmpfs tmpfs /sysroot/var/lib/init.d
mount -n -t tmpfs tmpfs /sysroot/var/lib/xkb
mount -n -t tmpfs tmpfs /sysroot/var/lib/dbus
mount -n -t tmpfs tmpfs /sysroot/var/lib/dhcpcd
mount -n -t tmpfs tmpfs /sysroot/var/log
mount -n -t tmpfs tmpfs /sysroot/var/run
mkdir -p /sysroot/var/run/lirc
mount -n -t tmpfs tmpfs /sysroot/var/run/lirc
mount -n -t tmpfs tmpfs /sysroot/var/lock
mount -n -t tmpfs tmpfs /sysroot/var/cache/hald

# Clean up.
umount /proc
umount /sys

# Boot the real thing.
exec switch_root /sysroot /sbin/init
Top
SlashBeast
Retired Dev
Retired Dev
User avatar
Posts: 2922
Joined: Tue May 23, 2006 11:50 am
Contact:
Contact SlashBeast
Website

  • Quote

Post by SlashBeast » Thu May 12, 2011 6:01 pm

If you use devtmpfs, you should do mount --move /dev /newroot/dev. nvidia nodes are created when nvidia module is loaded. Here I am using nvidia binary drivers and my initramfs (which use devtmpfs) as I have rootfs over encrypted lvm.

Also, use

Code: Select all

 tags.

FWIW instead of mounting so many tmpfs you could just use aufs/unionfs-fuse and store rw branch on tmpfs.
Top
pi3.14
n00b
n00b
Posts: 5
Joined: Wed May 25, 2011 10:42 am

  • Quote

Post by pi3.14 » Wed May 25, 2011 10:59 am

Hello,
I upgraded Gentoo to OpenRC/baselayout-1, but I am using 2.6.32 OpenVZ kernel, where CONFIG_DEVTMPFS option is missing.
Without it gentoo won't boot. When I use newer kernel, where devtmpfs is available it boots normaly.
Any ideas how to get it work without devtmpfs?
Top
pablolibo
n00b
n00b
Posts: 5
Joined: Sun May 29, 2011 11:59 pm

  • Quote

Post by pablolibo » Mon May 30, 2011 12:08 am

pi3.14 wrote:Hello,
I upgraded Gentoo to OpenRC/baselayout-1, but I am using 2.6.32 OpenVZ kernel, where CONFIG_DEVTMPFS option is missing.
Without it gentoo won't boot. When I use newer kernel, where devtmpfs is available it boots normaly.
Any ideas how to get it work without devtmpfs?
Pi3.14

you can enable the DEVTMPFS in kernel option from:

/usr/src/linux-2.6.32-openvz-feoktistov.1/drivers/Kconfig

chenge:

config DEVTMPFS
bool "Create a kernel maintained /dev tmpfs (EXPERIMENTAL)"
depends on HOTPLUG && SHMEM && TMPFS && !VE

to:

config DEVTMPFS
bool "Create a kernel maintained /dev tmpfs (EXPERIMENTAL)"
depends on HOTPLUG && SHMEM && TMPFS

and now, you can enable the DEVTMPFS from openvz-source

but, it is bad idea, because it feature was disable for an report bug.

anyway, i am testing it bug
Top
pi3.14
n00b
n00b
Posts: 5
Joined: Wed May 25, 2011 10:42 am

  • Quote

Post by pi3.14 » Mon May 30, 2011 5:10 am

I figured it without DEVTMPFS.
When using DEVTMPFS dev directory can be empty. When there isn't DEVTMPFS enabled it is necessary create
mknod -m 660 /dev/console c 5 1
mknod -m 660 /dev/null c 1 3
and then booting fine.
Top
Post Reply

8 posts • Page 1 of 1

Return to “Other Things Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic