blob: f8a6a207f700cfb9c7155e1019e50db43d0145eb [file] [log] [blame]
Vishal Bhoj9a67d912016-06-09 10:02:07 +01001#!/bin/sh
John Stultz09c0fb82017-08-10 17:30:17 -07002#
3# Generate partition table for HiKey eMMC or HiKey960 UFS
Vishal Bhoj9a67d912016-06-09 10:02:07 +01004#
5# tiny: for testing purpose.
John Stultz09c0fb82017-08-10 17:30:17 -07006# aosp: (same as linux with userdata).
7# linux: (same as aosp without userdata).
8# swap: (similar to asop, drop reserved, 1.5G of swap)
Vishal Bhoj9a67d912016-06-09 10:02:07 +01009
10PTABLE=${PTABLE:-aosp}
John Stultz09c0fb82017-08-10 17:30:17 -070011SECTOR_SIZE=${SECTOR_SIZE:-512}
12SGDISK=${SGDISK:-sgdisk}
Vishal Bhoj9a67d912016-06-09 10:02:07 +010013TEMP_FILE=$(mktemp /tmp/${PTABLE}.XXXXXX)
John Stultz09c0fb82017-08-10 17:30:17 -070014# 128 entries at most
15ENTRIES_IN_SECTOR=$(expr ${SECTOR_SIZE} / 128)
16ENTRY_SECTORS=$(expr 128 / ${ENTRIES_IN_SECTOR})
17PRIMARY_SECTORS=$(expr ${ENTRY_SECTORS} + 2)
18SECONDARY_SECTORS=$(expr ${ENTRY_SECTORS} + 1)
Vishal Bhoj9a67d912016-06-09 10:02:07 +010019
20case ${PTABLE} in
21 tiny)
22 SECTOR_NUMBER=81920
23 ;;
24 aosp-4g|linux-4g)
25 SECTOR_NUMBER=7471104
26 ;;
Mark Salyzyn97ae2202017-05-26 14:56:52 -070027 aosp-8g|linux-8g|swap-8g)
Vishal Bhoj9a67d912016-06-09 10:02:07 +010028 SECTOR_NUMBER=15269888
29 ;;
John Stultz09c0fb82017-08-10 17:30:17 -070030 aosp-32g*|linux-32g)
31 SECTOR_NUMBER=62447650 # count with 512-byte block size
32 ;;
33 aosp-64g|linux-64g)
34 SECTOR_NUMBER=124895300 # count with 512-byte block size
35 ;;
Vishal Bhoj9a67d912016-06-09 10:02:07 +010036esac
37
John Stultz09c0fb82017-08-10 17:30:17 -070038SECTOR_ALIGNMENT=$(expr ${SECTOR_SIZE} / 512)
39SECTOR_NUMBER=$(expr '(' ${SECTOR_NUMBER} '*' 512 + ${SECTOR_SIZE} - 1 ')' / ${SECTOR_SIZE})
Vishal Bhoj9a67d912016-06-09 10:02:07 +010040
41# get the partition table
42case ${PTABLE} in
43 tiny)
John Stultz09c0fb82017-08-10 17:30:17 -070044 dd if=/dev/zero of=${TEMP_FILE} bs=${SECTOR_SIZE} count=${SECTOR_NUMBER} conv=sparse
45 fakeroot ${SGDISK} -U -R -v ${TEMP_FILE}
46 fakeroot ${SGDISK} -n 1:2048:4095 -t 1:0700 -u 1:F9F21F01-A8D4-5F0E-9746-594869AEC3E4 -c 1:"vrl" -p ${TEMP_FILE}
47 fakeroot ${SGDISK} -n 2:4096:6143 -t 2:0700 -u 2:F9F21F02-A8D4-5F04-9746-594869AEC3E4 -c 2:"vrl_backup" -p ${TEMP_FILE}
Vishal Bhoj9a67d912016-06-09 10:02:07 +010048 ;;
John Stultz09c0fb82017-08-10 17:30:17 -070049 aosp-4g|aosp-8g)
50 dd if=/dev/zero of=${TEMP_FILE} bs=${SECTOR_SIZE} count=${SECTOR_NUMBER} conv=sparse
51 fakeroot ${SGDISK} -U 2CB85345-6A91-4043-8203-723F0D28FBE8 -v ${TEMP_FILE}
Vishal Bhoj9a67d912016-06-09 10:02:07 +010052 #[1: vrl: 1M-2M]
John Stultz09c0fb82017-08-10 17:30:17 -070053 fakeroot ${SGDISK} -n 1:0:+1M -t 1:0700 -u 1:496847AB-56A1-4CD5-A1AD-47F4ACF055C9 -c 1:"vrl" ${TEMP_FILE}
Vishal Bhoj9a67d912016-06-09 10:02:07 +010054 #[2: vrl_backup: 2M-3M]
John Stultz09c0fb82017-08-10 17:30:17 -070055 fakeroot ${SGDISK} -n 2:0:+1M -t 2:0700 -u 2:61A36FC1-8EFB-4899-84D8-B61642EFA723 -c 2:"vrl_backup" ${TEMP_FILE}
Vishal Bhoj9a67d912016-06-09 10:02:07 +010056 #[3: mcuimage: 3M-4M]
John Stultz09c0fb82017-08-10 17:30:17 -070057 fakeroot ${SGDISK} -n 3:0:+1M -t 3:0700 -u 3:65007411-962D-4781-9B2C-51DD7DF22CC3 -c 3:"mcuimage" ${TEMP_FILE}
Vishal Bhoj9a67d912016-06-09 10:02:07 +010058 #[4: fastboot: 4M-12M]
John Stultz09c0fb82017-08-10 17:30:17 -070059 fakeroot ${SGDISK} -n 4:0:+8M -t 4:EF02 -u 4:496847AB-56A1-4CD5-A1AD-47F4ACF055C9 -c 4:"fastboot" ${TEMP_FILE}
Vishal Bhoj9a67d912016-06-09 10:02:07 +010060 #[5: nvme: 12M-14M]
John Stultz09c0fb82017-08-10 17:30:17 -070061 fakeroot ${SGDISK} -n 5:0:+2M -t 5:0700 -u 5:00354BCD-BBCB-4CB3-B5AE-CDEFCB5DAC43 -c 5:"nvme" ${TEMP_FILE}
Vishal Bhoj9a67d912016-06-09 10:02:07 +010062 #[6: boot: 14M-78M]
John Stultz09c0fb82017-08-10 17:30:17 -070063 fakeroot ${SGDISK} -n 6:0:+64M -t 6:EF00 -u 6:5C0F213C-17E1-4149-88C8-8B50FB4EC70E -c 6:"boot" ${TEMP_FILE}
Dmitry Shmidt4c6629b2018-04-09 14:13:32 -070064 #[7: vendor: 78M-334M]
65 fakeroot ${SGDISK} -n 7:0:+256M -t 7:0700 -u 7:BED8EBDC-298E-4A7A-B1F1-2500D98453B7 -c 7:"vendor" ${TEMP_FILE}
Vishal Bhoj9a67d912016-06-09 10:02:07 +010066 #[8: cache: 334M-590M]
John Stultz09c0fb82017-08-10 17:30:17 -070067 fakeroot ${SGDISK} -n 8:0:+256M -t 8:8301 -u 8:A092C620-D178-4CA7-B540-C4E26BD6D2E2 -c 8:"cache" ${TEMP_FILE}
Vishal Bhoj9a67d912016-06-09 10:02:07 +010068 #[9: system: 590M-2126M]
John Stultz09c0fb82017-08-10 17:30:17 -070069 fakeroot ${SGDISK} -n 9:0:+1536M -t 9:8300 -u 9:FC56E345-2E8E-49AE-B2F8-5B9D263FE377 -c 9:"system" ${TEMP_FILE}
Vishal Bhoj9a67d912016-06-09 10:02:07 +010070 #[10: userdata: 2126M-End]
John Stultz09c0fb82017-08-10 17:30:17 -070071 fakeroot ${SGDISK} -n -E -t 10:8300 -u 10:064111F6-463B-4CE1-876B-13F3684CE164 -c 10:"userdata" -p ${TEMP_FILE}
Vishal Bhoj9a67d912016-06-09 10:02:07 +010072 ;;
John Stultz09c0fb82017-08-10 17:30:17 -070073 linux-4g|linux-8g)
74 dd if=/dev/zero of=${TEMP_FILE} bs=${SECTOR_SIZE} count=${SECTOR_NUMBER} conv=sparse
75 fakeroot ${SGDISK} -U 2CB85345-6A91-4043-8203-723F0D28FBE8 -v ${TEMP_FILE}
Vishal Bhoj9a67d912016-06-09 10:02:07 +010076 #[1: vrl: 1M-2M]
John Stultz09c0fb82017-08-10 17:30:17 -070077 fakeroot ${SGDISK} -n 1:0:+1M -t 1:0700 -u 1:496847AB-56A1-4CD5-A1AD-47F4ACF055C9 -c 1:"vrl" ${TEMP_FILE}
Vishal Bhoj9a67d912016-06-09 10:02:07 +010078 #[2: vrl_backup: 2M-3M]
John Stultz09c0fb82017-08-10 17:30:17 -070079 fakeroot ${SGDISK} -n 2:0:+1M -t 2:0700 -u 2:61A36FC1-8EFB-4899-84D8-B61642EFA723 -c 2:"vrl_backup" ${TEMP_FILE}
Vishal Bhoj9a67d912016-06-09 10:02:07 +010080 #[3: mcuimage: 3M-4M]
John Stultz09c0fb82017-08-10 17:30:17 -070081 fakeroot ${SGDISK} -n 3:0:+1M -t 3:0700 -u 3:65007411-962D-4781-9B2C-51DD7DF22CC3 -c 3:"mcuimage" ${TEMP_FILE}
Vishal Bhoj9a67d912016-06-09 10:02:07 +010082 #[4: fastboot: 4M-12M]
John Stultz09c0fb82017-08-10 17:30:17 -070083 fakeroot ${SGDISK} -n 4:0:+8M -t 4:EF02 -u 4:496847AB-56A1-4CD5-A1AD-47F4ACF055C9 -c 4:"fastboot" ${TEMP_FILE}
Vishal Bhoj9a67d912016-06-09 10:02:07 +010084 #[5: nvme: 12M-14M]
John Stultz09c0fb82017-08-10 17:30:17 -070085 fakeroot ${SGDISK} -n 5:0:+2M -t 5:0700 -u 5:00354BCD-BBCB-4CB3-B5AE-CDEFCB5DAC43 -c 5:"nvme" ${TEMP_FILE}
Vishal Bhoj9a67d912016-06-09 10:02:07 +010086 #[6: boot: 14M-78M]
John Stultz09c0fb82017-08-10 17:30:17 -070087 fakeroot ${SGDISK} -n 6:0:+64M -t 6:EF00 -u 6:5C0F213C-17E1-4149-88C8-8B50FB4EC70E -c 6:"boot" ${TEMP_FILE}
Vishal Bhoj9a67d912016-06-09 10:02:07 +010088 #[7: reserved: 78M-334M]
John Stultz09c0fb82017-08-10 17:30:17 -070089 fakeroot ${SGDISK} -n 7:0:+256M -t 7:0700 -u 7:BED8EBDC-298E-4A7A-B1F1-2500D98453B7 -c 7:"reserved" ${TEMP_FILE}
Vishal Bhoj9a67d912016-06-09 10:02:07 +010090 #[8: cache: 334M-590M]
John Stultz09c0fb82017-08-10 17:30:17 -070091 fakeroot ${SGDISK} -n 8:0:+256M -t 8:8301 -u 8:A092C620-D178-4CA7-B540-C4E26BD6D2E2 -c 8:"cache" ${TEMP_FILE}
Vishal Bhoj9a67d912016-06-09 10:02:07 +010092 #[9: system: 590M-End]
John Stultz09c0fb82017-08-10 17:30:17 -070093 fakeroot ${SGDISK} -n -E -t 9:8300 -u 9:FC56E345-2E8E-49AE-B2F8-5B9D263FE377 -c 9:"system" ${TEMP_FILE}
Vishal Bhoj9a67d912016-06-09 10:02:07 +010094 ;;
John Stultz09c0fb82017-08-10 17:30:17 -070095 swap-8g)
96 dd if=/dev/zero of=${TEMP_FILE} bs=${SECTOR_SIZE} count=${SECTOR_NUMBER} conv=sparse
97 fakeroot ${SGDISK} -U 2CB85345-6A91-4043-8203-723F0D28FBE8 -v ${TEMP_FILE}
Mark Salyzyn97ae2202017-05-26 14:56:52 -070098 #[1: vrl: 1M-2M]
John Stultz09c0fb82017-08-10 17:30:17 -070099 fakeroot ${SGDISK} -n 1:0:+1M -t 1:0700 -u 1:496847AB-56A1-4CD5-A1AD-47F4ACF055C9 -c 1:"vrl" ${TEMP_FILE}
Mark Salyzyn97ae2202017-05-26 14:56:52 -0700100 #[2: vrl_backup: 2M-3M]
John Stultz09c0fb82017-08-10 17:30:17 -0700101 fakeroot ${SGDISK} -n 2:0:+1M -t 2:0700 -u 2:61A36FC1-8EFB-4899-84D8-B61642EFA723 -c 2:"vrl_backup" ${TEMP_FILE}
Mark Salyzyn97ae2202017-05-26 14:56:52 -0700102 #[3: mcuimage: 3M-4M]
John Stultz09c0fb82017-08-10 17:30:17 -0700103 fakeroot ${SGDISK} -n 3:0:+1M -t 3:0700 -u 3:65007411-962D-4781-9B2C-51DD7DF22CC3 -c 3:"mcuimage" ${TEMP_FILE}
Mark Salyzyn97ae2202017-05-26 14:56:52 -0700104 #[4: fastboot: 4M-12M]
John Stultz09c0fb82017-08-10 17:30:17 -0700105 fakeroot ${SGDISK} -n 4:0:+8M -t 4:EF02 -u 4:496847AB-56A1-4CD5-A1AD-47F4ACF055C9 -c 4:"fastboot" ${TEMP_FILE}
Mark Salyzyn97ae2202017-05-26 14:56:52 -0700106 #[5: nvme: 12M-14M]
John Stultz09c0fb82017-08-10 17:30:17 -0700107 fakeroot ${SGDISK} -n 5:0:+2M -t 5:0700 -u 5:00354BCD-BBCB-4CB3-B5AE-CDEFCB5DAC43 -c 5:"nvme" ${TEMP_FILE}
Mark Salyzyn97ae2202017-05-26 14:56:52 -0700108 #[6: boot: 14M-78M]
John Stultz09c0fb82017-08-10 17:30:17 -0700109 fakeroot ${SGDISK} -n 6:0:+64M -t 6:EF00 -u 6:5C0F213C-17E1-4149-88C8-8B50FB4EC70E -c 6:"boot" ${TEMP_FILE}
Mark Salyzyn97ae2202017-05-26 14:56:52 -0700110 #[7: cache: 78M-384M]
John Stultz09c0fb82017-08-10 17:30:17 -0700111 fakeroot ${SGDISK} -n 7:0:+256M -t 7:8301 -u 7:A092C620-D178-4CA7-B540-C4E26BD6D2E2 -c 7:"cache" ${TEMP_FILE}
Mark Salyzyn97ae2202017-05-26 14:56:52 -0700112 #[8: swap: 384M-1920M]
John Stultz09c0fb82017-08-10 17:30:17 -0700113 fakeroot ${SGDISK} -n 8:0:+1536M -t 8:8200 -u 8:FC56E344-2E8E-49AE-B2F8-5B9D263FE377 -c 8:"swap" ${TEMP_FILE}
Mark Salyzyn97ae2202017-05-26 14:56:52 -0700114 #[9: system: 1920M-3556M]
John Stultz09c0fb82017-08-10 17:30:17 -0700115 fakeroot ${SGDISK} -n 9:0:+1536M -t 9:8300 -u 9:FC56E345-2E8E-49AE-B2F8-5B9D263FE377 -c 9:"system" ${TEMP_FILE}
Mark Salyzyn97ae2202017-05-26 14:56:52 -0700116 #[10: userdata: 3556M-End]
John Stultz09c0fb82017-08-10 17:30:17 -0700117 fakeroot ${SGDISK} -n -E -t 10:8300 -u 10:064111F6-463B-4CE1-876B-13F3684CE164 -c 10:"userdata" -p ${TEMP_FILE}
118 ;;
119 aosp-32g*|aosp-64g)
120 dd if=/dev/zero of=${TEMP_FILE} bs=${SECTOR_SIZE} count=${SECTOR_NUMBER} conv=sparse
121 fakeroot ${SGDISK} -U 2CB85345-6A91-4043-8203-723F0D28FBE8 -v ${TEMP_FILE}
122 #[1: xloader_reserved1: 1M-2M]
123 fakeroot ${SGDISK} -n 1:0:+1M -t 1:0700 -u 1:697c41e0-7a59-4dfa-a9a6-aa43ac5be684 -c 1:"xloader_reserved1" ${TEMP_FILE}
124 #[2: fastboot: 2M-14M]
125 fakeroot ${SGDISK} -n 2:0:+12M -t 2:0700 -u 2:3f5f8c48-4402-4ace-9058-30bfea4fa53f -c 2:"fastboot" ${TEMP_FILE}
126 #[3: nvme: 14M-20M]
127 fakeroot ${SGDISK} -n 3:0:+6M -t 3:0700 -u 3:e2f5e2a9-c9b7-4089-9859-4498f1d3ef7e -c 3:"nvme" ${TEMP_FILE}
128 #[4: fip: 20M-32M]
129 fakeroot ${SGDISK} -n 4:0:+12M -t 3:0700 -u 4:dc1a888e-f17c-4964-92d6-f8fcc402ed8b -c 4:"fip" ${TEMP_FILE}
130 #[5: cache: 32M-288M]
131 fakeroot ${SGDISK} -n 5:0:+256M -t 5:0700 -u 5:10cc3268-05f0-4db2-aa00-707361427fc8 -c 5:"cache" ${TEMP_FILE}
132 #[6: fw_lpm3: 288M-289M]
133 fakeroot ${SGDISK} -n 6:0:+1M -t 6:0700 -u 6:5d8481d4-c170-4aa8-9438-8743c73ea8f5 -c 6:"fw_lpm3" ${TEMP_FILE}
134 #[7: boot: 289M-353M]
135 fakeroot ${SGDISK} -n 7:0:+64M -t 7:EF00 -u 7:d3340696-9b95-4c64-8df6-e6d4548fba41 -c 7:"boot" ${TEMP_FILE}
136 #[8: dts: 353M-369M]
137 fakeroot ${SGDISK} -n 8:0:+16M -t 8:0700 -u 8:6e53b0bb-fa7e-4206-b607-5ae699e9f066 -c 8:"dts" ${TEMP_FILE}
138 #[9: trustfirmware: 369M-371M]
139 fakeroot ${SGDISK} -n 9:0:+2M -t 9:0700 -u 9:f1e126a6-ceef-45c1-aace-29f33ac9cf13 -c 9:"trustfirmware" ${TEMP_FILE}
140 #[10: system: 371M-5059M]
141 fakeroot ${SGDISK} -n 10:0:+4688M -t 10:8300 -u 10:c3e50923-fb85-4153-b925-759614d4dfcd -c 10:"system" ${TEMP_FILE}
142 #[11: vendor: 5059M-5843M]
143 fakeroot ${SGDISK} -n 11:0:+784M -t 11:0700 -u 11:919d7080-d71a-4ae1-9227-e4585210c837 -c 11:"vendor" ${TEMP_FILE}
144 #[12: reserved: 5843M-5844M]
145 fakeroot ${SGDISK} -n 12:0:+1M -t 12:0700 -u 12:611eac6b-bc42-4d72-90ac-418569c8e9b8 -c 12:"reserved" ${TEMP_FILE}
146 case ${PTABLE} in
147 aosp-32g)
148 #[13: userdata: 5844M-End]
149 fakeroot ${SGDISK} -n -E -t 13:8300 -u 13:fea80d9c-f3e3-45d9-aed0-1d06e4abd77f -c 13:"userdata" ${TEMP_FILE}
150 ;;
151 aosp-32g-spare)
152 #[13: userdata: 5844M-9844M]
153 fakeroot ${SGDISK} -n 13:0:+1000M -t 13:8300 -u 13:fea80d9c-f3e3-45d9-aed0-1d06e4abd77f -c 13:"userdata" ${TEMP_FILE}
154 #[14: swap: 9844M-End]
155 fakeroot ${SGDISK} -n -E -t 14:8300 -u 14:9501eade-20fb-4bc7-83d3-62c1be3ed92d -c 14:"swap" ${TEMP_FILE}
156 ;;
157 esac
158 ;;
159 linux-32g|linux-64g)
160 dd if=/dev/zero of=${TEMP_FILE} bs=${SECTOR_SIZE} count=${SECTOR_NUMBER} conv=sparse
161 fakeroot ${SGDISK} -U 2CB85345-6A91-4043-8203-723F0D28FBE8 -v ${TEMP_FILE}
162 #[1: vrl: 1M-2M]
163 fakeroot ${SGDISK} -n 1:0:+1M -t 1:0700 -u 1:697c41e0-7a59-4dfa-a9a6-aa43ac5be684 -c 1:"vrl" ${TEMP_FILE}
164 #[2: fastboot: 2M-14M]
165 fakeroot ${SGDISK} -n 2:0:+12M -t 2:0700 -u 2:3f5f8c48-4402-4ace-9058-30bfea4fa53f -c 2:"fastboot" ${TEMP_FILE}
166 #[3: nvme: 14M-20M]
167 fakeroot ${SGDISK} -n 3:0:+6M -t 3:0700 -u 3:e2f5e2a9-c9b7-4089-9859-4498f1d3ef7e -c 3:"nvme" ${TEMP_FILE}
168 #[4: fip: 20M-32M]
169 fakeroot ${SGDISK} -n 4:0:+12M -t 3:0700 -u 4:dc1a888e-f17c-4964-92d6-f8fcc402ed8b -c 4:"fip" ${TEMP_FILE}
170 #[5: cache: 32M-288M]
171 fakeroot ${SGDISK} -n 5:0:+256M -t 5:0700 -u 5:10cc3268-05f0-4db2-aa00-707361427fc8 -c 5:"cache" ${TEMP_FILE}
172 #[6: fw_lpm3: 288M-289M]
173 fakeroot ${SGDISK} -n 6:0:+1M -t 6:0700 -u 6:5d8481d4-c170-4aa8-9438-8743c73ea8f5 -c 6:"fw_lpm3" ${TEMP_FILE}
174 #[7: boot: 289M-353M]
175 fakeroot ${SGDISK} -n 7:0:+64M -t 7:EF00 -u 7:d3340696-9b95-4c64-8df6-e6d4548fba41 -c 7:"boot" ${TEMP_FILE}
176 #[8: dts: 353M-369M]
177 fakeroot ${SGDISK} -n 8:0:+16M -t 8:0700 -u 8:6e53b0bb-fa7e-4206-b607-5ae699e9f066 -c 8:"dts" ${TEMP_FILE}
178 #[9: trustfirmware: 369M-371M]
179 fakeroot ${SGDISK} -n 9:0:+2M -t 9:0700 -u 9:f1e126a6-ceef-45c1-aace-29f33ac9cf13 -c 9:"trustfirmware" ${TEMP_FILE}
180 #[10: system: 371M-5059M]
181 fakeroot ${SGDISK} -n 10:0:+4688M -t 10:8300 -u 10:c3e50923-fb85-4153-b925-759614d4dfcd -c 10:"system" ${TEMP_FILE}
182 #[11: vendor: 5059M-5843M]
183 fakeroot ${SGDISK} -n 11:0:+784M -t 11:0700 -u 11:919d7080-d71a-4ae1-9227-e4585210c837 -c 11:"vendor" ${TEMP_FILE}
184 #[12: reserved: 5843M-5844M]
185 fakeroot ${SGDISK} -n 12:0:+1M -t 12:0700 -u 12:611eac6b-bc42-4d72-90ac-418569c8e9b8 -c 12:"reserved" ${TEMP_FILE}
Mark Salyzyn97ae2202017-05-26 14:56:52 -0700186 ;;
Vishal Bhoj9a67d912016-06-09 10:02:07 +0100187esac
188
John Stultz09c0fb82017-08-10 17:30:17 -0700189# get the primary partition table
190dd if=${TEMP_FILE} of=prm_ptable.img bs=${SECTOR_SIZE} count=${PRIMARY_SECTORS}
191
192BK_PTABLE_LBA=$(expr ${SECTOR_NUMBER} - ${SECONDARY_SECTORS})
193dd if=${TEMP_FILE} of=sec_ptable.img skip=${BK_PTABLE_LBA} bs=${SECTOR_SIZE} count=${SECONDARY_SECTORS}
Vishal Bhoj9a67d912016-06-09 10:02:07 +0100194
195rm -f ${TEMP_FILE}