diff options
11 files changed, 51 insertions, 246 deletions
diff --git a/meta-boot2qt-distro/conf/distro/include/intel-corei7-64.conf b/meta-boot2qt-distro/conf/distro/include/intel-corei7-64.conf index 64432d3..8d106ce 100644 --- a/meta-boot2qt-distro/conf/distro/include/intel-corei7-64.conf +++ b/meta-boot2qt-distro/conf/distro/include/intel-corei7-64.conf | |||
@@ -1,6 +1,6 @@ | |||
1 | ############################################################################ | 1 | ############################################################################ |
2 | ## | 2 | ## |
3 | ## Copyright (C) 2016 The Qt Company Ltd. | 3 | ## Copyright (C) 2018 The Qt Company Ltd. |
4 | ## Contact: https://www.qt.io/licensing/ | 4 | ## Contact: https://www.qt.io/licensing/ |
5 | ## | 5 | ## |
6 | ## This file is part of the Boot to Qt meta layer. | 6 | ## This file is part of the Boot to Qt meta layer. |
@@ -38,12 +38,11 @@ QBSP_IMAGE_CONTENT ?= "\ | |||
38 | ${IMAGE_LINK_NAME}.conf \ | 38 | ${IMAGE_LINK_NAME}.conf \ |
39 | " | 39 | " |
40 | 40 | ||
41 | INITRAMFS_IMAGE = "initramfs-basic" | 41 | INITRAMFS_IMAGE = "core-image-minimal-initramfs" |
42 | 42 | ||
43 | SYSVINIT_ENABLED_GETTYS = "1" | 43 | SYSVINIT_ENABLED_GETTYS = "1" |
44 | 44 | ||
45 | MACHINE_EXTRA_INSTALL += "\ | ||
46 | grub-efi-config \ | ||
47 | " | ||
48 | |||
49 | SERIAL_CONSOLES += "115200;ttyUSB0" | 45 | SERIAL_CONSOLES += "115200;ttyUSB0" |
46 | |||
47 | WKS_FILE = "systemd-bootdisk-microcode-initramfs.wks" | ||
48 | WKS_FILE_DEPENDS += "microcode-initramfs" | ||
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 | |||
3 | PATH=/sbin:/bin:/usr/sbin:/usr/bin | ||
4 | ROOT_MOUNT="/sysroot/" | ||
5 | ROOT_DEVICE="" | ||
6 | |||
7 | early_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 | |||
19 | read_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 | |||
51 | mount_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 | |||
62 | switch_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 | |||
88 | debug_shell() { | ||
89 | |||
90 | echo ${1} | ||
91 | echo "Dropping to a shell." | ||
92 | exec sh | ||
93 | } | ||
94 | |||
95 | main() { | ||
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 | |||
107 | main | ||
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 | |||
30 | SUMMARY = "Simple init script that mounts root filesystem by label." | ||
31 | LICENSE = "The-Qt-Company-Commercial" | ||
32 | LIC_FILES_CHKSUM = "file://${QT_LICENSE};md5=948f8877345cd66106f11031977a4625" | ||
33 | SRC_URI = "file://init.sh" | ||
34 | |||
35 | S = "${WORKDIR}" | ||
36 | |||
37 | do_install () { | ||
38 | install -m 0755 ${WORKDIR}/init.sh ${D}/init | ||
39 | } | ||
40 | |||
41 | inherit allarch | ||
42 | |||
43 | FILES_${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 | |||
30 | DESCRIPTION = "Basic initramfs image. Useful as a template for more advanced functionality." | ||
31 | LICENSE = "The-Qt-Company-Commercial" | ||
32 | LIC_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 | ||
35 | PACKAGE_INSTALL = "init-basic busybox util-linux-findfs ${ROOTFS_BOOTSTRAP_INSTALL}" | ||
36 | |||
37 | # Do not pollute the initramfs image with rootfs features | ||
38 | IMAGE_FEATURES = "" | ||
39 | |||
40 | export IMAGE_BASENAME = "initramfs-basic" | ||
41 | IMAGE_LINGUAS = "" | ||
42 | |||
43 | IMAGE_FSTYPES = "cpio.gz" | ||
44 | inherit core-image | ||
45 | |||
46 | IMAGE_ROOTFS_SIZE = "8192" | ||
47 | IMAGE_ROOTFS_EXTRA_SPACE = "0" | ||
48 | |||
49 | BAD_RECOMMENDATIONS += "busybox-syslog" | ||
50 | |||
diff --git a/meta-intel-extras/recipes/grub/grub-efi/grub.cfg b/meta-intel-extras/recipes/grub/grub-efi/grub.cfg deleted file mode 100644 index 287cf7c..0000000 --- a/meta-intel-extras/recipes/grub/grub-efi/grub.cfg +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | # Created by meta-b2qt | ||
2 | serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1 | ||
3 | default=boot | ||
4 | timeout=0 | ||
5 | |||
6 | menuentry 'boot' { | ||
7 | linux /boot/bzImage root=LABEL=rootfs | ||
8 | initrd /boot/initramfs | ||
9 | } | ||
10 | |||
diff --git a/meta-intel-extras/recipes/initramfs-basic/initramfs-basic.bbappend b/meta-intel-extras/recipes/images/core-image-minimal-initramfs.bbappend index 1ac5f03..c1918ba 100644 --- a/meta-intel-extras/recipes/initramfs-basic/initramfs-basic.bbappend +++ b/meta-intel-extras/recipes/images/core-image-minimal-initramfs.bbappend | |||
@@ -27,4 +27,5 @@ | |||
27 | ## | 27 | ## |
28 | ############################################################################ | 28 | ############################################################################ |
29 | 29 | ||
30 | INITRAMFS_SCRIPTS += "initramfs-module-rtsx-pci-sdmmc" | ||
30 | PACKAGE_INSTALL += "kernel-module-rtsx-pci-sdmmc" | 31 | PACKAGE_INSTALL += "kernel-module-rtsx-pci-sdmmc" |
diff --git a/meta-intel-extras/recipes/initramfs-basic/init-basic/init-device.sh b/meta-intel-extras/recipes/initramfs-basic/init-basic/init-device.sh deleted file mode 100644 index 09eadbf..0000000 --- a/meta-intel-extras/recipes/initramfs-basic/init-basic/init-device.sh +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | modprobe rtsx_pci_sdmmc | ||
diff --git a/meta-intel-extras/recipes/initrdscripts/initramfs-framework/rtsx_pci_sdmmc b/meta-intel-extras/recipes/initrdscripts/initramfs-framework/rtsx_pci_sdmmc new file mode 100644 index 0000000..dd14d6d --- /dev/null +++ b/meta-intel-extras/recipes/initrdscripts/initramfs-framework/rtsx_pci_sdmmc | |||
@@ -0,0 +1,8 @@ | |||
1 | #!/bin/sh | ||
2 | rtsx_pci_sdmmc_enabled() { | ||
3 | return 0 | ||
4 | } | ||
5 | |||
6 | rtsx_pci_sdmmc_run() { | ||
7 | load_kernel_module rtsx_pci_sdmmc | ||
8 | } | ||
diff --git a/meta-intel-extras/recipes/initramfs-basic/init-basic.bbappend b/meta-intel-extras/recipes/initrdscripts/initramfs-framework_1.0.bbappend index ab69a09..cfd05cd 100644 --- a/meta-intel-extras/recipes/initramfs-basic/init-basic.bbappend +++ b/meta-intel-extras/recipes/initrdscripts/initramfs-framework_1.0.bbappend | |||
@@ -29,10 +29,14 @@ | |||
29 | 29 | ||
30 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | 30 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" |
31 | 31 | ||
32 | SRC_URI += "file://init-device.sh" | 32 | SRC_URI += "file://rtsx_pci_sdmmc" |
33 | 33 | ||
34 | do_install_append () { | 34 | do_install_append() { |
35 | install -m 0755 ${WORKDIR}/init-device.sh ${D}/init-device | 35 | install -m 0755 ${WORKDIR}/rtsx_pci_sdmmc ${D}/init.d/20-rtsx_pci_sdmmc |
36 | } | 36 | } |
37 | 37 | ||
38 | FILES_${PN} += "/init-device" | 38 | PACKAGES += "initramfs-module-rtsx-pci-sdmmc" |
39 | |||
40 | SUMMARY_initramfs-module-rtsx-pci-sdmmc = "initramfs support for rtsx_pci_sdmmc" | ||
41 | RDEPENDS_initramfs-module-rtsx-pci-sdmmc = "${PN}-base" | ||
42 | FILES_initramfs-module-rtsx-pci-sdmmc = "/init.d/20-rtsx_pci_sdmmc" | ||
diff --git a/meta-intel-extras/recipes/grub/grub-efi_%.bbappend b/meta-intel-extras/recipes/microcode-initramfs/microcode-initramfs.bb index f3a95f2..8682c27 100644 --- a/meta-intel-extras/recipes/grub/grub-efi_%.bbappend +++ b/meta-intel-extras/recipes/microcode-initramfs/microcode-initramfs.bb | |||
@@ -1,6 +1,6 @@ | |||
1 | ############################################################################ | 1 | ############################################################################ |
2 | ## | 2 | ## |
3 | ## Copyright (C) 2016 The Qt Company Ltd. | 3 | ## Copyright (C) 2018 The Qt Company Ltd. |
4 | ## Contact: https://www.qt.io/licensing/ | 4 | ## Contact: https://www.qt.io/licensing/ |
5 | ## | 5 | ## |
6 | ## This file is part of the Boot to Qt meta layer. | 6 | ## This file is part of the Boot to Qt meta layer. |
@@ -27,33 +27,26 @@ | |||
27 | ## | 27 | ## |
28 | ############################################################################ | 28 | ############################################################################ |
29 | 29 | ||
30 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | 30 | SUMMARY = "Initramfs with early load intel microcode" |
31 | SRC_URI += "file://grub.cfg" | 31 | LICENSE = "The-Qt-Company-Commercial" |
32 | LIC_FILES_CHKSUM = "file://${QT_LICENSE};md5=948f8877345cd66106f11031977a4625" | ||
32 | 33 | ||
33 | do_install[depends] += " \ | 34 | inherit deploy nopackages |
34 | virtual/kernel:do_deploy \ | 35 | |
36 | do_compile[depends] += " \ | ||
35 | ${INITRAMFS_IMAGE}:do_image_complete \ | 37 | ${INITRAMFS_IMAGE}:do_image_complete \ |
36 | ${@bb.utils.contains('MACHINE_FEATURES', 'intel-ucode', 'intel-microcode:do_deploy', '', d)} \ | 38 | ${@bb.utils.contains('MACHINE_FEATURES', 'intel-ucode', 'intel-microcode:do_deploy', '', d)} \ |
37 | " | 39 | " |
38 | |||
39 | do_deploy_prepend() { | ||
40 | 40 | ||
41 | cat > ${WORKDIR}/cfg <<EOF | 41 | do_compile() { |
42 | search.file /boot/grub2/grub.cfg root | 42 | # https://www.kernel.org/doc/Documentation/x86/microcode.txt |
43 | set prefix=/boot/grub2 | 43 | microcode="${@bb.utils.contains('MACHINE_FEATURES', 'intel-ucode', '${DEPLOY_DIR_IMAGE}/microcode.cpio ', '', d)}" |
44 | EOF | 44 | cat ${microcode} ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.cpio.gz > ${S}/microcode-initramfs |
45 | } | 45 | } |
46 | 46 | ||
47 | do_install_append() { | 47 | do_deploy() { |
48 | 48 | install -d ${DEPLOYDIR} | |
49 | install -d ${D}/boot/grub2/ | 49 | install -m 0644 ${S}/microcode-initramfs ${DEPLOYDIR}/ |
50 | install -m 644 ${WORKDIR}/grub.cfg ${D}/boot/grub2/ | ||
51 | |||
52 | # https://www.kernel.org/doc/Documentation/x86/early-microcode.txt | ||
53 | microcode="${@bb.utils.contains('MACHINE_FEATURES', 'intel-ucode', '${DEPLOY_DIR_IMAGE}/microcode.cpio ', '', d)}" | ||
54 | cat ${microcode} ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.cpio.gz > ${D}/boot/initramfs | ||
55 | chmod 0644 ${D}/boot/initramfs | ||
56 | } | 50 | } |
57 | 51 | ||
58 | PACKAGES += "${PN}-config" | 52 | addtask deploy before do_build after do_compile |
59 | FILES_${PN}-config = "/boot/grub2/ /boot/initramfs" | ||
diff --git a/meta-intel-extras/wic/systemd-bootdisk-microcode-initramfs.wks b/meta-intel-extras/wic/systemd-bootdisk-microcode-initramfs.wks new file mode 100644 index 0000000..4907631 --- /dev/null +++ b/meta-intel-extras/wic/systemd-bootdisk-microcode-initramfs.wks | |||
@@ -0,0 +1,13 @@ | |||
1 | # short-description: Create an EFI disk image with systemd-boot | ||
2 | # long-description: Creates a partitioned EFI disk image that the user | ||
3 | # can directly dd to boot media. The selected bootloader is systemd-boot. | ||
4 | # It also includes intel-microcode as an initrd for early update support. | ||
5 | # Based on OE-core's systemd-bootdisk.wks file. | ||
6 | |||
7 | part /boot --source bootimg-efi --sourceparams="loader=systemd-boot,initrd=microcode-initramfs" --ondisk sda --label msdos --active --align 1024 --use-uuid | ||
8 | |||
9 | part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid | ||
10 | |||
11 | part swap --ondisk sda --size 44 --label swap1 --fstype=swap --use-uuid | ||
12 | |||
13 | bootloader --ptable gpt --timeout=5 --append="rootwait rootfstype=ext4 console=ttyS0,115200 console=tty0" | ||