All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/2] Samsung XE303C12 aka Chromebook Snow
@ 2015-11-16 17:54 Alex Suykov
  2015-11-16 17:54 ` [Buildroot] [PATCH 1/2] vboot-utils: new package Alex Suykov
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Alex Suykov @ 2015-11-16 17:54 UTC (permalink / raw)
  To: buildroot

This short series adds board config for Chromebook Snow.

There are several ways to boot a custom kernel on the device,
the one used here is perhaps the easiest to implement.
However, it needs vboot-tools to sign the custom kernel.

The kernel is packed into u-boot flat image tree (FIT) together with
the DT blob. Long story short, this is the only way I can get it to boot
with the original bootloader. Using uImage with appended DT should be
possible as well, but for some reason it does not seem to work.

At first I tried to add FIT option to the Kernel binary format menu,
because it's not really Chromebook-specific, but it turned out to be
ugly and much more complex than doing it in a post-build script.

Most of this boot stuff is common for all Chromebooks, even x86 ones,
but not for Samsung devices other than Chromebooks. Because of this,
it's boards/chromebook/snow and not boards/samsung/xe303c12.

Alex Suykov (2):
  vboot-utils: new package
  board: add support for Chromebook Snow

 board/chromebook/snow/kernel.args      |   1 +
 board/chromebook/snow/kernel.its       |  34 ++++++
 board/chromebook/snow/linux-4.3.config | 161 +++++++++++++++++++++++++++
 board/chromebook/snow/readme.txt       | 191 +++++++++++++++++++++++++++++++++
 board/chromebook/snow/sign.sh          |  32 ++++++
 configs/chromebook_snow_defconfig      |  17 +++
 package/Config.in.host                 |   1 +
 package/vboot-utils/Config.in.host     |   6 ++
 package/vboot-utils/vboot-utils.mk     |  23 ++++
 9 files changed, 466 insertions(+)
 create mode 100644 board/chromebook/snow/kernel.args
 create mode 100644 board/chromebook/snow/kernel.its
 create mode 100644 board/chromebook/snow/linux-4.3.config
 create mode 100644 board/chromebook/snow/readme.txt
 create mode 100755 board/chromebook/snow/sign.sh
 create mode 100644 configs/chromebook_snow_defconfig
 create mode 100644 package/vboot-utils/Config.in.host
 create mode 100644 package/vboot-utils/vboot-utils.mk

-- 
2.0.3

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 1/2] vboot-utils: new package
  2015-11-16 17:54 [Buildroot] [PATCH 0/2] Samsung XE303C12 aka Chromebook Snow Alex Suykov
@ 2015-11-16 17:54 ` Alex Suykov
  2015-11-16 18:42   ` Baruch Siach
  2015-11-16 20:19   ` Arnout Vandecappelle
  2015-11-16 17:54 ` [Buildroot] [PATCH 2/2] board: add support for Chromebook Snow Alex Suykov
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 15+ messages in thread
From: Alex Suykov @ 2015-11-16 17:54 UTC (permalink / raw)
  To: buildroot

Host utilities for working with Chromium OS verified boot images.
Needed to create signed kernel images and manipulating bootable
partitions for Chromium OS bootloaders.

Signed-off-by: Alex Suykov <alex.suykov@gmail.com>
---
 package/Config.in.host             |  1 +
 package/vboot-utils/Config.in.host |  6 ++++++
 package/vboot-utils/vboot-utils.mk | 23 +++++++++++++++++++++++
 3 files changed, 30 insertions(+)
 create mode 100644 package/vboot-utils/Config.in.host
 create mode 100644 package/vboot-utils/vboot-utils.mk

diff --git a/package/Config.in.host b/package/Config.in.host
index ce1b6bc..7044a3b 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -29,5 +29,6 @@ menu "Host utilities"
 	source "package/sunxi-tools/Config.in.host"
 	source "package/uboot-tools/Config.in.host"
 	source "package/util-linux/Config.in.host"
+	source "package/vboot-utils/Config.in.host"
 
 endmenu
diff --git a/package/vboot-utils/Config.in.host b/package/vboot-utils/Config.in.host
new file mode 100644
index 0000000..a0c7497
--- /dev/null
+++ b/package/vboot-utils/Config.in.host
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_HOST_VBOOT_UTILS
+	bool "host vboot utils"
+	help
+	  ChromeOS verified boot utils: futility and cgpt.
+
+	  https://www.chromium.org/chromium-os/chromiumos-design-docs/verified-boot
diff --git a/package/vboot-utils/vboot-utils.mk b/package/vboot-utils/vboot-utils.mk
new file mode 100644
index 0000000..b160efa
--- /dev/null
+++ b/package/vboot-utils/vboot-utils.mk
@@ -0,0 +1,23 @@
+################################################################################
+#
+# vboot
+#
+################################################################################
+
+VBOOT_UTILS_VERSION = bbdd62f9b030db7ad8eef789aaf58a7ff9a25656
+VBOOT_UTILS_SITE = https://chromium.googlesource.com/chromiumos/platform/vboot_reference
+VBOOT_UTILS_SITE_METHOD = git
+VBOOT_UTILS_LICENSE = BSD
+
+HOST_VBOOT_UTILS_DEPENDENCIES = host-openssl
+
+define HOST_VBOOT_UTILS_BUILD_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) futil cgpt
+endef
+
+define HOST_VBOOT_UTILS_INSTALL_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(HOST_DIR)/usr \
+		futil_install cgpt_install devkeys_install
+endef
+
+$(eval $(host-generic-package))
-- 
2.0.3

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 2/2] board: add support for Chromebook Snow
  2015-11-16 17:54 [Buildroot] [PATCH 0/2] Samsung XE303C12 aka Chromebook Snow Alex Suykov
  2015-11-16 17:54 ` [Buildroot] [PATCH 1/2] vboot-utils: new package Alex Suykov
@ 2015-11-16 17:54 ` Alex Suykov
  2015-11-16 20:40   ` Arnout Vandecappelle
  2015-11-16 23:42 ` [Buildroot] [PATCH 1/2 v3] vboot-utils: new package Alex Suykov
  2015-11-18  3:29 ` [Buildroot] [PATCH 2/2 v2] board: add support for Chromebook Snow Alex Suykov
  3 siblings, 1 reply; 15+ messages in thread
From: Alex Suykov @ 2015-11-16 17:54 UTC (permalink / raw)
  To: buildroot

Samsung XE303C12 aka Chromebook Snow is an Exynos5250-based netbook.

There is barely anything special about this target as far as toolchain
is concerned, but its bootloader only accepts signed kernel images
in a Chromium OS specific format, and is not controllable otherwise.

This config provides a script for building the proper kernel blobs,
and a short manual for booting Buildroot images on the device.

The kernel defconfig is also provided. Mainline kernel already
has exynos_defconfig which could have been used here, but it builds
mwifiex statically, and that module tries to load its firmware during
initialization.

Since the board was going to get a custom kernel config anyway,
exynos_defconfig was trimmed to only include the drivers needed
for this particular chip and this particular board.

Signed-off-by: Alex Suykov <alex.suykov@gmail.com>
---
 board/chromebook/snow/kernel.args      |   1 +
 board/chromebook/snow/kernel.its       |  34 ++++++
 board/chromebook/snow/linux-4.3.config | 170 +++++++++++++++++++++++++++++
 board/chromebook/snow/readme.txt       | 191 +++++++++++++++++++++++++++++++++
 board/chromebook/snow/sign.sh          |  32 ++++++
 configs/chromebook_snow_defconfig      |  24 +++++
 6 files changed, 452 insertions(+)
 create mode 100644 board/chromebook/snow/kernel.args
 create mode 100644 board/chromebook/snow/kernel.its
 create mode 100644 board/chromebook/snow/linux-4.3.config
 create mode 100644 board/chromebook/snow/readme.txt
 create mode 100755 board/chromebook/snow/sign.sh
 create mode 100644 configs/chromebook_snow_defconfig

