Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Preventing the dreaded udev problem: Unable to open an in...
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
epretorious
Apprentice
Apprentice


Joined: 04 Jul 2003
Posts: 191
Location: Truckee, CA

PostPosted: Thu Dec 15, 2005 10:37 pm    Post subject: Preventing the dreaded udev problem: Unable to open an in... Reply with quote

I've been working on creating a "snapshot" of a fully-hardened Gentoo installation (i.e., /usr/portage/profiles/x86/hardened/2005.1) for...
  • installing across multiple systems, and/or
  • restoring the system to a base
...without having to recompile each time - a 12 hour task on the six 900MHz Celeron systems that we're using in our lab - but I've been having problems preventing the dreaded udev problem (i.e., "Warning: unable to open an initial console") before finalizing the snapshot.

I've read...
  • bugreport #40987 (i.e., the main udev bugreport - the one that's mentioned in the /etc/issue warning)...
    Code:
    -----------------------------------------------------
    Your system seems to be missing critical device files
    in /dev !  Although you may be running udev or devfs,
    the root partition is missing these required files !

    To rectify this situation, please do the following:
    mkdir /mnt/fixit
    mount --bind / /mnt/fixit
    cp -a /dev/* /mnt/fixit/dev/
    umount /mnt/fixit
    rmdir /mnt/fixit

    You may refer to these instructions at /etc/issue. 
    If you previously had an issue file, it has been
    backed up at /etc/issue.devfix.  Once you've fixed
    your system, you will have to restore your old issue
    file in order to get rid of this warning.

    Thanks for using Gentoo ! :)
    http://bugs.gentoo.org/show_bug.cgi?id=40987
    -----------------------------------------------------

  • The Gentoo udev Guide, and
  • a few very enlightening posts about udev failures on start-up (e.g., Just search the forums for the phrase "Warning: unable to open an initial console").
...but I'm not able to find any direction for actually preventing this error from occuring on the initial boot. (The fix described in The Gentoo udev Guide works just fine but my objective is to create a snapshot that doesn't need to be "fixed" after installing the snapshot onto the system.)

What can I do (before taking the final snapshot) to insure that I don't have to fix the snapshot each time I install it onto a system?
_________________
Eric P.
Sunnyvale, CA
Back to top
View user's profile Send private message
epretorious
Apprentice
Apprentice


Joined: 04 Jul 2003
Posts: 191
Location: Truckee, CA

PostPosted: Fri Dec 16, 2005 12:33 am    Post subject: Reply with quote

FWIW: I'm creating the snapshot by using this very simple script to create an archive of the chroot'ed environment during installation:
Code:
#!/bin/bash
# Execute this script from /mnt/gentoo after...
#  merging the base system (i.e., Stage 2)
#  merging all of additional ebuilds that constitute a complete system (i.e., Stage 3)

DATE=`date +%Y%m%d`
STAGE=$1
if [ "$STAGE" != '2' ] && [ "$STAGE" != '3' ]
then
   echo 'This script requires one argument - the number 2 or the number 3 - to indicate the level of completeness.'
   exit
fi
echo "Creating /mnt/nfs/snapshot.$DATE-$STAGE.tgz"
tar -czf /mnt/nfs/snapshot.$DATE-$STAGE.tgz --directory=/mnt/gentoo \
  --exclude='dev/*' \
  --exclude='proc/*' \
  --exclude='sys/*' \
  --exclude='usr/portage/*' \
  --exclude='usr/src/linux*' .

Later, I can retrieve the .tgz file and expand it in the /mnt/gentoo filesystem to import a completed system (i.e., a system with a fully-hardened 'system' and/or 'world').
_________________
Eric P.
Sunnyvale, CA
Back to top
View user's profile Send private message
epretorious
Apprentice
Apprentice


Joined: 04 Jul 2003
Posts: 191
Location: Truckee, CA

PostPosted: Sun Jan 29, 2006 3:42 am    Post subject: Re: Preventing the dreaded udev problem: Unable to open an i Reply with quote

epretorious wrote:
What can I do (before taking the final snapshot) to insure that I don't have to fix the snapshot each time I install it onto a system?

The simplest solutions are always the best: After successfully building the system, empty out the contents of the /dev mount point as I'm exiting the chroot'd environment and unmount'ing the partitions. i.e.,
Code:
%> exit
# unmount /mnt/gentoo/proc
# unmount /mnt/gentoo/dev
# rm /mnt/gentoo/dev/*
# mknod -m 660 /mnt/gentoo/dev/console c 5 1
# mknod -m 660 /mnt/gentoo/dev/null c 1 3
# tar -czf /mnt/nfs/snapshot.tgz --directory=/mnt/gentoo \
  --exclude='sys/*' \
  --exclude='usr/portage/*' \
  --exclude='usr/src/linux*' .

_________________
Eric P.
Sunnyvale, CA
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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