Commit Graph

137 Commits

Author SHA1 Message Date
Alexandru DAMIAN ed5d870c70 init-live: default to initrd shell if image isn't found
Adds "debugshell" command line parameter for live/install images.

If the init live fails to find and mount a root-fs image,
dumps to a shell after timeout so that the developer can figure
what's wrong.

Timeout defaults to 30 seconds, but it can be changed as param
argument.

Prior art in Ubuntu. Also, leaving a system stale isn't good form.

(From OE-Core rev: 6f99e530822ac32f32615590e22a9758ac210e84)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-19 17:55:02 +00:00
Otavio Salvador 1b99640481 initramfs-framework: udev: Handle alternative binary paths
This allows use of udev daemon for different installation destinations
so allowing use of udev's from systemd code for initramfs.

(From OE-Core rev: 96daf1b3105e17a67acb5027d0418b2ac28b6820)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-03 14:32:46 +00:00
Otavio Salvador 3d943dbac4 initramfs-framework: init: Stop mount warnings during boot
For a completely quiet boot using recent versions of utilities, the
/etc/fstab and /var/lock need to be available.

(From OE-Core rev: d7a8154d575f918a0a20cb0e3a8f65d02ed32f30)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-03 13:52:07 +00:00
Ross Burton fe16cbc6ed initrdscripts: fix udevd in the live boot init scripts
udevd moved location and isn't in $PATH anymore, so use an absolute path to
start it.

The control socket path moved too, so mkdir the directory it's in.

Mounts the new devtmpfs on /dev device tree.

(From OE-Core rev: 543606e5dc379497c34196d004a214e847f5db2d)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Alexandru Damian <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-12 22:31:20 +00:00
Ross Burton be8dd82ce9 Revert "initrd: Spawn an emergency shell when something goes wrong"
This had nowhere near enough testing...

This reverts commit ffb6928f57.

(From OE-Core rev: f162f0ecc96fdfb564aad968e5b8bc670640ea68)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-02 17:10:34 +01:00
Damien Lespiau 39a091fe1d initramfs: Make mkdir not fail
This patch make "mkdir foo" not fail if foo already exists.

(From OE-Core rev: 2bf5026933b733701d4d339e01a4f5e4468f368e)

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-28 11:07:40 +01:00
Damien Lespiau ffb6928f57 initrd: Spawn an emergency shell when something goes wrong
set -e allows to exit if a command fails. We install a trap and execute
emergency_shell() when either the init script exits or when ctrl-c is
typed (say if we are stuck somewhere and we want to debug it).

