From patchwork Fri Jun 24 05:59:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 640040 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rbSPT3rwMz9sDG for ; Fri, 24 Jun 2016 16:01:01 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=OfKZPKKd; dkim-atps=neutral Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3rbSPT2LjBzDqld for ; Fri, 24 Jun 2016 16:01:01 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=OfKZPKKd; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3rbSPK0hydzDq5W for ; Fri, 24 Jun 2016 16:00:53 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=OfKZPKKd; dkim-atps=neutral Received: by mail-pf0-x241.google.com with SMTP id i123so8375052pfg.3 for ; Thu, 23 Jun 2016 23:00:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=kyiED+O+/y1Rlqo6jMfIJzArjXvM2QtppfjuEA7GLrQ=; b=OfKZPKKdhl8lXrecdD3ajTPoIM171P4wtiyTBecDu/y1o9Yaz4QIIQtBqbv79YBQxf X/7x6pps49OUG+NdIOq+rFHIQBkIoQKIj2Rp5u2xjHW93sUGc6PXVK/nA6MWP5s0F9g7 Fu1oZ//07ea22KfxDzA8JJAu0/dF5CAgabjRuEpkg2qlMSK4cLDZH8TXav2oUVxe9Lk9 ypmKrfDmGE23+4wSvWoMLY1N9/xdYod/zGTZ9B7k//kewsuJMEEfgoZhTSCLpJSD8jh9 z8rdo+aPStFH9qLLieZswvE+5YEPrgN2qwEgVM4K0tuoRbrNPcenemsEbEVV8kgZuYaQ tTOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=kyiED+O+/y1Rlqo6jMfIJzArjXvM2QtppfjuEA7GLrQ=; b=KeWFhQxtzd2f3ogm7U80imtHPD/oEtPfNczVZhMgdZg9LbhkGJTJ029HdyIB+Pw2K/ AQMQDPHxDHzSZMX2Y5a4k+wtOh9JGsBLL2mZn/L9jIyVsf4b/9fhy5Ul+fFCgGZOxHjx 86FlUhlh9gC/mNi0PxRHdwgiX501GAxlFZmtH8RJbOEzqqqQwWiCN5GCd63ZXonFQ1/K ij6ck5hXqu41iG0FeIkhs9Zk1q/wjsY6Kk+I+IYmr7ZqV4fwqtiCF8rP5MXZswWxx7Pn 0i5HQPZoKHiW3jCJBt5pBFlrSOKz2Lf2yCeNvSy4pCYozOs9/nDhz2hrjYjUBj1z9SEs QWYg== X-Gm-Message-State: ALyK8tLoE0e3CEdp/mJdAKEuXVQ0tXjMPTmJV72O3zzKpq3WBSPPSiV0nTXmTKTA6iGzFQ== X-Received: by 10.98.216.199 with SMTP id e190mr4248842pfg.76.1466748051043; Thu, 23 Jun 2016 23:00:51 -0700 (PDT) Received: from canetoad.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id v62sm4317384pfv.50.2016.06.23.23.00.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jun 2016 23:00:50 -0700 (PDT) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Fri, 24 Jun 2016 15:59:49 +1000 Message-Id: <1466747989-19312-1-git-send-email-oohall@gmail.com> X-Mailer: git-send-email 2.5.5 Subject: [Skiboot] [PATCH] skiboot.tcl: set the kernel cmdline from env vars X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Allows the user to set the kernel command line arguments from the environmental variables SKIBOOT_BOOTARGS and SKIBOOT_APPEND when using mambo with skiboot.tcl. Setting BOOTARGS will override the existing command line set by scripts, etc while APPEND will append to any existing arguments. Signed-off-by: Oliver O'Halloran --- external/mambo/skiboot.tcl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/external/mambo/skiboot.tcl b/external/mambo/skiboot.tcl index 5c2c2ce21a2a..fb88b7b387d1 100644 --- a/external/mambo/skiboot.tcl +++ b/external/mambo/skiboot.tcl @@ -167,9 +167,10 @@ lappend compat "ibm,power8-xscom" set compat [of::encode_compat $compat] mysim of addprop $xscom_node byte_array "compatible" $compat +set chosen_node [mysim of find_device /chosen] + if { [info exists env(SKIBOOT_INITRD)] } { set cpio_file $env(SKIBOOT_INITRD) - set chosen_node [mysim of find_device /chosen] set cpio_size [file size $cpio_file] set cpio_start 0x80000000 set cpio_end [expr $cpio_start + $cpio_size] @@ -207,6 +208,17 @@ mysim memory fread $mconf(boot_load) $boot_size $mconf(boot_image) set payload_size [file size $mconf(payload)] mysim memory fread $mconf(payload_addr) $payload_size $mconf(payload) +# apply command line argument fixups just before we flatten the DT. +if { [info exists env(SKIBOOT_APPEND) ] } { + set args [mysim of getprop $chosen_node "bootargs"] + set extra_args $env(SKIBOOT_APPEND) + mysim of addprop $chosen_node string "bootargs" "$args $extra_args" +} + +if { [info exists env(SKIBOOT_BOOTARGS) ] } { + mysim of addprop $chosen_node string "bootargs" $env(SKIBOOT_BOOTARGS) +} + # Flatten it epapr::of2dtb mysim $mconf(epapr_dt_addr)