aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Enable setting xen,passthroughAyan Kumar Halder2021-11-102-0/+9
| | | | | | | | | | Add an option 'XEN_PASSTHROUGH_PATHS' to the imagebuilder config file. It takes a list of device paths (separated by spaces) which needs to be marked with xen,passthrough. Signed-off-by: Ayan Kumar Halder <ayankuma@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
* Moved the default assignment of domU bootargsAyan Kumar Halder2021-11-091-4/+4
| | | | | | | | | | | The default assignment of domU bootargs has been moved from add_device_tree_kernel() to xen_config(). This is done to mantain consistency with other DomU defaults. Reported-by: Brian Woods <brian.woods@xilinx.com> Signed-off-by: Ayan Kumar Halder <ayankuma@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
* Enable the user to override the bootargs for domUAyan Kumar Halder2021-11-052-5/+11
| | | | | | | | | | | | | | | | | | | | | The user can specify the bootargs for domU in the config file as follows:- DOMU_CMD[x]="<cmd line params>" As an example, DOMU_CMD[0]="console=ttyPS0 earlycon console=ttyPS0,115200 console=ttyAMA0 clk_ignore_unused rdinit=/sbin/init root=/dev/ram0 init=/bin/sh" If the user does not specify this, then the default command line param is:- "console=ttyAMA0" Also, updated the README.md. Signed-off-by: Ayan Kumar Halder <ayankuma@xilinx.com> [stefano: improve README] Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
* Add *.cpio to the list of know rootfs typesAyan Kumar Halder2021-10-281-6/+12
| | | | | | | | | | | Yocto generates *.cpio images. Thus, it can be a valid type of rootfs image. Also, when an invalid rootfs image is detected, the script should exit immediately Signed-off-by: Ayan Kumar Halder <ayankuma@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
* Add an option to specify the alignment for the imageAyan Kumar Halder2021-10-182-2/+32
| | | | | | | | | | "petalinux-boot --qemu" when used with a sd image, expects the image to be of size which is power of 2. Thus, one needs to provide an option to disk_image to create images aligned to the next power of two. Signed-off-by: Ayan Kumar Halder <ayankuma@xilinx.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
* Change Xen load order to enable Secure BootBrian Woods2021-09-221-5/+7
| | | | | | | | | | Secure boot on uboot expects the last PE image loaded be the signed image used. Simply move Xen to the bottom of the load order (other than device trees and bitstreams) and it enables Xen to boot. Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
* Clean up CLI argument override sectionBrian Woods2021-09-101-28/+14
| | | | | | Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
* Add support for loading bitstreamsBrian Woods2021-09-103-0/+49
| | | | | | Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
* Add baremetal Linux supportBrian Woods2021-09-102-108/+243
| | | | | | | | | | Make it possible to use imagebuilder with baremetal Linux. This allows baremetal Linux to be booted in the various ways Xen is now (individual files with a script, fit with a script and fit via a config). Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
* Restructure uboot-script-gen for Linux supportBrian Woods2021-09-031-273/+285
| | | | | | | | | For later add Linux support, restructure the code so it's easier to add various other OSs configurartions. Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
* Add FIT signing options to configBrian Woods2021-09-032-3/+21
| | | | | | | | Also add [-f] to the help message as it was missing. Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
* Add support for setting LOAD_CMD in the configBrian Woods2021-09-032-8/+24
| | | | | | | | | | Reducing what's needed in the CLI arguments to a minimum to streamline usage. The current behavior does not change and setting it on the CLI arguments will overwrite what's in the config file. Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
* Add support for EFI in configBrian Woods2021-09-032-2/+12
| | | | | | | | | Make it so that EFI enablement can be configured in the config file for uboot-script gen. Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
* Change fit behavior for uboot-script-genBrian Woods2021-09-032-48/+58
| | | | | | | | | Add support for adding a field in the config file and add support in uboot-script-gen for it. Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
* Copy DT_OVERLAY to boot partitionVíctor Mayoral Vilches2021-09-031-1/+18
| | | | | | | | | | Copy the device tree overlays to the boot partition so that they can be located and applied directly while booting. Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com> Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
* Add support for DOM0_RAMDISKVíctor Mayoral Vilches2021-09-031-0/+9
| | | | | | | Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com> Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
* Allow to generate non-Xen imagesVíctor Mayoral Vilches2021-09-031-5/+17
| | | | | | | | | | | This commit introduces several changes that allow the use of disk_image for the generation of non-Xen (e.g. plain vanilla kernel-based) raw images. Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com> Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
* Disable DomUs in disk_image if DOMU_NOBOOT is not setVictor Mayoral Vilches2021-09-031-25/+28
| | | | | | | Signed-off-by: Victor Mayoral Vilches <v.mayoralv@gmail.com> Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
* Add support for including files in first partitionVictor Mayoral Vilches2021-09-032-0/+37
| | | | | | | | | | | Add NUM_BOOT_AUX_FILE and BOOT_AUX_FILE[n] so that the user can add a number of files to the first partition with disk_image. This is useful for firmware files etc. Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com> Signed-off-by: Brian Woods <brian.woods@gmail.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
* Fix error in uboot-script-gen help messageBrian Woods2021-09-031-2/+2
| | | | | | Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
* Fix delimiters for dt_setBrian Woods2021-09-031-15/+28
| | | | | | | | | There was a problem with delimiters and how it worked for both the uboot scripts and the edited device trees. Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
* Add support for EFI in U-boot via bootefiBrian Woods2021-07-192-5/+16
| | | | | | | | | Also add "multiboot,module" compatible string for dom0 kernel and ramdisk, so that Xen can detect it and skip loading the xen.cfg file. Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
* Add support for device tree overlaysBrian Woods2021-07-192-1/+59
| | | | | | | | | | | | Device tree overlaps support in u-boot means that adding overlay support at boot time is easy. Simply loading the files via tftp/scsi/fit etc and then applying the overlays before the normal imagebuilder fdt edits at boot time allows for applying overlays without changing the device tree files. Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
* Add FIT signature supportBrian Woods2021-07-192-32/+65
| | | | | | | | Add support for signing FIT images. Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
* Add FIT support with scriptBrian Woods2021-07-192-16/+64
| | | | | | | | | | | | Add a "fit" option that uses a script rather than a standard FIT format. This allows traditional imagerbuilder script support to be used with FIT images. Dom0less and everything else works and is free of the limitations that the standard FIT format of using configs has. Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Tested-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
* Add support for creating a standard fit imageBrian Woods2021-07-192-6/+185
| | | | | | | | | | This allows the creation of a standard fit image without the use of a script. This also means that supporting dom0less configs is rather tricky since it uses bootm and not booti. Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
* Add support for modding device treeBrian Woods2021-07-192-36/+93
| | | | | | | | | | Rather than using an uboot script to modify the device tree, allow an config option to be specified so that a device tree is generated as well. Making it to see what exactly is given to Xen. Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
* Add a configurable SLACK parameter to set how many MB of free space are ↵Víctor Mayoral Vilches2021-05-171-3/+13
| | | | | | | | added to each partition. Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com> Reviewed-by: Brian Woods <brian.woods@xilinx.com>
* Account for rootfs compression and total sizeVíctor Mayoral Vilches2021-05-171-5/+23
| | | | | | | | | | | | A heuristic was used in the previous implementation for simplicity (*2) but when using bigger file systems size overflows. This patch uncompresses the archive in an auxiliary folder and calculates its total size in bytes instead. Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com> Reviewed-by: Brian Woods <brian.woods@xilinx.com>
* uboot-script-gen: skip DomUs with rootfs instead of exitingStefano Stabellini2021-05-172-6/+18
| | | | | | | | Also introduce a new DOMU_NOBOOT option to force a domU not to be started automatically at boot as dom0less guest. Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com> Reviewed-by: Brian Woods <brian.woods@xilinx.com>
* Generate xl config files to create DomUs from Dom0Stefano Stabellini2021-05-172-0/+110
| | | | | | | | | | | | disk_image generates xl config files to start DomUs from Dom0. The files are added to dom0 rootfs partition under /etc/xen for your convenience. They refer to kernels and ramdisks stored on the first partition. It is recommended to mount the first partition under /boot in Dom0 to use them. Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com> Reviewed-by: Brian Woods <brian.woods@xilinx.com>
* Add LOAD_CMD parsing to disk_imageStefano Stabellini2021-05-172-3/+29
| | | | | Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com> Reviewed-by: Brian Woods <brian.woods@xilinx.com>
* Remove Debug executionStefano Stabellini2021-05-171-1/+1
| | | | | Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com> Reviewed-by: Brian Woods <brian.woods@xilinx.com>
* Add support for tar.gz rootfsesStefano Stabellini2021-05-172-9/+21
| | | | | | Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com> Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com> Reviewed-by: Brian Woods <brian.woods@xilinx.com>
* Introduce multiple partitions support to disk_imageStefano Stabellini2021-05-173-48/+119
| | | | | | | | | | | | | | | | | | Rootfses that should be written to disk as their own partition are called *_ROOTFS instead of *_RAMDISK. This change makes the config file clearer and more consistent. However it changes the current behavior as the Dom0 RAMDISK (not ROOTFS) was written to disk as its own partition before, and now it is not. In the case of uboot-script-gen, dom0less guests cannot access disk partitions yet (missing PV drivers support). Hence, if one or more domU ROOTFSes are specified, print an error and exit. For dom0, base the root= parameter generation on the presence of DOM0_ROOTFS. Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com> Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Brian Woods <brian.woods@xilinx.com>
* Add/fix support for SCSI/SD aliases for load cmdsBrian Woods2021-02-012-6/+39
| | | | | | | | | | | | With the -t option, the "sd" was an alias for the "load scsi 0:1" load command. Change that to a "load mmc 0:1" alias and then add a "scsi" alias which is "load scsi 0:1". To make sure these aliases and manually setting the load command works, a parsing the command and setting the correct partition and devs was also added. Signed-off-by: Brian Woods <brian.woods@xilinx.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
* Add DOMU_MEM and DOMU_VCPUSStefano Stabellini2020-11-042-2/+22
| | | | | | | | Add two new config file parameters to configure the amount of memory and the number of vcpus of dom0less VMs. Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com> Reviewed-by: Brian Woods <brian.woods@xilinx.com>
* Add options for Xen and Dom0 CMD argumentsBrian Woods2020-10-272-3/+31
| | | | | | | | | | | Both XEN_CMD and DOM0_CMD are optional settings in the config file that set Xen's and Dom0's command line arguments. If not set, a default value will be used. Also, for Dom0's command line arguments, if root isn't set in it, it will determine the best option based on the load argument. Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
* Removed unused container-based usageStefano Stabellini2020-09-225-175/+3
| | | | | | | | | | Initially ImageBuilder was meant to be mainly invoked from a container but in practice ImageBuilder's scripts have been called directly. Remove the old documentation and Dockerfile. Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com> Reviewed-by: Brian Woods <brian.woods@xilinx.com>
* Don't display full path when printing helpBrian Woods2020-08-051-3/+4
| | | | | | Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
* Update doc for uboot-script-gen -dBrian Woods2020-05-132-3/+4
| | | | | | | | | | | The -d option for uboot-script-gen was poorly worded. The -d option isn't a working directory but rather the "root" directory for where the tftp or other root directory would be in relation to the files. Any files generated in the created of the boot.src/source files are in /tmp and are deleted afterwards. Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
* Add support for absolute paths in configSwagath Gadde2020-05-131-1/+3
| | | | | | | | | Some build systems like yocto use absolute paths. Add support for them so they can be used in the config file. Signed-off-by: Swagath Gadde <swagath.gadde@xilinx.com> Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
* Increase file compatibility for DTBsBrian Woods2020-05-131-0/+5
| | | | | | | | | | In some distros (like RHEL 6 and 7), file identifies the device tree blobs (DTBs) as "data". To make imagebuilder work on these older distros, change it where DTBs are correctly identified as "Device Tree Blob" or "data". Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
* Add clk_ignore_unused to the Linux kernel command line optionsStefano Stabellini2020-04-171-1/+1
| | | | | | | | | clk_ignore_unused reduces clock related errors and warning on many platforms. It looks like a safer default to have. Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com> CC: woods@xilinx.com CC: izhar.ameer.shaikh@xilinx.com
* Use stat -L instead of stat, file -L instead of fileStefano Stabellini2020-04-142-13/+13
| | | | | | | | | | Use stat -L and file -L so that the two tools follow symlinks correctly. Also fix an error in check_file_type: the error function is called cleanup_and_return_err, not clean_up_and_err_out. Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com> Reviewed-by: Brian Woods <brian.woods@xilinx.com>
* Introduce a -o option to specify output filenameStefano Stabellini2020-03-052-3/+19
| | | | | | | | | | Introduce a -o command line option for uboot-script-gen to be able to easily specify the output filename for the uboot script and the uboot script source. Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com> Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
* Increase default dom0_mem to 1GStefano Stabellini2020-03-051-1/+1
| | | | | | To account for configurations with larger rootfses. Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
* Add stricter checking of files in configBrian Woods2020-01-171-2/+22
| | | | | | | | | The boot script files would still be generated even if the files used in the config don't exist. This checks to make sure the files exist and if they don't, it exits and errs out. Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
* Add robustness to file type checkingBrian Woods2020-01-171-3/+10
| | | | | | | | | | | | Some versions of the file command and Xen will output: xen: Linux kernel ARM boot executable zImage (little-endian) and executables that file doesn't recognize are simply classified as "data." So changing "MS-DOS executable" to "executable" and or'ing that with "data" should increase coverage without making the check useless. Suggested-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
* remove tmp files when finishedBrian Woods2020-01-161-0/+12
| | | | | | | | Currently there are tmp files left after the script is run. This keeps track of the files and deletes them when exiting. Signed-of-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>