diff options
author | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
commit | 972dcfcdbfe75dcfeb777150c136576cf1a71e99 (patch) | |
tree | 97a61cd7e293d7ae9d56ef7ed0f81253365bb026 /meta/recipes-core/initrdscripts/initramfs-framework/finish | |
download | poky-972dcfcdbfe75dcfeb777150c136576cf1a71e99.tar.gz |
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-core/initrdscripts/initramfs-framework/finish')
-rwxr-xr-x | meta/recipes-core/initrdscripts/initramfs-framework/finish | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/finish b/meta/recipes-core/initrdscripts/initramfs-framework/finish new file mode 100755 index 0000000000..325f47be40 --- /dev/null +++ b/meta/recipes-core/initrdscripts/initramfs-framework/finish | |||
@@ -0,0 +1,47 @@ | |||
1 | #!/bin/sh | ||
2 | # Copyright (C) 2011 O.S. Systems Software LTDA. | ||
3 | # Licensed on MIT | ||
4 | |||
5 | finish_enabled() { | ||
6 | return 0 | ||
7 | } | ||
8 | |||
9 | finish_run() { | ||
10 | if [ -n "$ROOTFS_DIR" ]; then | ||
11 | if [ -n "$bootparam_rootdelay" ]; then | ||
12 | debug "Sleeping for $rootdelay second(s) to wait root to settle..." | ||
13 | sleep $bootparam_rootdelay | ||
14 | fi | ||
15 | |||
16 | if [ -n "$bootparam_root" ]; then | ||
17 | debug "No e2fs compatible filesystem has been mounted, mounting $bootparam_root..." | ||
18 | |||
19 | if [ "`echo ${bootparam_root} | cut -c1-5`" = "UUID=" ]; then | ||
20 | root_uuid=`echo $bootparam_root | cut -c6-` | ||
21 | bootparam_root="/dev/disk/by-uuid/$root_uuid" | ||
22 | fi | ||
23 | |||
24 | if [ -e "$bootparam_root" ]; then | ||
25 | mount $bootparam_root $ROOTFS_DIR | ||
26 | else | ||
27 | debug "root '$bootparam_root' doesn't exist." | ||
28 | fi | ||
29 | fi | ||
30 | |||
31 | if [ ! -d $ROOTFS_DIR/dev ]; then | ||
32 | fatal "ERROR: There's no '/dev' on rootfs." | ||
33 | fi | ||
34 | |||
35 | info "Switching root to '$ROOTFS_DIR'..." | ||
36 | |||
37 | debug "Moving /dev, /proc and /sys onto rootfs..." | ||
38 | mount --move /dev $ROOTFS_DIR/dev | ||
39 | mount --move /proc $ROOTFS_DIR/proc | ||
40 | mount --move /sys $ROOTFS_DIR/sys | ||
41 | |||
42 | cd $ROOTFS_DIR | ||
43 | exec switch_root -c /dev/console $ROOTFS_DIR /sbin/init | ||
44 | else | ||
45 | debug "No rootfs has been set" | ||
46 | fi | ||
47 | } | ||