diff --git a/board/chromebook/snow/kernel.args b/board/chromebook/snow/kernel.args
new file mode 100644
index 0000000..1220bf8
--- /dev/null
+++ b/board/chromebook/snow/kernel.args
@@ -0,0 +1 @@
+console=tty1 clk_ignore_unused root=/dev/mmcblk1p2 rootfstype=ext4 ro
diff --git a/board/chromebook/snow/kernel.its b/board/chromebook/snow/kernel.its
new file mode 100644
index 0000000..33f2c00
--- /dev/null
+++ b/board/chromebook/snow/kernel.its
@@ -0,0 +1,34 @@
+/dts-v1/;
+
+/ {
+    description = "Buildroot kernel for Chromebook Snow";
+    images {
+        kernel at 1{
+            description = "kernel";
+            data = /incbin/("zImage");
+            type = "kernel";
+            arch = "arm";
+            os = "linux";
+            compression = "none";
+            load = <0x40008000>;
+            entry = <0x40008000>;
+        };
+        fdt at 1{
+            description = "exynos5250-snow.dtb";
+            data = /incbin/("exynos5250-snow.dtb");
+            type = "flat_dt";
+            arch = "arm";
+            compression = "none";
+            hash at 1{
+                algo = "sha1";
+            };
+        };
+    };
+    configurations {
+        default = "conf at 1";
+        conf at 1{
+            kernel = "kernel at 1";
+            fdt = "fdt at 1";
+        };
+    };
+};
diff --git a/board/chromebook/snow/linux-4.3.config b/board/chromebook/snow/linux-4.3.config
new file mode 100644
index 0000000..8c7be6d
--- /dev/null
+++ b/board/chromebook/snow/linux-4.3.config
@@ -0,0 +1,161 @@
+CONFIG_NO_HZ_IDLE=y
+# CONFIG_COMPAT_BRK is not set
+CONFIG_MODULES=y
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_ARCH_EXYNOS=y
+# CONFIG_ARCH_EXYNOS4 is not set
+# CONFIG_SOC_EXYNOS5260 is not set
+# CONFIG_SOC_EXYNOS5410 is not set
+# CONFIG_SOC_EXYNOS5420 is not set
+# CONFIG_SOC_EXYNOS5440 is not set
+CONFIG_SMP=y
+CONFIG_HAVE_ARM_ARCH_TIMER=y
+CONFIG_BIG_LITTLE=y
+CONFIG_BL_SWITCHER=y
+CONFIG_NR_CPUS=8
+CONFIG_PREEMPT=y
+CONFIG_AEABI=y
+CONFIG_HIGHMEM=y
+CONFIG_CMA=y
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
+CONFIG_CPUFREQ_DT=y
+CONFIG_CPU_IDLE=y
+CONFIG_ARM_EXYNOS_CPUIDLE=y
+CONFIG_VFP=y
+CONFIG_NEON=y
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_NET_KEY=y
+CONFIG_INET=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+CONFIG_IP_PNP_RARP=y
+CONFIG_CFG80211=y
+CONFIG_RFKILL_REGULATOR=y
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_DMA_CMA=y
+CONFIG_CMA_SIZE_MBYTES=64
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_CRYPTOLOOP=y
+CONFIG_SCSI=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_CHR_DEV_SG=y
+CONFIG_MD=y
+CONFIG_BLK_DEV_DM=m
+CONFIG_DM_CRYPT=m
+CONFIG_NETDEVICES=y
+# CONFIG_ETHERNET is not set
+CONFIG_PHYLIB=y
+CONFIG_USB_NET_DRIVERS=m
+CONFIG_USB_USBNET=m
+CONFIG_USB_NET_SMSC75XX=m
+CONFIG_USB_NET_SMSC95XX=m
+CONFIG_MWIFIEX=m
+CONFIG_MWIFIEX_SDIO=m
+# CONFIG_INPUT_MOUSEDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_KEYBOARD_ATKBD is not set
+CONFIG_KEYBOARD_GPIO=y
+CONFIG_KEYBOARD_CROS_EC=y
+# CONFIG_MOUSE_PS2 is not set
+CONFIG_MOUSE_CYAPA=y
+# CONFIG_SERIO is not set
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_SAMSUNG=y
+CONFIG_SERIAL_SAMSUNG_CONSOLE=y
+CONFIG_SERIAL_OF_PLATFORM=y
+CONFIG_HW_RANDOM=y
+CONFIG_TCG_TPM=y
+CONFIG_TCG_TIS_I2C_INFINEON=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_MUX=y
+CONFIG_I2C_ARB_GPIO_CHALLENGE=y
+CONFIG_I2C_GPIO=y
+CONFIG_I2C_CROS_EC_TUNNEL=y
+CONFIG_SPI=y
+CONFIG_SPI_S3C64XX=y
+CONFIG_POWER_SUPPLY=y
+CONFIG_BATTERY_SBS=y
+CONFIG_CHARGER_TPS65090=y
+CONFIG_CPU_THERMAL=y
+CONFIG_WATCHDOG=y
+CONFIG_S3C2410_WATCHDOG=y
+CONFIG_MFD_CROS_EC=y
+CONFIG_MFD_CROS_EC_I2C=y
+CONFIG_MFD_CROS_EC_SPI=y
+CONFIG_MFD_MAX77686=y
+CONFIG_MFD_SEC_CORE=y
+CONFIG_MFD_TPS65090=y
+CONFIG_REGULATOR=y
+CONFIG_REGULATOR_FIXED_VOLTAGE=y
+CONFIG_REGULATOR_GPIO=y
+CONFIG_REGULATOR_MAX77686=y
+CONFIG_REGULATOR_TPS65090=y
+CONFIG_DRM=y
+CONFIG_DRM_EXYNOS=y
+CONFIG_DRM_EXYNOS_FIMD=y
+CONFIG_DRM_EXYNOS_DSI=y
+CONFIG_DRM_EXYNOS_HDMI=y
+CONFIG_DRM_PANEL_SIMPLE=y
+CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0=y
+CONFIG_DRM_NXP_PTN3460=y
+CONFIG_DRM_PARADE_PS8622=y
+CONFIG_FB_SIMPLE=y
+CONFIG_EXYNOS_VIDEO=y
+CONFIG_EXYNOS_MIPI_DSI=y
+CONFIG_LCD_CLASS_DEVICE=y
+CONFIG_LCD_PLATFORM=y
+CONFIG_BACKLIGHT_PWM=y
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_SOC=y
+CONFIG_SND_SOC_SAMSUNG=y
+CONFIG_SND_SOC_SNOW=y
+CONFIG_HID_GENERIC=m
+CONFIG_USB_HID=m
+CONFIG_USB=y
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_EXYNOS=y
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_EXYNOS=y
+CONFIG_USB_STORAGE=y
+CONFIG_USB_DWC3=y
+CONFIG_USB_HSIC_USB3503=y
+CONFIG_USB_GADGET=y
+CONFIG_MMC=y
+CONFIG_MMC_BLOCK_MINORS=16
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_S3C=y
+CONFIG_MMC_SDHCI_S3C_DMA=y
+CONFIG_MMC_DW=y
+CONFIG_MMC_DW_IDMAC=y
+CONFIG_MMC_DW_EXYNOS=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_MAX77686=y
+CONFIG_RTC_DRV_S3C=y
+CONFIG_DMADEVICES=y
+CONFIG_PL330_DMA=y
+CONFIG_CROS_EC_CHARDEV=y
+CONFIG_COMMON_CLK_MAX77686=y
+CONFIG_COMMON_CLK_MAX77802=y
+CONFIG_COMMON_CLK_S2MPS11=y
+CONFIG_EXYNOS_IOMMU=y
+CONFIG_EXTCON=y
+CONFIG_IIO=y
+CONFIG_EXYNOS_ADC=y
+CONFIG_PWM=y
+CONFIG_PWM_SAMSUNG=y
+CONFIG_PHY_EXYNOS5250_SATA=y
+CONFIG_EXT2_FS=y
+CONFIG_EXT4_FS=y
+CONFIG_TMPFS=y
+# CONFIG_ARM_UNWIND is not set
diff --git a/board/chromebook/snow/readme.txt b/board/chromebook/snow/readme.txt
new file mode 100644
index 0000000..add8c7a
--- /dev/null
+++ b/board/chromebook/snow/readme.txt
@@ -0,0 +1,191 @@
+Samsung XE303c12 aka Chromebook Snow
+====================================
+
+This file describes booting the Chromebook from an SD card containing
+Buildroot kernel and rootfs, using the original bootloader. This is
+the least invasive way to get Buildroot onto the devices and a good
+starting point.
+
+The bootloader will only boot a kernel from a GPT partition with specific
+attributes set, and the kernel image must be "signed" with a chromeos-specific
+utility. The "signing" part is done by sign.sh script in this directory.
+
+It does not really matter where rootfs is as long as the kernel is able
+to find it, but this particular configuration assumes the kernel is on
+partition 1 and rootfs is on partition 2 of the SD card.
+
+Start by configuring and building the images.
+
+	make chromebook_snow_defconfig
+	make menuconfig # if necessary
+	make
+
+The important files are uImage.kpart (kernel and device tree, signed)
+and rootfs.tar, located in output/images/.
+
+
+Partitioning the SD card
+------------------------
+Figure out the device name for the card on the host system. Typically
+it is either /dev/sdX or /dev/mmcblkX.
+
+	SD=/dev/sdb
+
+DOUBLE CHECK THE DEVICE NAME! The commands below will destroy and partially
+overwrite partitions on that device. Also make sure you have appropriate
+write permissions.
+
+You will need cgpt utility from vboot-utils package:
+
+	CGPT=output/host/usr/bin/cgpt
+
+First, erase and create a new GPT:
+
+	$CGPT create -z $SD
+	$CGPT create $SD	# ignore complaints about invalid GPT
+
+Take a look at the table:
+
+	$CGPT show $SD
+	       start        size    part  contents
+	           0           1          PMBR
+	           1           1          Pri GPT header
+	           2          32          Pri GPT table
+	    15564767          32          Sec GPT table
+	    15564799           1          Sec GPT header
+
+All offsets and sizes are in 512-blocks, and this table is from a 8GB SD card.
+Decide partition sizes. The kernel and the rootfs partition must fit between
+Pri and Sec GPT tables. It is also a good idea to have everything aligned
+at 8KB (16 blocks) boundary.
+
+	start=$[(2+32+15)&~15]
+	kernelsize=$[8*1024*2]			# 8MB in 512 blocks
+	rootfssize=$[(15564767-kernelsize-start)&~15]
+
+Create the partitions, marking the kernel partition as bootable.
+
+	$CGPT add -i 1 -b $start -s $kernelsize \
+		-t kernel -l kernel\
+		-S 1 -T 1 -P 10 $SD
+	$CGPT add -i 2 -b $[start+kernelsize] -s $rootfssize \
+		-t data -l rootfs $SD
+
+Check the resulting GPT:
+
+	$CGPT show $SD
+	       start        size    part  contents
+	           0           1          PMBR
+	           1           1          Pri GPT header
+	           2          32          Pri GPT table
+	          48       16384       1  Label: "kernel"
+	                                  Type: ChromeOS kernel
+	                                  UUID: ...
+	                                  Attr: priority=10 tries=1 successful=1
+	       16432    15548320       2  Label: "rootfs"
+	                                  Type: Linux data
+	                                  UUID: ...
+	    15564767          32          Sec GPT table
+	    15564799           1          Sec GPT header
+
+Natually this only needs to be done once per card.
+
+
+Writing kernel and rootfs to the SD card
+----------------------------------------
+Write .kpart directly to the bootable partition:
+
+	dd if=output/images/uImage.kpart of=${SD}1
+
+Make a new filesystem on the rootfs parition, and unpack fs image there:
+
+	mkfs.ext4 ${SD}2
+	mount ${SD2} /mnt/<ROOTFS-PARTITION>
+	tar -xvf output/images/rootfs.tar -C /mnt/<ROOTFS-PARTITION>
+	umount /mnt/<ROOTFS-PARTITION>
+
+This will require root permissions even if you can write to $SD.
+
+Alternatively, just write the fs image directly to the partition:
+
+	dd if=output/images/rootfs.ext2 of=${SD}2
+
+Select ext* fs image in menuconfig before doing this, and consider specifying
+extra fs size to have some empty space available there.
+
+
+Switching to developer mode and booting from SD
+-----------------------------------------------
+Power Chromebook down, then power it up while holding Esc+F3.
+BEWARE: switching to developer mode deletes all user data.
+Create backups if you need them.
+
+While in developer mode, Chromebook will boot into a white screen saying
+"OS verification is off".
+
+Press Ctrl-D at this screen to boot ChromeOS from eMMC.
+Press Ctrl-U at this screen to boot from SD (or USB)
+Press Power to power it off.
+Do NOT press Space unless you mean it.
+This will switch it back to normal mode.
+
+The is no way to get rid of the white screen without re-flashing the bootloader.
+
+
+Troubleshooting
+---------------
+Ctrl-U on the white screen followed by a loud *BEEP* and a return to the white
+screen means there's no valid partition to boot from.
+Which in turn means either bad GPT or improperly signed kernel.
+
+Return to the white screen without any sounds means the code managed to reboot
+the board. May indicate properly signed but invalid image. Blank screen means
+the image is valid and properly signed but cannot boot for some reason, like
+missing or incorrect DT.
+
+In case the board becomes unresponsible:
+
+* Press Esc+F3+Power. The board should reboot instantly.
+  Remove SD card to prevent it from attempting a system recovery.
+
+* Hold Power button for around 10s. The board should shut down into
+  its soft-off mode. Press Power button again or open the lid to turn in on.
+
+* If that does not work, disconnect the charger and push a hidden
+  button on the underside with a pin of some sort. The board should shut
+  down completely. Opening the lid and pressing Power button will not work.
+  To turn it back on, connect the charger.
+
+
+Kernel command line
+-------------------
+The command line is taken from board/chromebook/kernel.args and stored
+in the vboot header (which also holds the signature).
+To change it, edit the file, run make to rebuild the signed image (there is
+no need to rebuild the plain zImage) and write it to the kernel partition on SD.
+
+The original bootloader prepends "cros_secure console= " to the supplied
+command line. The only way to suppress this is to enable CMDLINE_FORCE in the
+kernel config, disabling external command line completely.
+
+However, this is not necessary. The mainline kernel ignores cros_secure,
+and supplying console=tty1 in kernel.args undoes the effect of console=
+
+Booting with effective console= suppresses all kernel output.
+As a side effect, it makes /dev/console unusable, which init in use must
+be able to handle.
+
+
+WiFi card
+---------
+Run modprobe mwifiex_sdio to load the driver.
+Network device name is typically mlan0.
+
+
+Further reading
+---------------
+https://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices/samsung-arm-chromebook
+http://linux-exynos.org/wiki/Samsung_Chromebook_XE303C12/Installing_Linux
+http://archlinuxarm.org/platforms/armv7/samsung/samsung-chromebook
+http://www.de7ec7ed.com/2013/05/application-processor-ap-uart-samsung.html
+http://www.de7ec7ed.com/2013/05/embedded-controller-ec-uart-samsung.html
diff --git a/board/chromebook/snow/sign.sh b/board/chromebook/snow/sign.sh
new file mode 100755
index 0000000..9a621b2
--- /dev/null
+++ b/board/chromebook/snow/sign.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+run() { echo "$@"; "$@"; }
+
+if [ -z "$BINARIES_DIR" -o -z "$HOST_DIR" ]; then
+	echo "BINARIES_DIR and HOST_DIR must be set" >&2
+	exit 1
+fi
+
+board=$PWD/board/chromebook/snow
+mkimage=$HOST_DIR/usr/bin/mkimage
+futility=$HOST_DIR/usr/bin/futility
+devkeys=$HOST_DIR/usr/share/vboot/devkeys
+
+cd "$BINARIES_DIR" || exit 1
+
+cp $board/kernel.its kernel.its || exit 1
+run $mkimage -f kernel.its uImage.itb
+
+echo > dummy.txt
+
+run $futility vbutil_kernel \
+	--keyblock $devkeys/kernel.keyblock \
+	--signprivate $devkeys/kernel_data_key.vbprivk \
+	--arch arm \
+	--version 1 \
+	--config $board/kernel.args \
+	--vmlinuz uImage.itb \
+	--bootloader dummy.txt \
+	--pack uImage.kpart
+
+rm -f kernel.its dummy.txt
diff --git a/configs/chromebook_snow_defconfig b/configs/chromebook_snow_defconfig
new file mode 100644
index 0000000..631ed73
--- /dev/null
+++ b/configs/chromebook_snow_defconfig
@@ -0,0 +1,17 @@
+BR2_arm=y
+BR2_cortex_a15=y
+BR2_BINUTILS_VERSION_2_25_X=y
+BR2_GCC_VERSION_5_X=y
+BR2_TARGET_GENERIC_GETTY_PORT="tty1"
+BR2_TARGET_GENERIC_GETTY_TERM="linux"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/chromebook/snow/sign.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/chromebook/snow/linux-4.3.config"
+BR2_LINUX_KERNEL_ZIMAGE=y
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="exynos5250-snow"
+BR2_PACKAGE_LINUX_FIRMWARE=y
+BR2_PACKAGE_LINUX_FIRMWARE_MWIFIEX_SD8797=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y
+BR2_PACKAGE_HOST_VBOOT_UTILS=y
-- 
2.0.3

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 1/2] vboot-utils: new package
  2015-11-16 17:54 ` [Buildroot] [PATCH 1/2] vboot-utils: new package Alex Suykov
@ 2015-11-16 18:42   ` Baruch Siach
  2015-11-16 20:03     ` Alex Suykov
  2015-11-16 20:19   ` Arnout Vandecappelle
  1 sibling, 1 reply; 15+ messages in thread
