mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 3/3] defenv-2: bring back /env/config
Date: Thu,  1 Nov 2012 19:52:48 +0100	[thread overview]
Message-ID: <1351795968-2352-4-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1351795968-2352-1-git-send-email-s.hauer@pengutronix.de>

The idea of having /env/init/* scripts was to make the configuration
more flexible and customizable for boards. It turned out though that
people (including myself) do not find the place where they should
change these settings.

So this patch brings back /env/config for defenv-2. The individual
env/init/* scripts are removed and their content is added to
/env/init/config-board. This makes the values from /env/init/config-board
the board specific defaults which can be overwritten in /env/config.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 .../crystalfontz-cfa10036/env/init/bootargs-base   |    8 --------
 .../crystalfontz-cfa10036/env/init/config-board    |    7 +++++++
 .../boards/crystalfontz-cfa10036/env/init/hostname |    8 --------
 .../freescale-mx51-pdk/env/init/bootargs-base      |    8 --------
 .../freescale-mx51-pdk/env/init/config-board       |    7 +++++++
 .../boards/freescale-mx51-pdk/env/init/hostname    |    8 --------
 .../freescale-mx6-sabrelite/env/init/bootargs-base |    8 --------
 .../freescale-mx6-sabrelite/env/init/config-board  |    7 +++++++
 .../freescale-mx6-sabrelite/env/init/hostname      |    8 --------
 arch/arm/boards/karo-tx53/env/init/bootargs-base   |    8 --------
 arch/arm/boards/karo-tx53/env/init/config-board    |    7 +++++++
 arch/arm/boards/karo-tx53/env/init/hostname        |    8 --------
 arch/arm/boards/pcm038/env/init/bootargs-base      |    8 --------
 arch/arm/boards/pcm038/env/init/config-board       |    7 +++++++
 arch/arm/boards/pcm038/env/init/hostname           |    8 --------
 arch/arm/boards/tqma53/env/init/bootargs-base      |    8 --------
 arch/arm/boards/tqma53/env/init/config-board       |    7 +++++++
 arch/arm/boards/tqma53/env/init/hostname           |    8 --------
 defaultenv-2/base/bin/init                         |   10 ++++++++--
 defaultenv-2/base/config                           |   21 ++++++++++++++++++++
 defaultenv-2/base/init/bootargs-base               |    8 --------
 defaultenv-2/base/init/general                     |   15 --------------
 defaultenv-2/base/init/hostname                    |    8 --------
 defaultenv-2/base/init/prompt                      |    7 -------
 defaultenv-2/menu/menu/mainmenu                    |    1 +
 25 files changed, 72 insertions(+), 136 deletions(-)
 delete mode 100644 arch/arm/boards/crystalfontz-cfa10036/env/init/bootargs-base
 create mode 100644 arch/arm/boards/crystalfontz-cfa10036/env/init/config-board
 delete mode 100644 arch/arm/boards/crystalfontz-cfa10036/env/init/hostname
 delete mode 100644 arch/arm/boards/freescale-mx51-pdk/env/init/bootargs-base
 create mode 100644 arch/arm/boards/freescale-mx51-pdk/env/init/config-board
 delete mode 100644 arch/arm/boards/freescale-mx51-pdk/env/init/hostname
 delete mode 100644 arch/arm/boards/freescale-mx6-sabrelite/env/init/bootargs-base
 create mode 100644 arch/arm/boards/freescale-mx6-sabrelite/env/init/config-board
 delete mode 100644 arch/arm/boards/freescale-mx6-sabrelite/env/init/hostname
 delete mode 100644 arch/arm/boards/karo-tx53/env/init/bootargs-base
 create mode 100644 arch/arm/boards/karo-tx53/env/init/config-board
 delete mode 100644 arch/arm/boards/karo-tx53/env/init/hostname
 delete mode 100644 arch/arm/boards/pcm038/env/init/bootargs-base
 create mode 100644 arch/arm/boards/pcm038/env/init/config-board
 delete mode 100644 arch/arm/boards/pcm038/env/init/hostname
 delete mode 100644 arch/arm/boards/tqma53/env/init/bootargs-base
 create mode 100644 arch/arm/boards/tqma53/env/init/config-board
 delete mode 100644 arch/arm/boards/tqma53/env/init/hostname
 create mode 100644 defaultenv-2/base/config
 delete mode 100644 defaultenv-2/base/init/bootargs-base
 delete mode 100644 defaultenv-2/base/init/general
 delete mode 100644 defaultenv-2/base/init/hostname
 delete mode 100644 defaultenv-2/base/init/prompt

diff --git a/arch/arm/boards/crystalfontz-cfa10036/env/init/bootargs-base b/arch/arm/boards/crystalfontz-cfa10036/env/init/bootargs-base
deleted file mode 100644
index 4dda550..0000000
--- a/arch/arm/boards/crystalfontz-cfa10036/env/init/bootargs-base
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-if [ "$1" = menu ]; then
-	init-menu-add-entry "$0" "Base bootargs"
-	exit
-fi
-
-global.linux.bootargs.base="console=ttyAMA0,115200"
diff --git a/arch/arm/boards/crystalfontz-cfa10036/env/init/config-board b/arch/arm/boards/crystalfontz-cfa10036/env/init/config-board
new file mode 100644
index 0000000..b99866e
--- /dev/null
+++ b/arch/arm/boards/crystalfontz-cfa10036/env/init/config-board
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# board defaults, do not change in running system. Change /env/config
+# instead
+
+global.hostname=cfa10036
+global.linux.bootargs.base="console=ttyAMA0,115200"
diff --git a/arch/arm/boards/crystalfontz-cfa10036/env/init/hostname b/arch/arm/boards/crystalfontz-cfa10036/env/init/hostname
deleted file mode 100644
index 1dbe346..0000000
--- a/arch/arm/boards/crystalfontz-cfa10036/env/init/hostname
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-if [ "$1" = menu ]; then
-	init-menu-add-entry "$0" "hostname"
-	exit
-fi
-
-global.hostname=cfa10036
diff --git a/arch/arm/boards/freescale-mx51-pdk/env/init/bootargs-base b/arch/arm/boards/freescale-mx51-pdk/env/init/bootargs-base
deleted file mode 100644
index d869754..0000000
--- a/arch/arm/boards/freescale-mx51-pdk/env/init/bootargs-base
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-if [ "$1" = menu ]; then
-	init-menu-add-entry "$0" "Base bootargs"
-	exit
-fi
-
-global.linux.bootargs.base="console=ttymxc0,115200"
diff --git a/arch/arm/boards/freescale-mx51-pdk/env/init/config-board b/arch/arm/boards/freescale-mx51-pdk/env/init/config-board
new file mode 100644
index 0000000..cfc483e
--- /dev/null
+++ b/arch/arm/boards/freescale-mx51-pdk/env/init/config-board
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# board defaults, do not change in running system. Change /env/config
+# instead
+
+global.hostname=babbage
+global.linux.bootargs.base="console=ttymxc0,115200"
diff --git a/arch/arm/boards/freescale-mx51-pdk/env/init/hostname b/arch/arm/boards/freescale-mx51-pdk/env/init/hostname
deleted file mode 100644
index 4c78902..0000000
--- a/arch/arm/boards/freescale-mx51-pdk/env/init/hostname
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-if [ "$1" = menu ]; then
-	init-menu-add-entry "$0" "hostname"
-	exit
-fi
-
-global.hostname=babbage
diff --git a/arch/arm/boards/freescale-mx6-sabrelite/env/init/bootargs-base b/arch/arm/boards/freescale-mx6-sabrelite/env/init/bootargs-base
deleted file mode 100644
index 2c51feb..0000000
--- a/arch/arm/boards/freescale-mx6-sabrelite/env/init/bootargs-base
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-if [ "$1" = menu ]; then
-	init-menu-add-entry "$0" "Base bootargs"
-	exit
-fi
-
-global.linux.bootargs.base="console=ttymxc1,115200"
diff --git a/arch/arm/boards/freescale-mx6-sabrelite/env/init/config-board b/arch/arm/boards/freescale-mx6-sabrelite/env/init/config-board
new file mode 100644
index 0000000..e39e4b6
--- /dev/null
+++ b/arch/arm/boards/freescale-mx6-sabrelite/env/init/config-board
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# board defaults, do not change in running system. Change /env/config
+# instead
+
+global.hostname=SabreLite
+global.linux.bootargs.base="console=ttymxc1,115200"
diff --git a/arch/arm/boards/freescale-mx6-sabrelite/env/init/hostname b/arch/arm/boards/freescale-mx6-sabrelite/env/init/hostname
deleted file mode 100644
index db5b2b2..0000000
--- a/arch/arm/boards/freescale-mx6-sabrelite/env/init/hostname
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-if [ "$1" = menu ]; then
-	init-menu-add-entry "$0" "hostname"
-	exit
-fi
-
-global.hostname=SabreLite
diff --git a/arch/arm/boards/karo-tx53/env/init/bootargs-base b/arch/arm/boards/karo-tx53/env/init/bootargs-base
deleted file mode 100644
index d869754..0000000
--- a/arch/arm/boards/karo-tx53/env/init/bootargs-base
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-if [ "$1" = menu ]; then
-	init-menu-add-entry "$0" "Base bootargs"
-	exit
-fi
-
-global.linux.bootargs.base="console=ttymxc0,115200"
diff --git a/arch/arm/boards/karo-tx53/env/init/config-board b/arch/arm/boards/karo-tx53/env/init/config-board
new file mode 100644
index 0000000..3ebfac6
--- /dev/null
+++ b/arch/arm/boards/karo-tx53/env/init/config-board
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# board defaults, do not change in running system. Change /env/config
+# instead
+
+global.hostname=tx53
+global.linux.bootargs.base="console=ttymxc0,115200"
diff --git a/arch/arm/boards/karo-tx53/env/init/hostname b/arch/arm/boards/karo-tx53/env/init/hostname
deleted file mode 100644
index 2de9130..0000000
--- a/arch/arm/boards/karo-tx53/env/init/hostname
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-if [ "$1" = menu ]; then
-	init-menu-add-entry "$0" "hostname"
-	exit
-fi
-
-global.hostname=tx53
diff --git a/arch/arm/boards/pcm038/env/init/bootargs-base b/arch/arm/boards/pcm038/env/init/bootargs-base
deleted file mode 100644
index d869754..0000000
--- a/arch/arm/boards/pcm038/env/init/bootargs-base
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-if [ "$1" = menu ]; then
-	init-menu-add-entry "$0" "Base bootargs"
-	exit
-fi
-
-global.linux.bootargs.base="console=ttymxc0,115200"
diff --git a/arch/arm/boards/pcm038/env/init/config-board b/arch/arm/boards/pcm038/env/init/config-board
new file mode 100644
index 0000000..93fd41b
--- /dev/null
+++ b/arch/arm/boards/pcm038/env/init/config-board
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# board defaults, do not change in running system. Change /env/config
+# instead
+
+global.hostname=pcm038
+global.linux.bootargs.base="console=ttymxc0,115200"
diff --git a/arch/arm/boards/pcm038/env/init/hostname b/arch/arm/boards/pcm038/env/init/hostname
deleted file mode 100644
index 09c2f08..0000000
--- a/arch/arm/boards/pcm038/env/init/hostname
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-if [ "$1" = menu ]; then
-	init-menu-add-entry "$0" "hostname"
-	exit
-fi
-
-global.hostname=pcm038
diff --git a/arch/arm/boards/tqma53/env/init/bootargs-base b/arch/arm/boards/tqma53/env/init/bootargs-base
deleted file mode 100644
index d869754..0000000
--- a/arch/arm/boards/tqma53/env/init/bootargs-base
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-if [ "$1" = menu ]; then
-	init-menu-add-entry "$0" "Base bootargs"
-	exit
-fi
-
-global.linux.bootargs.base="console=ttymxc0,115200"
diff --git a/arch/arm/boards/tqma53/env/init/config-board b/arch/arm/boards/tqma53/env/init/config-board
new file mode 100644
index 0000000..4776438
--- /dev/null
+++ b/arch/arm/boards/tqma53/env/init/config-board
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# board defaults, do not change in running system. Change /env/config
+# instead
+
+global.hostname=tqma53
+global.linux.bootargs.base="console=ttymxc0,115200"
diff --git a/arch/arm/boards/tqma53/env/init/hostname b/arch/arm/boards/tqma53/env/init/hostname
deleted file mode 100644
index c56ac6a..0000000
--- a/arch/arm/boards/tqma53/env/init/hostname
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-if [ "$1" = menu ]; then
-	init-menu-add-entry "$0" "hostname"
-	exit
-fi
-
-global.hostname=tqma53
diff --git a/defaultenv-2/base/bin/init b/defaultenv-2/base/bin/init
index 8e8871d..bb4abcd 100644
--- a/defaultenv-2/base/bin/init
+++ b/defaultenv-2/base/bin/init
@@ -8,12 +8,18 @@ global autoboot_timeout=3
 global boot.default=net
 global allow_color=true
 global linux.bootargs.base
-#linux.bootargs.dyn.* will be clearer at the beginning of boot
+#linux.bootargs.dyn.* will be cleared at the beginning of boot
 global linux.bootargs.dyn.ip
 global linux.bootargs.dyn.root
 global editcmd=sedit
 
-/env/init/general
+/env/config
+
+if [ ${global.allow_color} = "true" ]; then
+        export PS1="\e[1;32mbarebox@\e[1;36m\h:\w\e[0m "
+else
+        export PS1="barebox@\h:\w "
+fi
 
 if [ -e /env/menu ]; then
 	echo -e -n "\nHit m for menu or any other key to stop autoboot: "
diff --git a/defaultenv-2/base/config b/defaultenv-2/base/config
new file mode 100644
index 0000000..189e5a6
--- /dev/null
+++ b/defaultenv-2/base/config
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+# change network settings in /env/network/eth0
+# change mtd partition settings and automountpoints in /env/init/*
+
+#global.hostname=
+
+# set to false if you do not want to have colors
+global.allow_color=true
+
+# user (used for network filenames)
+global.user=none
+
+# timeout in seconds before the default boot entry is started
+global.autoboot_timeout=3
+
+# default boot entry (one of /env/boot/*)
+global.boot.default=net
+
+# base bootargs
+#global.linux.bootargs.base="console=ttyS0,115200"
diff --git a/defaultenv-2/base/init/bootargs-base b/defaultenv-2/base/init/bootargs-base
deleted file mode 100644
index 8e588ad..0000000
--- a/defaultenv-2/base/init/bootargs-base
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-if [ "$1" = menu ]; then
-	init-menu-add-entry "$0" "Base bootargs"
-	exit
-fi
-
-global.linux.bootargs.base="console=ttyS0,115200"
diff --git a/defaultenv-2/base/init/general b/defaultenv-2/base/init/general
deleted file mode 100644
index 1de06ce..0000000
--- a/defaultenv-2/base/init/general
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-if [ "$1" = menu ]; then
-	init-menu-add-entry "$0" "general config settings"
-	exit
-fi
-
-# user (used for network filenames)
-global.user=none
-
-# timeout in seconds before the default boot entry is started
-global.autoboot_timeout=3
-
-# default boot entry (one of /env/boot/*)
-global.boot.default=net
diff --git a/defaultenv-2/base/init/hostname b/defaultenv-2/base/init/hostname
deleted file mode 100644
index 57a2c94..0000000
--- a/defaultenv-2/base/init/hostname
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-if [ "$1" = menu ]; then
-	init-menu-add-entry "$0" "hostname"
-	exit
-fi
-
-global.hostname=generic
diff --git a/defaultenv-2/base/init/prompt b/defaultenv-2/base/init/prompt
deleted file mode 100644
index 11dce9f..0000000
--- a/defaultenv-2/base/init/prompt
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-if [ ${global.allow_color} = "true" ]; then
-	export PS1="\e[1;32mbarebox@\e[1;36m\h:\w\e[0m "
-else
-	export PS1="barebox@\h:\w "
-fi
diff --git a/defaultenv-2/menu/menu/mainmenu b/defaultenv-2/menu/menu/mainmenu
index 5bd7027..c74cc9c 100644
--- a/defaultenv-2/menu/menu/mainmenu
+++ b/defaultenv-2/menu/menu/mainmenu
@@ -15,6 +15,7 @@ while true; do
 	boot-entries-collect
 
 	menu -e -a -R -m boot -c "$global.editcmd /env/network/eth0" -d "Network settings"
+	menu -e -a -R -m boot -c "$global.editcmd /env/config" -d "Config settings"
 	menu -e -a -m boot -c "boot-entries-edit" -d "Edit boot entries"
 	menu -e -a -m boot -c "init-entries-edit" -d "Edit init entries"
 	menu -e -a -R -m boot -c "saveenv || echo \"failed to save environment\" && sleep 2" -d "Save settings"
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      parent reply	other threads:[~2012-11-01 18:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-01 18:52 [PATCH] defenv-2: Make it simpler Sascha Hauer
2012-11-01 18:52 ` [PATCH 1/3] defenv-2: remove initrd boot script Sascha Hauer
2012-11-01 18:52 ` [PATCH 2/3] defenv-2: remove some helper scripts Sascha Hauer
2012-11-01 18:52 ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1351795968-2352-4-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox