i'm trying to make my first steps with yocto.
While using psplash i can see the yocto-splashscreen only while shutting down the system. Not while the system is booting up.
For this i'm using a Ubuntu 18.10 in a Virtual Box (oracle).
I build the image with this commans:
~$ sudo apt-get install git python chrpath g++ gawk gcc make texinfo
~$ git clone -b sumo git://git.yoctoproject.org/poky
~$ cd poky/
~/poky$ source oe-init-build-env
~/poky/build$ nano /conf/local.conf
insert at the end of file:
BB_NUMBER_THREADS = “8”
PARALLEL_MAKE = “-j 4”
IMAGE_INSTALL_append = “ psplash”
INHERIT_remove = “uninative”
build with:
~/poky/build$ bitbake core-image-minimal
run the image with:
runqemu qemux86
While booting up i noticed the following two messages:
framebuffer /dev/fb0 not detected
Boot splashscreen disabled
I found this question: yocto splash screen not appearing
I already try to add IMAGE_INSTALL_append = " psplash" in the local.conf but no effect.
Do you have some ideas?
I just had the same problem. Apparently yocto would create a file /etc/rc.d/S00psplash.sh . S00 means this is executed right at the beginning of the boot process, before the required graphics drivers are loaded. I changed it to S40 and it worked. Not sure yet how to fix this inside yocto. You might also need to add to your local.conf:
DISTRO_FEATURES_append = " directfb" # (not sure whether this is really required)
and
IMAGE_FEATURES_append = " splash" # (this might already be enabled for your image)
If it does not work please report back
Best regards ~
Screenshot
Here you can see the described boot-sequence
framebuffer /dev/fb0 not detected
Boot splashscreen disabled
comes from the psplash-init file
#!/bin/sh
### BEGIN INIT INFO
# Provides: psplash
# Required-Start:
# Required-Stop:
# Default-Start: S
# Default-Stop:
### END INIT INFO
echo "########################################################"
if [ ! -e /dev/fb0 ]; then
echo "Framebuffer /dev/fb0 not detected"
echo "Boot splashscreen disabled 1"
exit 0;
fi
read CMDLINE < /proc/cmdline
for x in $CMDLINE; do
case $x in
psplash=false)
echo "Boot splashscreen disabled 2"
exit 0;
;;
esac
done
export TMPDIR=/mnt/.psplash
mount tmpfs -t tmpfs $TMPDIR -o,size=40k
rotation=0
if [ -e /etc/rotation ]; then
read rotation < /etc/rotation
fi
/usr/bin/psplash --angle $rotation &
So the try to show the splashscreen (lines 6-7 in screenshot) occures before the framebuffer is loaded (from line 13 ...)
Is this right?
I'm wondering about the message "Please wait: booting...."
Do we talk about different bootsteps? (like bootloader-boot and linux-boot)
Related
I am trying to get my RPi Zero W to emulate a keyboard and mouse. I can get it to emulate a keyboard or a mouse successfully, but not both at the same time.
I followed the instructions at iStickToIt and Key Mime Pi to successfully emulate a keyboard. Alternatively I followed the instructions here to successfully emulate a mouse. Both work fine on their own. However I don't know how to emulate both mouse and keyboard at once.
I thought that perhaps I just needed to combine the information and define 2 functions for the 1 USB gadget, creating /dev/hidg0 and /dev/hidg1, but only the 1st one works. Below is my combined code - you can see that the Report Length and Report Descriptor is different for keyboard and mouse. But only /dev/hidg0 works (keyboard).
Can you suggest where I am going wrong?
#!/usr/bin/env bash
# Adapted from https://github.com/girst/hardpass-sendHID/blob/master/README.md
# Exit on first error.
set -e
# Treat undefined environment variables as errors.
set -u
modprobe libcomposite
cd /sys/kernel/config/usb_gadget/
mkdir -p g1
cd g1
echo 0x1d6b > idVendor # Linux Foundation
echo 0x0104 > idProduct # Multifunction Composite Gadget
echo 0x0100 > bcdDevice # v1.0.0
echo 0x0200 > bcdUSB # USB2
STRINGS_DIR="strings/0x409"
mkdir -p "$STRINGS_DIR"
echo "82bc64754ca7384d7c90" > "${STRINGS_DIR}/serialnumber"
echo "Anykey" > "${STRINGS_DIR}/manufacturer"
echo "Generic USB Keyboard" > "${STRINGS_DIR}/product"
# -- Function 1: Keyboard -----------------------------------------------
FUNCTIONS_DIR="functions/hid.usb0"
mkdir -p "$FUNCTIONS_DIR"
echo 1 > "${FUNCTIONS_DIR}/protocol"
echo 0 > "${FUNCTIONS_DIR}/subclass" # No subclass
echo 8 > "${FUNCTIONS_DIR}/report_length"
# Write the report descriptor
# Source: https://www.kernel.org/doc/html/latest/usb/gadget_hid.html
echo -ne \\x05\\x01\\x09\\x06\\xa1\\x01\\x05\\x07\\x19\\xe0\\x29\\xe7\\x15\\x00\\x25\\x01\\x75\\x01\\x95\\x08\\x81\\x02\\x95\\x01\\x75\\x08\\x81\\x03\\x95\\x05\\x75\\x01\\x05\\x08\\x19\\x01\\x29\\x05\\x91\\x02\\x95\\x01\\x75\\x03\\x91\\x03\\x95\\x06\\x75\\x08\\x15\\x00\\x25\\x65\\x05\\x07\\x19\\x00\\x29\\x65\\x81\\x00\\xc0 > "${FUNCTIONS_DIR}/report_desc"
CONFIG_INDEX=1
CONFIGS_DIR="configs/c.${CONFIG_INDEX}"
mkdir -p "$CONFIGS_DIR"
echo 250 > "${CONFIGS_DIR}/MaxPower"
CONFIGS_STRINGS_DIR="${CONFIGS_DIR}/strings/0x409"
mkdir -p "$CONFIGS_STRINGS_DIR"
echo "Config ${CONFIG_INDEX}: ECM network" > "${CONFIGS_STRINGS_DIR}/configuration"
ln -s "$FUNCTIONS_DIR" "${CONFIGS_DIR}/"
# -- Function 2: Mouse --------------------------------------------------
FUNCTIONS_DIR="functions/hid.usb1"
mkdir -p "$FUNCTIONS_DIR"
echo 1 > "${FUNCTIONS_DIR}/protocol"
echo 0 > "${FUNCTIONS_DIR}/subclass" # No subclass
echo 3 > "${FUNCTIONS_DIR}/report_length"
# Write the report descriptor
# Source: https://www.kernel.org/doc/html/latest/usb/gadget_hid.html
echo -ne \\x05\\x01\\x09\\x02\\xa1\\x01\\x09\\x01\\xa1\\x00\\x05\\x09\\x19\\x01\\x29\\x03\\x15\\x00\\x25\\x01\\x95\\x03\\x75\\x01\\x81\\x02\\x95\\x01\\x75\\x05\\x81\\x03\\x05\\x01\\x09\\x30\\x09\\x31\\x15\\x81\\x25\\x7f\\x75\\x08\\x95\\x02\\x81\\x06\\xc0\\xc0 > "${FUNCTIONS_DIR}/report_desc"
CONFIG_INDEX=2
CONFIGS_DIR="configs/c.${CONFIG_INDEX}"
mkdir -p "$CONFIGS_DIR"
echo 250 > "${CONFIGS_DIR}/MaxPower"
CONFIGS_STRINGS_DIR="${CONFIGS_DIR}/strings/0x409"
mkdir -p "$CONFIGS_STRINGS_DIR"
echo "Config ${CONFIG_INDEX}: ECM network" > "${CONFIGS_STRINGS_DIR}/configuration"
ln -s "$FUNCTIONS_DIR" "${CONFIGS_DIR}/"
ls /sys/class/udc > UDC
chmod 777 /dev/hidg0
chmod 777 /dev/hidg1
I have found the answer to my own question. The mistake is in the 2 lines which say:
ln -s "$FUNCTIONS_DIR" "${CONFIGS_DIR}/"
Having set up 2 functions directories, they should both be linked into the same config directory and not 2 different config directories as I have done. So in my example one function directory was linked into "configs/c.1" and the other was linked into "configs/c.2", whereas they should both have been linked into "configs/c.1".
You can see a working report descriptor for both mouse and keyboard in the code for TinyPilot here. Note that this uses a slightly different mouse message format from my example above.
When you have set it up correctly use /dev/hidg0 for the keyboard and /dev/hidg1 for the mouse.
(With thanks to Michael Lynch, whose open-source RPi KVM project TinyPilot can be referred to here and here.)
I had a lengthy problem with Ubuntu 14.04 with Lenovo S20-30: after resuming suspended session some things break:
USB stops recognizing devices
due to this the webcam and bluetooth stop working
NetworkManager goes to sleep and no internet connections are made
Sound stops or hangs up in false "Headphones" mode,
or "Dummy" output is shown in Settings->Sound
This is a summary of many different answers (from the stack and others) on this topic which worked consistently for me:
to restart USB run in terminal as root e.g. in a scipt:
#!/bin/bash
for I in $(ls /sys/bus/pci/drivers/xhci_hcd/|grep : ) ; do
echo $I
sudo echo $I > /sys/bus/pci/drivers/xhci_hcd/unbind
sudo echo $I > /sys/bus/pci/drivers/xhci_hcd/bind
done
to wake up (resume) NetworkManager as normal user
#!/bin/bash
nmcli nm sleep false
to restart the sound as root
#!/bin/bash
pulseaudio -k ; sudo modprobe -fr snd_hda_intel; sudo modprobe snd-hda-intel
this solves the common message which came up upon restart:
modprobe: FATAL: Module snd_hda_intel is in use.
Adapting the answer by IljaBek into an automate one. Place the following script in a new file called:
/etc/pm/sleep.d/20_usb_unbind_bind
#!/bin/sh
# Action script to ubind then bind USB devices after sleep
#
case "${1}" in
hibernate)
# nothing
;;
resume|thaw)
for I in $(ls /sys/bus/pci/drivers/xhci_hcd/|grep : ) ; do
echo $I > /sys/bus/pci/drivers/xhci_hcd/unbind
echo $I > /sys/bus/pci/drivers/xhci_hcd/bind
done
;;
esac
Make the file executable with sudo chmod 755 /etc/pm/sleep.d/20_usb_unbind_bind
I'm trying to build embedded system using buildroot. Everything seems to work. All modules are starting, the system is stable. The problem is that /etc/init.d/rcS does not start during initialization of the system. If I run it manually everything is OK. I have it in my inittab file.
# /etc/inittab
#
# Copyright (C) 2001 Erik Andersen <andersen#codepoet.org>
#
# Note: BusyBox init doesn't support runlevels. The runlevels field is
# completely ignored by BusyBox init. If you want runlevels, use
# sysvinit.
#
# Format for each entry: <id>:<runlevels>:<action>:<process>
#
# id == tty to run on, or empty for /dev/console
# runlevels == ignored
# action == one of sysinit, respawn, askfirst, wait, and once
# process == program to run
# Startup the system
null::sysinit:/bin/mount -t proc proc /proc
null::sysinit:/bin/mount -o remount,rw /
null::sysinit:/bin/mkdir -p /dev/pts
null::sysinit:/bin/mkdir -p /dev/shm
null::sysinit:/bin/mount -a
null::sysinit:/bin/hostname -F /etc/hostname
# now run any rc scripts
::sysinit:/etc/init.d/rcS
# Put a getty on the serial port
ttyFIQ0::respawn:/sbin/getty -L -n ttyFIQ0 115200 vt100 # GENERIC_SERIAL
# Stuff to do for the 3-finger salute
::ctrlaltdel:/sbin/reboot
# Stuff to do before rebooting
null::shutdown:/etc/init.d/rcK
null::shutdown:/bin/umount -a -r
null::shutdown:/sbin/swapoff -a
Any idea what could be wrong?
/bin/init needs to be on your filesystem.
/bin/sh needs to be on your filesystem.
/etc/init.d/rcS needs to be executable and have #!/bin/sh as its first line.
Init
Are you sure you where invoking Busybox init? What was the kernel command line? If no init= option was supplied to the the kernel, the kernel will look for an executable at /init.
For instance, if your busybox binary resides in /bin/busybox, you need to create the following symlink :
ln -s /bin/busybox /init
If you want your init to reside in /sbin, to comply with the inittab, also create a symlink there. Note that the kernel will not respect init= setting if you don't mount root and your busybox only runs in an initramfs.
ln -s /bin/busybox /sbin/init
Inittab
Also, you could try not using an inittab. The things you try to run from inittab, might very well fit in rcS and any descendant scripts. From the same source you found your example inittab:
# Note: BusyBox init works just fine without an inittab. If no inittab is
# found, it has the following default behavior:
# ::sysinit:/etc/init.d/rcS
# ::askfirst:/bin/sh
# ::ctrlaltdel:/sbin/reboot
# ::shutdown:/sbin/swapoff -a
# ::shutdown:/bin/umount -a -r
# ::restart:/sbin/init
# tty2::askfirst:/bin/sh
# tty3::askfirst:/bin/sh
# tty4::askfirst:/bin/sh
rcS
Make sure /etc/init.d/rcS is executable:
chmod +x chroot chroot /bin/busybox
And try with:
#!/bin/busybox sh
echo "Hello world!"
Please note that this sentence can get buried between kernel log messages, so you might want to pass the quiet kernel command line option to see if it appears.
Busybox symlinks
Are the symlinks installed into the file system or not? If not it is not a disaster. Make sure that /etc/init.d/rcS starts with:
#!/bin/busybox sh
mkdir -pv /sbin
/bin/busybox --install -s
In addition to the scripts themselves being executable and having a correct shebang line, the kernel also needs to be compiled with the CONFIG_BINFMT_SCRIPT option enabled.
CONFIG_BINFMT_SCRIPT:
Say Y here if you want to execute interpreted scripts starting with
#! followed by the path to an interpreter.
You can build this support as a module; however, until that module
gets loaded, you cannot run scripts. Thus, if you want to load this
module from an initramfs, the portion of the initramfs before loading
this module must consist of compiled binaries only.
Most systems will not boot if you say M or N here. If unsure, say Y.
Without this option, you may receive the error message can't run '/etc/init.d/rcS': Exec format error.
From the information given, everything looks correct.
Some things to try:
Check ownership of your rcS script.
Comment out everything from rcS, and add something very simple:
echo "This worked" > /tmp/test
There might be something in your script related to a startup race condition that is causing it to exit. Also curious if your script is starting syslogd.
Recently I installed: Debian x86_64, oracle 11g and OCI8. I'd like to turn automatic the shell script below, but I received the following message error:
root#debian:/etc/init.d# uname -a
Linux debian 3.2.0-4-amd64 #1 SMP Debian 3.2.54-2 x86_64 GNU/Linux
root#debian:/etc/init.d# update-rc.d oracle-shm defaults
update-rc.d: using dependency based boot sequencing
insserv: Script oracle-shm is broken: incomplete LSB comment.
insserv: missing valid name for `Provides:' please add.
Looking my configuration file it has the comment necessary, as you can see below.
#! /bin/sh
case "$1" in
start)
echo "Starting script /etc/init.d/oracle-shm"
# Run only once at system startup
rm -rf /dev/shm
mkdir /dev/shm
mount -t tmpfs shmfs -o size=2048m /dev/shm
touch /dev/shm/.oracle-shm
;;
stop)
echo "Stopping script /etc/init.d/oracle-shm"
echo "Nothing to do"
;;
*)
echo "Usage: /etc/init.d/oracle-shm {start|stop}"
exit 1
;;
esac
#
### BEGIN INIT INFO
# Provides: oracle-shm
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Bind /run/shm to /dev/shm at system startup.
# Description: Fix to allow Oracle 11g use AMM.
### END INIT
I also received the message insserv: missing valid name for 'Provides:' please add ... when (re-)starting some init.d service foo. File /etc/init.d/foo did have a valid Provides
line, i.e.:
...
# Provides: foo
...
Nevertheless, service foo started fine despite that error message.
It turned out that insserv or whatever seems to complain about problems in any init.d script found in directory /etc/init.d/**, not necessarily the one that is currently being (re-)started.
Therefore, execute the following command to find problematic init.d scripts:
cd /etc/init.d/ && sudo grep -rin Provides
It will list all Provides lines of all scripts found in /etc/init.d/
Check whether all of them have a valid name provided.
In my case, there was a file /etc/init.d/template which had a Provides line without a name.
After I changed that file's line with Provides: template, the insserv error message disappeared.
I got it. The cause of the "insserv: missing valid name for `Provides:' please add." error was due to the multiple spaces between "# Provides:" and "oracle-shm"
I am currently running Ubuntu 12.04. I've created a debian package that currently installs successfully and starts three new processes. I have also made these three processes start at runtime by placing the following script inside /etc/init.d:
# This example is from http://www.debian-administration.org/article/Making_scripts_run_at_boot_time_with_Debian
# Also used http://wiki.debian.org/LSBInitScripts/
### BEGIN INIT INFO
# Provides: bleh
# Required-Start: $remote_fs $syslog $network
# Required-Stop: $remote_fs $syslog $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
# Carry out specific functions when asked to by the system
case "$1" in
start)
cd //opt/bleh
attrf=.gatewayattributes
if [ ! -z "$1" ]
then
echo "[gateway]" >> $attrf
echo "activationKey = $1" >> $attrf
fi
./bleh1 -n &
./bleh2 &
python bleh3 &
;;
stop)
cd //opt/bleh
/usr/bin/pkill -f ./bleh1 -n
/usr/bin/pkill -f bleh3
kill -9 $(pidof bleh2)
rm -rf logs
;;
This script does start the three processes at runtime, but for some reason I cannot actually use the start/stop commands, as in sudo /etc/init.d bleh.sh stop.
An even bigger issue is that removing this package using the command:
sudo dpkg -r bleh
Does not actually stop the three processes, it only tries to remove the bleh directory I installed in my opt folder. Also, I have a folder inside my bleh directory which does not get removed, it gives me a warning stating:
Removing bleh ...
dpkg: warning: while removing bleh, directory '/opt/bleh/logs' not empty so not removed.
The files inside of that logs directory are read-only unless you have SU priviledges, but I don't see how that should be a problem as I am calling sudo on that dpkg -r command.
If I run sudo dpkg -r bleh again, it states there's no installed package matching bleh, meaning it thinks it has successfully removed the installed package, even with that exisiting logs directory and the three processes which are still running.
Sorry, I know this was long, but I could really use some help.. thanks in advance!
As recommended by the Debian New Maintainer's Guide, please use dh_installinit (building your whole package with debhelper, of course). By default, this will add scripts to start and stop on package installation and removal.
Auxiliary files (such as configuration) are usually removed in purge (e.g. dpkg -P) state. To handle this yourself, you need a deconfigure script.
Also, it is highly preferable to use start-stop-daemon instead of &, which is insufficient for proper daemonization.