From: Baruch Siach @ 2015-11-16 18:42 UTC (permalink / raw)
  To: buildroot

Hi Alex,

On Mon, Nov 16, 2015 at 07:54:25PM +0200, Alex Suykov wrote:
> Host utilities for working with Chromium OS verified boot images.
> Needed to create signed kernel images and manipulating bootable
> partitions for Chromium OS bootloaders.
> 
> Signed-off-by: Alex Suykov <alex.suykov@gmail.com>

[...]

> +VBOOT_UTILS_VERSION = bbdd62f9b030db7ad8eef789aaf58a7ff9a25656
> +VBOOT_UTILS_SITE = https://chromium.googlesource.com/chromiumos/platform/vboot_reference
> +VBOOT_UTILS_SITE_METHOD = git
> +VBOOT_UTILS_LICENSE = BSD

Please add 'VBOOT_UTILS_LICENSE_FILES = LICENSE'.

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 1/2] vboot-utils: new package
  2015-11-16 18:42   ` Baruch Siach
@ 2015-11-16 20:03     ` Alex Suykov
  0 siblings, 0 replies; 15+ messages in thread
From: Alex Suykov @ 2015-11-16 20:03 UTC (permalink / raw)
  To: buildroot

Mon, Nov 16, 2015 at 08:42:37PM +0200, Baruch Siach wrote:

> > +VBOOT_UTILS_VERSION = bbdd62f9b030db7ad8eef789aaf58a7ff9a25656
> > +VBOOT_UTILS_SITE = https://chromium.googlesource.com/chromiumos/platform/vboot_reference
> > +VBOOT_UTILS_SITE_METHOD = git
> > +VBOOT_UTILS_LICENSE = BSD
> 
> Please add 'VBOOT_UTILS_LICENSE_FILES = LICENSE'.

Done, v2 patch sent.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 1/2] vboot-utils: new package
  2015-11-16 17:54 ` [Buildroot] [PATCH 1/2] vboot-utils: new package Alex Suykov
  2015-11-16 18:42   ` Baruch Siach
@ 2015-11-16 20:19   ` Arnout Vandecappelle
  2015-11-16 21:52     ` Alex Suykov
  1 sibling, 1 reply; 15+ messages in thread
From: Arnout Vandecappelle @ 2015-11-16 20:19 UTC (permalink / raw)
  To: buildroot

