Grub does not actually needs it. Save a disk space.
Remove unused support/cloud-image-builder/mk-setup-grub.sh
Change-Id: Ib8fb1eebddcd41964680af2ee3fdffc91f7231f2
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/1731
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: suezzelur <anishs@vmware.com>
... | ... |
@@ -83,7 +83,7 @@ if [ "$BOOTMODE" == "efi" ]; then |
83 | 83 |
grub_efi_install |
84 | 84 |
fi |
85 | 85 |
|
86 |
-cp boot/unifont.pf2 ${BUILDROOT}/boot/grub2/ |
|
86 |
+rm -rf ${BUILDROOT}/boot/grub2/fonts |
|
87 | 87 |
mkdir -p ${BUILDROOT}/boot/grub2/themes/photon |
88 | 88 |
cp boot/splash.png ${BUILDROOT}/boot/grub2/themes/photon/photon.png |
89 | 89 |
cp boot/terminal_*.tga ${BUILDROOT}/boot/grub2/themes/photon/ |
... | ... |
@@ -94,7 +94,6 @@ cat > $BUILDROOT/boot/grub2/grub.cfg << EOF |
94 | 94 |
set default=0 |
95 | 95 |
set timeout=5 |
96 | 96 |
search -n -u $BOOT_UUID -s |
97 |
-loadfont "$BOOT_DIRECTORY"grub2/unifont.pf2 |
|
98 | 97 |
|
99 | 98 |
insmod gfxterm |
100 | 99 |
insmod vbe |
... | ... |
@@ -81,7 +81,7 @@ exit 1 |
81 | 81 |
fi |
82 | 82 |
echo "Current directory is" |
83 | 83 |
pwd |
84 |
-cp boot/unifont.pf2 ${BUILDROOT}/boot/grub2/ |
|
84 |
+rm -rf ${BUILDROOT}/boot/grub2/fonts |
|
85 | 85 |
mkdir -p ${BUILDROOT}/boot/grub2/themes/photon |
86 | 86 |
cp boot/splash.png ${BUILDROOT}/boot/grub2/themes/photon/photon.png |
87 | 87 |
cp boot/terminal_*.tga ${BUILDROOT}/boot/grub2/themes/photon/ |
88 | 88 |
deleted file mode 100755 |
... | ... |
@@ -1,128 +0,0 @@ |
1 |
-#!/bin/bash |
|
2 |
-################################################# |
|
3 |
-# Title: mk-setup-grub # |
|
4 |
-# Date: 2014-11-26 # |
|
5 |
-# Version: 1.0 # |
|
6 |
-# Author: sharathg@vmware.com # |
|
7 |
-# Options: # |
|
8 |
-################################################# |
|
9 |
-# Overview |
|
10 |
-# This is a precursor for the vmware build system. |
|
11 |
-# This assumes that an empty hard disk is attached to the build VM. |
|
12 |
-# The path to this empty disk is specified in the HDD variable in config.inc |
|
13 |
-# End |
|
14 |
-# |
|
15 |
-grub_efi_install() |
|
16 |
-{ |
|
17 |
- mkdir $BUILDROOT/boot/efi |
|
18 |
- # |
|
19 |
- # if it is a loop device then we should mount the dev mapped boot partition |
|
20 |
- # |
|
21 |
- if [[ $HDD == *"loop"* ]] |
|
22 |
- then |
|
23 |
- BOOT_PARTITION=/dev/mapper/`basename ${HDD}`p1 |
|
24 |
- else |
|
25 |
- BOOT_PARTITION=${HDD}1 |
|
26 |
- fi |
|
27 |
- mkfs.vfat $BOOT_PARTITION |
|
28 |
- mount -t vfat $BOOT_PARTITION $BUILDROOT/boot/efi |
|
29 |
- cp boot/unifont.pf2 /usr/share/grub/ |
|
30 |
- grub2-efi-install --target=x86_64-efi --efi-directory=$BUILDROOT/boot/efi --bootloader-id=Boot --root-directory=$BUILDROOT --recheck |
|
31 |
- rm $BUILDROOT/boot/efi/EFI/Boot/grubx64.efi |
|
32 |
- cp efi/bootx64.efi $BUILDROOT/boot/efi/EFI/Boot/bootx64.efi |
|
33 |
- umount $BUILDROOT/boot/efi |
|
34 |
-} |
|
35 |
- |
|
36 |
-grub_mbr_install() |
|
37 |
-{ |
|
38 |
- $grubInstallCmd --force --boot-directory=$BUILDROOT/boot "$HDD" |
|
39 |
-} |
|
40 |
- |
|
41 |
-set -o errexit # exit if error...insurance ;) |
|
42 |
-set -o nounset # exit if variable not initalized |
|
43 |
-set +h # disable hashall |
|
44 |
-set -x |
|
45 |
-PRGNAME=${0##*/} # script name minus the path |
|
46 |
-source config.inc # configuration parameters |
|
47 |
-source function.inc # commonn functions |
|
48 |
-LOGFILE=/var/log/"${PRGNAME}-${LOGFILE}" # set log file name |
|
49 |
-#LOGFILE=/dev/null # uncomment to disable log file |
|
50 |
-ARCH=$(uname -m) # host architecture |
|
51 |
-[ ${EUID} -eq 0 ] || fail "${PRGNAME}: Need to be root user: FAILURE" |
|
52 |
-> ${LOGFILE} # clear/initialize logfile |
|
53 |
- |
|
54 |
-# Check if passing a HDD and partition |
|
55 |
-if [ $# -eq 5 ] |
|
56 |
- then |
|
57 |
- BOOTMODE=$1 |
|
58 |
- HDD=$2 |
|
59 |
- ROOT_PARTITION_PATH=$3 |
|
60 |
- BOOT_PARTITION_PATH=$4 |
|
61 |
- BOOT_DIRECTORY=$5 |
|
62 |
-fi |
|
63 |
- |
|
64 |
-# |
|
65 |
-# Install grub2. |
|
66 |
-# |
|
67 |
-PARTUUID=$(blkid -s PARTUUID -o value $ROOT_PARTITION_PATH) |
|
68 |
-BOOT_UUID=$(blkid -s UUID -o value $BOOT_PARTITION_PATH) |
|
69 |
- |
|
70 |
- |
|
71 |
-grubInstallCmd="" |
|
72 |
-mkdir -p $BUILDROOT/boot/grub2 |
|
73 |
-ln -sfv grub2 $BUILDROOT/boot/grub |
|
74 |
-command -v grub-install >/dev/null 2>&1 && grubInstallCmd="grub-install" && { echo >&2 "Found grub-install"; } |
|
75 |
-command -v grub2-install >/dev/null 2>&1 && grubInstallCmd="grub2-install" && { echo >&2 "Found grub2-install"; } |
|
76 |
-if [ -z $grubInstallCmd ]; then |
|
77 |
-echo "Unable to found grub install command" |
|
78 |
-exit 1 |
|
79 |
-fi |
|
80 |
- |
|
81 |
-if [ "$BOOTMODE" == "bios" ]; then |
|
82 |
- grub_mbr_install |
|
83 |
-fi |
|
84 |
-if [ "$BOOTMODE" == "efi" ]; then |
|
85 |
- grub_efi_install |
|
86 |
-fi |
|
87 |
- |
|
88 |
-cp boot/unifont.pf2 ${BUILDROOT}/boot/grub2/ |
|
89 |
-mkdir -p ${BUILDROOT}/boot/grub2/themes/photon |
|
90 |
-cp boot/splash.png ${BUILDROOT}/boot/grub2/themes/photon/photon.png |
|
91 |
-cp boot/terminal_*.tga ${BUILDROOT}/boot/grub2/themes/photon/ |
|
92 |
-cp boot/theme.txt ${BUILDROOT}/boot/grub2/themes/photon/ |
|
93 |
-cat > "$BUILDROOT"/boot/grub2/grub.cfg << "EOF" |
|
94 |
-# Begin /boot/grub2/grub.cfg |
|
95 |
-set default=0 |
|
96 |
-set timeout=5 |
|
97 |
-set root=(hd0,2) |
|
98 |
-loadfont /boot/grub2/unifont.pf2 |
|
99 |
-load_env -f "$BOOT_DIRECTORY"$photon.cfg |
|
100 |
- |
|
101 |
-insmod gfxterm |
|
102 |
-insmod vbe |
|
103 |
-insmod tga |
|
104 |
-insmod png |
|
105 |
- |
|
106 |
-set gfxmode="640x480" |
|
107 |
-gfxpayload=keep |
|
108 |
- |
|
109 |
-terminal_output gfxterm |
|
110 |
- |
|
111 |
-set theme=/boot/grub2/themes/photon/theme.txt |
|
112 |
- |
|
113 |
-menuentry "Photon" { |
|
114 |
- insmod ext2 |
|
115 |
- insmod part_gpt |
|
116 |
- linux "$BOOT_DIRECTORY"\$photon_linux init=/lib/systemd/systemd root=PARTUUID=UUID_PLACEHOLDER loglevel=3 ro |
|
117 |
- initrd /boot/initrd.img-no-kmods |
|
118 |
-} |
|
119 |
-# End /boot/grub2/grub.cfg |
|
120 |
-EOF |
|
121 |
- |
|
122 |
-sed -i "s/UUID_PLACEHOLDER/$PARTUUID/" "$BUILDROOT"/boot/grub2/grub.cfg > ${LOGFILE} |
|
123 |
- |
|
124 |
-#Cleanup the workspace directory |
|
125 |
-rm -rf "$BUILDROOT"/tools |
|
126 |
-rm -rf "$BUILDROOT"/RPMS |
|
127 |
- |
|
128 |
-#umount $BUILDROOT |