* updated blueman (2.3.5 -> 2.4.3)
[t2sde.git] / misc / target / initrd.in
blobbcdcc4001819e247d5b4ebb7bc95161ff330d63e
1 #!/bin/bash
2 # --- T2-COPYRIGHT-NOTE-BEGIN ---
3 # T2 SDE: misc/target/initrd.in
4 # Copyright (C) 2004 - 2023 The T2 SDE Project
5 #
6 # This Copyright note is generated by scripts/Create-CopyPatch,
7 # more information can be found in the files COPYING and README.
8 #
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License version 2.
11 # --- T2-COPYRIGHT-NOTE-END ---
13 # extend_initrd initrd-filename from-dir
14 # adds additional content to an existing initrd (cpio image)
15 extend_initrd() {
16 local initrd=$1
17 local from=$2
19 echo "Extending initrd archive ..."
20 echo "Initrd: ${initrd/$build_root/\$root}"
21 echo " from: ${from/$build_root/\$root}"
24 # extract archive
25 rm -rf $initrd.dir; mkdir $initrd.dir
26 cd $initrd.dir
28 zstd -d -c $initrd | cpio -i
30 # copy extensions
31 cd $from
32 cp -a . $initrd.dir
34 # create archive
35 cd $initrd.dir
36 find . | cpio -o -H newc | zstd -19 -T0 > $initrd
39 # cleanup
40 rm -rf $initrd.dir