defaultenv boot updates
cover defaultenv boot updates
HI,
this following patch series make boot script more configurable
The following changes since commit 8dfebf96d79aa8e37c2299af8c02a84d30f5e9e7:
Merge branch 'nand-pu' into next (2011-04-06 09:21:56 +0200)
are available in the git repository at:
game ..BRANCH.NOT.VERIFIED..
Jean-Christophe PLAGNIOL-VILLARD (4):
defaultenv/boot: switch to getopt
defaultenv/boot: add -k and -t option to specify the kernel location and image type defaultenv/boot: add -r and -T option to select rootfs location and type defaultenv/boot: add -i option to select the ip mode
defaultenv/bin/boot | 52 ++++++++++++++++++++++++++++++++++++++++++--- defaultenv/bin/boot_help | 36 +++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 4 deletions(-) create mode 100644 defaultenv/bin/boot_help
Best Regards,
J.
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
PATCH 1/4 defaultenv/boot: switch to getopt
this will allow to add more option to overwrite the boot type as today can only choose mode {nfs, tftp, nand, nor} and can not specify where is each component the kernel, the rootfs and the rootfs type
--- defaultenv/bin/boot | 20 ++++++++++++++++---- defaultenv/bin/boot_help | 29 +++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 defaultenv/bin/boot_help
defaultenv/bin/boot +16 -4
@@ -2,16 +2,28 @@ . /env/config -if [ x$1 = xnand ]; then +opt_mode="" + +while getopt "hm:" Option +do +if [ ${Option} = m ]; then + opt_mode=${OPTARG} +else + . /env/bin/boot_help + exit 0 +fi +done + +if [ x${opt_mode} = xnand ]; then rootfs_loc=nand kernel_loc=nand -elif [ x$1 = xnor ]; then +elif [ x${opt_mode} = xnor ]; then rootfs_loc=nor kernel_loc=nor -elif [ x$1 = xnfs ]; then +elif [ x${opt_mode} = xnfs ]; then rootfs_loc=net kernel_loc=nfs -elif [ x$1 = xtftp ]; then +elif [ x${opt_mode} = xtftp ]; then rootfs_loc=net kernel_loc=tftp fi
defaultenv/bin/boot_help new file +29 -0
@@ -0,0 +1,29 @@ +#!/bin/sh + +echo "usage: boot [-m <mode>]" +echo "boot." +echo "" +echo "options" +echo " -m boot mode will select kernel_loc and rootfs_loc" +echo " mode kernel_loc rootfs_loc" +echo " nfs nfs nfs" +echo " tftp tftp nfs" +echo " nor nor nor" +echo " nand nand nand" +echo "" +echo "default is" +echo -n "kernel_loc " +echo ${kernel_loc} +echo -n "kernelimage_type " +echo ${kernelimage_type} +echo -n "rootfs_loc " +echo ${rootfs_loc} +echo -n "rootfs_type " +echo ${rootfs_type} +echo -n "ip " +if [ x${ip} = x ] +then + echo "static" +else + echo ${ip} +fi
Signature · 7 lines
1.7.4.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 2/4 defaultenv/boot: add -k and -t option to specify the kernel location and image type
In reply to Jean-Christophe PLAGNIOL-VILLARD--- defaultenv/bin/boot | 17 ++++++++++++++++- defaultenv/bin/boot_help | 6 +++++- 2 files changed, 21 insertions(+), 2 deletions(-)
defaultenv/bin/boot +16 -1
@@ -3,11 +3,16 @@ . /env/config opt_mode="" +opt_kernel_loc="" -while getopt "hm:" Option +while getopt "hm:k:t:" Option do if [ ${Option} = m ]; then opt_mode=${OPTARG} +elif [ ${Option} = k ]; then + opt_kernel_loc=${OPTARG} +elif [ ${Option} = t ]; then + kernelimage_type=${OPTARG} else . /env/bin/boot_help exit 0
@@ -28,6 +33,16 @@ elif [ x${opt_mode} = xtftp ]; then kernel_loc=tftp fi +if [ x${opt_kernel_loc} = xnand ]; then + kernel_loc=nand +elif [ x${opt_kernel_loc} = xnor ]; then + kernel_loc=nor +elif [ x${opt_kernel_loc} = xnfs ]; then + kernel_loc=nfs +elif [ x${opt_kernel_loc} = xtftp ]; then + kernel_loc=tftp +fi + if [ x$ip = xdhcp ]; then bootargs="$bootargs ip=dhcp" elif [ x$ip = xnone ]; then
defaultenv/bin/boot_help +5 -1
@@ -1,6 +1,6 @@ #!/bin/sh -echo "usage: boot [-m <mode>]" +echo "usage: boot [-m <mode>] [-k <kernel location>] [-t <kernel image type]" echo "boot." echo "" echo "options"
@@ -11,6 +11,10 @@ echo " tftp tftp nfs" echo " nor nor nor" echo " nand nand nand" echo "" +echo " -k kernel location tftp, nfs, nand, nor" +echo " -t kernel image type uimage, zimage, raw or raw_lzo" +echo "" +echo "" echo "default is" echo -n "kernel_loc " echo ${kernel_loc}
Signature · 7 lines
1.7.4.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 3/4 defaultenv/boot: add -r and -T option to select rootfs location and type
In reply to Jean-Christophe PLAGNIOL-VILLARD--- defaultenv/bin/boot | 17 ++++++++++++++++- defaultenv/bin/boot_help | 4 +++- 2 files changed, 19 insertions(+), 2 deletions(-)
defaultenv/bin/boot +16 -1
@@ -4,8 +4,9 @@ opt_mode="" opt_kernel_loc="" +opt_rootfs_loc="" -while getopt "hm:k:t:" Option +while getopt "hm:k:t:r:T:" Option do if [ ${Option} = m ]; then opt_mode=${OPTARG}
@@ -13,6 +14,10 @@ elif [ ${Option} = k ]; then opt_kernel_loc=${OPTARG} elif [ ${Option} = t ]; then kernelimage_type=${OPTARG} +elif [ ${Option} = r ]; then + opt_rootfs_loc=${OPTARG} +elif [ ${Option} = T ]; then + rootfs_type=${OPTARG} else . /env/bin/boot_help exit 0
@@ -43,6 +48,16 @@ elif [ x${opt_kernel_loc} = xtftp ]; then kernel_loc=tftp fi +if [ x${opt_rootfs_loc} = xnand ]; then + rootfs_loc=nand +elif [ x${opt_rootfs_loc} = xnor ]; then + rootfs_loc=nor +elif [ x${opt_rootfs_loc} = xnfs ]; then + rootfs_loc=nfs +elif [ x${opt_rootfs_loc} = xinitrd ]; then + rootfs_loc=initrd +fi + if [ x$ip = xdhcp ]; then bootargs="$bootargs ip=dhcp" elif [ x$ip = xnone ]; then
defaultenv/bin/boot_help +3 -1
@@ -1,6 +1,6 @@ #!/bin/sh -echo "usage: boot [-m <mode>] [-k <kernel location>] [-t <kernel image type]" +echo "usage: boot [-m <mode>] [-k <kernel location>] [-t <kernel image type] [-r <rootfs location>] [-T <rootfs type>]" echo "boot." echo "" echo "options"
@@ -13,6 +13,8 @@ echo " nand nand nand" echo "" echo " -k kernel location tftp, nfs, nand, nor" echo " -t kernel image type uimage, zimage, raw or raw_lzo" +echo " -r rootfs location nfs, nand, nor, initrd" +echo " -T rootfs type ubi, jffs2, ext2, etc..." echo "" echo "" echo "default is"
Signature · 7 lines
1.7.4.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 4/4 defaultenv/boot: add -i option to select the ip mode
In reply to Jean-Christophe PLAGNIOL-VILLARD--- defaultenv/bin/boot | 4 +++- defaultenv/bin/boot_help | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-)
defaultenv/bin/boot +3 -1
@@ -6,7 +6,7 @@ opt_mode="" opt_kernel_loc="" opt_rootfs_loc="" -while getopt "hm:k:t:r:T:" Option +while getopt "hm:k:t:r:T:i:" Option do if [ ${Option} = m ]; then opt_mode=${OPTARG}
@@ -18,6 +18,8 @@ elif [ ${Option} = r ]; then opt_rootfs_loc=${OPTARG} elif [ ${Option} = T ]; then rootfs_type=${OPTARG} +elif [ ${Option} = i ]; then + ip=${OPTARG} else . /env/bin/boot_help exit 0
defaultenv/bin/boot_help +2 -1
@@ -1,6 +1,6 @@ #!/bin/sh -echo "usage: boot [-m <mode>] [-k <kernel location>] [-t <kernel image type] [-r <rootfs location>] [-T <rootfs type>]" +echo "usage: boot [-m <mode>] [-k <kernel location>] [-t <kernel image type] [-r <rootfs location>] [-T <rootfs type>] [-i <ip mode>]" echo "boot." echo "" echo "options"
@@ -15,6 +15,7 @@ echo " -k kernel location tftp, nfs, nand, nor" echo " -t kernel image type uimage, zimage, raw or raw_lzo" echo " -r rootfs location nfs, nand, nor, initrd" echo " -T rootfs type ubi, jffs2, ext2, etc..." +echo " -i ip mode dhcp, none, static" echo "" echo "" echo "default is"
Signature · 7 lines
1.7.4.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Hi,
Quoted 5 lines · Jean-Christophe PLAGNIOL-VILLARD
HI,
this following patch series make boot script more configurable
I'm getting the impression that we stretch the capabilities of our shell way beyond its limits. We started with booting from nand/nor/net and added mmc cards later. Still this is not flexible enough to handle images for example on a fat filesystem, not to mention different kernels on one medium.
I was thinking about this topic a bit, and my idea currently is to add a command with which we can build a list of images. An image can be a kernel or a filesystem image. Each image can be associated with a bootarg snippet and a command to execute to access this image.
Altogether this could look like this:
linux [OPTIONS]
-a <name> add a new image
-f <file> path to image
-b <bootarg> kernel bootargs to append for this image
-z This is a zImage -u This is a uImage -r <adr> This is a raw kernel image to be started at address <adr> -l The image is lzo compressed -i Show currently registered images -d delete all registered images
example:
barebox@Phytec phyCORE pcm049:/ linux -a kernel.nand -f /dev/nand0.kernel.bb -z
barebox@Phytec phyCORE pcm049:/ linux -a kernel.mmc -f /dev/disk0.1 -c "mci0.probe=1" -r 0x80008000 -l barebox@Phytec phyCORE pcm049:/ linux -a kernel.net -f /tftp/zImage-pcm038 -c /env/bin/netinit -z barebox@Phytec phyCORE pcm049:/ linux -a root.nand -b "root=ubi0:root ubi.mtd=7 rootfstype=ubifs" -f /dev/nand0.root.bb barebox@Phytec phyCORE pcm049:/ linux -a root.nfs -b "root=/dev/nfs nfsroot=$nfsroot,v3,tcp" barebox@Phytec phyCORE pcm049:/ linux -a root.net.ext2 -f /tftp/root-pcm038.ext2 -c /env/bin/netinit barebox@Phytec phyCORE pcm049:/ linux -i
kernel.nand (zImage)
file: /dev/nand0.kernel.bb
kernel.mmc (raw@80008000, lzo)
file: /dev/disk0.1
command: mci0.probe=1
kernel.net (zImage)
file: /tftp/zImage-pcm038
command: /env/bin/netinitroot.nand
file: /dev/nand0.root.bb
bootarg: root=ubi0:root ubi.mtd=7 rootfstype=ubifs
root.nfs
bootarg: root=/dev/nfs nfsroot=192.168.23.2:/home/sha/nfsroot/pcm049,v3,tcp
root.net.ext2
file: /tftp/root-pcm038.ext2
command: /env/bin/netinitbarebox@Phytec phyCORE pcm049:/
Then we can play tricks like:
boot kernel from nand with nfsroot:
barebox@Phytec phyCORE pcm049:/ boot kernel.nand root.nfs
Update kernel from network to nand:
barebox@Phytec phyCORE pcm049:/ update kernel.net kernel.nand
Most probably there are problems I haven't thought about yet, but what do think about it in general?
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 15 lines · Sascha Hauer
Hi,
Quoted 5 lines · Jean-Christophe PLAGNIOL-VILLARD
HI,
this following patch series make boot script more configurable
I'm getting the impression that we stretch the capabilities of our shell way beyond its limits. We started with booting from nand/nor/net and added mmc cards later. Still this is not flexible enough to handle images for example on a fat filesystem, not to mention different kernels on one medium.
Quoted 5 lines
I was thinking about this topic a bit, and my idea currently is to add a command with which we can build a list of images. An image can be a kernel or a filesystem image. Each image can be associated with a bootarg snippet and a command to execute to access this image.
I like the idea
as we can be multiple user of the same harware so it will simplify it
Quoted 11 lines
Altogether this could look like this:
linux [OPTIONS]
-a <name> add a new image
-f <file> path to image
-b <bootarg> kernel bootargs to append for this image-z This is a zImage -u This is a uImage -r <adr> This is a raw kernel image to be started at address <adr> -l The image is lzo compressed
-C <compression>
Quoted 1 line
-i Show currently registered images
-l for list
Quoted 1 line
-d delete all registered images
-d too delete all :(
I think -d should delete only one
-D for all
Quoted 6 lines
example:
barebox@Phytec phyCORE pcm049:/ linux -a kernel.nand -f
/dev/nand0.kernel.bb-z barebox@Phytec phyCORE pcm049:/ linux -a kernel.mmc -f/dev/disk0.1-c "mci0.probe=1" -r0x80008000-l
what is this -c ?
Quoted 28 lines
barebox@Phytec phyCORE pcm049:/ linux -a kernel.net -f /tftp/zImage-pcm038 -c /env/bin/netinit -z barebox@Phytec phyCORE pcm049:/ linux -a root.nand -b "root=ubi0:root ubi.mtd=7 rootfstype=ubifs" -f
/dev/nand0.root.bbbarebox@Phytec phyCORE pcm049:/ linux -a root.nfs -b "root=/dev/nfs nfsroot=$nfsroot,v3,tcp" barebox@Phytec phyCORE pcm049:/ linux -a root.net.ext2 -f /tftp/root-pcm038.ext2 -c /env/bin/netinit barebox@Phytec phyCORE pcm049:/ linux -i
kernel.nand (zImage)
file:/dev/nand0.kernel.bb
kernel.mmc (raw@80008000, lzo)file: /dev/disk0.1 command: mci0.probe=1 kernel.net (zImage) file: /tftp/zImage-pcm038 command: /env/bin/netinitroot.nand
file:/dev/nand0.root.bb
bootarg: root=ubi0:root ubi.mtd=7 rootfstype=ubifs
root.nfsbootarg: root=/dev/nfs nfsroot=192.168.23.2:/home/sha/nfsroot/pcm049,v3,tcp root.net.ext2 file: /tftp/root-pcm038.ext2 command: /env/bin/netinitbarebox@Phytec phyCORE pcm049:/
Then we can play tricks like:
boot kernel from nand with nfsroot:
Quoted 8 lines
barebox@Phytec phyCORE pcm049:/ boot kernel.nand root.nfs
Update kernel from network to nand:
barebox@Phytec phyCORE pcm049:/ update kernel.net kernel.nand
Most probably there are problems I haven't thought about yet, but what do think about it in general?
I like the idea
but we should use the menu to manage it?
Best Regards,
J.
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Hi J,
Quoted 36 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 15 lines · Sascha Hauer
Hi,
Quoted 5 lines · Jean-Christophe PLAGNIOL-VILLARD
HI,
this following patch series make boot script more configurable
I'm getting the impression that we stretch the capabilities of our shell way beyond its limits. We started with booting from nand/nor/net and added mmc cards later. Still this is not flexible enough to handle images for example on a fat filesystem, not to mention different kernels on one medium.
Quoted 5 lines
I was thinking about this topic a bit, and my idea currently is to add a command with which we can build a list of images. An image can be a kernel or a filesystem image. Each image can be associated with a bootarg snippet and a command to execute to access this image.
I like the idea
as we can be multiple user of the same harware so it will simplify it
Quoted 11 lines
Altogether this could look like this:
linux [OPTIONS]
-a <name> add a new image
-f <file> path to image
-b <bootarg> kernel bootargs to append for this image-z This is a zImage -u This is a uImage -r <adr> This is a raw kernel image to be started at address <adr> -l The image is lzo compressed
Quoted 8 lines
-C <compression>
Quoted 1 line
-i Show currently registered images
-l for list
Quoted 1 line
-d delete all registered images
-d too delete all :(
I think -d should delete only one
-D for all
Ok.
Quoted 7 lines
Quoted 6 lines
example:
barebox@Phytec phyCORE pcm049:/ linux -a kernel.nand -f
/dev/nand0.kernel.bb-z barebox@Phytec phyCORE pcm049:/ linux -a kernel.mmc -f/dev/disk0.1-c "mci0.probe=1" -r0x80008000-lwhat is this -c ?
-c specifies a command to be executed when this file is to be accessed. If you have network on a USB ethernet dongle for example, you want to delay the probing until it is really used. So you could provide a script here which calls "usb; dhcp" or something like that.
For a fat filesystem on a mmc card it could be
"mci0.probe=1; mkdir /fat; mount /dev/disk0.1 fat /fat"
Quoted 3 lines
I like the idea
but we should use the menu to manage it?
I think it should always work without the menu, but of course it's nice to integrate it into the menu also.
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
HI,
until this new way will be available can we have those patch integrated?
Best Regards,
J.
Quoted 66 lines · Sascha Hauer
Hi J,
Quoted 36 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 15 lines · Sascha Hauer
Hi,
Quoted 5 lines · Jean-Christophe PLAGNIOL-VILLARD
HI,
this following patch series make boot script more configurable
I'm getting the impression that we stretch the capabilities of our shell way beyond its limits. We started with booting from nand/nor/net and added mmc cards later. Still this is not flexible enough to handle images for example on a fat filesystem, not to mention different kernels on one medium.
Quoted 5 lines
I was thinking about this topic a bit, and my idea currently is to add a command with which we can build a list of images. An image can be a kernel or a filesystem image. Each image can be associated with a bootarg snippet and a command to execute to access this image.
I like the idea
as we can be multiple user of the same harware so it will simplify it
Quoted 11 lines
Altogether this could look like this:
linux [OPTIONS]
-a <name> add a new image
-f <file> path to image
-b <bootarg> kernel bootargs to append for this image-z This is a zImage -u This is a uImage -r <adr> This is a raw kernel image to be started at address <adr> -l The image is lzo compressedQuoted 8 lines
-C <compression>
Quoted 1 line
-i Show currently registered images
-l for list
Quoted 1 line
-d delete all registered images
-d too delete all :(
I think -d should delete only one
-D for allOk.
Quoted 7 lines
Quoted 6 lines
example:
barebox@Phytec phyCORE pcm049:/ linux -a kernel.nand -f
/dev/nand0.kernel.bb-z barebox@Phytec phyCORE pcm049:/ linux -a kernel.mmc -f/dev/disk0.1-c "mci0.probe=1" -r0x80008000-lwhat is this -c ?
-c specifies a command to be executed when this file is to be accessed. If you have network on a USB ethernet dongle for example, you want to delay the probing until it is really used. So you could provide a script here which calls "usb; dhcp" or something like that.
For a fat filesystem on a mmc card it could be"mci0.probe=1; mkdir /fat; mount
/dev/disk0.1fat /fat"
Quoted 14 lines
Quoted 3 lines
I like the idea
but we should use the menu to manage it?
I think it should always work without the menu, but of course it's nice to integrate it into the menu also.
Sascha
Signature · 4 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox