-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathreadme.txt
299 lines (218 loc) · 8.54 KB
/
readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
------------------
CFSpace
------------------
FAT32 partition contiguous file space manager.
Creating, checking or copying contiguous, not-fragmented files.
Command line utility for Linux and Windows platforms.
Features:
* Checks if file can be created contiguous before
begining to copy the data, by default.
Usefull for limiting the wear of the flash memory on the USB
connected devices.
* Can be used to check if the files on the disk are already
contiguous or not.
Providing contiguous, non-fragmented files can be necessary
for a hardware that has limited capabilities of reading the
data from the FAT32 partitions.
* Can be used to open system disks or disk image files.
(Administrator or root level privileges are usually required,
depending on the disk type, operating system type or version.)
* Can be configured to run only from the actual shell, with
no need of entering the internal micro shell otherwise.
See the '--run_cmd' switch or the 'scr' internal command.
This project makes use of the FatFs library that
enables reading and writing files on the FAT32 disks
(see the Links section for more info).
WARNING!
---------------------
USE AT YOUR OWN RISK!
NO WARRANTY PROVIDED!
BACKUP YOUR DATA FIRST!
Command line interface
-----------------------------
--open_disk DISKNAME
Open disk on the program startup.
DISKNAME can be:
* File name of the FAT32 partition image.
* System name of the partition on the physical HDD/SDD.
Eg. on Linux this may be "/dev/sdd2".
Note that this is an optional switch and the disk can be always
opened with the "open" command from the program's micro shell.
--read_only
Open the disk in read only mode.
This affect both, the "--open_disk" switch
and the "open" command.
--current_dir PATH
Directory on the opened disk to srart in.
Valid only when opening disk on startup with the "--open_disk" switch.
--error_exit
Exit the program when command error occuts.
Usefull when the program is running text script via the "scr" command.
--buff_rw_size NUM
Buffer size for read and write operations. Default is 1MiB.
For debug purposes.
--run_cmd CMD
Run command on the program startup.
Can be used for automation from the shell.
See "scr" command on how to execute commands from text file.
--crc_ul TEXT
Utility.
Generates checksum that goes into the "ul.cfg" file and the ties game entry
with the game split-files. USB Advance and OpenPS2Loader (OPL) format.
This is so that you can manually create and copy files to the disk,
For example, for game title "New Playstation Game", final file
name may endup being: ul.88BC6456.SLUS_123.45.00
--ul_cfg_add TEXT
Utility. Opens "ul.cfg" file in current system direntory,
adds entry froom text eneterd, and exits the program.
The TEXT sould contain game name followed by game id.
Game id can be with or without the punctuation. Either
SLUS12345 or SLUS_123.45 is expected.
Eg. if the TEXT is set to "New Playstation Game SLUS_123.45",
added will be game with name set to "New Playstation Game"
and game-id set to "SLUS_123.45".
Note 1: This is only a command line switch that makes the
program exit after it's done - does not starts the main program.
Note 2: No game files are opened or copied when using this switch.
--no_disk_reinit_w
Do not reinit the disk at the end of all write operations, like
injecting a file using the "inj" command.
--write_sync
For debug purposes.
Performs a sync operation on each buffer write.
Micro shell interface
------------------------------
This is just simple command line interpreter that parses user
input from the STDIN in the console/terminal.
Once started, enter "help" or "list" to get more info.
Enter "help all" to show list and info for all commands.
Commands
--------------------
>>> open <<<
Opens FAT32 disk, partition or disk image.
Use -r switch to open in the read-only mode.
>>> close <<<
Closes current, previously opened disk.
>>> ls <<<
Alias: dir
Shows contents of current directory.
Use '-l' switch to get long listing.
Use '-f' switch to show fragmentation for each file.
>>> cd <<<
Changes current directory.
Use 'cd ..' to switch to the parent directory.
Use 'cd /' to switch to the root directory.
>>> pwd <<<
Shows current directory path.
>>> diskinfo <<<
Alias: dinf
Shows basic disk information.
Size, empty space, label, etc.
>>> exit <<<
Aliases: quit, q
Exits the program and returns to the shell.
>>> dele <<<
Deletes single file or empty-directory.
Will not delete files with read-only flag
or non-empty directories.
Use '-f' switch to force delete of read-only file.
>>> mkfile <<<
Alias: mkf
Creates new file. Empty or with prealocated size.
File is created contiguous, with contents undefined.
Use '-s SIZE' switch to specify its size.
Fails if there is not enough contiguous space available.
>>> extr <<<
Copies file from curently mounted disk to the system.
Syntax: extr <source> <dest>.
>>> inj <<<
Copies file from the system to the currently opened disk.
By default, new file is being created contiguous.
Fails if there is not enouh contiguous space on the disk.
Use '-o' switch to allow file to be created non-contiguous.
Syntax: inj [-o] <source> [<dest>]
If <dest> is omited, new file name is automatically taken from the path in <source>.
If the file name in <dest> is without the path part, creates file in the current directory.
>>> showfrag <<<
Alias: sfr
Shows the file fragmentation.
Syntax: showfrag <file-name>
This command is limited in that it can only tell if the file is fragmented or not.
If retrieved value of is 1 then the file is not fragmented, contiguous.
If the file is fragmented, the value shown is '2+'.
Note: you can also use the 'ls -f' command.
>>> scr <<<
Alias: s
Runs commands from the text script - file on the system.
Syntax: scr [-c] <file-name>
File name is expected to be an ANSI or UTF-8 text file.
Use '-c' switch to continue executing on errors.
This command can be used to automate tasks from the actual shell.
For shell automation, consider command line switches: '--run_cmd'
and '--error_exit'.
If file name is without the extension, auto checks for the TXT file.
>>> show_disks <<<
Alias: sd
Shows system disks or volumes.
Use the 'open' command to open diisk from the list.
For example, to open disk D, use 'open D:' command.
On unix platforms use device names from the /dev directory.
Example: 'open /dev/sdc1'.
>>> ul_inject <<<
Alias: uli
Injects ISO adding entry to the 'ul.cfg' file.
Asks to press Enter key once files allocated, before file copy.
WARNING: does not checks if the same game already exists.
For PS2 games on USB disks.
This is USB Advance format that is also used by OPL.
Use '-b' to do not update the 'ul.cfg' file.
Use '-i' to do set game-id manually.
>>> ul_list <<<
Alias: ull
Lists contents of 'ul.cfg' file in current directory on the disk.
Use '-l' switch to show more info (game-id).
>>> ul_dele <<<
Alias: uld
Delete entry from 'ul.cfg' file in current directory on the disk.
Specify one or more entries as asterissk with number, 1-based.
Eg. 'ul_dele *2' or 'ul_dele *1 *5 *10'
Use '-t' switch for test mode - don't delete or modify any files.
Build Instructions
----------------------------
Unix:
* Download and unpack source code package.
* Enter directory: "projects/01_cli"
* Run the command: "make release"
* On success, the binary file is created under this path:
"projects/01_cli/bin/release/cfspace"
Windows:
Use Microsoft Visual C++ (MSVC) version 2017 and Windows
SDK that comes with it. Possibly can be compiled with
other MSVC versions.
Changelog
-----------------
v1.1.1
* Initial release.
* Builds for Linux x86_64 platforms.
v1.1.2
* Adds Windows support.
v1.3.1
* Added handling of USB Advance (also OpenPS2Loader) format games.
* Added ul.cfg commands: ul_inject, ul_list and ul_dele.
* Minor filesystem handling improvements.
* Previous official release was version 1.1.2.
* Readme file documentation updates.
Links
------------------
Github Project Page
https://github.com/ike9000e/CFSpace
FatFs Library - Generic FAT Filesystem Module
http://elm-chan.org/fsw/ff/00index_e.html
FatFs User Forum
http://elm-chan.org/fsw/ff/bd/
Forum Topic on PS2-HOME Website
https://www.ps2-home.com/forum/viewtopic.php?p=43159
Special Thanks
--------------------
Authors of the FatFs project.
Authors and contributors of the Linux and Ubuntu operating system.