2024-05-29 16:12:46 +02:00
|
|
|
Generate data for creating test archives
|
|
|
|
----------------------------------------
|
|
|
|
|
|
|
|
echo 'foobar' > /tmp/foo
|
|
|
|
|
|
|
|
# root perms required for the next command
|
|
|
|
echo 'numbers' > /123
|
|
|
|
|
|
|
|
echo 'qwerty' > very-long-long-long-long-name
|
|
|
|
|
|
|
|
echo 'asdfgh' > very-long-long-long-long-name2
|
|
|
|
|
|
|
|
echo 'newline' > 'very-long-name
|
|
|
|
-with-newline'
|
|
|
|
|
|
|
|
echo 'newline' > 'a
|
|
|
|
b'
|
|
|
|
|
|
|
|
mkdir 'dir'
|
|
|
|
echo 'file-in-a-dir' > dir/file
|
|
|
|
|
|
|
|
|
|
|
|
Create archive.ar
|
|
|
|
-----------------
|
|
|
|
|
|
|
|
ar qP archive.ar /tmp/foo /123 very-long-long-long-long-name very-long-long-long-long-name2 'very-long-name
|
|
|
|
-with-newline' 'a
|
|
|
|
b' dir/file
|
2024-05-30 11:12:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
Create archive.cpio
|
|
|
|
-------------------
|
|
|
|
|
|
|
|
printf "/tmp/foo\0/123\0very-long-long-long-long-name\0very-long-long-long-long-name2\0very-long-name
|
|
|
|
-with-newline\0a\nb\0dir/file\0" | cpio -ocv0 --owner=root:root > archive.cpio
|
2024-08-20 10:38:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
Create archive-no-ext_fnhdr.ar
|
|
|
|
------------------------------
|
|
|
|
|
|
|
|
ar qP archive-no-ext_fnhdr.ar dir/file
|