summaryrefslogtreecommitdiffstats
path: root/builder/build-initramfs.sh
diff options
context:
space:
mode:
authortorben2015-12-10 15:27:21 +0100
committertorben2015-12-10 15:27:21 +0100
commit25b2e9124e50bb69bc3d39b545560b4dfb53f072 (patch)
tree3d9cced0d95298edd947e23a92f7111c69b47106 /builder/build-initramfs.sh
parentEven more fixes in archLinuxStartup.nsh Make KCL reading more resilient. (diff)
downloadsystemd-init-25b2e9124e50bb69bc3d39b545560b4dfb53f072.tar.gz
systemd-init-25b2e9124e50bb69bc3d39b545560b4dfb53f072.tar.xz
systemd-init-25b2e9124e50bb69bc3d39b545560b4dfb53f072.zip
Initialize new offline initramfs creation feature.
Diffstat (limited to 'builder/build-initramfs.sh')
-rwxr-xr-xbuilder/build-initramfs.sh18
1 files changed, 17 insertions, 1 deletions
diff --git a/builder/build-initramfs.sh b/builder/build-initramfs.sh
index 45a54b2b..f4e7f699 100755
--- a/builder/build-initramfs.sh
+++ b/builder/build-initramfs.sh
@@ -93,10 +93,11 @@ logging.set_log_level critical
build_initramfs_dracut_parameter='--force --no-hostonly'
build_initramfs_verbose='no'
build_initramfs_debug='no'
+build_initramfs_target=''
build_initramfs_create_system_image=''
build_initramfs_cleanup='no'
build_initramfs_dependencies=(bash cpio git test shift echo mktemp cat rm sed \
- gzip curl tar grep make gcc cmake readlink dirname dmsetup)
+ gzip curl tar grep make gcc cmake readlink dirname dmsetup fakeroot)
# endregion
@@ -133,6 +134,10 @@ function build_initramfs_print_command_line_option_description() {
-i --create-system-image Creates an image under given path from current system.
(default: "$build_initramfs_create_system_image").
+-t --target Creates an image against given target template filesystem. If not
+ explicitly speicifed current system will be used as template system
+ (default).
+
Additional dracut parameter and normal parameter can be deleimiter via a single
dash (-) (default: "$build_initramfs_dracut_parameter").
EOF
@@ -181,6 +186,15 @@ function build_initramfs_parse_command_line() {
fi
shift
;;
+ -t|--target)
+ shift
+ build_initramfs_target="$1"
+ if [[ "$build_initramfs_target" == '' ]]; then
+ logging.critical "This options needs a path create initramfs from."
+ return 1
+ fi
+ shift
+ ;;
-)
shift
while [[ "$1" =~ ^.+$ ]]; do
@@ -262,6 +276,8 @@ function build_initramfs_cleanup() {
# region controller
+# TODO handle fakeroot target feature.
+
utils.dependency_check "${build_initramfs_dependencies[*]}"
# TODO check for existing kernel headers.
# Find lib locations: $(gcc -print-prog-name=cc1plus) -v