summaryrefslogtreecommitdiffstats
path: root/commands
Commit message (Collapse)AuthorAgeFilesLines
* Implement bootloader spec support for bareboxSascha Hauer2013-10-141-23/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Bootloader Specification describes a way how kernels can be installed on devices and how they can be started by the bootloader. The bootloader spec is currently supported by (x86) gummiboot and by systemd which provides a kernel-install script. With the bootloader spec it's possible for the Operating system to install a new kernel without knowing about the bootloader and for the bootloader it's possible to discover and start Operating Systems on a media without being configured. For more details about the spec see: http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec/ This patch adds barebox support for the spec. It enhances the 'boot' command so that not only boot script names can be given, but also devices containing bootloader spec entries. With this it's possible to call the 'boot' command like: 'boot sd emmc net'. It would then first look for bootloader spec entries on the (removable) sd card, then, is nothing is found, on the internal emmc and if still unsuccessful would call the 'net' bootscript. The bootloader Spec currently doesn't specify which entry should be default if multiple entries are found on a single device. Therefore barebox currently has two extensions of the spec. The $BOOT diretory can contain a file named 'default'. If present, the content of the file is treated as a filename under $BOOT/loader/entries/ which is used as default. Similarly if a file named 'once' is present, the entry is started once and the file is removed afterwards. This is useful for testing if a newly installed kernel works before making it the default. As on ARM and other Architectures a devicetree has to be specified for the kernel, the 'devicetree' property is used to specify a devicetree. Like 'kernel' and 'initrd' this also contains a pth relative to $BOOT. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mount'Sascha Hauer2013-10-071-10/+56
|\
| * mount: use standard mountpath if path is ommittedSascha Hauer2013-09-301-1/+26
| | | | | | | | | | | | | | With this a mount <devname> will mount the device to /mnt/<devname>. This directory is created automatically if it doesn't exist already. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mount: Allow to mount all available partitionsSascha Hauer2013-09-301-1/+7
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mount: implement -v option to print available filesystemsSascha Hauer2013-09-291-10/+25
| | | | | | | | | | | | | | It's useful to know which filesystems a barebox binary supports. Add a -v option to the mount command to find it out. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mount: print backingstore instead of dev_nameSascha Hauer2013-09-291-1/+1
| | | | | | | | | | | | | | When printing the devices on which a path is mounted the backingstore is the interesting thing, not dev_name. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2013-10-074-5/+194
|\ \ | | | | | | | | | | | | Conflicts: commands/Makefile
| * | move devinfo command to its own fileSascha Hauer2013-09-272-0/+159
| | | | | | | | | | | | | | | | | | Just like nearly all other commands are in individual files. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | command: crc: add -V option to check the crc store in a fileJean-Christophe PLAGNIOL-VILLARD2013-09-201-1/+19
| | | | | | | | | | | | | | | | | | | | | the format is %08x Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | command: ubiattach: add option to pass VID offsetJean-Christophe PLAGNIOL-VILLARD2013-09-181-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | use the same option as linux -O as example due to a bug in already deployed kernel we must for the VID offset at 512 even it should be at 256 Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/login'Sascha Hauer2013-10-072-6/+26
|\ \ \ | | | | | | | | | | | | | | | | Conflicts: include/console.h
| * | | login/passwd: add default password supportJean-Christophe PLAGNIOL-VILLARD2013-09-191-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | even if the env is broken you will have a password Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | login: disable input console if password wrongJean-Christophe PLAGNIOL-VILLARD2013-09-191-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | so we guarantee that barebox is secured again user interaction Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | login: add globalvar timeout supportJean-Christophe PLAGNIOL-VILLARD2013-09-181-1/+17
| |/ / | | | | | | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/console'Sascha Hauer2013-10-072-43/+3
|\ \ \
| * | | console: factorise function to get the first enabled consoleJean-Christophe PLAGNIOL-VILLARD2013-10-062-43/+3
| |/ / | | | | | | | | | | | | | | | | | | rename it to console_get_first_active Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/bootm'Sascha Hauer2013-10-075-73/+289
|\ \ \ | |_|/ |/| |
| * | bootm: Replace getenv_loadaddr with getenv_ulSascha Hauer2013-10-072-4/+4
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | loads: use getenv_bool for 'loads_echo'Sascha Hauer2013-09-301-6/+1
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | defenv-2: replace boot script with commandSascha Hauer2013-09-303-0/+270
| | | | | | | | | | | | | | | | | | | | | | | | This replaces the 'boot' script in the defaultenv-2 with a command with the same behaviour. A command gives more flexibility for future externsions Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | bootm: Add dryrun supportSascha Hauer2013-09-241-3/+12
| | | | | | | | | | | | | | | | | | This adds support for checking the bootm command without actually booting. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | bootm: separate bootm input data and internal dataSascha Hauer2013-09-241-30/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to use struct image_data as the central data structure for bootm and also as the input data structure. This makes it unclear which of the fields are actually input data. This patch creates a struct bootm_data which is exclusively used for input data to make usage clearer. Also it moves the dispatching of multifile uImage pathnames to the core bootm code so that the core code gets more flexible and the command code simpler. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | bootm: move globalvars from command to commonSascha Hauer2013-09-241-14/+0
| | | | | | | | | | | | | | | | | | | | | The globalvars should be available even if the bootm command is not directly present. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | bootm: move getenv_loadaddr from command to commonSascha Hauer2013-09-241-13/+0
| | | | | | | | | | | | | | | | | | | | | getenv_loadaddr may be used by other code, so move it from command/ to common/ Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | bootm: remove unused defineSascha Hauer2013-09-241-5/+0
| |/ | | | | | | | | | | OFTREE_SIZE_INCREASE isn't used anymore. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / detect command: Add missing help text for -a optionSascha Hauer2013-09-271-0/+1
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/boardinfo'Sascha Hauer2013-09-054-26/+10
|\ | | | | | | | | | | | | Conflicts: arch/mips/boards/qemu-malta/init.c commands/bootm.c drivers/of/base.c
| * remove remaining references of CONFIG_BOARDINFOSascha Hauer2013-08-162-4/+4
| | | | | | | | | | | | | | | | | | | | | | With this all code uses barebox_get_model() and no longer a compile time generated string. Also this renames barebox_boardinfo() to barebox_get_model() since we are going to add the corresponding _set_ function and 'model' corresponds to the devicetree notion. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * globalvar: Allow to set initial valueSascha Hauer2013-08-162-19/+4
| | | | | | | | | | | | | | Calling globalvar_add_simple() and setting a value is more than common. Add a parameter for the initial value. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2013-09-051-1/+21
|\ \
| * | bootm: add global bootm.{image/initrd}.loadaddr supportJean-Christophe PLAGNIOL-VILLARD2013-09-021-1/+21
| | | | | | | | | | | | | | | | | | | | | To be able to pass the loadaddr of the image and the initrd. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/of'Sascha Hauer2013-09-052-4/+34
|\ \ \
| * | | oftree command: Allow to specify node by aliasSascha Hauer2013-08-141-1/+1
| | | | | | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | of_property command: allow to set phandlesSascha Hauer2013-08-141-2/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this properties with phandles can be created. A phandle is created when cells are parsed (in '<' '>') and a cell does not begin with a digit. The phandles can be specified either by alias or by full path. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | of_property command: allow to specify a node by aliasSascha Hauer2013-08-141-1/+1
| | |/ | |/| | | | | | | | | | | | | | | | With this not only a full path can be used to specify a node, but also an alias. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / | commands: Fix memtest return valueChristian Hemp2013-09-021-1/+1
|/ / | | | | | | | | Signed-off-by: Christian Hemp <c.hemp@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / Cleanup Kconfig filesAlexander Shiyan2013-08-121-8/+8
|/ | | | | | | | | This patch provides a global cleanup barebox Kconfig files. This includes replacing spaces to tabs, formatting in accordance format. No functional changes. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/of'Sascha Hauer2013-08-051-3/+8
|\ | | | | | | | | | | Conflicts: arch/arm/boards/freescale-mx53-loco/board.c drivers/of/Makefile
| * devfs: let devfs_add_partition return the new partitionSascha Hauer2013-07-151-3/+8
| | | | | | | | | | | | Useful for unregistering later or for adding addional flags. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mtd'Sascha Hauer2013-08-052-7/+38
|\ \
| * | UBI: reimport UBI from Linux v3.10Sascha Hauer2013-07-252-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a fresh UBI import from Linux v3.10 This is done mainly to get fastmap support. This was tested with the i.MX nand driver, the MXS nand driver and on CFI NOR flash. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ubiattach command: Properly check return valuesSascha Hauer2013-07-231-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | - print error when ioctl fails, not a combined message when one of ioctl or ubi_attach_mtd_dev failed. - ubi_attach_mtd_dev() returns the ubi number for success, not 0, so check for ret < 0 to detect errors. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | UBI: Add ubidetach commandSascha Hauer2013-07-231-0/+26
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/misc'Sascha Hauer2013-08-051-1/+1
|\ \ \
| * | | commands: nandtest: Fix incorrect size for memset in do_nandtestAlexander Shiyan2013-07-091-1/+1
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/marvell'Sascha Hauer2013-08-052-3/+3
|\ \ \ \ | |_|/ / |/| | / | | |/ | |/| | | | Conflicts: arch/arm/boards/Makefile arch/arm/dts/Makefile
| * | OF: base: rename of_free to of_delete_nodeSebastian Hesselbarth2013-07-052-3/+3
| |/ | | | | | | | | | | | | | | | | of_free is misleading about the actual purpose of the function. There is already a of_create_node counterpart, so rename of_free to of_create_node and update all users accordingly. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / commands: spi: Fix spi read procedureAlexander Shiyan2013-07-151-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Buffer for RX is set incorrectly. barebox@Phytec phyCORE-i.MX27:/ spi -r 128 -v device config bus_num = 0 max_speed_hz = 1000000 chip_select = 0 mode = 0x0 bits_per_word = 8 wrote 0 bytes 00000000: read 128 bytes 00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00000040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00000050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ unable to handle paging request at address 0x4dffd3d0 pc : [<a7f05ec4>] lr : [<a7f05ebc>] sp : a7fff890 ip : a7fff860 fp : a7f68820 r10: a6ffe9bc r9 : 00000000 r8 : 00000001 r7 : a6ffe9ec r6 : a6f00000 r5 : a6ffe9ec r4 : a6ffe9e4 r3 : a6ffe9e4 r2 : a6ffe9e5 r1 : a6ffe9e4 r0 : 4dffd3cc Flags: nZCv IRQs off FIQs off Mode SVC_32 ... Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next-manual/oftree-linux-sync'Sascha Hauer2013-07-023-20/+5
|\
| * OF: base: sync of_find_node_by_path with linux OF APISebastian Hesselbarth2013-06-203-19/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Barebox of_find_node_by_path requires a node to be passed as start node to start searching. Linux OF API does not pass this node and no current user of it in barebox is passing anything else than the root node. Therefore, we rename current function to of_find_node_by_path_from and introduce a Linux OF API compatible of_find_node_by_path that always passes the current root_node. Also, all current users of that function are updated to reflect the API change. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>