File: efi-misc-binary-hook

package info (click to toggle)
clonezilla 5.12.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 4,580 kB
  • sloc: sh: 41,014; perl: 193; python: 59; makefile: 26
file content (28 lines) | stat: -rwxr-xr-x 1,315 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
# Author: Steven Shiau <steven _at_ clonezilla org>
# License: GPL

# The working dir for the binary hook is the binary/ under working dir (e.g. debian-live/binary/), not in the chroot.
# Put grub2 efi boot loader
# The name server is deconfigured, we have to enable it so the apt-get will work in ocs-gen-grub2-efi-bldr.
# Load DRBL setting and functions
DRBL_SCRIPT_PATH="${DRBL_SCRIPT_PATH:-/usr/share/drbl}"

. $DRBL_SCRIPT_PATH/sbin/drbl-conf-functions

# Clean the duplicated vmlinuz-* and initrd-*, we just want vmlinuz and initrd so that the iso file can be smaller.
# For arm64, binary_syslinux of live-build is not run, so there is no hard link (ln) for vmlinuz-* to vmlinuz, and initrd-* to initrd.
# For i386/amd64, binary_syslinux of live-build is run, so there are two files, i.e., ln vmlinuz-4.10.0-38-generic vmlinuz -> so vmlinuz-4.10.0-38-generic and vmlinuz
vmlinuz_no="$(LC_ALL=C find live/ -iname "vmlinuz*" -print 2>/dev/null | wc -l)"
if [ "$vmlinuz_no" -ge 2 ]; then
  # Keep vmlinuz and initrd only.
  rm -f live/vmlinuz-* live/initrd.img-*
elif [ "$vmlinuz_no" -eq 1 ]; then
  # Rename them as vmlinuz and initrd.img
  mv live/vmlinuz-* live/vmlinuz
  mv live/initrd.img-* live/initrd.img
fi

### THE END ###
# DO NOT PUT ANY SCRIPT AFTHER THIS!!!
rm -rf live-binary-hook-dir/