File tree Expand file tree Collapse file tree 2 files changed +43
-27
lines changed Expand file tree Collapse file tree 2 files changed +43
-27
lines changed Original file line number Diff line number Diff line change 17
17
along with this program; If not, see <http://www.gnu.org/licenses/>.
18
18
*/
19
19
20
- #define PROGRAM_VERSION_STRING "1"
21
-
22
20
#ifndef _GNU_SOURCE
23
21
#define _GNU_SOURCE
24
22
#endif
25
23
26
24
#include <stdio.h>
27
25
#include <stdlib.h>
28
26
#include <string.h>
29
-
30
- #define CPIO_MAGIC "070701"
31
- #define CPIO_END "TRAILER!!!"
32
- #define CPIO_ENDLEN (sizeof(CPIO_END) - 1)
33
-
34
- #define CPIO_ALIGNMENT 4
35
-
36
- struct cpio_header {
37
- char c_magic [6 ];
38
- char c_ino [8 ];
39
- char c_mode [8 ];
40
- char c_uid [8 ];
41
- char c_gid [8 ];
42
- char c_nlink [8 ];
43
- char c_mtime [8 ];
44
- char c_filesize [8 ];
45
- char c_dev_maj [8 ];
46
- char c_dev_min [8 ];
47
- char c_rdev_maj [8 ];
48
- char c_rdev_min [8 ];
49
- char c_namesize [8 ];
50
- char c_chksum [8 ];
51
- } __attribute__((packed ));
27
+ #include "skipcpio.h"
52
28
53
29
struct buf_struct {
54
30
struct cpio_header h ;
@@ -62,8 +38,6 @@ union buf_union {
62
38
63
39
static union buf_union buf ;
64
40
65
- #define ALIGN_UP (n , a ) (((n) + (a) - 1) & (~((a) - 1)))
66
-
67
41
int main (int argc , char * * argv )
68
42
{
69
43
FILE * f ;
Original file line number Diff line number Diff line change
1
+ /*
2
+ Copyright (C) 2021 Harald Hoyer
3
+ Copyright (C) 2021 Red Hat, Inc. All rights reserved.
4
+
5
+ This program is free software: you can redistribute it and/or modify
6
+ under the terms of the GNU Lesser General Public License as published by
7
+ the Free Software Foundation; either version 2.1 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful, but
11
+ WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ Lesser General Public License for more details.
14
+
15
+ You should have received a copy of the GNU Lesser General Public License
16
+ along with this program; If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+
19
+ #define CPIO_MAGIC "070701"
20
+ #define CPIO_END "TRAILER!!!"
21
+ #define CPIO_ENDLEN (sizeof(CPIO_END) - 1)
22
+
23
+ #define CPIO_ALIGNMENT 4
24
+
25
+ struct cpio_header {
26
+ char c_magic [6 ];
27
+ char c_ino [8 ];
28
+ char c_mode [8 ];
29
+ char c_uid [8 ];
30
+ char c_gid [8 ];
31
+ char c_nlink [8 ];
32
+ char c_mtime [8 ];
33
+ char c_filesize [8 ];
34
+ char c_dev_maj [8 ];
35
+ char c_dev_min [8 ];
36
+ char c_rdev_maj [8 ];
37
+ char c_rdev_min [8 ];
38
+ char c_namesize [8 ];
39
+ char c_chksum [8 ];
40
+ } __attribute__((packed ));
41
+
42
+ #define ALIGN_UP (n , a ) (((n) + (a) - 1) & (~((a) - 1)))
You can’t perform that action at this time.
0 commit comments