aboutsummaryrefslogtreecommitdiff
path: root/scripts/disk_image
Commit message (Collapse)AuthorAgeFilesLines
* Generate the domU partial dtb via disk_imageAyan Kumar Halder2021-12-211-12/+45
| | | | | | | | | | | | | | | | | | | | Similar to uboot-script-gen, disk_image invokes compile_merge_partial_dts to generate the domU partial dtbs. It copies the dtbs to /etc/xen. Added functions to cleanup the temporary files. Also removed 'set -e'. This was causing the script to terminate if any of the functions returned non zero. In our approach, the functions in common script will return 1 (on failure), and the caller (ie disk_image) will check the return code and do the appropriate cleanup. Moreover, 'set -e' cannot be relied upon to terminate the script if any function returns error. Thus, it is not very useful. Details :- https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html 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 *.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-181-2/+30
| | | | | | | | | | "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>
* Add support for loading bitstreamsBrian Woods2021-09-101-0/+8
| | | | | | 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-031-0/+26
| | | | | | | | | | | 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>
* 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>
* Generate xl config files to create DomUs from Dom0Stefano Stabellini2021-05-171-0/+101
| | | | | | | | | | | | 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-171-2/+23
| | | | | 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-171-5/+14
| | | | | | 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-171-41/+96
| | | | | | | | | | | | | | | | | | 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>
* Use stat -L instead of stat, file -L instead of fileStefano Stabellini2020-04-141-9/+9
| | | | | | | | | | 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>
* Fix DESTDIR path in disk_imageBrian Woods2019-10-251-8/+9
| | | | | | | | | | When the user supplies a relative path to use as a working tmp directory, the path is broken when a cd occurs in the script. Fix this by using the absolute path for DESTDIR when we cd. Fixes: "Fix copying files to boot partition in disk_image" Signed-off-by: Brian Woods <brian.woods@xilinx.com> Acked-by: Stefano Stabellini <sstabellini@kernel.org>
* Add command line arguments for disk_imageBrian Woods2019-10-251-7/+83
| | | | | | | | | Add some simple command line arguments and some dependency checking that makes running the script outside of a container much easier. 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>
* Convert indentation of disk_imageBrian Woods2019-10-251-23/+23
| | | | | | | | Convert the indentation of disk_image to 4 space from hard tabs so that it matches the rest of the Imagebuilder scripts. Signed-off-by: Brian Woods <brian.woods@xilinx.com> Acked-by: Stefano Stabellini <sstabellini@kernel.org>
* Fix copying files to boot partition in disk_imageBrian Woods2019-10-241-2/+24
| | | | | | | | | | Copy only the files that were used to generate the size of the boot partition. This fixes a bug where if the Dom0 ramdisk is over ~16M the boot partition will run out of space since everything in the directory is copied over. Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
* Fix hardcoded dom0 ramdisk name in disk_imageBrian Woods2019-10-241-4/+5
| | | | | | | | Get rid of a hardcoded dom0 ramdisk name so that it doesn't err out when the name is different. Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
* Rename docker-extras to scriptsStefano Stabellini2019-10-211-0/+134
Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>