summaryrefslogtreecommitdiffstats
path: root/meta-boot2qt
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@qt.io>2018-10-31 15:15:29 +0200
committerSamuli Piippo <samuli.piippo@qt.io>2018-11-01 07:55:40 +0000
commit1b57456064b33a5838882909d26f92c00982a0a0 (patch)
tree779f08ecc748ba03645563391fa195363a48ad37 /meta-boot2qt
parentdd7ede32632c6452c10aa424800c60a09cc42c8a (diff)
downloadmeta-boot2qt-1b57456064b33a5838882909d26f92c00982a0a0.tar.gz
intel: rework initramfs support
The WKS image creation ignored our old initramfs. Change to using an existing core-image-minimal-initramfs recipe and extend it with support for the internal MMC reader. Add separate recipe to combine the intel microcode and the new initramfs, and add wks file to use it. Remove all old recipes that are no longer used. Change-Id: I4e1f244685a7f2bd304aa23d9e07580fa9dc9652 Reviewed-by: Timo Aarnipuro <timo.aarnipuro@qt.io> Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
Diffstat (limited to 'meta-boot2qt')
-rw-r--r--meta-boot2qt/recipes-core/initramfs-basic/files/init.sh107
-rw-r--r--meta-boot2qt/recipes-core/initramfs-basic/init-basic.bb43
-rw-r--r--meta-boot2qt/recipes-core/initramfs-basic/initramfs-basic.bb50
3 files changed, 0 insertions, 200 deletions
diff --git a/meta-boot2qt/recipes-core/initramfs-basic/files/init.sh b/meta-boot2qt/recipes-core/initramfs-basic/files/init.sh
deleted file mode 100644
index 94eb39b..0000000
--- a/meta-boot2qt/recipes-core/initramfs-basic/files/init.sh
+++ /dev/null
@@ -1,107 +0,0 @@
1#!/bin/sh
2
3PATH=/sbin:/bin:/usr/sbin:/usr/bin
4ROOT_MOUNT="/sysroot/"
5ROOT_DEVICE=""
6
7early_setup() {
8
9 mkdir -p /proc
10 mkdir -p /sys
11 mount -t proc proc /proc
12 mount -t sysfs sysfs /sys
13 mount -t devtmpfs none /dev
14
15 mkdir -p /run
16 mkdir -p /var/run
17}
18
19read_args() {
20
21 for arg in $(cat /proc/cmdline); do
22 value=$(echo ${arg} | cut -s -f2- -d '=')
23 case $arg in
24 root=*)
25 root=$value
26 ;;
27 debugshell*)
28 if [ -z "$value" ]; then
29 shelltimeout=30
30 else
31 shelltimeout=$value
32 fi
33 ;;
34 esac
35 done
36
37 if [ -z "$root" ] ; then
38 debug_shell "No root= specified via kernel command line."
39 else
40 case $root in
41 LABEL=*)
42 label=${root#LABEL=}
43 ;;
44 *)
45 debug_shell "This init script only supports root=LABEL=* for specifying root file system, but root=$root was provided."
46 ;;
47 esac
48 fi
49}
50
51mount_rootfs() {
52
53 mkdir -p $ROOT_MOUNT
54 mount $ROOT_DEVICE $ROOT_MOUNT
55 mount -n --move /proc $ROOT_MOUNT/proc
56 mount -n --move /sys $ROOT_MOUNT/sys
57 mount -n --move /dev $ROOT_MOUNT/dev
58
59 exec switch_root $ROOT_MOUNT /sbin/init || debug_shell "Couldn't switch_root."
60}
61
62switch_real_root() {
63
64 echo "Searching for media..."
65 C=0
66 while true
67 do
68
69 rootfs=$(findfs LABEL=$label)
70 if [ -n "$rootfs" ] ; then
71 ROOT_DEVICE=$rootfs
72 mount_rootfs
73 fi
74
75 # don't wait for more than $shelltimeout seconds, if it's set
76 if [ -n "$shelltimeout" ]; then
77 echo -n " " $(( $shelltimeout - $C ))
78 if [ $C -ge $shelltimeout ]; then
79 debug_shell "Cannot find root file system."
80 fi
81 C=$(( C + 1 ))
82 fi
83
84 sleep 1
85 done
86}
87
88debug_shell() {
89
90 echo ${1}
91 echo "Dropping to a shell."
92 exec sh
93}
94
95main() {
96
97 early_setup
98 read_args
99
100 if [ -f init-device ]; then
101 source init-device
102 fi
103
104 switch_real_root
105}
106
107main
diff --git a/meta-boot2qt/recipes-core/initramfs-basic/init-basic.bb b/meta-boot2qt/recipes-core/initramfs-basic/init-basic.bb
deleted file mode 100644
index 39d590a..0000000
--- a/meta-boot2qt/recipes-core/initramfs-basic/init-basic.bb
+++ /dev/null
@@ -1,43 +0,0 @@
1############################################################################
2##
3## Copyright (C) 2016 The Qt Company Ltd.
4## Contact: https://www.qt.io/licensing/
5##
6## This file is part of the Boot to Qt meta layer.
7##
8## $QT_BEGIN_LICENSE:GPL$
9## Commercial License Usage
10## Licensees holding valid commercial Qt licenses may use this file in
11## accordance with the commercial license agreement provided with the
12## Software or, alternatively, in accordance with the terms contained in
13## a written agreement between you and The Qt Company. For licensing terms
14## and conditions see https://www.qt.io/terms-conditions. For further
15## information use the contact form at https://www.qt.io/contact-us.
16##
17## GNU General Public License Usage
18## Alternatively, this file may be used under the terms of the GNU
19## General Public License version 3 or (at your option) any later version
20## approved by the KDE Free Qt Foundation. The licenses are as published by
21## the Free Software Foundation and appearing in the file LICENSE.GPL3
22## included in the packaging of this file. Please review the following
23## information to ensure the GNU General Public License requirements will
24## be met: https://www.gnu.org/licenses/gpl-3.0.html.
25##
26## $QT_END_LICENSE$
27##
28############################################################################
29
30SUMMARY = "Simple init script that mounts root filesystem by label."
31LICENSE = "The-Qt-Company-Commercial"
32LIC_FILES_CHKSUM = "file://${QT_LICENSE};md5=948f8877345cd66106f11031977a4625"
33SRC_URI = "file://init.sh"
34
35S = "${WORKDIR}"
36
37do_install () {
38 install -m 0755 ${WORKDIR}/init.sh ${D}/init
39}
40
41inherit allarch
42
43FILES_${PN} += "/init"
diff --git a/meta-boot2qt/recipes-core/initramfs-basic/initramfs-basic.bb b/meta-boot2qt/recipes-core/initramfs-basic/initramfs-basic.bb
deleted file mode 100644
index 283a681..0000000
--- a/meta-boot2qt/recipes-core/initramfs-basic/initramfs-basic.bb
+++ /dev/null
@@ -1,50 +0,0 @@
1############################################################################
2##
3## Copyright (C) 2016 The Qt Company Ltd.
4## Contact: https://www.qt.io/licensing/
5##
6## This file is part of the Boot to Qt meta layer.
7##
8## $QT_BEGIN_LICENSE:GPL$
9## Commercial License Usage
10## Licensees holding valid commercial Qt licenses may use this file in
11## accordance with the commercial license agreement provided with the
12## Software or, alternatively, in accordance with the terms contained in
13## a written agreement between you and The Qt Company. For licensing terms
14## and conditions see https://www.qt.io/terms-conditions. For further
15## information use the contact form at https://www.qt.io/contact-us.
16##
17## GNU General Public License Usage
18## Alternatively, this file may be used under the terms of the GNU
19## General Public License version 3 or (at your option) any later version
20## approved by the KDE Free Qt Foundation. The licenses are as published by
21## the Free Software Foundation and appearing in the file LICENSE.GPL3
22## included in the packaging of this file. Please review the following
23## information to ensure the GNU General Public License requirements will
24## be met: https://www.gnu.org/licenses/gpl-3.0.html.
25##
26## $QT_END_LICENSE$
27##
28############################################################################
29
30DESCRIPTION = "Basic initramfs image. Useful as a template for more advanced functionality."
31LICENSE = "The-Qt-Company-Commercial"
32LIC_FILES_CHKSUM = "file://${QT_LICENSE};md5=948f8877345cd66106f11031977a4625"
33
34# findfs from busybox fails to do its jobs, the full version from util-linux-findfs works fine
35PACKAGE_INSTALL = "init-basic busybox util-linux-findfs ${ROOTFS_BOOTSTRAP_INSTALL}"
36
37# Do not pollute the initramfs image with rootfs features
38IMAGE_FEATURES = ""
39
40export IMAGE_BASENAME = "initramfs-basic"
41IMAGE_LINGUAS = ""
42
43IMAGE_FSTYPES = "cpio.gz"
44inherit core-image
45
46IMAGE_ROOTFS_SIZE = "8192"
47IMAGE_ROOTFS_EXTRA_SPACE = "0"
48
49BAD_RECOMMENDATIONS += "busybox-syslog"
50