Commit Graph

41 Commits

Author SHA1 Message Date
PartialVolume
9ffa4513a6 Added an extra option in the config menu to toggle visability of host UUID & host S/N in the PDF. Also changed the functionality of Tag visability. If the user enters a custom tag in the config menu it will automatically be displayed in the PDF, if you remove the custom tag, then the tag field disappears from the PDF. The command line option --pdftag, now only enables the tag field. To enable visibility of host UUID & host S/N this must be enabled in the config menu. Any change is saved to nwipe.conf and is reinstated next time nwipe starts. 2026-02-02 00:58:27 +00:00
PartialVolume
65ff9ff64c Allow custom text on PDF report.
Allows user-defined text or tags to be embedded
in the PDF report. The tag data is stored in
nwipe.conf and may be entered via the customer
and organisation preview screen, when enabled,
or directly through the config screen. Press
C on drive selection screen.

Inclusion of this tag in the generated PDF
report requires the pdftag option to be enabled
in the configuration screen or specified explicitly
using the --pdftag command-line argument when
invoking nwipe.
2025-12-14 22:23:00 +00:00
PartialVolume
0801ca7ae8 Add user selectable host information
You can now specify --pdftag to enable the
display of system UUID and system serial
number information on the PDF report.

Nwipe defaults to not displaying system IDs
but some users like to record the system UUID
or serial number on the Erasure Report along
with the disk information.
2025-11-18 18:44:41 +00:00
PartialVolume
67df917378 Reinstate page 1 label on PDF 2025-11-14 17:08:40 +00:00
PartialVolume
30015d1be4 Combine duplicated code into function
The fifteen lines of code that creates the header
and footer text in the PDF appear in two separate
places. The first occurrence  in the create_pdf(..)
function and once in the create_header_and_footer(..)
function.

This duplicated code was combined into a third
function pdf_header_footer_text(..) and is now called
from the other functions.

This was done as I need to add some user selectable
changes to the header text that will include host
identification such as system tag, UUID, hostname
without creating further duplicated code.
2025-11-13 21:43:55 +00:00
PartialVolume
e8c07bddc5 Add device name, e.g sda, SD etc to PDF filename
The purpose of this commit is to add an additional
identifying piece of information to the pdf filename.

This was found to be necessary in the case of a user
wiping partitions as opposed to the whole disc. Currently
when wiping a partition the model name and serial number
is missing from the pdf content and pdf filename so by adding
the device name, it make it less likely that an existing pdf
will get overwritten. This is a stop gap fix as preferably
the disk model and serial no needs to be retrieved even
wiping just one partition.

Additional functions were added including retrieval of UUID,
however UUID was found to not be available for some USB
devices when wiping partitions. The UUID function remains
in the code and the UUID if available is output to the log
but is not used anywhere else at the moment.
2025-11-10 23:21:15 +00:00
PartialVolume
5506c76b65 Add a new search location when looking for
hdparm and smartctl.

The new search location is /usr/sbin/. Previously
we searched /sbin/ and /usr/bin/ but /sbin is symbolically linked
to /usr/sbin/ so just in case there was some issue with the
symbolic link we also now search /usr/sbin/
2024-09-13 21:57:31 +01:00
Pascal Mages
1511791a25 Update create_pdf.c
Fix mini typo on PRNG algorithm
2024-09-10 17:39:58 +02:00
PartialVolume
e851769025 Update PDF code with new PRNGs
Updated pdf to recognise XORshiro256 and
lagged Fibonacci PRNGs.
2024-03-26 21:17:23 +00:00
PartialVolume
c24e248055 Make smart page titles consistent with page 1
Should now read
Page 1 - Erasure Status
Page 2 - Smart Data
Page 3 - Smart Data

and not as previously
Page 1 - Erasure Status
Smart Data - Page 2
Smart Data - Page 3
2023-11-28 21:21:48 +00:00
PartialVolume
508a6d2a62 PDF_Gen37_single_column_smart_data
Previously smart data was completely located
on page 2 in two columns using a variable width font.
This had two issues. The font size had to be very small
to fit on the page which made it difficult to read
and variable width fonts were used because the smart
attribute table took up too much width when all the data
was displayed in two newspaper type columns. This made the
smart attribute table look messy.

This patch now displays the smart data over page two and three
in mono spaced font and with a larger font size so it's easier
to read and the columns with the smart attribute table are now
aligned correctly.