On 16-11-15 18:54, Alex Suykov wrote:
> Host utilities for working with Chromium OS verified boot images.
> Needed to create signed kernel images and manipulating bootable
> partitions for Chromium OS bootloaders.
> 
> Signed-off-by: Alex Suykov <alex.suykov@gmail.com>
> ---
>  package/Config.in.host             |  1 +
>  package/vboot-utils/Config.in.host |  6 ++++++
>  package/vboot-utils/vboot-utils.mk | 23 +++++++++++++++++++++++
>  3 files changed, 30 insertions(+)
>  create mode 100644 package/vboot-utils/Config.in.host
>  create mode 100644 package/vboot-utils/vboot-utils.mk
> 
> diff --git a/package/Config.in.host b/package/Config.in.host
> index ce1b6bc..7044a3b 100644
> --- a/package/Config.in.host
> +++ b/package/Config.in.host
> @@ -29,5 +29,6 @@ menu "Host utilities"
>  	source "package/sunxi-tools/Config.in.host"
>  	source "package/uboot-tools/Config.in.host"
>  	source "package/util-linux/Config.in.host"
> +	source "package/vboot-utils/Config.in.host"
>  
>  endmenu
> diff --git a/package/vboot-utils/Config.in.host b/package/vboot-utils/Config.in.host
> new file mode 100644
> index 0000000..a0c7497
> --- /dev/null
> +++ b/package/vboot-utils/Config.in.host
> @@ -0,0 +1,6 @@
> +config BR2_PACKAGE_HOST_VBOOT_UTILS
> +	bool "host vboot utils"
> +	help
> +	  ChromeOS verified boot utils: futility and cgpt.

 ChromeOS or Chromius OS? Please be consistent :-)

> +
> +	  https://www.chromium.org/chromium-os/chromiumos-design-docs/verified-boot
> diff --git a/package/vboot-utils/vboot-utils.mk b/package/vboot-utils/vboot-utils.mk
> new file mode 100644
> index 0000000..b160efa
> --- /dev/null
> +++ b/package/vboot-utils/vboot-utils.mk
> @@ -0,0 +1,23 @@
> +################################################################################
> +#
> +# vboot
> +#
> +################################################################################
> +
> +VBOOT_UTILS_VERSION = bbdd62f9b030db7ad8eef789aaf58a7ff9a25656
> +VBOOT_UTILS_SITE = https://chromium.googlesource.com/chromiumos/platform/vboot_reference

 Since googlesource is shutting down: is there an alternative location already?
Possibly one which doesn't require git download method?

> +VBOOT_UTILS_SITE_METHOD = git
> +VBOOT_UTILS_LICENSE = BSD

 BSD doesn't exist, I think it's BSD-3c in this case.

> +
> +HOST_VBOOT_UTILS_DEPENDENCIES = host-openssl
> +
> +define HOST_VBOOT_UTILS_BUILD_CMDS
> +	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) futil cgpt
> +endef
> +
> +define HOST_VBOOT_UTILS_INSTALL_CMDS
> +	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(HOST_DIR)/usr \
> +		futil_install cgpt_install devkeys_install
> +endef

 Why not just 'make' and 'make install'? Please add the explanation as a comment.

 Regards,
 Arnout

> +
> +$(eval $(host-generic-package))
> 


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 2/2] board: add support for Chromebook Snow
  2015-11-16 17:54 ` [Buildroot] [PATCH 2/2] board: add support for Chromebook Snow Alex Suykov
@ 2015-11-16 20:40   ` Arnout Vandecappelle
  2015-11-18  3:27     ` Alex Suykov
  0 siblings, 1 reply; 15+ messages in thread
From: Arnout Vandecappelle @ 2015-11-16 20:40 UTC (permalink / raw)
  To: buildroot

On 16-11-15 18:54, Alex Suykov wrote:
> Samsung XE303C12 aka Chromebook Snow is an Exynos5250-based netbook.
> 
> There is barely anything special about this target as far as toolchain
> is concerned, but its bootloader only accepts signed kernel images
> in a Chromium OS specific format, and is not controllable otherwise.
> 
> This config provides a script for building the proper kernel blobs,
> and a short manual for booting Buildroot images on the device.
> 
> The kernel defconfig is also provided. Mainline kernel already
> has exynos_defconfig which could have been used here, but it builds
> mwifiex statically, and that module tries to load its firmware during
> initialization.
> 
> Since the board was going to get a custom kernel config anyway,
> exynos_defconfig was trimmed to only include the drivers needed
> for this particular chip and this particular board.
> 
> Signed-off-by: Alex Suykov <alex.suykov@gmail.com>
> ---
[snip]

> +Partitioning the SD card
> +------------------------
> +Figure out the device name for the card on the host system. Typically
> +it is either /dev/sdX or /dev/mmcblkX.
> +
> +	SD=/dev/sdb
> +
> +DOUBLE CHECK THE DEVICE NAME! The commands below will destroy and partially
> +overwrite partitions on that device. Also make sure you have appropriate
> +write permissions.
> +
> +You will need cgpt utility from vboot-utils package:
> +
> +	CGPT=output/host/usr/bin/cgpt
> +
> +First, erase and create a new GPT:
> +
> +	$CGPT create -z $SD
> +	$CGPT create $SD	# ignore complaints about invalid GPT
> +
> +Take a look at the table:
> +
> +	$CGPT show $SD
> +	       start        size    part  contents
> +	           0           1          PMBR
> +	           1           1          Pri GPT header
> +	           2          32          Pri GPT table
> +	    15564767          32          Sec GPT table
> +	    15564799           1          Sec GPT header
> +
> +All offsets and sizes are in 512-blocks, and this table is from a 8GB SD card.
> +Decide partition sizes. The kernel and the rootfs partition must fit between
> +Pri and Sec GPT tables. It is also a good idea to have everything aligned
> +at 8KB (16 blocks) boundary.
> +
> +	start=$[(2+32+15)&~15]
> +	kernelsize=$[8*1024*2]			# 8MB in 512 blocks
> +	rootfssize=$[(15564767-kernelsize-start)&~15]
> +
> +Create the partitions, marking the kernel partition as bootable.
> +
> +	$CGPT add -i 1 -b $start -s $kernelsize \
> +		-t kernel -l kernel\
> +		-S 1 -T 1 -P 10 $SD
> +	$CGPT add -i 2 -b $[start+kernelsize] -s $rootfssize \
> +		-t data -l rootfs $SD

 Wouldn't it be possible to do all this in a post-image script that generates an
SD card image?

> +
> +Check the resulting GPT:
> +
> +	$CGPT show $SD
> +	       start        size    part  contents
> +	           0           1          PMBR
> +	           1           1          Pri GPT header
> +	           2          32          Pri GPT table
> +	          48       16384       1  Label: "kernel"
> +	                                  Type: ChromeOS kernel
> +	                                  UUID: ...
> +	                                  Attr: priority=10 tries=1 successful=1
> +	       16432    15548320       2  Label: "rootfs"
> +	                                  Type: Linux data
> +	                                  UUID: ...
> +	    15564767          32          Sec GPT table
> +	    15564799           1          Sec GPT header
> +
> +Natually this only needs to be done once per card.
> +
> +
> +Writing kernel and rootfs to the SD card
> +----------------------------------------
> +Write .kpart directly to the bootable partition:
> +
> +	dd if=output/images/uImage.kpart of=${SD}1
> +
> +Make a new filesystem on the rootfs parition, and unpack fs image there:
> +
> +	mkfs.ext4 ${SD}2
> +	mount ${SD2} /mnt/<ROOTFS-PARTITION>
> +	tar -xvf output/images/rootfs.tar -C /mnt/<ROOTFS-PARTITION>
> +	umount /mnt/<ROOTFS-PARTITION>
> +
> +This will require root permissions even if you can write to $SD.
> +
> +Alternatively, just write the fs image directly to the partition:
> +
> +	dd if=output/images/rootfs.ext2 of=${SD}2
> +
> +Select ext* fs image in menuconfig before doing this, and consider specifying
> +extra fs size to have some empty space available there.

 Just add an ext4 image to the buildroot config right away.

[snip]
> diff --git a/configs/chromebook_snow_defconfig b/configs/chromebook_snow_defconfig
> new file mode 100644
> index 0000000..631ed73
> --- /dev/null
> +++ b/configs/chromebook_snow_defconfig
> @@ -0,0 +1,17 @@
> +BR2_arm=y
> +BR2_cortex_a15=y

 You also have to fixate the kernel headers version, i.e. use a custom version
and specify 4.3

> +BR2_BINUTILS_VERSION_2_25_X=y
> +BR2_GCC_VERSION_5_X=y
> +BR2_TARGET_GENERIC_GETTY_PORT="tty1"
> +BR2_TARGET_GENERIC_GETTY_TERM="linux"
> +BR2_ROOTFS_POST_BUILD_SCRIPT="board/chromebook/snow/sign.sh"
> +BR2_LINUX_KERNEL=y

 Here also fixate the version, but SAME_AS_HEADERS is ok.

> +BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
> +BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/chromebook/snow/linux-4.3.config"
> +BR2_LINUX_KERNEL_ZIMAGE=y
> +BR2_LINUX_KERNEL_DTS_SUPPORT=y
> +BR2_LINUX_KERNEL_INTREE_DTS_NAME="exynos5250-snow"
> +BR2_PACKAGE_LINUX_FIRMWARE=y
> +BR2_PACKAGE_LINUX_FIRMWARE_MWIFIEX_SD8797=y

 As mentioned, add an ext4 image.

 Regards,
 Arnout

> +BR2_PACKAGE_HOST_UBOOT_TOOLS=y
> +BR2_PACKAGE_HOST_VBOOT_UTILS=y
> 


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 1/2] vboot-utils: new package
  2015-11-16 20:19   ` Arnout Vandecappelle
