diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2018-12-05 11:27:54 +0100 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2018-12-05 19:34:17 +0100 |
commit | 8204be095a670386f7464f27f067d843db3330bd (patch) | |
tree | c19649f132d30255dbe6b758409e1392dc0b4712 /non-free | |
parent | 5b59b876d70c3ede55476f91c9c05ec51a160fca (diff) | |
download | alpine_aports-8204be095a670386f7464f27f067d843db3330bd.tar.bz2 alpine_aports-8204be095a670386f7464f27f067d843db3330bd.tar.xz alpine_aports-8204be095a670386f7464f27f067d843db3330bd.zip |
non-free/intel-ucode: fix build and clean up license
Diffstat (limited to 'non-free')
-rw-r--r-- | non-free/intel-ucode/APKBUILD | 28 | ||||
-rw-r--r-- | non-free/intel-ucode/LICENSE | 123 | ||||
-rw-r--r-- | non-free/intel-ucode/intel-microcode2ucode.c | 156 |
3 files changed, 11 insertions, 296 deletions
diff --git a/non-free/intel-ucode/APKBUILD b/non-free/intel-ucode/APKBUILD index 488a35e777..82c0cef369 100644 --- a/non-free/intel-ucode/APKBUILD +++ b/non-free/intel-ucode/APKBUILD | |||
@@ -6,30 +6,24 @@ pkgdesc="Microcode update files for Intel CPUs" | |||
6 | arch=noarch | 6 | arch=noarch |
7 | url="https://downloadcenter.intel.com/SearchResult.aspx?lang=eng&keyword=%22microcode%22" | 7 | url="https://downloadcenter.intel.com/SearchResult.aspx?lang=eng&keyword=%22microcode%22" |
8 | license="custom" | 8 | license="custom" |
9 | source="https://downloadmirror.intel.com/28087/eng/microcode-$pkgver.tgz | 9 | makedepens="iucode-tool" |
10 | LICENSE | 10 | source="https://downloadmirror.intel.com/28087/eng/microcode-$pkgver.tgz" |
11 | intel-microcode2ucode.c" | ||
12 | options="!check" | 11 | options="!check" |
13 | 12 | ||
14 | build() { | 13 | build() { |
15 | cd "$srcdir" | 14 | cd "$srcdir" |
16 | gcc -Wall ${CFLAGS} -o intel-microcode2ucode intel-microcode2ucode.c | 15 | rm -f intel-ucode/list intel-ucode-with-caveats/list |
17 | ./intel-microcode2ucode ./microcode.dat | 16 | mkdir -p kernel/x86/microcode |
17 | iucode_tool -w kernel/x86/microcode/GenuineIntel.bin \ | ||
18 | intel-ucode/ intel-ucode-with-caveats/ | ||
19 | echo kernel/x86/microcode/GenuineIntel.bin | \ | ||
20 | cpio -o -H newc -R 0:0 > intel-ucode.img | ||
18 | } | 21 | } |
19 | 22 | ||
20 | package() { | 23 | package() { |
21 | cd "$srcdir" | 24 | cd "$srcdir" |
22 | 25 | install -D -m0644 intel-ucode.img "$pkgdir"/boot/intel-ucode.img | |
23 | install -d -m755 "$pkgdir"/boot | 26 | install -Dm644 license "$pkgdir"/usr/share/licenses/$pkgname/LICENSE |
24 | mkdir -p kernel/x86/microcode | ||
25 | mv microcode.bin kernel/x86/microcode/GenuineIntel.bin | ||
26 | |||
27 | echo kernel/x86/microcode/GenuineIntel.bin | \ | ||
28 | cpio -o -H newc -R 0:0 > "$pkgdir"/boot/intel-ucode.img | ||
29 | |||
30 | install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE | ||
31 | } | 27 | } |
32 | 28 | ||
33 | sha512sums="3cd6794a5ce26e86f7b644e523ba978699316046e593da215b73b17c4b43049ac4a81636e2ce3e727d06c2efbac98657764aa3ff355edb429127585bb49a9b10 microcode-20180807a.tgz | 29 | sha512sums="3cd6794a5ce26e86f7b644e523ba978699316046e593da215b73b17c4b43049ac4a81636e2ce3e727d06c2efbac98657764aa3ff355edb429127585bb49a9b10 microcode-20180807a.tgz" |
34 | d80ce9087e2ffd0168600a34de195d6514d3a496bc233294cd838498e1ce668b9ad4463bbbe7958feec0421b5aed3ade1633432ce086241e03ed06bbd53b83a5 LICENSE | ||
35 | ee60f968acab4067f5660449eabae533b5d3996cd59fd4b69d0e23e0b264da216ab6e6ccd554222cf355fc14dbd348562a2d36a87a60f1f54433603e04998cd1 intel-microcode2ucode.c" | ||
diff --git a/non-free/intel-ucode/LICENSE b/non-free/intel-ucode/LICENSE deleted file mode 100644 index c05358c0f8..0000000000 --- a/non-free/intel-ucode/LICENSE +++ /dev/null | |||
@@ -1,123 +0,0 @@ | |||
1 | INTEL SOFTWARE LICENSE AGREEMENT | ||
2 | |||
3 | IMPORTANT - READ BEFORE COPYING, INSTALLING OR USING. | ||
4 | Do not use or load this software and any associated materials (collectively, | ||
5 | the "Software") until you have carefully read the following terms and | ||
6 | conditions. By loading or using the Software, you agree to the terms of this | ||
7 | Agreement. If you do not wish to so agree, do not install or use the Software. | ||
8 | |||
9 | LICENSES: Please Note: | ||
10 | - If you are a network administrator, the "Site License" below shall | ||
11 | apply to you. | ||
12 | - If you are an end user, the "Single User License" shall apply to you. | ||
13 | - If you are an original equipment manufacturer (OEM), the "OEM License" | ||
14 | shall apply to you. | ||
15 | |||
16 | SITE LICENSE. You may copy the Software onto your organization's computers | ||
17 | for your organization's use, and you may make a reasonable number of | ||
18 | back-up copies of the Software, subject to these conditions: | ||
19 | |||
20 | 1. This Software is licensed for use only in conjunction with Intel | ||
21 | component products. Use of the Software in conjunction with non-Intel | ||
22 | component products is not licensed hereunder. | ||
23 | 2. You may not copy, modify, rent, sell, distribute or transfer any part | ||
24 | of the Software except as provided in this Agreement, and you agree to | ||
25 | prevent unauthorized copying of the Software. | ||
26 | 3. You may not reverse engineer, decompile, or disassemble the Software. | ||
27 | 4. You may not sublicense or permit simultaneous use of the Software by | ||
28 | more than one user. | ||
29 | 5. The Software may include portions offered on terms in addition to those | ||
30 | set out here, as set out in a license accompanying those portions. | ||
31 | |||
32 | SINGLE USER LICENSE. You may copy the Software onto a single computer for | ||
33 | your personal, noncommercial use, and you may make one back-up copy of the | ||
34 | Software, subject to these conditions: | ||
35 | |||
36 | 1. This Software is licensed for use only in conjunction with Intel | ||
37 | component products. Use of the Software in conjunction with non-Intel | ||
38 | component products is not licensed hereunder. | ||
39 | 2. You may not copy, modify, rent, sell, distribute or transfer any part | ||
40 | of the Software except as provided in this Agreement, and you agree to | ||
41 | prevent unauthorized copying of the Software. | ||
42 | 3. You may not reverse engineer, decompile, or disassemble the Software. | ||
43 | 4. You may not sublicense or permit simultaneous use of the Software by | ||
44 | more than one user. | ||
45 | 5. The Software may include portions offered on terms in addition to those | ||
46 | set out here, as set out in a license accompanying those portions. | ||
47 | |||
48 | OEM LICENSE: You may reproduce and distribute the Software only as an | ||
49 | integral part of or incorporated in Your product or as a standalone | ||
50 | Software maintenance update for existing end users of Your products, | ||
51 | excluding any other standalone products, subject to these conditions: | ||
52 | |||
53 | 1. This Software is licensed for use only in conjunction with Intel | ||
54 | component products. Use of the Software in conjunction with non-Intel | ||
55 | component products is not licensed hereunder. | ||
56 | 2. You may not copy, modify, rent, sell, distribute or transfer any part | ||
57 | of the Software except as provided in this Agreement, and you agree to | ||
58 | prevent unauthorized copying of the Software. | ||
59 | 3. You may not reverse engineer, decompile, or disassemble the Software. | ||
60 | 4. You may only distribute the Software to your customers pursuant to a | ||
61 | written license agreement. Such license agreement may be a "break-the- | ||
62 | seal" license agreement. At a minimum such license shall safeguard | ||
63 | Intel's ownership rights to the Software. | ||
64 | 5. The Software may include portions offered on terms in addition to those | ||
65 | set out here, as set out in a license accompanying those portions. | ||
66 | |||
67 | NO OTHER RIGHTS. No rights or licenses are granted by Intel to You, expressly | ||
68 | or by implication, with respect to any proprietary information or patent, | ||
69 | copyright, mask work, trademark, trade secret, or other intellectual property | ||
70 | right owned or controlled by Intel, except as expressly provided in this | ||
71 | Agreement. | ||
72 | |||
73 | OWNERSHIP OF SOFTWARE AND COPYRIGHTS. Title to all copies of the Software | ||
74 | remains with Intel or its suppliers. The Software is copyrighted and | ||
75 | protected by the laws of the United States and other countries, and | ||
76 | international treaty provisions. You may not remove any copyright notices | ||
77 | from the Software. Intel may make changes to the Software, or to items | ||
78 | referenced therein, at any time without notice, but is not obligated to | ||
79 | support or update the Software. Except as otherwise expressly provided, Intel | ||
80 | grants no express or implied right under Intel patents, copyrights, | ||
81 | trademarks, or other intellectual property rights. You may transfer the | ||
82 | Software only if the recipient agrees to be fully bound by these terms and if | ||
83 | you retain no copies of the Software. | ||
84 | |||
85 | LIMITED MEDIA WARRANTY. If the Software has been delivered by Intel on | ||
86 | physical media, Intel warrants the media to be free from material physical | ||
87 | defects for a period of ninety days after delivery by Intel. If such a defect | ||
88 | is found, return the media to Intel for replacement or alternate delivery of | ||
89 | the Software as Intel may select. | ||
90 | |||
91 | EXCLUSION OF OTHER WARRANTIES. EXCEPT AS PROVIDED ABOVE, THE SOFTWARE IS | ||
92 | PROVIDED "AS IS" WITHOUT ANY EXPRESS OR IMPLIED WARRANTY OF ANY KIND | ||
93 | INCLUDING WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, OR FITNESS FOR A | ||
94 | PARTICULAR PURPOSE. Intel does not warrant or assume responsibility for the | ||
95 | accuracy or completeness of any information, text, graphics, links or other | ||
96 | items contained within the Software. | ||
97 | |||
98 | LIMITATION OF LIABILITY. IN NO EVENT SHALL INTEL OR ITS SUPPLIERS BE LIABLE | ||
99 | FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, LOST PROFITS, | ||
100 | BUSINESS INTERRUPTION, OR LOST INFORMATION) ARISING OUT OF THE USE OF OR | ||
101 | INABILITY TO USE THE SOFTWARE, EVEN IF INTEL HAS BEEN ADVISED OF THE | ||
102 | POSSIBILITY OF SUCH DAMAGES. SOME JURISDICTIONS PROHIBIT EXCLUSION OR | ||
103 | LIMITATION OF LIABILITY FOR IMPLIED WARRANTIES OR CONSEQUENTIAL OR INCIDENTAL | ||
104 | DAMAGES, SO THE ABOVE LIMITATION MAY NOT APPLY TO YOU. YOU MAY ALSO HAVE | ||
105 | OTHER LEGAL RIGHTS THAT VARY FROM JURISDICTION TO JURISDICTION. | ||
106 | |||
107 | TERMINATION OF THIS AGREEMENT. Intel may terminate this Agreement at any time | ||
108 | if you violate its terms. Upon termination, you will immediately destroy the | ||
109 | Software or return all copies of the Software to Intel. | ||
110 | |||
111 | APPLICABLE LAWS. Claims arising under this Agreement shall be governed by the | ||
112 | laws of California, excluding its principles of conflict of laws and the | ||
113 | United Nations Convention on Contracts for the Sale of Goods. You may not | ||
114 | export the Software in violation of applicable export laws and regulations. | ||
115 | Intel is not obligated under any other agreements unless they are in writing | ||
116 | and signed by an authorized representative of Intel. | ||
117 | |||
118 | GOVERNMENT RESTRICTED RIGHTS. The Software is provided with "RESTRICTED | ||
119 | RIGHTS." Use, duplication, or disclosure by the Government is subject to | ||
120 | restrictions as set forth in FAR52.227-14 and DFAR252.227-7013 et seq. or its | ||
121 | successor. Use of the Software by the Government constitutes acknowledgment | ||
122 | of Intel's proprietary rights therein. Contractor or Manufacturer is Intel | ||
123 | 2200 Mission College Blvd., Santa Clara, CA 95052. | ||
diff --git a/non-free/intel-ucode/intel-microcode2ucode.c b/non-free/intel-ucode/intel-microcode2ucode.c deleted file mode 100644 index fe410ac86e..0000000000 --- a/non-free/intel-ucode/intel-microcode2ucode.c +++ /dev/null | |||
@@ -1,156 +0,0 @@ | |||
1 | /* | ||
2 | * Convert Intel microcode.dat into a single binary microcode.bin file | ||
3 | * | ||
4 | * Based on code by Kay Sievers <kay.sievers@vrfy.org> | ||
5 | * Changed to create a single file by Thomas Bächler <thomas@archlinux.org> | ||
6 | */ | ||
7 | |||
8 | |||
9 | #ifndef _GNU_SOURCE | ||
10 | # define _GNU_SOURCE 1 | ||
11 | #endif | ||
12 | |||
13 | #include <stdio.h> | ||
14 | #include <unistd.h> | ||
15 | #include <stdlib.h> | ||
16 | #include <string.h> | ||
17 | #include <time.h> | ||
18 | #include <limits.h> | ||
19 | #include <stdbool.h> | ||
20 | #include <inttypes.h> | ||
21 | #include <fcntl.h> | ||
22 | #include <errno.h> | ||
23 | #include <sys/stat.h> | ||
24 | |||
25 | struct microcode_header_intel { | ||
26 | unsigned int hdrver; | ||
27 | unsigned int rev; | ||
28 | unsigned int date; | ||
29 | unsigned int sig; | ||
30 | unsigned int cksum; | ||
31 | unsigned int ldrver; | ||
32 | unsigned int pf; | ||
33 | unsigned int datasize; | ||
34 | unsigned int totalsize; | ||
35 | unsigned int reserved[3]; | ||
36 | }; | ||
37 | |||
38 | union mcbuf { | ||
39 | struct microcode_header_intel hdr; | ||
40 | unsigned int i[0]; | ||
41 | char c[0]; | ||
42 | }; | ||
43 | |||
44 | int main(int argc, char *argv[]) | ||
45 | { | ||
46 | const char *filename = "/lib/firmware/microcode.dat"; | ||
47 | FILE *f; | ||
48 | char line[LINE_MAX]; | ||
49 | char buf[4000000]; | ||
50 | union mcbuf *mc; | ||
51 | size_t bufsize, count, start; | ||
52 | int rc = EXIT_SUCCESS; | ||
53 | |||
54 | if (argv[1] != NULL) | ||
55 | filename = argv[1]; | ||
56 | |||
57 | count = 0; | ||
58 | mc = (union mcbuf *) buf; | ||
59 | f = fopen(filename, "re"); | ||
60 | if (f == NULL) { | ||
61 | printf("open %s: %m\n", filename); | ||
62 | rc = EXIT_FAILURE; | ||
63 | goto out; | ||
64 | } | ||
65 | |||
66 | while (fgets(line, sizeof(line), f) != NULL) { | ||
67 | if (sscanf(line, "%x, %x, %x, %x", | ||
68 | &mc->i[count], | ||
69 | &mc->i[count + 1], | ||
70 | &mc->i[count + 2], | ||
71 | &mc->i[count + 3]) != 4) | ||
72 | continue; | ||
73 | count += 4; | ||
74 | } | ||
75 | fclose(f); | ||
76 | |||
77 | bufsize = count * sizeof(int); | ||
78 | printf("%s: %lu(%luk) bytes, %zu integers\n", | ||
79 | filename, | ||
80 | bufsize, | ||
81 | bufsize / 1024, | ||
82 | count); | ||
83 | |||
84 | if (bufsize < sizeof(struct microcode_header_intel)) | ||
85 | goto out; | ||
86 | |||
87 | f = fopen("microcode.bin", "we"); | ||
88 | if (f == NULL) { | ||
89 | printf("open microcode.bin: %m\n"); | ||
90 | rc = EXIT_FAILURE; | ||
91 | goto out; | ||
92 | } | ||
93 | |||
94 | start = 0; | ||
95 | for (;;) { | ||
96 | size_t size; | ||
97 | unsigned int family, model, stepping, type; | ||
98 | unsigned int year, month, day; | ||
99 | |||
100 | mc = (union mcbuf *) &buf[start]; | ||
101 | |||
102 | if (mc->hdr.totalsize) | ||
103 | size = mc->hdr.totalsize; | ||
104 | else | ||
105 | size = 2000 + sizeof(struct microcode_header_intel); | ||
106 | |||
107 | if (mc->hdr.ldrver != 1 || mc->hdr.hdrver != 1) { | ||
108 | printf("unknown version/format:\n"); | ||
109 | rc = EXIT_FAILURE; | ||
110 | break; | ||
111 | } | ||
112 | |||
113 | /* | ||
114 | * 0- 3 stepping | ||
115 | * 4- 7 model | ||
116 | * 8-11 family | ||
117 | * 12-13 type | ||
118 | * 16-19 extended model | ||
119 | * 20-27 extended family | ||
120 | */ | ||
121 | stepping = mc->hdr.sig & 0x0f; | ||
122 | model = (mc->hdr.sig >> 4) & 0x0f; | ||
123 | family = (mc->hdr.sig >> 8) & 0x0f; | ||
124 | type = (mc->hdr.sig >> 12) & 0x0f; | ||
125 | if (family == 0x06) | ||
126 | model += ((mc->hdr.sig >> 16) & 0x0f) << 4; | ||
127 | if (family == 0x0f) | ||
128 | family += (mc->hdr.sig >> 20) & 0xff; | ||
129 | |||
130 | year = mc->hdr.date & 0xffff; | ||
131 | month = mc->hdr.date >> 24; | ||
132 | day = (mc->hdr.date >> 16) & 0xff; | ||
133 | |||
134 | printf("\n"); | ||
135 | printf("signature: 0x%02x (stepping %d, model %d, family %d, type %d)\n", | ||
136 | mc->hdr.sig, stepping, model, family, type); | ||
137 | printf("flags: 0x%02x\n", mc->hdr.pf); | ||
138 | printf("revision: 0x%02x\n", mc->hdr.rev); | ||
139 | printf("date: %04x-%02x-%02x\n", year, month, day); | ||
140 | printf("size: %zu\n", size); | ||
141 | |||
142 | if (fwrite(mc, size, 1, f) != 1) { | ||
143 | printf("write microcode.bin: %m\n"); | ||
144 | rc = EXIT_FAILURE; | ||
145 | goto out; | ||
146 | } | ||
147 | |||
148 | start += size; | ||
149 | if (start >= bufsize) | ||
150 | break; | ||
151 | } | ||
152 | fclose(f); | ||
153 | printf("\n"); | ||
154 | out: | ||
155 | return rc; | ||
156 | } | ||