This changelist will create a compressed raw image as required
by NXP ls1012a ARM-64 based board.
This image can be flashed to a SD Card and boot the
NXP ls1012a board.
Change-Id: I0e24be7dbbb43428e70041aa00a0306101fd1c71
Signed-off-by: srinidhira0 <srinidhir@vmware.com>
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/6393
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Alexey Makhalov <amakhalov@vmware.com>
... | ... |
@@ -6,6 +6,7 @@ DST=linux-firmware-$DATE_TAG |
6 | 6 |
mkdir $DST |
7 | 7 |
|
8 | 8 |
git clone https://github.com/RPi-Distro/firmware-nonfree.git --depth=1 |
9 |
+git clone https://github.com/NXP/qoriq-engine-pfe-bin.git --depth=1 |
|
9 | 10 |
git clone git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git --depth=1 |
10 | 11 |
|
11 | 12 |
cp linux-firmware/WHENCE $DST/ |
... | ... |
@@ -27,4 +28,11 @@ cp firmware-nonfree/LICENCE.broadcom_bcm43xx $DST/ |
27 | 27 |
cp -a linux-firmware/rsi $DST/ |
28 | 28 |
cp linux-firmware/rsi_91x.fw $DST/ |
29 | 29 |
|
30 |
+# NXP ls1012a FRWY requires: |
|
31 |
+mkdir $DST/ls1012a_ppe/ |
|
32 |
+cp qoriq-engine-pfe-bin/ls1012a/slow_path/ppfe_class_ls1012a.elf $DST/ls1012a_ppe/ |
|
33 |
+cp qoriq-engine-pfe-bin/ls1012a/slow_path/ppfe_tmu_ls1012a.elf $DST/ls1012a_ppe/ |
|
34 |
+cp qoriq-engine-pfe-bin/NXP-Binary-EULA.txt $DST/ls1012a_ppe/ |
|
35 |
+ |
|
36 |
+ |
|
30 | 37 |
tar -czvf $DST.tar.gz $DST |
... | ... |
@@ -1,8 +1,11 @@ |
1 |
+%global debug_package %{nil} |
|
2 |
+%global __os_install_post %{nil} |
|
1 | 3 |
%global _firmwarepath /lib/firmware |
4 |
+%define _binaries_in_noarch_packages_terminate_build 0 |
|
2 | 5 |
|
3 | 6 |
Summary: Linux Firmware |
4 | 7 |
Name: linux-firmware |
5 |
-Version: 20181010 |
|
8 |
+Version: 20181129 |
|
6 | 9 |
Release: 1%{?dist} |
7 | 10 |
License: GPL+ and GPLv2+ and MIT and Redistributable, no modification permitted |
8 | 11 |
URL: http://www.kernel.org/ |
... | ... |
@@ -10,7 +13,7 @@ Group: System Environment/Kernel |
10 | 10 |
Vendor: VMware, Inc. |
11 | 11 |
Distribution: Photon |
12 | 12 |
Source0: %{name}-%{version}.tar.gz |
13 |
-%define sha1 linux=b0ac86dbd7eac291a6ce6a53c2aaae4ca83e665e |
|
13 |
+%define sha1 linux=73b5cab414c26bac116d6c5d976287bfb913b68c |
|
14 | 14 |
BuildArch: noarch |
15 | 15 |
|
16 | 16 |
%description |
... | ... |
@@ -26,12 +29,15 @@ mkdir -p %{buildroot}%{_firmwarepath} |
26 | 26 |
cp -r brcm %{buildroot}%{_firmwarepath} |
27 | 27 |
cp -r rsi %{buildroot}%{_firmwarepath} |
28 | 28 |
cp rsi_91x.fw %{buildroot}%{_firmwarepath} |
29 |
- |
|
29 |
+cp ls1012a_ppe/ppfe_class_ls1012a.elf %{buildroot}%{_firmwarepath} |
|
30 |
+cp ls1012a_ppe/ppfe_tmu_ls1012a.elf %{buildroot}%{_firmwarepath} |
|
31 |
+cp ls1012a_ppe/NXP-Binary-EULA.txt %{buildroot}%{_firmwarepath} |
|
30 | 32 |
%files |
31 | 33 |
%defattr(-,root,root) |
32 | 34 |
%{_firmwarepath}/* |
33 |
- |
|
34 | 35 |
%changelog |
36 |
+* Thu Nov 29 2018 Srinidhi Rao <srinidhir@vmware.com> 20181129-1 |
|
37 |
+- Updated pfe firmware files for NXP LS1012A FRWY board |
|
35 | 38 |
* Wed Oct 10 2018 Ajay Kaher <akaher@vmware.com> 20181010-1 |
36 | 39 |
- Updated brcm firmwares for Rpi B and Rpi B+ |
37 | 40 |
* Thu Aug 23 2018 Alexey Makhalov <amakhalov@vmware.com> 20180823-1 |
... | ... |
@@ -340,7 +340,7 @@ CONFIG_PCI_HOST_THUNDER_ECAM=y |
340 | 340 |
CONFIG_PCIE_DW=y |
341 | 341 |
CONFIG_PCIE_DW_HOST=y |
342 | 342 |
# CONFIG_PCIE_DW_PLAT_HOST is not set |
343 |
-# CONFIG_PCI_LAYERSCAPE is not set |
|
343 |
+CONFIG_PCI_LAYERSCAPE=y |
|
344 | 344 |
CONFIG_PCI_HISI=y |
345 | 345 |
CONFIG_PCIE_QCOM=y |
346 | 346 |
CONFIG_PCIE_ARMADA_8K=y |
... | ... |
@@ -441,7 +441,7 @@ CONFIG_SETEND_EMULATION=y |
441 | 441 |
# |
442 | 442 |
CONFIG_ARM64_HW_AFDBM=y |
443 | 443 |
CONFIG_ARM64_PAN=y |
444 |
-# CONFIG_ARM64_LSE_ATOMICS is not set |
|
444 |
+CONFIG_ARM64_LSE_ATOMICS=y |
|
445 | 445 |
CONFIG_ARM64_VHE=y |
446 | 446 |
|
447 | 447 |
# |
... | ... |
@@ -1725,7 +1725,7 @@ CONFIG_VEXPRESS_SYSCFG=y |
1725 | 1725 |
# EEPROM support |
1726 | 1726 |
# |
1727 | 1727 |
# CONFIG_EEPROM_AT24 is not set |
1728 |
-# CONFIG_EEPROM_AT25 is not set |
|
1728 |
+CONFIG_EEPROM_AT25=y |
|
1729 | 1729 |
# CONFIG_EEPROM_LEGACY is not set |
1730 | 1730 |
# CONFIG_EEPROM_MAX6875 is not set |
1731 | 1731 |
CONFIG_EEPROM_93CX6=m |
... | ... |
@@ -2647,7 +2647,7 @@ CONFIG_SERIAL_8250_DW=y |
2647 | 2647 |
# CONFIG_SERIAL_8250_RT288X is not set |
2648 | 2648 |
# CONFIG_SERIAL_8250_MT6577 is not set |
2649 | 2649 |
# CONFIG_SERIAL_8250_MOXA is not set |
2650 |
-# CONFIG_SERIAL_OF_PLATFORM is not set |
|
2650 |
+CONFIG_SERIAL_OF_PLATFORM=y |
|
2651 | 2651 |
|
2652 | 2652 |
# |
2653 | 2653 |
# Non-8250 serial port support |
... | ... |
@@ -2836,7 +2836,7 @@ CONFIG_I2C_XGENE_SLIMPRO=m |
2836 | 2836 |
CONFIG_SPI=y |
2837 | 2837 |
# CONFIG_SPI_DEBUG is not set |
2838 | 2838 |
CONFIG_SPI_MASTER=y |
2839 |
-# CONFIG_SPI_MEM is not set |
|
2839 |
+CONFIG_SPI_MEM=y |
|
2840 | 2840 |
|
2841 | 2841 |
# |
2842 | 2842 |
# SPI Master Controller Drivers |
... | ... |
@@ -4626,7 +4626,8 @@ CONFIG_MMC_BLOCK_MINORS=16 |
4626 | 4626 |
# MMC/SD/SDIO Host Controller Drivers |
4627 | 4627 |
# |
4628 | 4628 |
# CONFIG_MMC_DEBUG is not set |
4629 |
-# CONFIG_MMC_ARMMMCI is not set |
|
4629 |
+CONFIG_MMC_ARMMMCI=y |
|
4630 |
+CONFIG_MMC_QCOM_DML=y |
|
4630 | 4631 |
CONFIG_MMC_SDHCI=y |
4631 | 4632 |
CONFIG_MMC_SDHCI_IO_ACCESSORS=y |
4632 | 4633 |
CONFIG_MMC_SDHCI_PCI=m |
... | ... |
@@ -4635,7 +4636,7 @@ CONFIG_MMC_SDHCI_ACPI=m |
4635 | 4635 |
CONFIG_MMC_SDHCI_PLTFM=y |
4636 | 4636 |
# CONFIG_MMC_SDHCI_OF_ARASAN is not set |
4637 | 4637 |
# CONFIG_MMC_SDHCI_OF_AT91 is not set |
4638 |
-# CONFIG_MMC_SDHCI_OF_ESDHC is not set |
|
4638 |
+CONFIG_MMC_SDHCI_OF_ESDHC=y |
|
4639 | 4639 |
# CONFIG_MMC_SDHCI_OF_DWCMSHC is not set |
4640 | 4640 |
# CONFIG_MMC_SDHCI_CADENCE is not set |
4641 | 4641 |
# CONFIG_MMC_SDHCI_TEGRA is not set |
... | ... |
@@ -4646,7 +4647,7 @@ CONFIG_MMC_SDHCI_IPROC=y |
4646 | 4646 |
# CONFIG_MMC_MESON_MX_SDIO is not set |
4647 | 4647 |
CONFIG_MMC_SDHCI_MSM=m |
4648 | 4648 |
# CONFIG_MMC_TIFM_SD is not set |
4649 |
-# CONFIG_MMC_SPI is not set |
|
4649 |
+CONFIG_MMC_SPI=y |
|
4650 | 4650 |
# CONFIG_MMC_CB710 is not set |
4651 | 4651 |
# CONFIG_MMC_VIA_SDMMC is not set |
4652 | 4652 |
# CONFIG_MMC_DW is not set |
... | ... |
@@ -5289,7 +5290,14 @@ CONFIG_OF_PMEM=y |
5289 | 5289 |
CONFIG_DAX_DRIVER=y |
5290 | 5290 |
CONFIG_DAX=y |
5291 | 5291 |
CONFIG_DEV_DAX=m |
5292 |
-# CONFIG_NVMEM is not set |
|
5292 |
+CONFIG_NVMEM=y |
|
5293 |
+# CONFIG_MTK_EFUSE is not set |
|
5294 |
+# CONFIG_QCOM_QFPROM is not set |
|
5295 |
+# CONFIG_ROCKCHIP_EFUSE is not set |
|
5296 |
+CONFIG_NVMEM_BCM_OCOTP=y |
|
5297 |
+# CONFIG_NVMEM_SUNXI_SID is not set |
|
5298 |
+# CONFIG_MESON_EFUSE is not set |
|
5299 |
+# CONFIG_MESON_MX_EFUSE is not set |
|
5293 | 5300 |
|
5294 | 5301 |
# |
5295 | 5302 |
# HW tracing support |
... | ... |
@@ -2,7 +2,7 @@ |
2 | 2 |
Summary: Kernel |
3 | 3 |
Name: linux |
4 | 4 |
Version: 4.19.6 |
5 |
-Release: 1%{?kat_build:.%kat_build}%{?dist} |
|
5 |
+Release: 2%{?kat_build:.%kat_build}%{?dist} |
|
6 | 6 |
License: GPLv2 |
7 | 7 |
URL: http://www.kernel.org/ |
8 | 8 |
Group: System Environment/Kernel |
... | ... |
@@ -122,6 +122,14 @@ Group: System Environment/Kernel |
122 | 122 |
Requires: %{name} = %{version}-%{release} |
123 | 123 |
%description dtb-rpi3 |
124 | 124 |
Kernel Device Tree Blob files for Raspberry Pi3 |
125 |
+ |
|
126 |
+%package dtb-ls1012afrwy |
|
127 |
+Summary: Kernel Device Tree Blob files for NXP ls1012a FRWY board |
|
128 |
+Group: System Environment/Kernel |
|
129 |
+Requires: %{name} = %{version}-%{release} |
|
130 |
+%description dtb-ls1012afrwy |
|
131 |
+Kernel Device Tree Blob files for NXP ls1012a FRWY board |
|
132 |
+ |
|
125 | 133 |
%endif |
126 | 134 |
|
127 | 135 |
|
... | ... |
@@ -241,6 +249,7 @@ install -vm 644 arch/arm64/boot/Image %{buildroot}/boot/vmlinuz-%{uname_r} |
241 | 241 |
# Install DTB files |
242 | 242 |
install -vdm 755 %{buildroot}/boot/dtb |
243 | 243 |
install -vm 640 arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dtb %{buildroot}/boot/dtb/ |
244 |
+install -vm 640 arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dtb %{buildroot}/boot/dtb/ |
|
244 | 245 |
%endif |
245 | 246 |
|
246 | 247 |
# Restrict the permission on System.map-X file |
... | ... |
@@ -369,9 +378,16 @@ ln -sf %{name}-%{uname_r}.cfg /boot/photon.cfg |
369 | 369 |
%files dtb-rpi3 |
370 | 370 |
%defattr(-,root,root) |
371 | 371 |
/boot/dtb/bcm2837-rpi-3-b.dtb |
372 |
+ |
|
373 |
+%files dtb-ls1012afrwy |
|
374 |
+%defattr(-,root,root) |
|
375 |
+/boot/dtb/fsl-ls1012a-frdm.dtb |
|
376 |
+ |
|
372 | 377 |
%endif |
373 | 378 |
|
374 | 379 |
%changelog |
380 |
+* Wed Dec 19 2018 Srinidhi Rao <srinidhir@vmware.com> 4.19.6-2 |
|
381 |
+- Add NXP LS1012A support. |
|
375 | 382 |
* Mon Dec 10 2018 Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> 4.19.6-1 |
376 | 383 |
- Update to version 4.19.6 |
377 | 384 |
* Fri Dec 07 2018 Alexey Makhalov <amakhalov@vmware.com> 4.19.1-3 |
378 | 385 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,14 @@ |
0 |
+{ |
|
1 |
+ "packages":["glibc", "zlib", "filesystem", |
|
2 |
+ "pkg-config", "bash", "bzip2", "shadow", "procps-ng", |
|
3 |
+ "coreutils", "bc", "libtool", "net-tools", "findutils", "xz", |
|
4 |
+ "iproute2", "util-linux", "kmod", "linux", "linux-dtb-ls1012afrwy", |
|
5 |
+ "ca-certificates", "curl", "iptables", "Linux-PAM", "systemd", |
|
6 |
+ "dbus", "file", "e2fsprogs", "rpm","gawk","gptfdisk", |
|
7 |
+ "openssh", "gdbm", "parted", "linux-firmware", |
|
8 |
+ "photon-release", "photon-repos", |
|
9 |
+ "sed", "grep", "cpio", "gzip", "vim", "libdb", "tdnf", |
|
10 |
+ "which", "tzdata", "motd", "gdbm" ] |
|
11 |
+} |
|
12 |
+ |
|
13 |
+ |
... | ... |
@@ -4,6 +4,7 @@ import os |
4 | 4 |
import re |
5 | 5 |
import shutil |
6 | 6 |
import tarfile |
7 |
+import lzma as xz |
|
7 | 8 |
import fileinput |
8 | 9 |
from argparse import ArgumentParser |
9 | 10 |
import json |
... | ... |
@@ -158,9 +159,18 @@ def createOutputArtifact(raw_image_path, config, src_root, tools_bin_path): |
158 | 158 |
os.remove(raw_image) |
159 | 159 |
|
160 | 160 |
def generateCompressedFile(inputfile, outputfile, formatstring): |
161 |
- tarout = tarfile.open(outputfile, formatstring) |
|
162 |
- tarout.add(inputfile, arcname=os.path.basename(inputfile)) |
|
163 |
- tarout.close() |
|
161 |
+ if formatstring == "w:xz": |
|
162 |
+ in_file = open(inputfile, 'rb') |
|
163 |
+ in_data = in_file.read() |
|
164 |
+ |
|
165 |
+ out_file = open(inputfile+".xz", 'wb') |
|
166 |
+ out_file.write(xz.compress(in_data)) |
|
167 |
+ in_file.close() |
|
168 |
+ out_file.close() |
|
169 |
+ else: |
|
170 |
+ tarout = tarfile.open(outputfile, formatstring) |
|
171 |
+ tarout.add(inputfile, arcname=os.path.basename(inputfile)) |
|
172 |
+ tarout.close() |
|
164 | 173 |
|
165 | 174 |
def generateImage(raw_image_path, additional_rpms_path, tools_bin_path, src_root, config): |
166 | 175 |
working_directory = os.path.dirname(raw_image_path) |
... | ... |
@@ -176,8 +186,11 @@ def generateImage(raw_image_path, additional_rpms_path, tools_bin_path, src_root |
176 | 176 |
device_name = disk_device.split('/')[2] |
177 | 177 |
if not device_name: |
178 | 178 |
raise Exception("Could not create loop device and partition") |
179 |
+ |
|
179 | 180 |
loop_device_path = "/dev/mapper/{}p2".format(device_name) |
180 |
- |
|
181 |
+ |
|
182 |
+ print(loop_device_path) |
|
183 |
+ |
|
181 | 184 |
try: |
182 | 185 |
(uuidval, partuuidval) = generateUuid(loop_device_path) |
183 | 186 |
# Prep the loop device |
184 | 187 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,21 @@ |
0 |
+{ |
|
1 |
+ "image_type": "ls1012afrwy", |
|
2 |
+ "hostname": "photon-machine", |
|
3 |
+ "password": |
|
4 |
+ { |
|
5 |
+ "crypted": false, |
|
6 |
+ "text": "PASSWORD" |
|
7 |
+ }, |
|
8 |
+ "packagelist_file": "packages_ls1012afrwy.json", |
|
9 |
+ "size": {"root": "1", "swap": "0"}, |
|
10 |
+ "boot":"bios", |
|
11 |
+ "public_key":"<ssh-key-here>", |
|
12 |
+ "postinstallscripts": ["ls1012afrwy-custom-patch.sh"], |
|
13 |
+ "additionalfiles": [ |
|
14 |
+ {"resizefs.sh": "/usr/local/bin/resizefs.sh"}, |
|
15 |
+ {"resizefs.service": "/lib/systemd/system/resizefs.service"} |
|
16 |
+ ], |
|
17 |
+ "artifacttype": "xz", |
|
18 |
+ "keeprawdisk": "true" |
|
19 |
+} |
|
20 |
+ |
2 | 23 |
new file mode 100755 |
... | ... |
@@ -0,0 +1,12 @@ |
0 |
+#!/bin/bash |
|
1 |
+ |
|
2 |
+echo -e "changeme\nchangeme" | passwd root |
|
3 |
+chage -d 0 -M 999 root |
|
4 |
+ |
|
5 |
+echo "/dev/mmcblk0p3 swap swap defaults 0 0" >> /etc/fstab |
|
6 |
+ |
|
7 |
+chmod +x /usr/local/bin/resizefs.sh |
|
8 |
+ln -s /lib/systemd/system/resizefs.service /etc/systemd/system/multi-user.target.wants/resizefs.service |
|
9 |
+ln -s /lib/systemd/system/sshd-keygen.service /etc/systemd/system/multi-user.target.wants/sshd-keygen.service |
|
10 |
+ln -s /lib/systemd/system/sshd.service /etc/systemd/system/multi-user.target.wants/sshd.service |
|
11 |
+ |
0 | 12 |
new file mode 100755 |
... | ... |
@@ -0,0 +1,67 @@ |
0 |
+#!/bin/bash |
|
1 |
+################################################# |
|
2 |
+# Title: mk-prepare-system # |
|
3 |
+# Date: 2014-11-26 # |
|
4 |
+# Version: 1.0 # |
|
5 |
+# Author: mbassiouny@vmware.com # |
|
6 |
+# Options: # |
|
7 |
+################################################# |
|
8 |
+# Overview |
|
9 |
+# Preparing the system to install photon |
|
10 |
+# End |
|
11 |
+# |
|
12 |
+set -o errexit # exit if error...insurance ; |
|
13 |
+set -o nounset # exit if variable not initalized |
|
14 |
+set +h # disable hashall |
|
15 |
+SCRIPT_PATH=$(dirname $(realpath -s $0)) |
|
16 |
+INSTALLER_PATH=$SCRIPT_PATH/../../../installer |
|
17 |
+source ${INSTALLER_PATH}/config.inc # configuration parameters |
|
18 |
+source ${INSTALLER_PATH}/function.inc |
|
19 |
+PRGNAME=${0##*/} # script name minus the path |
|
20 |
+ |
|
21 |
+LOGFILE=/var/log/"${PRGNAME}-${LOGFILE}" # set log file name |
|
22 |
+#LOGFILE=/dev/null # uncomment to disable log file |
|
23 |
+ |
|
24 |
+[ ${EUID} -eq 0 ] || fail "${PRGNAME}: Need to be root user: FAILURE" |
|
25 |
+[ -z ${BUILDROOT} ] && fail "${PRGNAME}: Build root not set: FAILURE" |
|
26 |
+ |
|
27 |
+ |
|
28 |
+mnt_nd=`mount -v -f -l` |
|
29 |
+ |
|
30 |
+echo $mnt_nd |
|
31 |
+ |
|
32 |
+cd ${BUILDROOT} || fail "${PRGNAME}: Change directory: ${BUILDROOT}: FAILURE" |
|
33 |
+ |
|
34 |
+# |
|
35 |
+# Setup the filesystem for chapter 06 |
|
36 |
+# |
|
37 |
+if [[ $# -gt 0 ]] && [[ $1 == 'install' ]]; then |
|
38 |
+ mkdir -p ${BUILDROOT}/var/lib/rpm |
|
39 |
+ mkdir -p ${BUILDROOT}/cache/tdnf |
|
40 |
+ rpm --root ${BUILDROOT} --initdb |
|
41 |
+ tdnf install filesystem --installroot ${BUILDROOT} --nogpgcheck --assumeyes |
|
42 |
+else |
|
43 |
+ RPMPKG="$(find RPMS -name 'filesystem-[0-9]*.rpm' -print)" |
|
44 |
+ [ -z ${RPMPKG} ] && fail " Filesystem rpm package missing: Can not continue" |
|
45 |
+ run_command " Installing filesystem" "rpm -Uvh --nodeps --root ${BUILDROOT} --dbpath /var/lib/rpm ${RPMPKG}" "${LOGFILE}" |
|
46 |
+fi |
|
47 |
+ |
|
48 |
+# Ommited in the filesystem.spec file - not needed for booting |
|
49 |
+[ -e ${BUILDROOT}/dev/console ] || mknod -m 600 ${BUILDROOT}/dev/console c 5 1 |
|
50 |
+[ -e ${BUILDROOT}/dev/null ] || mknod -m 666 ${BUILDROOT}/dev/null c 1 3 |
|
51 |
+[ -e ${BUILDROOT}/dev/random ] || mknod -m 444 ${BUILDROOT}/dev/random c 1 8 |
|
52 |
+[ -e ${BUILDROOT}/dev/urandom ] || mknod -m 444 ${BUILDROOT}/dev/urandom c 1 9 |
|
53 |
+ |
|
54 |
+if [[ $# -eq 0 ]] || [[ $1 != 'install' ]]; then |
|
55 |
+ chown -R 0:0 ${BUILDROOT}/* || : |
|
56 |
+fi |
|
57 |
+ |
|
58 |
+# |
|
59 |
+# Mount kernel filesystem |
|
60 |
+# |
|
61 |
+#if ! mountpoint ${BUILDROOT}/dev >/dev/null 2>&1; then mount --rbind /dev ${BUILDROOT}/dev; mount --make-rslave ${BUILDROOT}/dev; fi |
|
62 |
+#if ! mountpoint ${BUILDROOT}/proc >/dev/null 2>&1; then mount -t proc proc ${BUILDROOT}/proc; fi |
|
63 |
+#if ! mountpoint ${BUILDROOT}/sys >/dev/null 2>&1; then mount -t sysfs sysfs ${BUILDROOT}/sys; fi |
|
64 |
+#if ! mountpoint ${BUILDROOT}/run >/dev/null 2>&1; then mount -t tmpfs tmpfs ${BUILDROOT}/run; fi |
|
65 |
+#if [ -h ${BUILDROOT}/dev/shm ]; then mkdir -pv ${BUILDROOT}/$(readlink ${BUILDROOT}/dev/shm); fi |
|
66 |
+exit 0 |
0 | 67 |
new file mode 100755 |
... | ... |
@@ -0,0 +1,112 @@ |
0 |
+#!/bin/bash |
|
1 |
+################################################# |
|
2 |
+# Title: mk-setup-grub # |
|
3 |
+# Date: 2014-11-26 # |
|
4 |
+# Version: 1.0 # |
|
5 |
+# Author: sharathg@vmware.com # |
|
6 |
+# Options: # |
|
7 |
+################################################# |
|
8 |
+# Overview |
|
9 |
+# This is a precursor for the vmware build system. |
|
10 |
+# This assumes that an empty hard disk is attached to the build VM. |
|
11 |
+# The path to this empty disk is specified in the HDD variable in config.inc |
|
12 |
+# End |
|
13 |
+# |
|
14 |
+ |
|
15 |
+grub_efi_install() |
|
16 |
+{ |
|
17 |
+ BOOT_PARTITION=/dev/mapper/`basename ${HDD}`p2 |
|
18 |
+ mkdir -p $BUILDROOT/boot_temp/ |
|
19 |
+ mount -t ext4 $BOOT_PARTITION $BUILDROOT/boot_temp/ |
|
20 |
+ cp -rfa $BUILDROOT/boot/* $BUILDROOT/boot_temp/ |
|
21 |
+ cp -r $SCRIPT_PATH/esp/ls1012afrwy_boot.scr $BUILDROOT/boot_temp/ |
|
22 |
+ cp -rfa $BUILDROOT/boot_temp/vmlinuz-* $BUILDROOT/boot_temp/Image |
|
23 |
+ gzip -k $BUILDROOT/boot_temp/Image |
|
24 |
+ cp -rfa $BUILDROOT/boot_temp/dtb/fsl-ls1012a-frdm.dtb $BUILDROOT/boot_temp/fsl-ls1012a-frwy.dtb |
|
25 |
+ sync |
|
26 |
+ umount $BUILDROOT/boot_temp/ |
|
27 |
+ rm -rf $BUILDROOT/boot_temp/ |
|
28 |
+} |
|
29 |
+ |
|
30 |
+set -o errexit # exit if error...insurance ;) |
|
31 |
+set -o nounset # exit if variable not initalized |
|
32 |
+set +h # disable hashall |
|
33 |
+PRGNAME=${0##*/} # script name minus the path |
|
34 |
+SCRIPT_PATH=$(dirname $(realpath -s $0)) |
|
35 |
+INSTALLER_PATH=$SCRIPT_PATH/../../../installer |
|
36 |
+source ${INSTALLER_PATH}/config.inc # configuration parameters |
|
37 |
+source ${INSTALLER_PATH}/function.inc # commonn functions |
|
38 |
+LOGFILE=/var/log/"${PRGNAME}-${LOGFILE}" # set log file name |
|
39 |
+ARCH=$(uname -m) # host architecture |
|
40 |
+[ ${EUID} -eq 0 ] || fail "${PRGNAME}: Need to be root user: FAILURE" |
|
41 |
+> ${LOGFILE} # clear/initialize logfile |
|
42 |
+ |
|
43 |
+# Check if passing a HHD and partition |
|
44 |
+if [ $# -eq 6 ] ; then |
|
45 |
+ BOOTMODE=$1 |
|
46 |
+ HDD=$2 |
|
47 |
+ ROOT_PARTITION_PATH=$3 |
|
48 |
+ BOOT_PARTITION_PATH=$4 |
|
49 |
+ BOOT_DIRECTORY=$5 |
|
50 |
+ BOOT_PARTITION_NUMBER=$6 |
|
51 |
+fi |
|
52 |
+ |
|
53 |
+ |
|
54 |
+# |
|
55 |
+# Install grub2. |
|
56 |
+# |
|
57 |
+BOOT_UUID=$(blkid -s UUID -o value $BOOT_PARTITION_PATH) |
|
58 |
+ |
|
59 |
+echo "$ROOT_PARTITION_PATH" |
|
60 |
+echo "$BUILDROOT" |
|
61 |
+ |
|
62 |
+RFS_PARTITION=/dev/mapper/`basename ${HDD}`p2 |
|
63 |
+#umount -f $BUILDROOT |
|
64 |
+#mount -t ext4 $ROOT_PATITION_PATH $BUILDROOT |
|
65 |
+ |
|
66 |
+EXTRA_PARAMS="rootwait rw console=ttyS0,115200n8 console=tty0 cma=256M rootfs=/dev/mmcblk0p3" |
|
67 |
+ |
|
68 |
+ |
|
69 |
+mkdir -p $BUILDROOT/boot/grub2/ |
|
70 |
+ |
|
71 |
+cat > $BUILDROOT/boot/grub2/grub.cfg << EOF |
|
72 |
+# Begin /boot/grub2/grub.cfg |
|
73 |
+ |
|
74 |
+set default=0 |
|
75 |
+set timeout=2 |
|
76 |
+loadfont ${BOOT_DIRECTORY}grub2/ascii.pf2 |
|
77 |
+ |
|
78 |
+insmod all_video |
|
79 |
+insmod gfxterm |
|
80 |
+insmod png |
|
81 |
+insmod ext2 |
|
82 |
+ |
|
83 |
+set theme=${BOOT_DIRECTORY}grub2/themes/photon/theme.txt |
|
84 |
+load_env -f ${BOOT_DIRECTORY}photon.cfg |
|
85 |
+if [ -f ${BOOT_DIRECTORY}systemd.cfg ]; then |
|
86 |
+ load_env -f ${BOOT_DIRECTORY}systemd.cfg |
|
87 |
+else |
|
88 |
+ set systemd_cmdline=net.ifnames=0 |
|
89 |
+fi |
|
90 |
+set rootpartition=/dev/mmcblk0p2 |
|
91 |
+ |
|
92 |
+menuentry "Photon" { |
|
93 |
+ linux ${BOOT_DIRECTORY}\$photon_linux root=\$rootpartition \$photon_cmdline \$systemd_cmdline $EXTRA_PARAMS |
|
94 |
+ if [ -f ${BOOT_DIRECTORY}\$photon_initrd ]; then |
|
95 |
+ initrd ${BOOT_DIRECTORY}\$photon_initrd |
|
96 |
+ fi |
|
97 |
+} |
|
98 |
+# End /boot/grub2/grub.cfg |
|
99 |
+EOF |
|
100 |
+ |
|
101 |
+ |
|
102 |
+ |
|
103 |
+mkdir $BUILDROOT/boot/grub |
|
104 |
+cp -rfa $BUILDROOT/boot/grub2/* $BUILDROOT/boot/grub/ |
|
105 |
+ |
|
106 |
+grub_efi_install |
|
107 |
+ |
|
108 |
+#Cleanup the workspace directory |
|
109 |
+rm -rf "$BUILDROOT"/tools |
|
110 |
+rm -rf "$BUILDROOT"/RPMS |
|
111 |
+ |
0 | 112 |
new file mode 100755 |
... | ... |
@@ -0,0 +1,124 @@ |
0 |
+#!/bin/bash |
|
1 |
+################################################# |
|
2 |
+# Title: mk-setup-vmdk # |
|
3 |
+# Date: 2014-11-14 # |
|
4 |
+# Version: 1.0 # |
|
5 |
+# Author: dthaluru@vmware.com # |
|
6 |
+# Options: # |
|
7 |
+################################################# |
|
8 |
+# Overview |
|
9 |
+# Creating hard disk with photon on it |
|
10 |
+# End |
|
11 |
+# |
|
12 |
+set -o errexit # exit if error...insurance ;) |
|
13 |
+set -o nounset # exit if variable not initalized |
|
14 |
+set +h # disable hashall |
|
15 |
+PRGNAME=${0##*/} # script name minus the path |
|
16 |
+SCRIPT_PATH=$(dirname $(realpath -s $0)) |
|
17 |
+INSTALLER_PATH=$SCRIPT_PATH/../../../installer |
|
18 |
+source ${INSTALLER_PATH}/config.inc # configuration parameters |
|
19 |
+source ${INSTALLER_PATH}/function.inc # commonn functions |
|
20 |
+LOGFILE="/var/log/${PRGNAME}-${LOGFILE}" # set log file name |
|
21 |
+LFS_DISK="/mnt/photon-disk" |
|
22 |
+[ ${EUID} -eq 0 ] || die "${PRGNAME}: Need to be root user: FAILURE" |
|
23 |
+> ${LOGFILE} # clear/initialize logfile |
|
24 |
+ |
|
25 |
+echo -e "Setting up the disk...\n" |
|
26 |
+set -x |
|
27 |
+LFS_OPTION="" |
|
28 |
+VMDK_IMAGE_NAME=mydisk.vmdk |
|
29 |
+ROOT_PARTITION_SIZE=1 |
|
30 |
+SWAP_PARTITION_SIZE=0 |
|
31 |
+BOOT_FIRM_WARE="bios" |
|
32 |
+ |
|
33 |
+while [[ $# > 0 ]] |
|
34 |
+do |
|
35 |
+ key="$1" |
|
36 |
+ shift |
|
37 |
+ |
|
38 |
+ case $key in |
|
39 |
+ -rp|--ROOT_PARTITION_SIZE) |
|
40 |
+ ROOT_PARTITION_SIZE="$1" |
|
41 |
+ shift |
|
42 |
+ ;; |
|
43 |
+ -sp|--SWAP_PARTITION_SIZE) |
|
44 |
+ SWAP_PARTITION_SIZE="$1" |
|
45 |
+ shift |
|
46 |
+ ;; |
|
47 |
+ -fm|--firmware) |
|
48 |
+ BOOT_FIRM_WARE="$1" |
|
49 |
+ shift |
|
50 |
+ |
|
51 |
+ ;; |
|
52 |
+ -a|--all) |
|
53 |
+ LFS_OPTION="all" |
|
54 |
+ ;; |
|
55 |
+ -m|--minimal) |
|
56 |
+ LFS_OPTION="" |
|
57 |
+ ;; |
|
58 |
+ -n|--IMG_NAME) |
|
59 |
+ VMDK_IMAGE_NAME="$1".raw |
|
60 |
+ shift |
|
61 |
+ ;; |
|
62 |
+ -h|--help) |
|
63 |
+ echo 'Usage:' |
|
64 |
+ echo '-rp|--ROOT_PARTITION_SIZE :sets root partition size' |
|
65 |
+ echo '-sp|--SWAP_PARTITION_SIZE :sets swap partition size' |
|
66 |
+ echo '-a|--all :installs all available packages' |
|
67 |
+ echo '-n|--IMG_NAME :sets name of the vmdk image' |
|
68 |
+ echo '-m|--minimal :installs basic packages' |
|
69 |
+ echo '-fm|--firmware :firmware' |
|
70 |
+ exit 0 |
|
71 |
+ ;; |
|
72 |
+ *) |
|
73 |
+ # unknown option |
|
74 |
+ ;; |
|
75 |
+ esac |
|
76 |
+done |
|
77 |
+ |
|
78 |
+mkdir -p $LFS_DISK |
|
79 |
+ |
|
80 |
+TOTAL_SIZE=` echo $ROOT_PARTITION_SIZE + $SWAP_PARTITION_SIZE | bc` |
|
81 |
+ |
|
82 |
+echo "Creating raw disk file " $VMDK_IMAGE_NAME " of size " $TOTAL_SIZE |
|
83 |
+# hack to create 512MB image instead of 1GB - use 512 instead of 1024 |
|
84 |
+dd if=/dev/zero of=$VMDK_IMAGE_NAME bs=1024 count=$(($TOTAL_SIZE * 1024 * 512)) |
|
85 |
+chmod 755 $VMDK_IMAGE_NAME |
|
86 |
+ |
|
87 |
+parted -s $VMDK_IMAGE_NAME 'mklabel msdos mkpart primary fat32 1MB 12MB mkpart primary ext4 12MB 100%' |
|
88 |
+ |
|
89 |
+echo "Associating loopdevice to raw disk" |
|
90 |
+DISK_DEVICE=`losetup --show -f -P $VMDK_IMAGE_NAME` |
|
91 |
+ |
|
92 |
+#echo "Creating partition on raw disk" |
|
93 |
+#if [ $SWAP_PARTITION_SIZE -gt 0 ] |
|
94 |
+#then |
|
95 |
+# sgdisk -n 1::+8M -n 2::+${ROOT_PARTITION_SIZE}G -n 3: -p $DISK_DEVICE >> $LOGFILE |
|
96 |
+#else |
|
97 |
+# sgdisk -n 1::+8M -n 2: -p $DISK_DEVICE >> $LOGFILE |
|
98 |
+#fi |
|
99 |
+ |
|
100 |
+#if [ $BOOT_FIRM_WARE = "efi" ] |
|
101 |
+#then |
|
102 |
+# echo "EFI boot partition" |
|
103 |
+# sgdisk -t1:ef00 $DISK_DEVICE >> $LOGFILE |
|
104 |
+#else |
|
105 |
+# echo "BIOS boot partition" |
|
106 |
+# sgdisk -t1:ef02 $DISK_DEVICE >> $LOGFILE |
|
107 |
+#fi |
|
108 |
+ |
|
109 |
+echo "Mapping device partition to loop device" |
|
110 |
+kpartx -avs $DISK_DEVICE >> $LOGFILE |
|
111 |
+ |
|
112 |
+DEVICE_NAME=`echo $DISK_DEVICE|cut -c6- ` |
|
113 |
+ |
|
114 |
+echo "Formatting partitions" |
|
115 |
+mkfs.ext4 -F -v -O ^huge_file -b 4096 -L rootfs /dev/mapper/${DEVICE_NAME}p2 |
|
116 |
+#mkfs.ext4 -F -v -b 4096 -L boot /dev/mapper/${DEVICE_NAME}p1 |
|
117 |
+mkfs.fat -n EFI /dev/mapper/${DEVICE_NAME}p1 |
|
118 |
+ |
|
119 |
+echo "DISK_DEVICE=$DISK_DEVICE" |
|
120 |
+echo "ROOT_PARTITION=/dev/mapper/${DEVICE_NAME}p2" |
|
121 |
+echo "BOOT_PARTITION=/dev/mapper/${DEVICE_NAME}p2" |
|
122 |
+echo "ESP_PARTITION=/dev/mapper/${DEVICE_NAME}p1" |
|
123 |
+ |
0 | 124 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,15 @@ |
0 |
+[Unit] |
|
1 |
+Description=Resizes rootfs and creates swap partition |
|
2 |
+DefaultDependencies=no |
|
3 |
+Conflicts=shutdown.target |
|
4 |
+After=systemd-remount-fs.service |
|
5 |
+Before=systemd-sysusers.service sysinit.target shutdown.target |
|
6 |
+ConditionPathExists=!/dev/mmcblk0p3 |
|
7 |
+ |
|
8 |
+[Service] |
|
9 |
+Type=oneshot |
|
10 |
+RemainAfterExit=yes |
|
11 |
+ExecStart=/usr/local/bin/resizefs.sh |
|
12 |
+ |
|
13 |
+[Install] |
|
14 |
+WantedBy=multi-user.target |