Commit Graph

64 Commits

Author SHA1 Message Date
Darren Hart 1917544d2f init-install-efi.sh: Remove unnecessary udev rules file to avoid errors
Fixes [YOCTO #5233]

Modeled after Chen Qi's fix to [YOCTO #3924] from oe-core commit:
6b6db7b4fb7aa17b8e29076decc830149b9d35bc
init-install.sh: remove unnecessary udev rules file to avoid error messages

/etc/udev/scripts/mount.sh is removed by init-install-efi.sh, but the
udev rules file which specifies the invocation of this script is not
removed, thus causing the error message during a live install:

/etc/udev/scripts/mount.sh: No such file or directory

The /etc/udev/rules/automount.rules no longer works once the mount.sh
script is removed. Remove it to avoid the error message.

(From OE-Core rev: 1f5a2b616d902b1158e348bf8c33b6d36e21cadc)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Cc: mihaix.lindner@linux.intel.com
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-24 17:24:14 +01:00
Darren Hart e42fefe717 init-install-efi.sh: Fix root= specification
Fixes [YOCTO #5237]

The current grub.cfg manipulation depends on an existing root=
parameter. If this doesn't exist, the correct root= parameter will not
be added.

Instead, remove any existing root= parameters and add the correct one
explicitly.

(From OE-Core rev: 14b124122c1b7d10b9a3a96fe4617c6fc1c661c5)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Cc: mihaix.lindner@linux.intel.com
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-24 17:24:14 +01:00
Ross Burton 242ad61580 Revert "initrdscripts: look for new systemd-udevd location"
systemd-udevd is back in /lib, so revert this change.

This reverts commit 27bb516be4.

(From OE-Core rev: 3f6324a86cb8c1c253af06a1033ac71fa61c58d3)

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>
2013-09-17 14:35:19 +01:00
Chen Qi 4c3f8d2063 init-live.sh: distinguish between a read-only image and a read-write image
The iso and hddimg share a common concept of 'live image', and they
use the same initramfs and thus the same init. However, that init
script in initramfs made a wrong assumption that the rootfs image
was read-only by itself. This is apparently not true for hddimg.

To make things work as expected, this init script should at least
distinguish between a read-only rootfs image and a read-write one.

This patch adds this ability to the init script. After this change,
the init script would be able to check whether the rootfs image is
read-only or not. If the rootfs image is read-write, the image will
be mounted and then booted directly. No union mounts will be attempted
in this case.

[YOCTO #5164]

(From OE-Core rev: 29f869b68a9017502f75915784a924f0fe9d4be1)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-11 11:05:05 +01:00
Chen Qi 059db226a0 init-install.sh: fix to handle the boot partition correctly
Previously, the boot partition was created for the target hard drive
but there was no corresponding entry for it in /etc/fstab. Besides,
even if the boot partition was mounted, it would just result in odd
directory hierarchy like /boot/boot/grub. However, what we really need
is /boot/grub. This patch fixes this problem.

Besides, for future maintance work, this patch also renames some of the
intermediate directories. It uses more descriptive names like /tgt_root
and /src_root. The name of /ssd is dropped.

[YOCTO #5018]

(From OE-Core rev: aa67b1333b4774e1845f562085f7048df65a644f)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-20 15:31:25 +01:00
Chen Qi d9e7fbad52 init-install.sh: improve hard drive searching process
Previously, only unremovable hard drives are searched and are treated
as candidates of target disks to intall into.

However, it's possible that we're going to install the live image into
a removable media such as an USB. This patch enables this possibility.

In addition, this patch presents more information about the hard drives
so that user may have more knowledge about which hard drive they are
going to install their image into.

[YOCTO #5018]

(From OE-Core rev: 358f0584d779825307eec08c023b5ff14e72cf9e)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-20 15:31:25 +01:00
Chen Qi 7ab93ec664 init-live.sh: make $ROOT_MOUNT/media writable when necessary
If the live image is mounted as read-only, we cannot make necessary
directories under $ROOT_MOUNT/media, so trying to move the mount points
lead to errors.

So in case that no unification filesystem mechanism is available in kernel
and the rootfs is mounted as read-only, we mount tmpfs on $ROOT_MOUNT/media
so that it's possible to make necessary directories under it.

[YOCTO #4881]
[YOCTO #4103]

(From OE-Core rev: aeeb3418ff08dfd29edc0ce8a41cb6887d4e11fe)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-16 11:14:34 +01:00
Chen Qi ca365c603b initramfs-framework: fix bashism
(From OE-Core rev: e6039e6e3b98d6ab91252a5012d76279b1fac6e8)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-06 12:39:53 +01:00
Ross Burton ec0e7f7fc7 Revert "initrdscripts: mount / as read-only when live-booting"
My test environment must have been messed up as now hddimgs are failing to
re-mount / as read-write.

This reverts commit 7af92f8fa3.

(From OE-Core rev: 4174dcbd3328e6badb269d09b024f2b83408bd8c)

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>
2013-07-29 13:09:15 +01:00
Ross Burton 7af92f8fa3 initrdscripts: mount / as read-only when live-booting
So that the root filesystem can be fsck'd properly, mount it read only.  Either
initscripts or systemd will re-mount as read-write in early boot.

(From OE-Core rev: 1ace2bdd8d6d950038fb6d9b83f6eceba276f588)

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>
2013-07-24 11:35:33 +01:00
Chen Qi 29e55997ca init-live.sh: try to make a union mount when possible
This patch tries to make a union mount in live image. For example,
if aufs is enabled with the aufs-enable.scc configuration fragment,
the init-live.sh script will use aufs to make a union mount.

Although overlayfs is not supported by Yocto kernel yet, this patch
still takes it into consideration with the expect that the related
code should at least serve as a placeholder.

[YOCTO #1487]
[YOCTO #4761]

(From OE-Core rev: 3cd6fedd815688b2f3fd97a56feb5f8696ebeace)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-28 11:02:40 +01:00
Chen Qi 76ccbba748 initrdscripts: unionfs cleanup
The unionfs has been disabled for more than a year and it's not going
to be used any more.

This patch cleans up the unionfs related code.

[YOCTO #4761]
[YOCTO #1487]

(From OE-Core rev: ba5e437bc7335468a70ea293496f78e1a9d66287)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-28 11:02:40 +01:00
Hongxu Jia 337125545d init-live.sh: fix automount failed occasionally
Reboot system repeatedly, occasionally found usb automount failed, a
low probability but it happens.
$ df
Filesystem           1K-blocks      Used Available Use% Mounted on
none                   1024972         4   1024968   0% /dev
/dev/sda3              7689384   3540940   3757840  49% /media/sda3
/dev/sda2            146127424   1238432 137466120   1% /media/sda2
/dev/sda1                17845     14570      2354  86% /media/sda1
/dev/sdb                293400    288560      4840  98% /media/sdb
/dev/sdc4               457632        32    457600   0% /media/sdc4
/dev/sdc1               475018      2321    447749   1% /media/sdc1
/dev/sdd               1382298   1382298         0 100% /media/sdd
/dev/sdc2               475694      2320    448374   1% /media/sdc2
/dev/loop0              270649    181249     75644  71% /
df: /media/sdc3: No such file or directory
tmpfs                  1029352         0   1029352   0% /dev/shm
tmpfs                  1029352      2816   1026536   0% /run
tmpfs                  1029352         0   1029352   0% /sys/fs/cgroup
tmpfs                  1029352         4   1029348   0% /tmp
tmpfs                  1029352         0   1029352   0% /media/ram
tmpfs                  1029352       116   1029236   0% /var/volatile

When boot media has been found, udev will be killed. If udev is busy
to mount other medias at the killing time (especially medias is many),
the above issue will occur occasionally.

Invoke `udevadm settle' before killing udev will resolve this
issue, it watches the udev event queue, and exits if all current
events are handled.

Use variable `_UDEV_DAEMON' to replace hardcoded `udevd' to keep
consistent with previous.

[YOCTO #4745]

(From OE-Core rev: 2f209a7045a93e7e42f90418a42f464827b4a7f8)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-28 09:14:04 +01:00
Hongxu Jia 66079795c9 init-live.sh: fix media automount failed after booting from usb-drive
1, This issue happens to BSP only.
After a BSP board is booted with Yocto linux from USB drive, "cat /proc/mounts" shows:
...
/dev/sda3 /media/sda3 ext3 rw,relatime,errors=continue,user_xattr,acl,barrier=1,data=ordered 0 0
/dev/sda1 /media/sda1 ext3 rw,relatime,errors=continue,barrier=1,data=ordered 0 0
/dev/sda2 /media/sda2 ext3 rw,relatime,errors=continue,user_xattr,acl,barrier=1,data=ordered 0 0
...

but actually the directory /media/sda1 doesn't exist at all, "df" shows:
...
df: /media/sda3: No such file or directory
df: /media/sda1: No such file or directory
df: /media/sda2: No such file or directory
...

2, This is because the mount data comes from proc setup during early boot
before the change root, which then uses a different root filesystem, the
media is not in the new root filesystem.

3, During early boot before switch_root, use `mount --move' to move all
medias to the new root filesystem could also fix this issue.

[YOCTO #2064]
[YOCTO #3705]

(From OE-Core rev: 79bd773cc5e8b8e873cabeb2b9a91f460501dad7)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-11 15:38:00 +01:00
Saul Wold f371626f70 Revert "initramfs-live-install*: fix the "install" boot option"
This was not the correct fix for this issues, it turns out that
base-files package was getting installed un-intentionally when
rpm-postinsts was split out. The base-files recipe lays down the
link that caused the cat failure.

[YOCTO #4504]

This reverts commit 45e460d0846f0f660128dc06064b597ce40282b3.

(From OE-Core rev: 7d50133dd5c955d97193cc26458ebbf84dbfe0a4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-17 09:37:29 +03:00
Nitin A Kamble 1695345393 initramfs-live-install*: fix the "install" boot option
The install boot option was giving the following error when one tried to
install the live image on a  permanent storage of a BSP.

cat: write error Invalid argument
Installation image failed
sh: can't access tty: job control turned off

Further digging into the issue, found out that the install script was trying
to do this:
 cat /proc/mounts > /etc/mtab

And in the base-files recipe the /etc/mtab is made soft link to /proc/mounts.
So the cat command was failing to write on /etc/mtab. As the contents of
the /proc/mounts is already reflected in the /etc/mtab file due to the
symlink-ing, there is no need for this step to recreate /etc/mtab in the
install script. So just removing this unnecessary step, which solves the
install issue of the live images.

Fixes this bug:
[YOCTO #4229]

(From OE-Core rev: f8663eac872882e94d956b1b604304e92b865766)

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-16 12:06:40 +01:00
Ross Burton c9ce1643ef initramfs-live-boot: explicitly depend on udev-extraconf
init-live.sh depends on udev performing automounting, which happens in
udev-extraconf.  Explicitly depend on it so that we always have it installed.

(From OE-Core rev: a608d74e69ca1efe5f2b176c000fb8212797d056)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-15 15:58:15 +01:00
Ross Burton 27bb516be4 initrdscripts: look for new systemd-udevd location
As per the previous commit, systemd-udevd is now in /sbin/systemd/.

(From OE-Core rev: ff0fd25206c3c75921d51cb80bcb6c94ca47b405)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-13 23:53:06 +01:00
Richard Purdie 51cc49ddda initrdscripts: Add udev sbin based libexec path
For better or worse we need to use base_sbindir for udev's libexec dir. This
updates the initrdscripts to also cover the new location. I'd prevously assumed
that it was already covered but its not. udev internal binaries shouldn't be in
PATH so we have to do this to deal with the issue.

(From OE-Core rev: 7e17cba75c20ad820d30128d9b4b0132e7b924a8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-10 11:49:04 +01:00
Chen Qi e0da509973 init-install.sh: remove unnecessary udev rules file to avoid error messages
/etc/udev/scripts/mount.sh is removed by init-install.sh, but the udev
rules file which specifies the invocation of this script is not removed,
thus causing the error message '/etc/udev/scripts/mount.sh: No such file
or directory' shown at a live install.

The /etc/udev/rules/automount.rules no longer works once the mount.sh script
is removed. So we remove it to avoid the error message.

[YOCTO #3924]

(From OE-Core rev: 6b6db7b4fb7aa17b8e29076decc830149b9d35bc)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-29 10:40:55 +00:00
Darren Hart 4f4d82c62c install: Look for grub2 files on the initramfs, not rootfs
Fixes [YOCTO #3870] atom-pc - cannot boot image on netbook after install

The problem here is that grub2 is installed but a grub 1 menu.lst is
created at install time. At boot, grub2 doesn't find a grub.cfg file and
drops to the grub shell.

This happens because the installer is looking for 40_custom (a grub2
file) on the rootfs, but grub2 isn't installed on the rootfs. It exists
in the initramfs. Patching the installer to look on the initramfs
resolves the problem.

Note that the problem may have occurred if grub2 used to be installed on
the rootfs but was later removed. In any case, the installer is HORRIBLE
and really needs to be completely redesigned as part of the deployment
effort. For now, this should get the live image installer limping along
again.

Tested on a Toshiba NB-305.

(From OE-Core rev: 8756a19bd24045d41ad20abb581e7872d0fc9ee6)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Cc: alexandru.c.georgescu@intel.com
Cc: sgw@linux.intel.com
Cc: ross.burton@intel.com
Cc: richard.purdie@intel.com
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-22 06:39:07 -08:00
Richard Purdie 2f497d0952 initramfsframework: Improve RDEPENDS to be package specific
(From OE-Core rev: 8c9a604d3ef33d47a48000d6c38159a64204e81e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-04 16:42:48 +00:00
Richard Purdie b6bade27b8 initramfs-live-boot: Set RDEPENDS on the specific package that needs it
Set the RDEPENDS on the specific package that has the dependency and stop it
being applied to for example ${PN}-doc (and others).

(From OE-Core rev: 7437a864f03ff56a4fba9d8ce9baf845b945ed9e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-04 16:42:47 +00:00
Ian Reinhart Geiser 57bbb7d6f4 initramds-framework: add shutdown hook for udev
In cases where other initramfs modules need to rely on
udev running (ie in my case I have to load firmware on
a device that is slow to start) there needs to be a way
to keep it running during the lifecycle of the initramfs
but still be shut down before swith_root is called.  I
added a  module_pre_hook that will shut down udev before
the finish module is called.

(From OE-Core rev: ce690659ef797bd26dc2be59167aa01744841510)

Signed-off-by: Ian Reinhart Geiser <igeiser@devonit.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-04 13:18:25 +00:00
Chen Qi f8a4a74c8c init-live.sh: move /media/xxx over to the real root filesystem
Previously, the /media/xxx which contains the root image was not
moved to be under the real root filesystem. Because of this, the
output of the 'mount' command is somewhat confusing, that is, it
has some mount point that is not even in the filesystem.

Besides, on some machine, it caused the recovery procedure when we
booted it next time.

This patches fixes this issue by moving the /media/xxx over to be
under the real root filesystem.

[YOCTO #2064]
[YOCTO #3705]

(From OE-Core rev: 261d21d36298bb7822ee7370c30441f42ef2b093)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-25 12:42:46 +00:00
Ross Burton e7ebff0a98 initramfs-live-boot: handle multiple udev locations
udevd isn't on $PATH and is in different places depending on what version of
udev is being used.  Copy the code from initramfs-framework to search for the
right udevd at boot time instead of hard-coding a location.

(From OE-Core rev: a5de76317112fc065a78a745c2f23775dca15d75)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-18 13:28:06 +00:00
Chen Qi 14649c0035 init-live.sh: avoid duplicate mount points for the same filesystem
A live system had duplicate mount points for the same filesystem
in the output of 'mount' command. That was because we didn't handle
the temporary mounts properly before switch_root.

This patch fixes this problem by moving the mount points of some
filesystems to the corresponding directories in the real root filesystem.

[YOCTO #3155]

(From OE-Core rev: 050a745413f8bb26212b84da391e0f7665f77728)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-07 11:09:40 +00:00
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