(From OE-Core rev: ae5e2bd994e3f60d3803ab56e6ed34d08fbc56f0)

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-28 11:07:40 +01:00
Darren Hart 64f7feb5c3 EFI: Make installer EFI aware
[YOCTO #1919]

Create a basic EFI installer script modeled after the existing installer
and add it to a new initramfs-live-install-efi recipe. Update the
init-live.sh script to distinguish between LABEL=install and
LABEL=install-efi and select the appropriate script. Add the efi
installer to core-image-minimal-initramfs.

Update grub-efi.bbclass to use "LABEL=install-efi" when it detects a
label of "install". This is clearly not ideal, but a proper fix would
involve decoupling the LABELS assignment from the image-live.bbclass
usage of SYSLINUX_LABELS. We should be able to address that in a
follow-on clean-up series.

V2: Include missing initramfs-live-install-efi_1.0.bb
V3: Rebase after Radu's console_params fix

(From OE-Core rev: 4bce3417917a3e88ba6529db394525fba82e0699)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19 17:49:48 +01:00
Radu Moisan 807ff46bc9 Add console kernel options
Live image installer did not preserve BSP specified console= kernel parameter.
This patch updates the init scripts that are responsible for grub.cfg creation
so that options like console= are passed allong from installer to installed img

[YOCTO #2426]

(From OE-Core rev: e18c59eb5a61f265b9cad6de68359fa1430b0e58)

Signed-off-by: Radu Moisan <radu.moisan@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19 17:18:10 +01:00
Darren Hart 7af1525794 init-install: Clean up partition alignment
The current partitioning scheme leaves a 1MB gap between all the
generated partitions by adding a 1 to the end of the last partition to
use as the start of the next. parted is smart enough to not overlap
start and end positions of the same value. This avoids the 1 MB gaps.

Rather than pad the disk with 1MB in the beginning and cut it off at the
MB boundary on the end, we can use 0% and 100% to allow parted to do the
required math and use as much of the disk as possible.

(From OE-Core rev: 8aac6ecc5194c734dfd3d677017ab3ea045b2339)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-09 16:58:58 +01:00
Darren Hart 6f932f80bb init-install: Correct ext2->ext3 typo in logging
We create both the boot and root partitions as ext3 now, update the
logging accordingly.

(From OE-Core rev: 4436639eed57d818992596d6f0f7b53d3bbd4800)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-09 16:58:58 +01:00
Darren Hart ae18c85da6 init-install: Use swap_ratio in the calulation of swap_size
swap_size currently uses a hard coded percentage and ignores the
swap_ratio variable. Fortunately they are the same value currently. Make
the calculation use the variable to avoid problems in the future.

(From OE-Core rev: 2678ce668499af0e90994b9da8c518e85de56651)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-09 16:58:58 +01:00
Darren Hart 203231f1f8 initrdscripts: Update install.sh to work with mmc devices
Fixes [YOCTO #2385]

The installer only searches for hd[ab] sd[ab]. Some newer BSPs have mmcblk
devices that should be used as the install target. These devices also have a
partition prefix (mmcblk0p1 instead of mmcblk01). As they are detected
asynchronously, it is necessary to add the rootwait kernel parameter to avoid
a race condition trying to mount the root device.

As BSPs like the FRI2 and the sys940x have mmc devices and will have a 1.2
release, we should push this to 1.2.1. The changes are perfectly contained and
easily verified.

Test for an mmcblk device and add the p partition prefix if necessary. Add the
rootwait kernel parameter when an mmcblk device is detected.  Replace the series
of explicit umount commands with a single umount using a wildcard. This will
find all the partitions and will not try to unmount non-existant devices. Avoid
copy and paste errors by replacing /dev/${device}${pX} references with the
previously assigned rootfs, bootfs, and swap variables.

These changes have been tested on the FRI2 Sato image which installed to
/dev/mmcblk0 as well as the N450 Sato image which installed to /dev/sda. Both
were successful.

(From OE-Core rev: bf403680d72e360c7382f540ea25cfdcbe77b4e5)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-06 09:55:48 +01:00
Richard Purdie 939e6947ae initramfs-live-boot: Disable unionfs until its issue with the system rootdir are resolved
There are issues with the current unionfs when making a union mount over "/".
Until these are resolved we can't use unionfs for live booting so disable this
temporarily as a workaround.

unionfs is usable in other circumstances.

[YOCTO #2331 workaround]

(From OE-Core rev: 60ee26ae23132b916019d58e20b8c2e1ddd2b471)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-22 16:00:26 +01:00
Yang Shi b23b2b42a0 initrdscripts: fix init-live.sh and use unionfs
[YOCTO #1487]

When booting up with liveCD image, init scripts can't work well on read-only filesystem. Unionfs,
which is supported in Yocto kernel, allows a filesystem to appear as writeable, but without
actually allowing writes to change the filesystem.

Use unionfs to mount rootfs and make root file system can be writen when using liveCD to boot up.
Set UNION_FS variable depending on kernel config, so that it can work with kernel which doesn't
have unionfs feature.

[RP: Mark recipe as machine specific due to kernel dependency]
(From OE-Core rev: b7f4e8d153c2aebbcf6556e7e926f6b94801d6aa)

Signed-off-by: Yang Shi <yang.shi@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-11 12:15:32 +01:00
Saul Wold b0de4b0415 initrdscripts: add sleep to avoid kernel messages before install message
As suggested by Darren Hart

[YOCTO #725]

(From OE-Core rev: ed76654c613d38095f085640acb6591b9739a60e)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-08 15:24:28 +00:00
Otavio Salvador ed2ac23c5b initramfs-framework: provides a modular initramfs
Provides the API and modules for a modular initramfs. The currently
included modules are:

 * initramfs-module-debug adds support to dynamic debugging of
   initramfs using bootparams

 * initramfs-module-udev: enables udev usage

 * initramfs-module-mdev: enables mdev usage

 * initramfs-module-e2fs: adds support for ext4, ext3 and ext2
   filesystems

(From OE-Core rev: 7b69ad2167a1f0e57db82817b98a0cbcb70a0dd3)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-08 15:24:28 +00:00
Otavio Salvador e4953031de initramfs-live-boot: make it more generic and easy to use
The script was making some assumptions that enforced many requirement
in the machine kernel configuration and usage, besides it were too
while booting.

Changes included:

 * fix indentation;
 * rdepends on udev;
 * allow use of isofs as module;
 * remove rootdelay param parsing as it was unused;
 * don't verbosely kill udevd and mknod;
 * mount devtmpfs into rootfs, if available, before swithing root;

(From OE-Core rev: 3fc8cec53038f41d31344040c56d62aac90ba7e0)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-14 13:18:15 +01:00
Darren Hart e4fe5542a5 Set an explicit path for the initrd scripts
If we don't set PATH, then the shell will specify one for us.
Busybox adds the sbin dirs, but bash does not. I hit an
issue where bash (among other things) ended up in my initrd
and the boot scripts failed due to a bad default PATH. While
that is a separate issue, we should not be at the mercy of the
shell's default PATH. Update the initrdscripts to all specify:

PATH=/sbin:/bin:/usr/sbin:/usr/bin

(From OE-Core rev: 4617ae0f433876037c2c9a0dfdb5e373e7a5c77b)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-16 13:30:26 +01:00
Tom Zanussi 0ecc7bbb46 initramfs-live-install: add PN to RDEPENDS
RDEPENDS is package-specific, so add ${PN} to it.

(From OE-Core rev: ac3373f5baefd5ac5fea7d7f68690bf0f0889be6)

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-16 13:30:26 +01:00
Tom Zanussi bcd1bca880 initramfs-live-install: add support for grub2
grub2 needs a different set of install steps from grub 0.97.  This
adds them to init-install.sh and adds an install-time check that
determines which version is being used and which steps to use
depending on the version of grub selected.

(From OE-Core rev: c67d03eb3684acab89e5972609e397087727e74e)

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-15 11:23:58 +01:00
Lianhao Lu dc3a8274c7 initramfs-live-install: Be consistent with grub.
[YOCTO #1428]
Because the underlying grub 0.97 the initramfs-live-install RDEPDNEDS on
only supports 32bit x86 target, set the COMPATIBLE_HOST accordingly.

(From OE-Core rev: d128b4f2746ee8525352ce982a9c2a5e422630f2)

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-07 22:54:14 +01:00
Jingdong Lu 4f4475f498 initrdscripts: fix init-live.sh for hddimg and livecd
Both hddimg and livecd use init-live.sh script to boot the rootfs.img.
But the paths of rootfs.img in hddimg and livecd are different. So we add
a variable "ISOLINUX" to provide a correct path.

(From OE-Core rev: 4e7221d23bf335cbb4e1e2ba703e4c0a04df7129)

Signed-off-by: Jingdong Lu <jingdong.lu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-24 15:02:23 -07:00
Jingdong Lu 30ba9839a2 initrdscripts: fix init-live.sh
Fix bug: [YOCTO #686]
Because the variable "ROOT_IMAGE" in init-live.sh is not correct, it fails to
run when using liveCD. Modify value of "ROOT_IMAGE" to "isolinux/rootfs.img".
If we want to use liveCD, we also need to add some kernel options related to
CDROM support when compling kernel.

(From OE-Core rev: f9b6f41c9249cc90f7621d446eafae5e5508dd6e)

Signed-off-by: Jingdong Lu <jingdong.lu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-19 09:29:19 -07:00
Mei Lei 577a914512 init-install.sh: Fix make partition and make file system issues
[YOCTO #1151]

Change the offset from the beginning of the disk to aligne the blocks.

In this script, we use mkfs.ext3 to create file system after partition, but we use mkpartfs to create file system repeatly,
and get some warnings about choose another specific tools to create file system for reliability.

So use mkpart instead of mkpartfs and only use mkfs.ext3 to create file system.

(From OE-Core rev: 67c9804e0416defb7c3f69bd02bbae3710e5be0a)

Signed-off-by: Mei Lei <lei.mei@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-12 17:21:54 +01:00
Richard Purdie 05b59a64a3 initrdscripts: Inhibit compiler/libc dependencies as this is just a configuration file 2011-06-13 22:38:06 +01:00
Tom Zanussi 10cf515710 initramfs-live-install: comment out allarch inherit to resolve no provider
initramfs-live-install is only compatible with i.86|x86_64 so
shouldn't inherit 'allarch'.  This comments it out.

More specifically, commit 52295fa3de
(Improve handling of 'all' architecture recipes and their interaction
with sstate) sets TARGET_ARCH which due to the COMPATIBLE_HOST setting
in the recipe causes it to be skipped and gives the following error
for any -live build:

NOTE: Resolving any missing task queue dependencies
NOTE: Runtime target 'initramfs-live-install' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['initramfs-live-install']
ERROR: Required build target 'core-image-sato-live' has no buildable providers.
Missing or unbuildable dependency chain was: ['core-image-sato-live', 'core-ima\
ge-minimal-initramfs', 'initramfs-live-install']
ERROR: Nothing RPROVIDES 'initramfs-live-install'

(From OE-Core rev: e576e4aa91fc1608f706a341088f9a7b9a21cd2a)

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>

Commented out with explaination instead of remove

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-09 15:48:27 +01:00
Richard Purdie 52295fa3de Improve handling of 'all' architecture recipes and their interaction with sstate
The existing PACKAGE_ARCH = "all" mechanism of sharing packages is problematic
with sstate since there are a variety of variables which have target specific
values and the sstate package therefore correctly changes signature depending
on the MACHINE setting.

This patch creates a new "allarch" class which sets:

PACKAGE_ARCH = "all"

(as per the existing convention)

INHIBIT_DEFAULT_DEPS = "1"

(since its not target specific and therefore can't depend on the cross
compiler or target libc)

TARGET_ARCH = "all"
TARGET_OS = "linux"
TARGET_CC_ARCH = "none"

(since these variables shouldn't change between the different packages and
target compiler flags shouldn't be getting used)

PACKAGE_EXTRA_ARCHS = ""

(since we shouldn't be depending on any architecture specific package architectures)

Not all PACKAGE_ARCH = "all" recipes can use this class since some run configure
checks on the compiler. This means they have target specific components and therefore
the "all" classification is incorrect.

(From OE-Core rev: 26e5e5feb695864b11e47e24017e254c28f14494)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-31 13:07:00 +01:00
Richard Purdie 65f4b65410 Further cleanup of various poky references
(From OE-Core rev: fe73ea8c510877fe4e3c117985e8f3d0b79ddf1b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-21 12:56:16 +01:00
Richard Purdie 4d609d5021 Replace POKYBASE with COREBASE
(From OE-Core rev: 607a7657715f6fcba467a4e55ba64f41f4e13a15)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-21 00:29:29 +01:00
Tom Zanussi 6ec0e55375 init-live.sh: add 'coldplug' udev trigger
Fixes [BUGID #693]

The init-live.sh script starts udevd in init-live.sh:early_setup(),
but doesn't account for the possibility that the root device may have
already been registered by the kernel before udevd starts up.

If the device is detected after udevd starts up, everything's fine -
udevd gets the 'add' uevent for the device, the root image shows up at
e.g. /media/sda/rootfs.img, and the boot continues.

If however the device is detected before udevd starts up, udevd misses
the 'add' uevent and the root image never shows up, causing it to stay
in the 'waiting for removable media' loop forever.

The 'udevadm trigger' command is meant to be used to avoid this
situation, but init-live.sh doesn't use it.  Furthermore, since the
default was changed in udev 152 from 'add' to 'change', the command
needs to explicity name 'add' as the action.

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
2011-02-07 21:53:42 +00:00
Darren Hart d9573b40b1 Correct DESCRIPTION typos in various recipes
An investigation into undocumented variables uncovered a few mispellings
of the variable DESCRIPTION.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2010-12-10 22:01:42 -08:00
Mei Lei d1cd2fd60b initramfs-live-boot:Add license checksum to bb file
Add COPYING.MIT file checksum to bb file

Signed-off-by: Mei Lei <lei.mei@intel.com>
2010-12-06 22:02:19 +00:00
Mei Lei a12aa5a7c7 initramfs-boot:Add license checksum to bb file
Add COPYING.MIT file checksum to bb file

Signed-off-by: Mei Lei <lei.mei@intel.com>
2010-12-06 22:02:18 +00:00
Mei Lei 7adf2aa0d3 initramfs-live-install:Add license checksum to bb file
Add COPYING.MIT file checksum to bb file

Signed-off-by: Mei Lei <lei.mei@intel.com>
2010-12-06 22:02:18 +00:00
Yu Ke b07cc5a74a initrdscripts: remove the incorrect moblin message (Bug 368)
When install the live image into netbook/emenlow, the install tool prompt:
# Found drive at /dev/sda. Do you want to install moblin there ? [y/n]
The "moblin" here should be replaced by "poky".

Fix [BUGID #368]

Signed-off-by: Yu Ke <ke.yu@intel.com>
2010-09-30 10:14:07 -07:00
Richard Purdie 29d6678fd5 Major layout change to the packages directory
Having one monolithic packages directory makes it hard to find things
and is generally overwhelming. This commit splits it into several
logical sections roughly based on function, recipes.txt gives more
information about the classifications used.

The opportunity is also used to switch from "packages" to "recipes"
as used in OpenEmbedded as the term "packages" can be confusing to
people and has many different meanings.

Not all recipes have been classified yet, this is just a first pass
at separating things out. Some packages are moved to meta-extras as
they're no longer actively used or maintained.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-27 15:29:45 +01:00