2 # --- T2-COPYRIGHT-NOTE-BEGIN ---
3 # T2 SDE: target/share/install/build_initrd.sh
4 # Copyright (C) 2004 - 2021 The T2 SDE Project
6 # This Copyright note is generated by scripts/Create-CopyPatch,
7 # more information can be found in the files COPYING and README.
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 ---
15 [ "$boot_title" ] || boot_title
="T2 Installation"
17 .
$base/misc
/target
/initrd.
in
18 .
$base/misc
/target
/boot.
in
22 # Additional initrd overlay
25 mkdir
-p initramfs
/{,usr
/}{,s
}bin
27 cp $build_root/usr
/embutils
/{tar,readlink
,rmdir,bunzip2
} initramfs
/bin
/
28 cp -a $build_root/usr
/bin
/{,un
}zstd initramfs
/usr
/bin
/
29 cp $build_root/usr
/bin
/fget initramfs
/bin
/
31 sed '/PANICMARK/Q' $build_root/sbin
/initrdinit
> initramfs
/init
32 cat $base/target
/share
/install
/init
>> initramfs
/init
33 chmod +x initramfs
/init
35 # For each available kernel:
37 arch_boot_cd_pre
$isofsdir
38 for x
in `egrep 'X .* KERNEL .*' $base/config/$config/packages |
41 for kernelver
in `sed -n "s,.*boot/kconfig.,,p" $build_root/var/adm/flists/$kernel`; do
42 initrd
="initrd-$kernelver"
43 kernelimg
=`ls $build_root/boot/vmlinu?-$kernelver`
44 kernelimg
=${kernelimg##*/}
46 cp $build_root/boot
/vmlinu?
-$kernelver $isofsdir/boot
/
47 cp $build_root/boot
/$initrd $isofsdir/boot
/
48 extend_initrd
$isofsdir/boot
/$initrd $build_toolchain/initramfs
49 arch_boot_cd_add
$isofsdir $kernelver "$boot_title" \
50 /boot
/$kernelimg /boot
/$initrd
51 initrd
=${initrd/initrd/minird}
52 if [ -e $build_root/boot
/$initrd ]; then
53 cp $build_root/boot
/$initrd $isofsdir/boot
/
54 extend_initrd
$isofsdir/boot
/$initrd $build_toolchain/initramfs
55 arch_boot_cd_add
$isofsdir $kernelver-minird "$boot_title (minird)" \
56 /boot
/$kernelimg /boot
/$initrd
61 arch_boot_cd_post
$isofsdir