summaryrefslogtreecommitdiffstats
path: root/debian/patches
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/52_remove-pragma.diff265
-rw-r--r--debian/patches/53_use-smartd-runner-by-default.diff21
-rw-r--r--debian/patches/61_cciss-doc.patch46
-rw-r--r--debian/patches/63_removable.patch24
-rw-r--r--debian/patches/manpage.diff22
-rw-r--r--debian/patches/series6
-rw-r--r--debian/patches/service-alias.patch13
7 files changed, 397 insertions, 0 deletions
diff --git a/debian/patches/52_remove-pragma.diff b/debian/patches/52_remove-pragma.diff
new file mode 100644
index 0000000..5a92422
--- /dev/null
+++ b/debian/patches/52_remove-pragma.diff
@@ -0,0 +1,265 @@
+From: Giuseppe Iuculano <iuculano@debian.org>
+Date: Thu, 27 Sep 2018 19:03:07 +0800
+Subject: _remove-pragma
+
+---
+ atacmds.h | 15 ---------------
+ 1 file changed, 15 deletions(-)
+
+--- a/atacmds.h
++++ b/atacmds.h
+@@ -110,9 +110,8 @@
+ #define NUMBER_ATA_SMART_ATTRIBUTES 30
+
+ // Needed parts of the ATA DRIVE IDENTIFY Structure. Those labeled
+ // word* are NOT used.
+-#pragma pack(1)
+ struct ata_identify_device {
+ unsigned short words000_009[10];
+ unsigned char serial_no[20];
+ unsigned short words020_022[3];
+@@ -132,9 +131,8 @@
+ #pragma pack()
+ STATIC_ASSERT(sizeof(ata_identify_device) == 512);
+
+ /* ata_smart_attribute is the vendor specific in SFF-8035 spec */
+-#pragma pack(1)
+ struct ata_smart_attribute {
+ unsigned char id;
+ // meaning of flag bits: see MACROS just below
+ // WARNING: MISALIGNED!
+@@ -193,9 +191,8 @@
+
+
+ // Format of data returned by SMART READ DATA
+ // Table 62 of T13/1699-D (ATA8-ACS) Revision 6a, September 2008
+-#pragma pack(1)
+ struct ata_smart_values {
+ unsigned short int revnumber;
+ struct ata_smart_attribute vendor_attributes [NUMBER_ATA_SMART_ATTRIBUTES];
+ unsigned char offline_data_collection_status;
+@@ -226,9 +223,8 @@
+ 05 - Read scan
+ */
+
+ /* Vendor attribute of SMART Threshold (compare to ata_smart_attribute above) */
+-#pragma pack(1)
+ struct ata_smart_threshold_entry {
+ unsigned char id;
+ unsigned char threshold;
+ unsigned char reserved[10];
+@@ -237,9 +233,8 @@
+ STATIC_ASSERT(sizeof(ata_smart_threshold_entry) == 12);
+
+ /* Format of Read SMART THreshold Command */
+ /* Compare to ata_smart_values above */
+-#pragma pack(1)
+ struct ata_smart_thresholds_pvt {
+ unsigned short int revnumber;
+ struct ata_smart_threshold_entry thres_entries[NUMBER_ATA_SMART_ATTRIBUTES];
+ unsigned char reserved[149];
+@@ -249,9 +244,8 @@
+ STATIC_ASSERT(sizeof(ata_smart_thresholds_pvt) == 512);
+
+
+ // Table 42 of T13/1321D Rev 1 spec (Error Data Structure)
+-#pragma pack(1)
+ struct ata_smart_errorlog_error_struct {
+ unsigned char reserved;
+ unsigned char error_register;
+ unsigned char sector_count;
+@@ -268,9 +262,8 @@
+ STATIC_ASSERT(sizeof(ata_smart_errorlog_error_struct) == 30);
+
+
+ // Table 41 of T13/1321D Rev 1 spec (Command Data Structure)
+-#pragma pack(1)
+ struct ata_smart_errorlog_command_struct {
+ unsigned char devicecontrolreg;
+ unsigned char featuresreg;
+ unsigned char sector_count;
+@@ -284,18 +277,16 @@
+ #pragma pack()
+ STATIC_ASSERT(sizeof(ata_smart_errorlog_command_struct) == 12);
+
+ // Table 40 of T13/1321D Rev 1 spec (Error log data structure)
+-#pragma pack(1)
+ struct ata_smart_errorlog_struct {
+ struct ata_smart_errorlog_command_struct commands[5];
+ struct ata_smart_errorlog_error_struct error_struct;
+ } ATTR_PACKED;
+ #pragma pack()
+ STATIC_ASSERT(sizeof(ata_smart_errorlog_struct) == 90);
+
+ // Table 39 of T13/1321D Rev 1 spec (SMART error log sector)
+-#pragma pack(1)
+ struct ata_smart_errorlog {
+ unsigned char revnumber;
+ unsigned char error_log_pointer;
+ struct ata_smart_errorlog_struct errorlog_struct[5];
+@@ -313,9 +304,8 @@
+ // T13/1699-D Revision 6a (Working Draft), September 6, 2008.
+
+ // Command data structure
+ // Table A.9 of T13/1699-D Revision 6a
+-#pragma pack(1)
+ struct ata_smart_exterrlog_command
+ {
+ unsigned char device_control_register;
+ unsigned char features_register;
+@@ -338,9 +328,8 @@
+ STATIC_ASSERT(sizeof(ata_smart_exterrlog_command) == 18);
+
+ // Error data structure
+ // Table A.10 T13/1699-D Revision 6a
+-#pragma pack(1)
+ struct ata_smart_exterrlog_error
+ {
+ unsigned char device_control_register;
+ unsigned char error_register;
+@@ -363,9 +352,8 @@
+ STATIC_ASSERT(sizeof(ata_smart_exterrlog_error) == 34);
+
+ // Error log data structure
+ // Table A.8 of T13/1699-D Revision 6a
+-#pragma pack(1)
+ struct ata_smart_exterrlog_error_log
+ {
+ ata_smart_exterrlog_command commands[5];
+ ata_smart_exterrlog_error error;
+@@ -374,9 +362,8 @@
+ STATIC_ASSERT(sizeof(ata_smart_exterrlog_error_log) == 124);
+
+ // Ext. Comprehensive SMART error log
+ // Table A.7 of T13/1699-D Revision 6a
+-#pragma pack(1)
+ struct ata_smart_exterrlog
+ {
+ unsigned char version;
+ unsigned char reserved1;
+@@ -390,9 +377,8 @@
+ STATIC_ASSERT(sizeof(ata_smart_exterrlog) == 512);
+
+
+ // Table 45 of T13/1321D Rev 1 spec (Self-test log descriptor entry)
+-#pragma pack(1)
+ struct ata_smart_selftestlog_struct {
+ unsigned char selftestnumber; // Sector number register
+ unsigned char selfteststatus;
+ unsigned short int timestamp;
+@@ -403,9 +389,8 @@
+ #pragma pack()
+ STATIC_ASSERT(sizeof(ata_smart_selftestlog_struct) == 24);
+
+ // Table 44 of T13/1321D Rev 1 spec (Self-test log data structure)
+-#pragma pack(1)
+ struct ata_smart_selftestlog {
+ unsigned short int revnumber;
+ struct ata_smart_selftestlog_struct selftest_struct[21];
+ unsigned char vendorspecific[2];
+@@ -422,9 +407,8 @@
+ // T13/1699-D Revision 6a (Working Draft), September 6, 2008.
+
+ // Extended Self-test log descriptor entry
+ // Table A.13 of T13/1699-D Revision 6a
+-#pragma pack(1)
+ struct ata_smart_extselftestlog_desc
+ {
+ unsigned char self_test_type;
+ unsigned char self_test_status;
+@@ -437,9 +421,8 @@
+ STATIC_ASSERT(sizeof(ata_smart_extselftestlog_desc) == 26);
+
+ // Extended Self-test log data structure
+ // Table A.12 of T13/1699-D Revision 6a
+-#pragma pack(1)
+ struct ata_smart_extselftestlog
+ {
+ unsigned char version;
+ unsigned char reserved1;
+@@ -452,17 +435,15 @@
+ #pragma pack()
+ STATIC_ASSERT(sizeof(ata_smart_extselftestlog) == 512);
+
+ // SMART LOG DIRECTORY Table 52 of T13/1532D Vol 1 Rev 1a
+-#pragma pack(1)
+ struct ata_smart_log_entry {
+ unsigned char numsectors;
+ unsigned char reserved;
+ } ATTR_PACKED;
+ #pragma pack()
+ STATIC_ASSERT(sizeof(ata_smart_log_entry) == 2);
+
+-#pragma pack(1)
+ struct ata_smart_log_directory {
+ unsigned short int logversion;
+ struct ata_smart_log_entry entry[255];
+ } ATTR_PACKED;
+@@ -470,17 +451,15 @@
+ STATIC_ASSERT(sizeof(ata_smart_log_directory) == 512);
+
+ // SMART SELECTIVE SELF-TEST LOG Table 61 of T13/1532D Volume 1
+ // Revision 3
+-#pragma pack(1)
+ struct test_span {
+ uint64_t start;
+ uint64_t end;
+ } ATTR_PACKED;
+ #pragma pack()
+ STATIC_ASSERT(sizeof(test_span) == 16);
+
+-#pragma pack(1)
+ struct ata_selective_self_test_log {
+ unsigned short logversion;
+ struct test_span span[5];
+ unsigned char reserved1[337-82+1];
+@@ -507,9 +486,8 @@
+ // T13/1699-D Revision 3f (Working Draft), December 11, 2006.
+
+ // SCT Status response (read with SMART_READ_LOG page 0xe0)
+ // Table 194 of T13/BSR INCITS 529 (ACS-4) Revision 20, October 26, 2017
+-#pragma pack(1)
+ struct ata_sct_status_response
+ {
+ unsigned short format_version; // 0-1: Status response format version number (2, 3)
+ unsigned short sct_version; // 2-3: Vendor specific version number
+@@ -540,9 +518,8 @@
+ STATIC_ASSERT(sizeof(ata_sct_status_response) == 512);
+
+ // SCT Error Recovery Control command (send with SMART_WRITE_LOG page 0xe0)
+ // Table 88 of T13/1699-D Revision 6a
+-#pragma pack(1)
+ struct ata_sct_error_recovery_control_command
+ {
+ unsigned short action_code; // 3 = Error Recovery Control
+ unsigned short function_code; // 1 = Set Current, 2 = Return Current, 3 = Set Power-on, 4 = Return Power-on, 5 = Restore Default
+@@ -554,9 +531,8 @@
+ STATIC_ASSERT(sizeof(ata_sct_error_recovery_control_command) == 512);
+
+ // SCT Feature Control command (send with SMART_WRITE_LOG page 0xe0)
+ // Table 72 of T13/1699-D Revision 3f
+-#pragma pack(1)
+ struct ata_sct_feature_control_command
+ {
+ unsigned short action_code; // 4 = Feature Control
+ unsigned short function_code; // 1 = Set, 2 = Return, 3 = Return options
+@@ -569,9 +545,8 @@
+ STATIC_ASSERT(sizeof(ata_sct_feature_control_command) == 512);
+
+ // SCT Data Table command (send with SMART_WRITE_LOG page 0xe0)
+ // Table 73 of T13/1699-D Revision 3f
+-#pragma pack(1)
+ struct ata_sct_data_table_command
+ {
+ unsigned short action_code; // 5 = Data Table
+ unsigned short function_code; // 1 = Read Table
+@@ -582,9 +557,8 @@
+ STATIC_ASSERT(sizeof(ata_sct_data_table_command) == 512);
+
+ // SCT Temperature History Table (read with SMART_READ_LOG page 0xe1)
+ // Table 75 of T13/1699-D Revision 3f
+-#pragma pack(1)
+ struct ata_sct_temperature_history_table
+ {
+ unsigned short format_version; // 0-1: Data table format version number (2)
+ unsigned short sampling_period; // 2-3: Temperature sampling period in minutes
diff --git a/debian/patches/53_use-smartd-runner-by-default.diff b/debian/patches/53_use-smartd-runner-by-default.diff
new file mode 100644
index 0000000..40520ba
--- /dev/null
+++ b/debian/patches/53_use-smartd-runner-by-default.diff
@@ -0,0 +1,21 @@
+From: Giuseppe Iuculano <iuculano@debian.org>
+Date: Thu, 27 Sep 2018 19:03:07 +0800
+Subject: _use-smartd-runner-by-default
+
+---
+ smartd.conf | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/smartd.conf
++++ b/smartd.conf
+@@ -14,9 +14,9 @@
+ # ATA and SCSI devices. DEVICESCAN may be followed by any of the
+ # Directives listed below, which will be applied to all devices that
+ # are found. Most users should comment out DEVICESCAN and explicitly
+ # list the devices that they wish to monitor.
+-DEVICESCAN
++DEVICESCAN -n standby -m root -M exec /usr/share/smartmontools/smartd-runner
+
+ # Alternative setting to ignore temperature and power-on hours reports
+ # in syslog.
+ #DEVICESCAN -I 194 -I 231 -I 9
diff --git a/debian/patches/61_cciss-doc.patch b/debian/patches/61_cciss-doc.patch
new file mode 100644
index 0000000..db56950
--- /dev/null
+++ b/debian/patches/61_cciss-doc.patch
@@ -0,0 +1,46 @@
+From: Giuseppe Iuculano <iuculano@debian.org>
+Date: Thu, 27 Sep 2018 19:03:07 +0800
+Subject: Update cciss examples/docs
+
+Here is a patch that adds examples for cciss to the default smartd.conf
+file and adds some more cciss documentation to the manpages. I think this
+patch gets things to parity with the 3ware documentation with a couple
+minor exceptions
+
+Refreshed by jmtd@debian.org 2018-08-10
+Refreshed by nirgal@debian.org 2019-09-17
+---
+ smartd.conf | 6 ++++++
+ smartd.conf.5.in | 10 ++++++++++
+ 2 files changed, 16 insertions(+)
+
+--- a/smartd.conf.5.in
++++ b/smartd.conf.5.in
+@@ -164,8 +164,14 @@
+ /dev/sda \-d cciss,1 \-a \-s (L/../../7/03|S/../.././03) \-m root
+ .\" %ENDIF OS Linux
+ .\" %IF OS FreeBSD Linux
+ #
++# Monitor 2 disks connected to the first HP SmartArray controller which
++# uses the cciss driver. Start long tests on Sunday nights and short
++# self-tests every night and send errors to root
++# \ /dev/sda -d cciss,0 -a -s (L/../../7/02|S/../.././02) -m root
++# \ /dev/sda -d cciss,1 -a -s (L/../../7/03|S/../.././03) -m root
++#
+ # Three SATA disks on a HighPoint RocketRAID controller.
+ # Start short self\-tests daily between 1\-2, 2\-3, and
+ # 3\-4 am.
+ .\" %ENDIF OS FreeBSD Linux
+@@ -231,8 +237,12 @@
+ #
+ ################################################
+ .Ve
+ .Sp
++.B If a cciss controller is used
++then the corresponding block device (/dev/sd?) must be listed,
++along with the \'\-d cciss,N\' Directive (see below).
++.TP
+ .SH DEVICESCAN
+ If a non-comment entry in the configuration file is the text string
+ .B DEVICESCAN
+ in capital letters, then
diff --git a/debian/patches/63_removable.patch b/debian/patches/63_removable.patch
new file mode 100644
index 0000000..048fa52
--- /dev/null
+++ b/debian/patches/63_removable.patch
@@ -0,0 +1,24 @@
+From: Giuseppe Iuculano <iuculano@debian.org>
+Date: Thu, 27 Sep 2018 19:03:07 +0800
+Subject: _removable
+
+Added the removable option by default. This indicates to smartd that it should continue if the device does not appear to be present when smartd is started.
+
+Closes: #406130
+---
+ smartd.conf | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/smartd.conf
++++ b/smartd.conf
+@@ -14,9 +14,9 @@
+ # ATA and SCSI devices. DEVICESCAN may be followed by any of the
+ # Directives listed below, which will be applied to all devices that
+ # are found. Most users should comment out DEVICESCAN and explicitly
+ # list the devices that they wish to monitor.
+-DEVICESCAN -n standby -m root -M exec /usr/share/smartmontools/smartd-runner
++DEVICESCAN -d removable -n standby -m root -M exec /usr/share/smartmontools/smartd-runner
+
+ # Alternative setting to ignore temperature and power-on hours reports
+ # in syslog.
+ #DEVICESCAN -I 194 -I 231 -I 9
diff --git a/debian/patches/manpage.diff b/debian/patches/manpage.diff
new file mode 100644
index 0000000..ca99941
--- /dev/null
+++ b/debian/patches/manpage.diff
@@ -0,0 +1,22 @@
+From: Giuseppe Iuculano <iuculano@debian.org>
+Date: Thu, 27 Sep 2018 19:03:07 +0800
+Subject: manpage
+
+Fixed example path in man pages
+---
+ smartd.conf.5.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/smartd.conf.5.in
++++ b/smartd.conf.5.in
+@@ -1776,9 +1776,9 @@
+ /sbin/shutdown \-hf now
+ .Ve
+ .Sp
+ Some example scripts are distributed with the smartmontools package,
+-in /usr/local/share/doc/smartmontools/examplescripts/.
++in /usr/local/share/doc/smartmontools/examples/.
+ .Sp
+ Please note that these scripts typically run as root, so any files
+ that they read/write should not be writable by ordinary users or
+ reside in directories like /tmp that are writable by ordinary users
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..5914327
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,6 @@
+52_remove-pragma.diff
+53_use-smartd-runner-by-default.diff
+61_cciss-doc.patch
+63_removable.patch
+manpage.diff
+service-alias.patch
diff --git a/debian/patches/service-alias.patch b/debian/patches/service-alias.patch
new file mode 100644
index 0000000..dd36803
--- /dev/null
+++ b/debian/patches/service-alias.patch
@@ -0,0 +1,13 @@
+Last-Update: 2019-10-10
+Forwarded: not-needed
+Author: Dmitry Smirnov <onlyjob@debian.org>
+Description: register service alias, as per original service name.
+
+--- a/smartd.service.in
++++ b/smartd.service.in
+@@ -13,4 +13,5 @@
+ ExecReload=/bin/kill -HUP $MAINPID
+
+ [Install]
+ WantedBy=multi-user.target
++Alias=smartd.service