From f53f66f9c837652615f4814159cf8be793601e46 Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Tue, 9 Aug 2016 10:44:09 -0400 Subject: [PATCH] replace non-free ntfsprogs/boot.c with boot-gpl.c (resolves bz1364710) --- boot-gpl.c | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++ ntfs-3g.spec | 15 +++++++- sources | 2 +- 3 files changed, 115 insertions(+), 3 deletions(-) create mode 100644 boot-gpl.c diff --git a/boot-gpl.c b/boot-gpl.c new file mode 100644 index 0000000..cde65cc --- /dev/null +++ b/boot-gpl.c @@ -0,0 +1,101 @@ +/* + * NTFS bootsector, adapted from the vfat one. + */ + +/* mkfs.fat.c - utility to create FAT/MS-DOS filesystems +Copyright (C) 1991 Linus Torvalds +Copyright (C) 1992-1993 Remy Card +Copyright (C) 1993-1994 David Hudson +Copyright (C) 1998 H. Peter Anvin +Copyright (C) 1998-2005 Roman Hodek +Copyright (C) 2008-2014 Daniel Baumann +Copyright (C) 2015 Andreas Bombe +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +You should have received a copy of the GNU General Public License +along with this program. If not, see . +The complete text of the GNU General Public License +can be found in /usr/share/common-licenses/GPL-3 file. +*/ + +#include "boot.h" + +#define BOOTCODE_SIZE 4136 + +/* The "boot code" we put into the filesystem... it writes a message and +tells the user to try again */ + +#define MSG_OFFSET_OFFSET 3 + +const unsigned char boot_array[BOOTCODE_SIZE] = + +"\xeb\x52\x90" /* jump to code at 0x54 (0x7c54) */ +"NTFS \0" /* NTFS signature */ + +"\0\0\0\0\0\0\0\0\0\0\0\0" /* 72 bytes for device parameters */ +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" + /* Boot code run at location 0x7c54 */ +"\x0e" /* push cs */ +"\x1f" /* pop ds */ +"\xbe\x71\x7c" /* mov si, offset message_txt (at location 0x7c71) */ + /* write_msg: */ +"\xac" /* lodsb */ +"\x22\xc0" /* and al, al */ +"\x74\x0b" /* jz key_press */ +"\x56" /* push si */ +"\xb4\x0e" /* mov ah, 0eh */ +"\xbb\x07\x00" /* mov bx, 0007h */ +"\xcd\x10" /* int 10h */ +"\x5e" /* pop si */ +"\xeb\xf0" /* jmp write_msg */ + /* key_press: */ +"\x32\xe4" /* xor ah, ah */ +"\xcd\x16" /* int 16h */ +"\xcd\x19" /* int 19h */ +"\xeb\xfe" /* foo: jmp foo */ +/* message_txt: */ +"This is not a bootable disk. Please insert a bootable floppy and\r\n" +"press any key to try again ... \r\n" + /* At location 0xd4, 298 bytes to reach 0x1fe */ + /* 298 = 4 blocks of 72 then 10 */ +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" + +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" + +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" + +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" + +"\0\0\0\0\0\0\0\0\0\0" + /* Boot signature at 0x1fe */ +"\x55\xaa"; diff --git a/ntfs-3g.spec b/ntfs-3g.spec index 4534db5..036edd4 100644 --- a/ntfs-3g.spec +++ b/ntfs-3g.spec @@ -16,13 +16,19 @@ Name: ntfs-3g Summary: Linux NTFS userspace driver Version: 2016.2.22 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ Group: System Environment/Base -Source0: http://tuxera.com/opensource/%{name}_ntfsprogs-%{version}%{?subver}.tgz +# Upstream source includes non-free ntfsprogs/boot.c +# GPL replacement file exists as Source2, but we need to delete boot.c from the tarball +# Unpack it, rm ntfsprogs/boot.c, then repackage it as ntfs3g_ntfsprogs-clean-%{version}%{?subver}.tgz +# Source0: http://tuxera.com/opensource/%{name}_ntfsprogs-%{version}%{?subver}.tgz +Source0: %{name}_ntfsprogs-clean-%{version}%{?subver}.tgz %if %{oldrhel} Source1: 20-ntfs-config-write-policy.fdi %endif +# http://tuxera.com/forum/viewtopic.php?f=2&t=31104 +Source2: boot-gpl.c URL: http://www.ntfs-3g.org/ %if %{with_externalfuse} BuildRequires: fuse-devel @@ -83,6 +89,8 @@ included utilities see man 8 ntfsprogs after installation). %setup -q -n %{name}_ntfsprogs-%{version}%{?subver} %patch0 -p1 -b .unsupported +cp %{SOURCE2} ntfsprogs/boot.c + %build CFLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64" %configure \ @@ -288,6 +296,9 @@ cp -a %{SOURCE1} %{buildroot}%{_datadir}/hal/fdi/policy/10osvendor/ %exclude %{_mandir}/man8/ntfs-3g* %changelog +* Tue Aug 9 2016 Tom Callaway - 2:2016.2.22-2 +- replace non-free ntfsprogs/boot.c with boot-gpl.c (resolves bz1364710) + * Wed Mar 23 2016 Tom Callaway - 2:2016.2.22-1 - update to 2016.2.22 diff --git a/sources b/sources index c117b48..80db28e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -ccbe8672d0f757bd0c975b50aa4c512e ntfs-3g_ntfsprogs-2016.2.22.tgz +86fff2fe6e775e0fbb7f865a3f534f31 ntfs-3g_ntfsprogs-clean-2016.2.22.tgz