@ 2015-11-16 21:52     ` Alex Suykov
  2015-11-16 22:00       ` Arnout Vandecappelle
  2015-12-08 21:11       ` Mike Frysinger
  0 siblings, 2 replies; 15+ messages in thread
From: Alex Suykov @ 2015-11-16 21:52 UTC (permalink / raw)
  To: buildroot

Mon, Nov 16, 2015 at 09:19:43PM +0100, Arnout Vandecappelle wrote:

> > +	  ChromeOS verified boot utils: futility and cgpt.
> 
>  ChromeOS or Chromius OS? Please be consistent :-)
 
Fixed that in v2 already. Should be Chromium OS throughout of course.
Chromium OS but Chrome-book.

> > +VBOOT_UTILS_VERSION = bbdd62f9b030db7ad8eef789aaf58a7ff9a25656
> > +VBOOT_UTILS_SITE = https://chromium.googlesource.com/chromiumos/platform/vboot_reference
> 
>  Since googlesource is shutting down: is there an alternative location already?
> Possibly one which doesn't require git download method?

Isn't it Google Code that's shutting down?
It does not look like they have any other site for Chromium OS sources.
https://www.chromium.org/chromium-os/developer-guide#TOC-Get-the-Source

They do have tgz shapshots however, I overlooked that.
Should be better than git checkouts.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 1/2] vboot-utils: new package
  2015-11-16 21:52     ` Alex Suykov
@ 2015-11-16 22:00       ` Arnout Vandecappelle
  2015-12-08 21:11       ` Mike Frysinger
  1 sibling, 0 replies; 15+ messages in thread
From: Arnout Vandecappelle @ 2015-11-16 22:00 UTC (permalink / raw)
  To: buildroot

On 16-11-15 22:52, Alex Suykov wrote:
> Mon, Nov 16, 2015 at 09:19:43PM +0100, Arnout Vandecappelle wrote:
> 
>>> +	  ChromeOS verified boot utils: futility and cgpt.
>>
>>  ChromeOS or Chromius OS? Please be consistent :-)
>  
> Fixed that in v2 already. Should be Chromium OS throughout of course.
> Chromium OS but Chrome-book.

 Yeah sorry I was replying to the wrong version.

> 
>>> +VBOOT_UTILS_VERSION = bbdd62f9b030db7ad8eef789aaf58a7ff9a25656
>>> +VBOOT_UTILS_SITE = https://chromium.googlesource.com/chromiumos/platform/vboot_reference
>>
>>  Since googlesource is shutting down: is there an alternative location already?
>> Possibly one which doesn't require git download method?
> 
> Isn't it Google Code that's shutting down?

 Oops, my bad.


> It does not look like they have any other site for Chromium OS sources.
> https://www.chromium.org/chromium-os/developer-guide#TOC-Get-the-Source
> 
> They do have tgz shapshots however, I overlooked that.
> Should be better than git checkouts.

 All right, so my comments weren't completely useless :-)

 Don't forget to add a hash file then.

 Regards,
 Arnout


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 1/2 v3] vboot-utils: new package
  2015-11-16 17:54 [Buildroot] [PATCH 0/2] Samsung XE303C12 aka Chromebook Snow Alex Suykov
  2015-11-16 17:54 ` [Buildroot] [PATCH 1/2] vboot-utils: new package Alex Suykov
  2015-11-16 17:54 ` [Buildroot] [PATCH 2/2] board: add support for Chromebook Snow Alex Suykov
@ 2015-11-16 23:42 ` Alex Suykov
  2015-12-24 11:36   ` Thomas Petazzoni
  2015-11-18  3:29 ` [Buildroot] [PATCH 2/2 v2] board: add support for Chromebook Snow Alex Suykov
  3 siblings, 1 reply; 15+ messages in thread
From: Alex Suykov @ 2015-11-16 23:42 UTC (permalink / raw)
  To: buildroot

Chromium OS verified boot utilities.

Needed for signing kernel images and manipulating bootable
partitions on media intended for Chromebooks.

Signed-off-by: Alex Suykov <alex.suykov@gmail.com>
---
v2: _LICENSE_FILES
    minor text fixes
v3: git snapshot over https instead of git checkout
    comments on unusual make targets
    proper license name
    minor text fixes

 package/Config.in.host               |  1 +
 package/vboot-utils/Config.in.host   |  6 ++++++
 package/vboot-utils/vboot-utils.hash |  2 ++
 package/vboot-utils/vboot-utils.mk   | 35 +++++++++++++++++++++++++++++++++++
 4 files changed, 44 insertions(+)
 create mode 100644 package/vboot-utils/Config.in.host
 create mode 100644 package/vboot-utils/vboot-utils.hash
 create mode 100644 package/vboot-utils/vboot-utils.mk

diff --git a/package/Config.in.host b/package/Config.in.host
index ce1b6bc..7044a3b 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -29,5 +29,6 @@ menu "Host utilities"
 	source "package/sunxi-tools/Config.in.host"
 	source "package/uboot-tools/Config.in.host"
 	source "package/util-linux/Config.in.host"
+	source "package/vboot-utils/Config.in.host"
 
 endmenu
diff --git a/package/vboot-utils/Config.in.host b/package/vboot-utils/Config.in.host
new file mode 100644
index 0000000..5cecef0
--- /dev/null
+++ b/package/vboot-utils/Config.in.host
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_HOST_VBOOT_UTILS
+	bool "host vboot utils"
+	help
+	  ChromiumOS verified boot utilities: futility and cgpt.
+
+	  https://www.chromium.org/chromium-os/chromiumos-design-docs/verified-boot
diff --git a/package/vboot-utils/vboot-utils.hash b/package/vboot-utils/vboot-utils.hash
new file mode 100644
index 0000000..e161423
--- /dev/null
+++ b/package/vboot-utils/vboot-utils.hash
@@ -0,0 +1,2 @@
+# Git shapshot
+none	xxx	bbdd62f9b030db7ad8eef789aaf58a7ff9a25656.tar.gz
diff --git a/package/vboot-utils/vboot-utils.mk b/package/vboot-utils/vboot-utils.mk
new file mode 100644
index 0000000..7d83899
--- /dev/null
+++ b/package/vboot-utils/vboot-utils.mk
@@ -0,0 +1,35 @@
+################################################################################
+#
+# vboot-utils
+#
+################################################################################
+
+VBOOT_UTILS_VERSION = bbdd62f9b030db7ad8eef789aaf58a7ff9a25656
+VBOOT_UTILS_SOURCE = $(VBOOT_UTILS_VERSION).tar.gz
+VBOOT_UTILS_SITE = https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+archive
+VBOOT_UTILS_STRIP_COMPONENTS = 0
+VBOOT_UTILS_LICENSE = BSD-3c
+VBOOT_UTILS_LICENSE_FILES = LICENSE
+
+HOST_VBOOT_UTILS_DEPENDENCIES = host-openssl
+
+# vboot_reference contains code that goes into bootloaders,
+# utilities intended for the target system, and a bunch of scripts
+# for Chromium OS build system. Most of that does not make sense
+# in a buildroot host-package.
+#
+# We only need futility for signing images, the keys, and cgpt for boot
+# media partitioning.
+#
+# make target for futility is "futil".
+
+define HOST_VBOOT_UTILS_BUILD_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) futil cgpt
+endef
+
+define HOST_VBOOT_UTILS_INSTALL_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(HOST_DIR)/usr \
+		futil_install cgpt_install devkeys_install
+endef
+
+$(eval $(host-generic-package))
-- 
2.0.3

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 2/2] board: add support for Chromebook Snow
  2015-11-16 20:40   ` Arnout Vandecappelle
@ 2015-11-18  3:27     ` Alex Suykov
  0 siblings, 0 replies; 15+ messages in thread
From: Alex Suykov @ 2015-11-18  3:27 UTC (permalink / raw)
  To: buildroot

Mon, Nov 16, 2015 at 09:40:30PM +0100, Arnout Vandecappelle wrote:

> > +Create the partitions, marking the kernel partition as bootable.
> > +
> > +	$CGPT add -i 1 -b $start -s $kernelsize \
> > +		-t kernel -l kernel\
> > +		-S 1 -T 1 -P 10 $SD
> > +	$CGPT add -i 2 -b $[start+kernelsize] -s $rootfssize \
> > +		-t data -l rootfs $SD
> 
>  Wouldn't it be possible to do all this in a post-image script that generates an
> SD card image?

Seems to be possible. The resulting image has secondary GPT in the wrong
location, but as long as the primary one is ok it should not cause trouble.

This also adds host-parted dependency, but that would be needed anyway.
I was working with a partitioned card and did not notice it, but cgpt
does not write protective MBR.

Sending v2.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 2/2 v2] board: add support for Chromebook Snow
  2015-11-16 17:54 [Buildroot] [PATCH 0/2] Samsung XE303C12 aka Chromebook Snow Alex Suykov
                   ` (2 preceding siblings ...)
  2015-11-16 23:42 ` [Buildroot] [PATCH 1/2 v3] vboot-utils: new package Alex Suykov
@ 2015-11-18  3:29 ` Alex Suykov
  3 siblings, 0 replies; 15+ messages in thread
From: Alex Suykov @ 2015-11-18  3:29 UTC (permalink / raw)
  To: buildroot

Samsung XE303C12 aka Chromebook Snow is an Exynos5250-based netbook.

There is barely anything special about this target as far as toolchain
is concerned, but its bootloader only accepts signed kernel images
in a Chromium OS specific format, and is not controllable otherwise.