In terms of the code, I placed the header and footer creation
code in it's own function as this is called multiple times
and will make it easier to add additional information pages
in the future.
2023-10-15 23:16:14 +01:00
Gerold Gruber
8124e6b3d5 added -P option for PDFreportpath 2023-10-02 20:28:49 +02:00
PartialVolume
e74ae252ef PDFGen21 Completed all GUI dialog boxes for entering organisational data. Confirmed the data is correctly saved to /etc/nwipe/nwipe.conf and read back for automatic entry into the PDF erasure report. Further work is required to create dialog entry screens for customer details.. to be continued. 2023-07-14 23:00:17 +01:00
PartialVolume
6f453967f6 PDFGen19 Completed the code the extracts the organisation and selected customer details from the nwipe.conf configuration file and populates the business and customer details boxes on the PDF report. 2023-07-12 20:37:08 +01:00
PartialVolume
447c4eddf7 HPA_DCO_013 Continuation of HPA/DCO integration
Fixes to apparent and real disc size fields in PDF based on use
of c->Calculated_real_max_size_in_bytes.

Minor changes to HPA status messages for consistent messaging.

When HPA and DCO sector information cannot be obtained display the
message "HPA/DCO data unavailable, can not determine hidden sector
status" in the information field on the PDF.

Determine human readable size for the c->Calculated_real_max_size_in_bytes
as used in the PDF real disc size field.

Instead of >>FAILURE!<< -1 when a I/O error occurs display >>IOERROR!<< -1
in the GUI.
2023-04-12 23:29:13 +01:00
PartialVolume
d981159f04 HPA_DCO_012 Continuation of HPA/DCO integration
Simplified the code that determines whether a HPA/DCO
is present and in the process fixed some related bugs
to do with the HPA/DCO fields in the PDF document
displaying incorrect information in some drive specific
cases.
2023-04-11 22:42:16 +01:00
PartialVolume
776717a729 HPA_DCO_009 Continuation of HPA/DCO integration.
Changed the way percentage is calculated. As we
are dealing with large numbers and for some reason
printf prints a double that is 99.99999999999 as
100.00 when a precision of two is specified I wrote
a function that creates a percentage string such that
99.99999999999 is displayed as 99.99%. This is important
in the report as a disc with one hidden sector will now
correctly show as 99.99% erased and not 100.00% erased.
2023-04-04 23:52:40 +01:00
PartialVolume
0b720b155c HPA_DCO_008 continuation of HPA/DCO integration.
Many changes related to DCO real max sectors and HPA set and real
sectors and how they are processed and used in the PDF creation
function. More testing is required until I'm happy this works
correctly with lots of different hardware including USB adapters
that don't support DCO/HPA and also drives that don't support
DCO/HPA such as the Seagate Enterprise EXOS drives.
2023-04-03 23:11:41 +01:00
PartialVolume
3d5fdd3f11 HPA_DCO_007 - Add HPA/DCO capability
1. Fix issue in PDF certificate where a drive that doesn't
support device configuration overlay, shows 512 bytes as the
disc size in the "Size(Real)" area on the certificate.

2. Fix a comment in the log that suggests you might be using a USB
adapter or memory stick and those device can cause an indeterminate
HPA/DCO status. This is now corrected so that we check the bus
is USB before we issue that message.

3. Changes to some GUI text, replaced 'area' with 'sectors'.

4. Aligned "HPA/DCO No hidden sectors detected" to the drive
model/serial text that it alternates with. One character left.

5. Nwipe's version and operating system information that is always
printed to the console on exit, was not appearing in the optional
log file, as optionally specified on the command line. This was
caused because those nwipe_log() calls were happening before the
command line options had been parsed. Essentially there was no log file.
Comments were made in the nwipe.c as a reminder to use nwipe_log()
calls with caution, prior to the options parser.

6. Made changes to the logic in the HPA_dco functions such that
a device that does not appear to support device configuration
overlay and host protected area is classified as HPA_NOT APPLICABLE
in regards to the hpa_status which is important for the PDF
certificate code so that the fields in the certificate are updated
appropriately.
2023-03-16 20:57:07 +00:00
PartialVolume
c3cd5011a2 PDFGen17 - further work on PDF certificate
1. I wasn't keen on my first attempt at the exclamation
icon so I redesigned it.I think this one looks better.
2023-03-12 16:34:43 +00:00
PartialVolume
f258872c67 PDFGen16 - further work on PDF certificate
1. Added a new icon, a yellow exclamation in a red circle
with the words "erased with a warning" inside the circle.
This is used instead of the green tick icon or red cross icon
when a disk is successfully erase as requested but the user
chose not to expose the hidden sectors by removing the HPA and/or
restoring the drive configuration overlay (DCO).

