# uvesafb and initramfs

## mathfeel

I can get uvesafb to work if I followed Spock's tutorial, part of that involving compiling in an initramfs image to the kernel via source:

CONFIG_INITRAMFS_SOURCE="/usr/share/v86d/initramfs"

```
# cat /usr/share/v86d/initramfs

dir /dev 0755 0 0

nod /dev/console 0600 0 0 c 5 1

nod /dev/tty1 0600 0 0 c 4 1

nod /dev/zero 0600 0 0 c 1 5

nod /dev/mem 0600 0 0 c 1 1

dir /root 0700 0 0

dir /sbin 0755 0 0

file /sbin/v86d /sbin/v86d 0755 0 0
```

without this, uvesafb fails with an error very commonly inquired about:

```
Sep 18 16:22:22 [kernel] uvesafb: Getting VBE info block failed (eax=0x4f00, err=-3)

Sep 18 16:22:22 [kernel] uvesafb: vbe_init() failed with -22

Sep 18 16:22:22 [kernel] uvesafb: probe of uvesafb.0 failed with error -22
```

Since the reason one wants uvesafb often have to do with fbsplash, so one would usually make a initramfs using splash_geninitramfs anyway:

```
# splash_geninitramfs -r 1600x1200 -g initrd_natural_gentoo natural_gentoo

# zcat initrd_natural_gentoo | cpio --list

.

dev

dev/fb

dev/vc

dev/misc

dev/null

dev/tty0

dev/console

etc

etc/splash

etc/splash/luxisri.ttf

etc/splash/natural_gentoo

etc/splash/natural_gentoo/images

etc/splash/natural_gentoo/images/silent-1600x1200.jpg

etc/splash/natural_gentoo/images/verbose-1600x1200.jpg

etc/splash/natural_gentoo/1600x1200.cfg

lib

lib/splash

lib/splash/sys

lib/splash/proc

sbin

sbin/splash_helper

sbin/fbcondecor_helper

root

1357 blocks
```

It seems redundant to me that in this situation one would still want to set CONFIG_INITRAMFS_SOURCE. The problem here is that /sbin/v86d is _NOT_ in the image. The solution is to make an overlay with /sbin/v86d in it, but apparently that's not sufficient. Comparing the list of file in /usr/share/v86d/initramfs, it seems one also needs one of these nodes:

```
nod /dev/tty1 0600 0 0 c 4 1

nod /dev/zero 0600 0 0 c 1 5

nod /dev/mem 0600 0 0 c 1 1
```

Indeed, I can successfully use uvesafb without CONFIG_INITRAMFS_SOURCE if ALL three are included in the overlay. My question is are all of them necessary? If so, why doesn't splash_geninitramfs include them in the first place?

--MZ

----------

## marduk

splashutils doesn't incorporate uvesafb stuff because it tries to be "fb agnostic"

I too had this problem and here's how *I* solved it.  There may be better methods but this works for me:

```

# mkdir /root/initramfs

# splash_geninitramfs $fbsplash_theme -r $resolution -g /tmp/fbsplash_initramfs.gz

# cd /root/initramfs

# zcat /tmp/fbsplash_initramfs.gz| cpio -idv

# cp -a /dev/tty1 dev/tty1

# cp -a /dev/zero dev/zero

# cp -a /dev/mem dev/mem

# cp -a /sbin/v86d sbin/v86d

# ln -s $fbsplash_theme etc/splash/tuxonice # if you use tuxonice-sources w/ tuxoniceui_fbsplash

```

Then change CONFIG_INITRAMFS_SOURCE to /root/initramfs and rebuild/install your kernel

Hope this helps

----------

## V-Man

I realize this is a 2 year old thread, but I wanted to update the method with what I used to accomplish this same thing.

```
# /usr/src/linux/usr/gen_init_cpio /usr/share/v86d/initramfs | gzip > /root/initramfs.gz

# splash_geninitramfs --verbose --res 1280x1024 --append /root/initramfs.gz natural_gentoo

```

I have too much time on my hands (and tend to forget things), so I wrapped all this up in a shell script:

```
#!/bin/bash

VERSION="linux"

RESOLUTION="800x600"

function usage {

    cat << EOF

usage: $0 res theme

Creates an initramfs for the specified theme, including everything required

for uvesafb.

OPTIONS:

  -h            Show this message

  -r res        Speficy the resolution (ex. 800x600)

  -V version    Specify the kernel version string (defaults to "linux")

EOF

}

while getopts ":r:V:v" opt; do

    case $opt in

        h)

            usage

            exit

            ;;

        r)

            RESOLUTION=$OPTARG

            ;;

        V)

            VERSION=$OPTARG

            ;;

        :)

            echo "Option -$OPTARG requires an argument." >&2

            usage

            exit

            ;;

        default)

            echo "Invalid option $opt" >&2

            usage

            exit

            ;;

    esac

done

shift $(($OPTIND - 1))

if [ -z "$1" ]; then

    echo "theme is required"

    usage

    exit

fi

THEME="$1"

KERNEL_ROOT="/usr/src/$VERSION"

if [ ! -d ${KERNEL_ROOT} ]; then

    echo "Invalid kernel version string: ${VERSION}"

    usage

    exit

fi

GEN_CPIO="${KERNEL_ROOT}/usr/gen_init_cpio"

if [ ! -f ${GEN_CPIO} ]; then

    echo "Unable to locate gen_init_cpio in ${KERNEL_ROOT}"

    usage

    exit

fi

echo "Kernel:     ${VERSION}"

echo "Resolution: ${RESOLUTION}"

echo "Theme:      ${THEME}"

$GEN_CPIO /usr/share/v86d/initramfs | gzip > initramfs.gz

splash_geninitramfs --verbose --res $RESOLUTION --append initramfs.gz $THEME

gunzip initramfs.gz

```

----------

