10 # 3 -> character special
14 # filename mode type link target major minor
15 ["", oct(755), 5, '', undef, undef],
16 ["console", oct(666), 3, '', 5, 1],
17 ["fd", oct(777), 2, '/proc/self/fd', undef, undef],
18 ["full", oct(666), 3, '', 1, 7],
19 ["null", oct(666), 3, '', 1, 3],
20 ["ptmx", oct(666), 3, '', 5, 2],
21 ["pts/", oct(755), 5, '', undef, undef],
22 ["random", oct(666), 3, '', 1, 8],
23 ["shm/", oct(755), 5, '', undef, undef],
24 ["stderr", oct(777), 2, '/proc/self/fd/2', undef, undef],
25 ["stdin", oct(777), 2, '/proc/self/fd/0', undef, undef],
26 ["stdout", oct(777), 2, '/proc/self/fd/1', undef, undef],
27 ["tty", oct(666), 3, '', 5, 0],
28 ["urandom", oct(666), 3, '', 1, 9],
29 ["zero", oct(666), 3, '', 1, 5],
33 if (exists $ENV{SOURCE_DATE_EPOCH}) {
34 $mtime = $ENV{SOURCE_DATE_EPOCH} + 0;
37 foreach my $file (@devfiles) {
38 my ($fname, $mode, $type, $linkname, $devmajor, $devminor) = @{$file};
40 'a100 a8 a8 a8 a12 a12 A8 a1 a100 a8 a32 a32 a8 a8 a155 x12',
42 sprintf('%07o', $mode),
43 sprintf('%07o', 0), # uid
44 sprintf('%07o', 0), # gid
45 sprintf('%011o', 0), # size
46 sprintf('%011o', $mtime),
53 defined($devmajor) ? sprintf('%07o', $devmajor) : '',
54 defined($devminor) ? sprintf('%07o', $devminor) : '',
58 # compute and insert checksum
59 substr($entry, 148, 7)
60 = sprintf("%06o\0", unpack("%16C*", $entry));