2. Expanded the size of the "Disk Erasure Details" section on
the certificate by 20 points to provide better spacing for warnings

3. Removed remapped sectors label, as that information already
appears on page 2 in the smart data.

4. Improvements to the logic in regards to text colour changes.

5. Added a additional red warning message in the information section
when the exposed sectors of the disc are erased but the hidden sectors
are not.

6. Added the original images in .xcf (gimp) and jpg formats that are
used to generate the embedded .c and .h files using bin2c.
2023-03-11 22:24:34 +00:00
PartialVolume
b35400b22a PDFGen15 - further work on PDF certificate
1. Added page 2 of the report which includes all
smart data as displayed by smartctl -a /dev/sdx

2. Did some more work on the logic, i.e. when certain
data on the certificate should be green and when it should be
red.

3. Made some changes to nwipe's log in regards to the way
it displays disc info right at the beginning of the log.
Separated the drive information by a blank line to make
each drive stand out from the rest.

4. Moved a string function from device.c to miscellaneous.c

more code to follow ..
2023-03-10 23:33:46 +00:00
PartialVolume
b79eea6c9f PDFGen14 - further work on PDF certificate
1. Changes to colour on some items under certain
conditions.

2. Changed the HPA labels to include DCO, and changed
the text from HPA enabled/disabled to something more
meaningful to a user, i.e Hidden area found, no hidden
area.

3. Added a new define "HPA_NOT_SUPPORTED_BY_DRIVE" for
recent SATA drives that no longer support HPA/DCO.
Further work needs to be done determining whether a drive
supports HPA/DCO or not in the hpa_dco.c functions.

more code to follow ..
2023-03-05 23:24:49 +00:00
PartialVolume
dc6d76176a PDFGen13 - further work on PDF certificate
1. Reduced font size for data info.
2. Used a define for text point size to make it easier
to change size.
3. Started work on function to parse sense data for older
versions of hdparm (9.60) that fail to parse the real max
sectors correctly. (fixed in 9.65).
4. Miscellaneous changes.

More changes to follow ..
2023-03-05 00:42:37 +00:00
PartialVolume
8abab96a3e HPA_DCO_003 - Add HPA,DCO capability
1. For devices that support HPA/DCO (not NVMe) nwipe
displays the HPA status, it toggles every two seconds
the size and the temperature i.e "[  1TB][ 35C]" with
the HPA status such as [HPA disabled], [HPA ENABLED!],
[HPA unknown]. The HPA ENABLED is highlighted with red
text and a white background. HPA_disabled is standard
white text on blue background.

More code to follow, a new option to be added, HPA, disable/enable
which will disable the HPA and shut down the system. On manually
powering back up the HPA should be reported as disabled.

Then lots of testing.
2023-02-28 23:48:17 +00:00
PartialVolume
c7d17df7f8 HPA_DCO_002 - Add HPA, DCO capability
1. Further work was completed, putting the HPA status and HPA size into
the report/certificate.

2. Moved some general functions that may be used throughout nwipe
into miscellaneous.c These tend to be string processing functions.

3. Tested certificate HPA status. There are three possible states of the HPA
i. Enabled and HPA size is displayed on the certificate
ii. Disabled, the drive reports it's real size to the O.S.
iii. Unknown. Nwipe could not determine whether there is a HPA or not.
This may be caused by the use of a USB adapter or could be a bad drive,
or finally a change in hdparms format when displaying HPA information.

More code to follow, next on the list is to add the HPA status into the
drive selection screen in the GUI, so when you select the drive you can see
the status of HPA and choose to disable it.
2023-02-28 00:02:01 +00:00
PartialVolume
ecfc252015 PDFGen12 - further work on PDF certificate
1. Add information regarding how many pass, sync
and verify errors, if any.
2023-02-23 12:31:41 +00:00
PartialVolume
8b827f9ea0 PDFGen10 - further work on PDF certificate
1. Fix rounds reported on abort or fail.
2023-02-22 00:06:28 +00:00
PartialVolume
04c409a665 PDFGen10 - further work on PDF certificate
1. Fix percentage for bytes erased on certificate.
2023-02-21 22:59:09 +00:00
PartialVolume
c5f9c1d6e9 PDFGen10 - further work on PDF certificate
1. Added the red cross icon located on the top right of
the certificate. This is displayed when the wipe is aborted
or failed to complete due to disc I/O errors etc. The
green tick icon is displayed on a successful wipe.