This config provides a script for building the proper kernel blobs,
and a short manual for booting Buildroot images on the device.

The kernel defconfig is also provided. Mainline kernel already
has exynos_defconfig which could have been used here, but it builds
mwifiex statically, and that module tries to load its firmware during
initialization.

Since the board was going to get a custom kernel config anyway,
exynos_defconfig was trimmed to only include the drivers needed
for this particular chip and this particular board.

Signed-off-by: Alex Suykov <alex.suykov@gmail.com>
---
v2: script to make complete SD card image
    explicit kernel version in defconfig
    comments and text updates

 board/chromebook/snow/kernel.args      |   1 +
 board/chromebook/snow/kernel.its       |  34 +++++++
 board/chromebook/snow/linux-4.3.config | 161 +++++++++++++++++++++++++++++++++
 board/chromebook/snow/mksd.sh          |  72 +++++++++++++++
 board/chromebook/snow/readme.txt       | 145 +++++++++++++++++++++++++++++
 board/chromebook/snow/sign.sh          |  44 +++++++++
 configs/chromebook_snow_defconfig      |  22 +++++
 7 files changed, 479 insertions(+)
 create mode 100644 board/chromebook/snow/kernel.args
 create mode 100644 board/chromebook/snow/kernel.its
 create mode 100644 board/chromebook/snow/linux-4.3.config
 create mode 100755 board/chromebook/snow/mksd.sh
 create mode 100644 board/chromebook/snow/readme.txt
 create mode 100755 board/chromebook/snow/sign.sh
 create mode 100644 configs/chromebook_snow_defconfig