2. When the user manually aborts the wipe, the bytes so
far erased incorrectly displayed as zero. This change updates the
c->bytes_erased variable in the static pass and random
pass functions to correct this.
2023-02-21 21:33:19 +00:00
PartialVolume
84048ba58b PDFGen9 - further work on PDF certificate
1. Added rounds requested & completed. Coloured
green if equal and red if not.
2. Fixed endtime sometimes not being recorded when
a wipe is aborted. This affected the creation of the
PDF filename. Now ok.
3. Added throughput using the appropriate nomenclature
such as KB/sec MB/sec, GB/sec etc
2023-02-21 11:51:36 +00:00
PartialVolume
eda930f06d PDFGen8 - further work on PDF certificate
1. Added bytes erased including percentage, green
if equal to disc size and red if the drive hasn't been
fully erased at least once.
2. Added explanation of bytes erased to certificate.
3. Added throughput
2023-02-21 00:35:52 +00:00
PartialVolume
581e83e615 PDFGen7 - further work on PDF certificate
1. Change model/serial no in header to bold and move left
2. Create a filename for the report that identifies the
wipe uniquely ie:
nwipe_report_YY-MM-DD_HH-MM-SS_Model_XXXX_Serial_XXXX.pdf
3. Move size data 2 characters right to allow for up to two
space prefix on size string. So data doesn't get written over
the end of the 'Size:' label.
2023-02-18 23:04:28 +00:00
PartialVolume
a29cc3b543 PDFGen6 - further work on PDF certificate
1. Fix @param in pdfgen.h, committed and accepted upstream
2. Added size of disk in bytes
3. When NVME drive show message "Not applicable" for HPA, DCO
4. Highlight status ERASED, FAILED etc with coloured ellipse
5. Added function help for nwipe_log (shows in hints in IDE)
2023-02-18 00:13:56 +00:00
PartialVolume
b5eb549c59 PDFGen5 - further work on PDF certificate
1. Rearranged the layout so the Tech/ID signature
is at the bottom of the report.
2. Added start date/time
3. Added end date/time
4. Changed data from helvetica to helvetica-bold
5. Created a definition for PDF_DARK_GREEN text in
create_pdf.h and moved the previously created PDF_GRAY
to create_pdf.h, to keep pdfgen.h vanilla.
6. Added the erasure status, ERASED, FAILED, ABORTED.
ERASED in green and FAILED, ABORTED in red.

Further code to follow ..
2023-02-16 20:49:41 +00:00
PartialVolume
ac6f14d86d PDFGen4 - further work on PDF certificate
1. Display unknown in serial number field for loopback device
2. Added device type, USB, SATA, VIRT etc
3. Added duration of wipe in hh:mm:ss
4. Added pseudo random number generator type, twister, isaac etc
5. Added final blanking pass type, none, zeros, ones
6. Added number of rounds
2023-02-15 23:52:17 +00:00
PartialVolume
40fdaf49a3 Formatted text .. I need to auto run make format! 2023-02-15 01:25:10 +00:00
PartialVolume
0c0e3f2930 PDFGen3 - further work on PDF certificate
1. Changed most titles in certificate to gray with
the data in black.

Started adding real data to template including:
Model, serial no., method, verify, size.

more code to follow...
2023-02-15 01:15:36 +00:00
PartialVolume
cb129ffbc2 As usual, forgot to run make format ! 2023-02-14 01:48:16 +00:00
PartialVolume
8c7b1839f4 Embed PDF header images, plus font
1. Embed the images contained in the PDF into nwipes code
rather than use external image files.
2. Changed the font from Times New Roman to Helvetica
to give it a cleaner look.
2023-02-14 01:42:27 +00:00
PartialVolume
ed478f6dc0 Create Disk Erasure Report PDF template
This commits code that creates a erasure report
pdf file. Further to will follow that populates
the template.
2023-02-13 22:38:30 +00:00