diff --git a/board/chromebook/snow/kernel.args b/board/chromebook/snow/kernel.args
new file mode 100644
index 0000000..1220bf8
--- /dev/null
+++ b/board/chromebook/snow/kernel.args
@@ -0,0 +1 @@
+console=tty1 clk_ignore_unused root=/dev/mmcblk1p2 rootfstype=ext4 ro
diff --git a/board/chromebook/snow/kernel.its b/board/chromebook/snow/kernel.its
new file mode 100644
index 0000000..33f2c00
--- /dev/null
+++ b/board/chromebook/snow/kernel.its
@@ -0,0 +1,34 @@
+/dts-v1/;
+
+/ {
+    description = "Buildroot kernel for Chromebook Snow";
+    images {
+        kernel at 1{
+            description = "kernel";
+            data = /incbin/("zImage");
+            type = "kernel";
+            arch = "arm";
+            os = "linux";
+            compression = "none";
+            load = <0x40008000>;
+            entry = <0x40008000>;
+        };
+        fdt at 1{
+            description = "exynos5250-snow.dtb";
+            data = /incbin/("exynos5250-snow.dtb");
+            type = "flat_dt";
+            arch = "arm";
+            compression = "none";
+            hash at 1{
+                algo = "sha1";
+            };
+        };
+    };
+    configurations {
+        default = "conf at 1";
+        conf at 1{
+            kernel = "kernel at 1";
+            fdt = "fdt at 1";
+        };
+    };
+};
diff --git a/board/chromebook/snow/linux-4.3.config b/board/chromebook/snow/linux-4.3.config
new file mode 100644
index 0000000..8c7be6d
--- /dev/null
+++ b/board/chromebook/snow/linux-4.3.config
@@ -0,0 +1,161 @@
+CONFIG_NO_HZ_IDLE=y
+# CONFIG_COMPAT_BRK is not set
+CONFIG_MODULES=y
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_ARCH_EXYNOS=y
+# CONFIG_ARCH_EXYNOS4 is not set
+# CONFIG_SOC_EXYNOS5260 is not set
+# CONFIG_SOC_EXYNOS5410 is not set
+# CONFIG_SOC_EXYNOS5420 is not set
+# CONFIG_SOC_EXYNOS5440 is not set
+CONFIG_SMP=y
+CONFIG_HAVE_ARM_ARCH_TIMER=y
+CONFIG_BIG_LITTLE=y
+CONFIG_BL_SWITCHER=y
+CONFIG_NR_CPUS=8
+CONFIG_PREEMPT=y
+CONFIG_AEABI=y
+CONFIG_HIGHMEM=y
+CONFIG_CMA=y
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
+CONFIG_CPUFREQ_DT=y
+CONFIG_CPU_IDLE=y
+CONFIG_ARM_EXYNOS_CPUIDLE=y
+CONFIG_VFP=y
+CONFIG_NEON=y
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_NET_KEY=y
+CONFIG_INET=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+CONFIG_IP_PNP_RARP=y
+CONFIG_CFG80211=y
+CONFIG_RFKILL_REGULATOR=y
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_DMA_CMA=y
+CONFIG_CMA_SIZE_MBYTES=64
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_CRYPTOLOOP=y
+CONFIG_SCSI=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_CHR_DEV_SG=y
+CONFIG_MD=y
+CONFIG_BLK_DEV_DM=m
+CONFIG_DM_CRYPT=m
+CONFIG_NETDEVICES=y
+# CONFIG_ETHERNET is not set
+CONFIG_PHYLIB=y
+CONFIG_USB_NET_DRIVERS=m
+CONFIG_USB_USBNET=m
+CONFIG_USB_NET_SMSC75XX=m
+CONFIG_USB_NET_SMSC95XX=m
+CONFIG_MWIFIEX=m
+CONFIG_MWIFIEX_SDIO=m
+# CONFIG_INPUT_MOUSEDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_KEYBOARD_ATKBD is not set
+CONFIG_KEYBOARD_GPIO=y
+CONFIG_KEYBOARD_CROS_EC=y
+# CONFIG_MOUSE_PS2 is not set
+CONFIG_MOUSE_CYAPA=y
+# CONFIG_SERIO is not set
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_SAMSUNG=y
+CONFIG_SERIAL_SAMSUNG_CONSOLE=y
+CONFIG_SERIAL_OF_PLATFORM=y
+CONFIG_HW_RANDOM=y
+CONFIG_TCG_TPM=y
+CONFIG_TCG_TIS_I2C_INFINEON=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_MUX=y
+CONFIG_I2C_ARB_GPIO_CHALLENGE=y
+CONFIG_I2C_GPIO=y
+CONFIG_I2C_CROS_EC_TUNNEL=y
+CONFIG_SPI=y
+CONFIG_SPI_S3C64XX=y
+CONFIG_POWER_SUPPLY=y
+CONFIG_BATTERY_SBS=y
+CONFIG_CHARGER_TPS65090=y
+CONFIG_CPU_THERMAL=y
+CONFIG_WATCHDOG=y
+CONFIG_S3C2410_WATCHDOG=y
+CONFIG_MFD_CROS_EC=y
+CONFIG_MFD_CROS_EC_I2C=y
+CONFIG_MFD_CROS_EC_SPI=y
+CONFIG_MFD_MAX77686=y
+CONFIG_MFD_SEC_CORE=y
+CONFIG_MFD_TPS65090=y
+CONFIG_REGULATOR=y
+CONFIG_REGULATOR_FIXED_VOLTAGE=y
+CONFIG_REGULATOR_GPIO=y
+CONFIG_REGULATOR_MAX77686=y
+CONFIG_REGULATOR_TPS65090=y
+CONFIG_DRM=y
+CONFIG_DRM_EXYNOS=y
+CONFIG_DRM_EXYNOS_FIMD=y
+CONFIG_DRM_EXYNOS_DSI=y
+CONFIG_DRM_EXYNOS_HDMI=y
+CONFIG_DRM_PANEL_SIMPLE=y
+CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0=y
+CONFIG_DRM_NXP_PTN3460=y
+CONFIG_DRM_PARADE_PS8622=y
+CONFIG_FB_SIMPLE=y
+CONFIG_EXYNOS_VIDEO=y
+CONFIG_EXYNOS_MIPI_DSI=y
+CONFIG_LCD_CLASS_DEVICE=y
+CONFIG_LCD_PLATFORM=y
+CONFIG_BACKLIGHT_PWM=y
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_SOC=y
+CONFIG_SND_SOC_SAMSUNG=y
+CONFIG_SND_SOC_SNOW=y
+CONFIG_HID_GENERIC=m
+CONFIG_USB_HID=m
+CONFIG_USB=y
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_EXYNOS=y
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_EXYNOS=y
+CONFIG_USB_STORAGE=y
+CONFIG_USB_DWC3=y
+CONFIG_USB_HSIC_USB3503=y
+CONFIG_USB_GADGET=y
+CONFIG_MMC=y
+CONFIG_MMC_BLOCK_MINORS=16
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_S3C=y
+CONFIG_MMC_SDHCI_S3C_DMA=y
+CONFIG_MMC_DW=y
+CONFIG_MMC_DW_IDMAC=y
+CONFIG_MMC_DW_EXYNOS=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_MAX77686=y
+CONFIG_RTC_DRV_S3C=y
+CONFIG_DMADEVICES=y
+CONFIG_PL330_DMA=y
+CONFIG_CROS_EC_CHARDEV=y
+CONFIG_COMMON_CLK_MAX77686=y
+CONFIG_COMMON_CLK_MAX77802=y
+CONFIG_COMMON_CLK_S2MPS11=y
+CONFIG_EXYNOS_IOMMU=y
+CONFIG_EXTCON=y
+CONFIG_IIO=y
+CONFIG_EXYNOS_ADC=y
+CONFIG_PWM=y
+CONFIG_PWM_SAMSUNG=y
+CONFIG_PHY_EXYNOS5250_SATA=y
+CONFIG_EXT2_FS=y
+CONFIG_EXT4_FS=y
+CONFIG_TMPFS=y
+# CONFIG_ARM_UNWIND is not set
diff --git a/board/chromebook/snow/mksd.sh b/board/chromebook/snow/mksd.sh
new file mode 100755
index 0000000..539eed7
--- /dev/null
+++ b/board/chromebook/snow/mksd.sh
@@ -0,0 +1,72 @@
+#!/bin/sh
+
+# This scripts makes a minimal bootable SD card image for the Chromebook.
+# The resulting file is called bootsd.img. It should be written directly
+# to the card:
+#
+#	SD=/dev/mmcblk1		# check your device name!
+#	dd if=output/images/bootsd.img of=$SD
+#
+# The partitions are created just large enough to hold the kernel and
+# the rootfs image. Most of the card will be empty, and the secondary
+# GPT will not be in its proper location.
+
+output_images=${BINARIES_DIR:-output/images}
+output_host=${HOST_DIR:-output/host}
+
+# cgpt does not create protective MBR, and the kernel refuses to read
+# GPT unless there's some kind of MBR in sector 0. So we need parted
+# to write that single sector before doing anything with the GPT.
+cgpt=$output_host/usr/bin/cgpt
+parted=$output_host/usr/sbin/parted
+kernel=$output_images/uImage.kpart
+rootfs=$output_images/rootfs.ext2
+
+run() { echo "$@"; "$@"; }
+die() { echo "$@" >&2; exit 1; }
+test -f $kernel || die "No kernel image found"
+test -f $rootfs || die "No rootfs image found"
+test -x $cgpt || die "cgpt not found (host-vboot-utils have not been built?)"
+
+# True file sizes in bytes
+kernelsize=`stat -t $kernel | cut -d\  -f2`
+rootfssize=`stat -t $rootfs | cut -d\  -f2`
+
+# The card is partitioned in sectors of 8KB.
+# 4 sectors are reserved for MBR+GPT. Their actual size turns out
+# to be 33 512-blocks which is just over 2 sectors, but we align
+# it to a nice round number.
+sec=8192
+kernelsec=$[(kernelsize+8191)>>13]
+rootfssec=$[(rootfssize+8191)>>13]
+headersec=4
+
+# There is also a copy of MBR+GPT at the end of the image.
+# It's going to be useless but both tools assume it's there.
+imagesec=$[2*headersec+kernelsec+rootfssec]
+bootsd="$output_images/bootsd.img"
+run dd bs=$sec count=$imagesec if=/dev/zero of=$bootsd
+
+# cgpt needs offsets and sizes in 512-blocks.
+block=512
+kernelstart=$[headersec<<4]
+kernelblocks=$[kernelsec<<4]
+rootfsblocks=$[rootfssec<<4]
+rootfsstart=$[kernelstart+kernelblocks]
+
+# This command initializes both GPT and MBR
+run $parted -s $bootsd mklabel gpt
+
+# The kernel partition must be marked as bootable, that's why -S -T -P
+run $cgpt add -i 1 -b $kernelstart -s $kernelblocks \
+	-t kernel -l kernel \
+	-S 1 -T 1 -P 10 $bootsd
+
+# It does not really matter where the rootfs partition is located as long
+# as the kernel can find it.
+# However, if anything is changed here, kernel.args must be updated as well.
+run $cgpt add -i 2 -b $rootfsstart -s $rootfsblocks \
+	-t data -l rootfs $bootsd
+
+run dd bs=$block if=$kernel of=$bootsd seek=$kernelstart
+run dd bs=$block if=$rootfs of=$bootsd seek=$rootfsstart
diff --git a/board/chromebook/snow/readme.txt b/board/chromebook/snow/readme.txt
new file mode 100644
index 0000000..4c2d8f5
--- /dev/null
+++ b/board/chromebook/snow/readme.txt
@@ -0,0 +1,145 @@
+Samsung XE303C12 aka Chromebook Snow
+====================================
+
+This file describes booting the Chromebook from an SD card containing
+Buildroot kernel and rootfs, using the original bootloader. This is
+the least invasive way to get Buildroot onto the devices and a good
+starting point.
+
+The bootloader will only boot a kernel from a GPT partition marked
+bootable with cgpt tool from vboot-utils package.
+The kernel image must be signed using futility from the same package.
+The signing part is done by sign.sh script in this directory.
+
+It does not really matter where rootfs is as long as the kernel is able
+to find it, but this particular configuration assumes the kernel is on
+partition 1 and rootfs is on partition 2 of the SD card.
+Make sure to check kernel.args if you change this.
+
+
+Making the boot media
+---------------------
+Start by configuring and building the images.
+
+	make chromebook_snow_defconfig
+	make menuconfig # if necessary
+	make
+
+The important files are:
+
+	uImage.kpart (kernel and device tree, signed)
+	rootfs.tar
+	bootsd.img (SD card image containing both kernel and rootfs)
+
+Write the image directly to some SD card.
+WARNING: make sure there is nothing important on that card,
+and double-check the device name!
+
+	SD=/dev/mmcblk1		# may be /dev/sdX on some hosts
+	dd if=output/images/bootsd.img of=$SD
+
+
+Switching to developer mode and booting from SD
+-----------------------------------------------
+Power Chromebook down, then power it up while holding Esc+F3.
+BEWARE: switching to developer mode deletes all user data.
+Create backups if you need them.
+
+While in developer mode, Chromebook will boot into a white screen saying
+"OS verification is off".
+
+Press Ctrl-D at this screen to boot ChromeOS from eMMC.
+Press Ctrl-U@this screen to boot from SD (or USB)
+Press Power to power it off.
+Do NOT press Space unless you mean it.
+This will switch it back to normal mode.
+
+The is no way to get rid of the white screen without re-flashing the bootloader.
+
+
+Troubleshooting
+---------------
+Loud *BEEP* after pressing Ctrl-U means there's no valid partition to boot from.
+Which in turn means either bad GPT or improperly signed kernel.
+
+Return to the OS verification screen without any sounds means the code managed
+to reboot the board. May indicate properly signed but invalid image.
+
+Blank screen means the image is valid and properly signed but cannot boot
+for some reason, like missing or incorrect DT.
+
+In case the board becomes unresponsive:
+
+* Press Esc+F3+Power. The board should reboot instantly.
+  Remove SD card to prevent it from attempting a system recovery.
+
+* Hold Power button for around 10s. The board should shut down into
+  its soft-off mode. Press Power button again or open the lid to turn in on.
+
+* If that does not work, disconnect the charger and push a hidden
+  button on the underside with a pin of some sort. The board should shut
+  down completely. Opening the lid and pressing Power button will not work.
+  To turn it back on, connect the charger.
+
+
+Partitioning SD card manually
+----------------------------
+Check mksd.sh for partitioning commands.
+
+Use parted and cgpt on a real device, and calculate the partition
+sizes properly. The kernel partition may be as small as 4MB, but
+you will probably want the rootfs to occupy the whole remaining space.
+
+cgpt may be used to check current layout:
+
+	output/hosst/usr/bin/cgpt show $SD
+
+All sizes and all offsets are in 512-byte blocks.
+
+
+Writing kernel and rootfs to a partitioned SD card
+--------------------------------------------------
+Write .kpart directly to the bootable partition:
+
+	dd if=output/images/uImage.kpart of=${SD}1
+
+Make a new filesystem on the rootfs partition, and unpack rootfs.tar there:
+
+	mkfs.ext4 ${SD}2
+	mount ${SD2} /mnt/<ROOTFS-PARTITION>
+	tar -xvf output/images/rootfs.tar -C /mnt/<ROOTFS-PARTITION>
+	umount /mnt/<ROOTFS-PARTITION>
+
+This will require root permissions even if you can write to $SD.
+
+
+Kernel command line
+-------------------
+The command line is taken from board/chromebook/kernel.args and stored
+in the vboot header (which also holds the signature).
+
+The original bootloader prepends "cros_secure console= " to the supplied
+command line. The only way to suppress this is to enable CMDLINE_FORCE
+in the kernel config, disabling external command line completely.
+
+That's not necessary however. The mainline kernel ignores cros_secure,
+and supplying console=tty1 in kernel.args undoes the effect of console=
+
+Booting with console= suppresses all kernel output.
+As a side effect, it makes /dev/console unusable, which init in use must
+be able to handle.
+
+
+WiFi card
+---------
+Run modprobe mwifiex_sdio to load the driver.
+Network device name should be mlan0.
+
+
+Further reading
+---------------
+https://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices/samsung-arm-chromebook
+http://linux-exynos.org/wiki/Samsung_Chromebook_XE303C12/Installing_Linux
+http://archlinuxarm.org/platforms/armv7/samsung/samsung-chromebook
+http://www.de7ec7ed.com/2013/05/application-processor-ap-uart-samsung.html
+http://www.de7ec7ed.com/2013/05/embedded-controller-ec-uart-samsung.html
diff --git a/board/chromebook/snow/sign.sh b/board/chromebook/snow/sign.sh
new file mode 100755
index 0000000..cdd9781
--- /dev/null
+++ b/board/chromebook/snow/sign.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+# This script creates u-boot FIT image containing the kernel and the DT,
+# then signs it using futility from vboot-utils.
+# The resulting file is called uImage.kpart.
+
+output_images=${BINARIES_DIR:-$PWD/output/images}
+output_host=${HOST_DIR:-$PWD/output/host}
+
+board=$PWD/board/chromebook/snow
+mkimage=$output_host/usr/bin/mkimage
+futility=$output_host/usr/bin/futility
+devkeys=$output_host/usr/share/vboot/devkeys
+
+run() { echo "$@"; "$@"; }
+die() { echo "$@" >&2; exit 1; }
+test -f $output_images/zImage || \
+	die "No kernel image found"
+test -x $mkimage || \
+	die "No mkimage found (host-uboot-tools has not been built?)"
+test -x $futility || \
+	die "No futility found (host-vboot-utils has not been built?)"
+
+# kernel.its references zImage and exynos5250-snow.dtb, and all three
+# files must be in current directory for mkimage.
+run cd $output_images || exit 1
+cp $board/kernel.its ./kernel.its || exit 1
+run $mkimage -f kernel.its uImage.itb
+
+# futility requires non-empty file to be supplied with --bootloader
+# even if it does not make sense for the target platform.
+echo > dummy.txt
+
+run $futility vbutil_kernel \
+	--keyblock $devkeys/kernel.keyblock \
+	--signprivate $devkeys/kernel_data_key.vbprivk \
+	--arch arm \
+	--version 1 \
+	--config $board/kernel.args \
+	--vmlinuz uImage.itb \
+	--bootloader dummy.txt \
+	--pack uImage.kpart
+
+rm -f kernel.its dummy.txt
diff --git a/configs/chromebook_snow_defconfig b/configs/chromebook_snow_defconfig
new file mode 100644
index 0000000..5df3141
--- /dev/null
+++ b/configs/chromebook_snow_defconfig
@@ -0,0 +1,23 @@
+BR2_arm=y
+BR2_cortex_a15=y
+BR2_KERNEL_HEADERS_4_3=y
+BR2_BINUTILS_VERSION_2_25_X=y
+BR2_GCC_VERSION_5_X=y
+BR2_TARGET_GENERIC_GETTY_PORT="tty1"
+BR2_TARGET_GENERIC_GETTY_TERM="linux"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/chromebook/snow/sign.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/chromebook/snow/mksd.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_SAME_AS_HEADERS=y
+BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/chromebook/snow/linux-4.3.config"
+BR2_LINUX_KERNEL_ZIMAGE=y
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="exynos5250-snow"
+BR2_PACKAGE_LINUX_FIRMWARE=y
+BR2_PACKAGE_LINUX_FIRMWARE_MWIFIEX_SD8797=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_PACKAGE_HOST_PARTED=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y
+BR2_PACKAGE_HOST_VBOOT_UTILS=y
-- 
2.0.3

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 1/2] vboot-utils: new package
  2015-11-16 21:52     ` Alex Suykov
  2015-11-16 22:00       ` Arnout Vandecappelle
@ 2015-12-08 21:11       ` Mike Frysinger
  1 sibling, 0 replies; 15+ messages in thread
From: Mike Frysinger @ 2015-12-08 21:11 UTC (permalink / raw)
  To: buildroot

On 16 Nov 2015 23:52, Alex Suykov wrote:
> Mon, Nov 16, 2015 at 09:19:43PM +0100, Arnout Vandecappelle wrote:
> 
> > > +	  ChromeOS verified boot utils: futility and cgpt.
> > 
> >  ChromeOS or Chromius OS? Please be consistent :-)
>  
> Fixed that in v2 already. Should be Chromium OS throughout of course.
> Chromium OS but Chrome-book.

mmm, it should be "Chromium OS" and "Chrome OS", but it should be "Chromebook"

> > > +VBOOT_UTILS_VERSION = bbdd62f9b030db7ad8eef789aaf58a7ff9a25656
> > > +VBOOT_UTILS_SITE = https://chromium.googlesource.com/chromiumos/platform/vboot_reference
> > 
> >  Since googlesource is shutting down: is there an alternative location already?
> > Possibly one which doesn't require git download method?
> 
> Isn't it Google Code that's shutting down?
> It does not look like they have any other site for Chromium OS sources.
> https://www.chromium.org/chromium-os/developer-guide#TOC-Get-the-Source
> 
> They do have tgz shapshots however, I overlooked that.
> Should be better than git checkouts.

unfortunately, the tgz snapshots are not stable (same code but diff hash).
there's a bug open to get it fixed, but i don't know when/if it'll change :(.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20151208/89878b60/attachment.asc>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 1/2 v3] vboot-utils: new package
  2015-11-16 23:42 ` [Buildroot] [PATCH 1/2 v3] vboot-utils: new package Alex Suykov
@ 2015-12-24 11:36   ` Thomas Petazzoni
  2015-12-24 18:42     ` Alex Suykov
  0 siblings, 1 reply; 15+ messages in thread
From: Thomas Petazzoni @ 2015-12-24 11:36 UTC (permalink / raw)
  To: buildroot

Dear Alex Suykov,

On Tue, 17 Nov 2015 01:42:21 +0200, Alex Suykov wrote:
> Chromium OS verified boot utilities.
> 
> Needed for signing kernel images and manipulating bootable
> partitions on media intended for Chromebooks.
> 
> Signed-off-by: Alex Suykov <alex.suykov@gmail.com>

I wanted to apply this patch, but it fails to build. It forgets to link
with the OpenSSL library that has been built in $(HOST_DIR)/usr/lib.
Can you have a look? To reproduce, make sure you don't have the
openssl-dev package installed on your system.

    AR            libvboot_util21.a
    LD            futility/futility_s
    LD            futility/futility
    LDcgpt        cgpt/cgpt
/home/thomas/projets/buildroot/output/build/host-vboot-utils-bbdd62f9b030db7ad8eef789aaf58a7ff9a25656/build/futility/cmd_create.o: In function `do_create':
cmd_create.c:(.text+0x42a): undefined reference to `PEM_read_RSAPrivateKey'
cmd_create.c:(.text+0x5fa): undefined reference to `RSA_free'
cmd_create.c:(.text+0x65e): undefined reference to `PEM_read_RSAPrivateKey'
cmd_create.c:(.text+0x680): undefined reference to `PEM_read_RSA_PUBKEY'
cmd_create.c:(.text+0x962): undefined reference to `RSA_free'
/home/thomas/projets/buildroot/output/build/host-vboot-utils-bbdd62f9b030db7ad8eef789aaf58a7ff9a25656/build/futility/cmd_show.o: In function `ft_show_privkey':
cmd_show.c:(.text+0x875): undefined reference to `d2i_RSAPrivateKey'
cmd_show.c:(.text+0x901): undefined reference to `RSA_free'
/home/thomas/projets/buildroot/output/build/host-vboot-utils-bbdd62f9b030db7ad8eef789aaf58a7ff9a25656/build/futility/vb1_helper.o: In function `ft_recognize_vb1_key':
vb1_helper.c:(.text+0x1141): undefined reference to `d2i_RSAPrivateKey'
vb1_helper.c:(.text+0x1159): undefined reference to `RSA_free'
/home/thomas/projets/buildroot/output/build/host-vboot-utils-bbdd62f9b030db7ad8eef789aaf58a7ff9a25656/build/futility/vb2_helper.o: In function `rsa_from_buffer':
vb2_helper.c:(.text+0x4): undefined reference to `BIO_new_mem_buf'
vb2_helper.c:(.text+0x1a): undefined reference to `PEM_read_bio_RSAPrivateKey'
vb2_helper.c:(.text+0x33): undefined reference to `BIO_ctrl'
vb2_helper.c:(.text+0x45): undefined reference to `PEM_read_bio_RSA_PUBKEY'
vb2_helper.c:(.text+0x55): undefined reference to `BIO_free'
vb2_helper.c:(.text+0x61): undefined reference to `BIO_free'

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 1/2 v3] vboot-utils: new package
  2015-12-24 11:36   ` Thomas Petazzoni
@ 2015-12-24 18:42     ` Alex Suykov
  0 siblings, 0 replies; 15+ messages in thread
From: Alex Suykov @ 2015-12-24 18:42 UTC (permalink / raw)
  To: buildroot

Thu, Dec 24, 2015 at 12:36:33PM +0100, Thomas Petazzoni wrote:

> I wanted to apply this patch, but it fails to build. It forgets to link
> with the OpenSSL library that has been built in $(HOST_DIR)/usr/lib.
> Can you have a look? To reproduce, make sure you don't have the
> openssl-dev package installed on your system.

Well it fails for me even with the system openssl installed.
That's because of pkg-config actually, and fixing pkg-config brought up
some more issues.

Sending v4, checked against current master.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2015-12-24 18:42 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-16 17:54 [Buildroot] [PATCH 0/2] Samsung XE303C12 aka Chromebook Snow Alex Suykov
2015-11-16 17:54 ` [Buildroot] [PATCH 1/2] vboot-utils: new package Alex Suykov
2015-11-16 18:42   ` Baruch Siach
2015-11-16 20:03     ` Alex Suykov
2015-11-16 20:19   ` Arnout Vandecappelle
2015-11-16 21:52     ` Alex Suykov
2015-11-16 22:00       ` Arnout Vandecappelle
2015-12-08 21:11       ` Mike Frysinger
2015-11-16 17:54 ` [Buildroot] [PATCH 2/2] board: add support for Chromebook Snow Alex Suykov
2015-11-16 20:40   ` Arnout Vandecappelle
2015-11-18  3:27     ` Alex Suykov
2015-11-16 23:42 ` [Buildroot] [PATCH 1/2 v3] vboot-utils: new package Alex Suykov
2015-12-24 11:36   ` Thomas Petazzoni
2015-12-24 18:42     ` Alex Suykov
2015-11-18  3:29 ` [Buildroot] [PATCH 2/2 v2] board: add support for Chromebook Snow Alex Suykov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.