--- mbr-1.1.11.orig/Makefile.am +++ mbr-1.1.11/Makefile.am @@ -19,27 +19,17 @@ AS86 = as86 LD86 = ld86 -AM_CFLAGS = -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror +AM_CFLAGS = -Wall -Wstrict-prototypes -Wmissing-prototypes man_MANS = install-mbr.8 -TESTS = tests/version tests/inst-1 tests/inst-2 tests/inst-3 \ - tests/inst-4 tests/inst-5 tests/inst-6 tests/inst-7 tests/inst-8 \ - tests/mbr-1 tests/mbr-2 tests/mbr-3 tests/mbr-4 \ - tests/mbr-5 tests/mbr-6 \ - tests/testdisk-1 tests/testdisk-2 tests/testdisk-3 \ - tests/testdisk-4 tests/testdisk-5 tests/testdisk-6 +TESTS = tests/inst-1 tests/inst-3 \ + tests/inst-4 tests/inst-6 tests/inst-7 tests/inst-8 TESTS_ENVIRONMENT = sh wraptest check_DATA = \ table.b \ - mbr.b \ - mbr-1.1.3.b \ - mbr-1.1.2.b \ - mbr-1.1.1.b \ - mbr-1.1.0.b \ - mbr-1.0.1.b \ - mbr-1.0.0.b + mbr.b EXTRA_DIST = table.S86 historic,v ${TESTS} ${man_MANS} --- mbr-1.1.11.orig/Makefile.in +++ mbr-1.1.11/Makefile.in @@ -181,25 +181,15 @@ noinst_SCRIPTS = wraptest AS86 = as86 LD86 = ld86 -AM_CFLAGS = -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror +AM_CFLAGS = -Wall -Wstrict-prototypes -Wmissing-prototypes man_MANS = install-mbr.8 -TESTS = tests/version tests/inst-1 tests/inst-2 tests/inst-3 \ - tests/inst-4 tests/inst-5 tests/inst-6 tests/inst-7 tests/inst-8 \ - tests/mbr-1 tests/mbr-2 tests/mbr-3 tests/mbr-4 \ - tests/mbr-5 tests/mbr-6 \ - tests/testdisk-1 tests/testdisk-2 tests/testdisk-3 \ - tests/testdisk-4 tests/testdisk-5 tests/testdisk-6 +TESTS = tests/inst-1 tests/inst-3 \ + tests/inst-4 tests/inst-6 tests/inst-7 tests/inst-8 TESTS_ENVIRONMENT = sh wraptest check_DATA = \ table.b \ - mbr.b \ - mbr-1.1.3.b \ - mbr-1.1.2.b \ - mbr-1.1.1.b \ - mbr-1.1.0.b \ - mbr-1.0.1.b \ - mbr-1.0.0.b + mbr.b EXTRA_DIST = table.S86 historic,v ${TESTS} ${man_MANS} CLEANFILES = *.b *.s86 *.o86 *.lst *.sym test.* test-* \ --- mbr-1.1.11.orig/configure +++ mbr-1.1.11/configure @@ -3262,7 +3262,7 @@ -if uname -m | grep -q 'i[0-9]86'; then +if uname -sm | grep -q 'Linux i[0-9]86'; then HAVE_VM86_TRUE= HAVE_VM86_FALSE='#' else --- mbr-1.1.11.orig/debian/README-1st.Debian +++ mbr-1.1.11/debian/README-1st.Debian @@ -0,0 +1,20 @@ +mbr for Debian +-------------- + +This package used to consist essentialy of the file /boot/mbr.b, which was +used by the `lilo' package. Now this has changed and the lilo package uses +the install-mbr program to install our mbr if you want it. + +You can also use the install-mbr by yourself, even to put our mbr on +machines that don't have Debian or Linux at all, as our mbr is capable of +loading other OS loaders, and being small it has some nice things, like our +prompt allowing us to boot from different drives/partitions, or now the Y2K +patch for some buggy BIOSes. + +The README file included in this directory is from the source package and it +is included here for completeness, you don't have to follow what it says if +you are letting liloconfig install the mbr for you, but if you want to +install the mbr by yourself you should give it a look. + +If you want to see how the mbr interacts with lilo, see +/usr/sbin/liloconfig. --- mbr-1.1.11.orig/debian/changelog +++ mbr-1.1.11/debian/changelog @@ -0,0 +1,226 @@ +mbr (1.1.11-5ubuntu1) xenial; urgency=medium + + * install-mbr.c: Read "RTC is in local time" setting from /etc/adjtime + instead of /etc/default/rcS. (Closes: #813671, LP: #1541532) + + -- Martin Pitt Fri, 05 Feb 2016 13:40:36 +0100 + +mbr (1.1.11-5) unstable; urgency=low + + * Add dh_md5sums to debian/rules, thanks to jmccrohan. Closes: #672321. + * Change build targets thanks to lintian. + + -- Santiago Garcia Mantinan Sun, 13 May 2012 10:24:15 +0200 + +mbr (1.1.11-4) unstable; urgency=low + + * Try to fix building on kfreebsd-i386 not building the harness. + + -- Santiago Garcia Mantinan Fri, 15 Apr 2011 19:57:48 +0200 + +mbr (1.1.11-3) unstable; urgency=low + + * Fix couple of bashishms on tests so that we build on pure i386. + * Run tests only once. + + -- Santiago Garcia Mantinan Fri, 15 Apr 2011 19:37:31 +0200 + +mbr (1.1.11-2) unstable; urgency=low + + * Stop tests on non i386. Closes: #516644. + * It was also failing on pure i386 when run as nonroot, had to + remove all the tests that were failing on current kernels. + + -- Santiago Garcia Mantinan Thu, 14 Apr 2011 20:49:59 +0200 + +mbr (1.1.11-1) unstable; urgency=low + + * The after a long long wait release. + + [ Santiago Garcia Mantinan ] + * New upstream version. + * Change mbr's architecture to any (not for the udeb). Closes: #516644. + * Bump standards version to 3.9.1. + + [ Cody A.W. Somerville ] + * debian/control: Closes: #535098. + - Add mbr-udeb binary package for use with debian-installer. + - Add build-dependency on debhelper. + * debian/compat: Set to level debhelper compat level 7 + * debian/rules: Rewrote to use debhelper. + + -- Santiago Garcia Mantinan Tue, 05 Apr 2011 22:27:33 +0200 + +mbr (1.1.10-2) unstable; urgency=low + + * Added patch from upstream, thanks to Loïc for reporting and sending + the patch. Closes: #509285. + + -- Santiago Garcia Mantinan Sat, 27 Dec 2008 00:49:19 +0100 + +mbr (1.1.10-1) unstable; urgency=low + + * New upstream version. + * Compile with support for large files. Closes: #418297. + * Add support for lpia architecture. Closes: #454203. + * Get a 64-bit installer where available. Closes: #382812. + + -- Santiago Garcia Mantinan Sat, 29 Dec 2007 20:15:27 +0100 + +mbr (1.1.9-3) unstable; urgency=low + + * Fix FTBFS on amd64 (Thanks Daniel). Closes: #434307. + * Fix FTBFS on i386 64 bits (Thanks Daniel and Colin). Closes: #439283. + * Merge Ubuntu's clear the ID flag in test harness output. + + -- Santiago Garcia Mantinan Mon, 08 Oct 2007 21:25:11 +0200 + +mbr (1.1.9-2) unstable; urgency=low + + * Fix FTBFS on new kernels. Closes: #392776. + * Bashisms should be now gone. Closes: #382586. + + -- Santiago Garcia Mantinan Sat, 25 Nov 2006 20:41:01 +0100 + +mbr (1.1.9-1) unstable; urgency=low + + * New upstream version. + + -- Santiago Garcia Mantinan Tue, 3 Oct 2006 19:48:03 +0200 + + +mbr (1.1.8-2) unstable; urgency=low + + * Change section to accomodate to override. + + -- Santiago Garcia Mantinan Tue, 23 May 2006 00:02:53 +0200 + +mbr (1.1.8-1) unstable; urgency=low + + * The "I thought nobody used mbr anymore" release. + + [ Santiago Garcia Mantinan ] + * New upstream version. + * Bump up Standards-Version. + * Change description so that it is OS independant. + + [ Goswin von Brederlow ] + * Port to amd64 (closes: #330190) + + debian/rules: set CC and LD + + debian/rules: add -W to CFLAGS for proper warnings + + debian/control: Build-Depend on libc6-dev-i386 [amd64] and + (temporary) on ia32-libs [amd64] for dpkg-shlibdeps to work + * Fix potentialy harmfull warnings + + harness/args.c:57: warning: suggest parentheses around arithmetic + + harness/output.c:22: warning: comparison between signed and unsigned + + harness/process.c:25: warning: implicit declaration of function 'exit' + + install-mbr.c:617: warning: return type defaults to 'int' + + install-mbr.c:702: warning: comparison between signed and unsigned + + install-mbr.c:1357: warning: format '%d' expects type 'int', but + argument 4 has type 'char *' + * Enable testsuite partialy + + remove tests for non existing old mbrs + + conditionaly remove runtime test that fail on amd64 + * Fix typo in manpage found by A Costa (Closes: #311235) + + -- Santiago Garcia Mantinan Mon, 22 May 2006 20:45:18 +0200 + +mbr (1.1.5-2) unstable; urgency=low + + * The "we are no longer required for anything" release. + * Updated Standards-Version to 3.6.1 thanks to Santiago Vila. + * Lowered priority to optional. Closes: #169492. + + -- Santiago Garcia Mantinan Sat, 29 May 2004 13:16:27 +0200 + +mbr (1.1.5-1) unstable; urgency=low + + * New upstream version. + + -- Santiago Garcia Mantinan Mon, 17 Sep 2001 12:12:17 +0200 + +mbr (1.1.4-1) unstable; urgency=low + + * New upstream version, extends the maximum time limit. Closes #95528. + + -- Santiago Garcia Mantinan Wed, 25 Jul 2001 12:23:36 +0200 + +mbr (1.1.3-1) unstable; urgency=low + + * New maintainer. + * New upstream version, includes my Y2K fix for some buggy BIOSes. + * Removed /boot/mbr.b as now lilo uses install-mbr to install it. + + -- Santiago Garcia Mantinan Wed, 11 Apr 2001 21:46:34 +0200 + +mbr (1.1.2-2) unstable; urgency=low + + * Added a Depends: line (because of the install-mbr program). + * Build-Depends: bin86. + + -- Santiago Vila Sat, 9 Sep 2000 19:01:54 +0200 + +mbr (1.1.2-1) frozen unstable; urgency=low + + * Installed upstream ChangeLog in the doc directory. + * Fixed install-mbr manpage (Bug #58799). + * Added set -e to prerm and postinst. + * New upstream release: The MBR now prints out the string "MBR" to show + it's presence. Initial logo code by Tom Rothamel (Bug #56973). + + -- Santiago Vila Fri, 3 Mar 2000 20:32:35 +0100 + +mbr (1.1.1-1) unstable; urgency=low + + * Standards-Version: 3.1.1. + * New upstream release, featuring: + - Added support for accessing large disks (>8G). + - Added the install-mbr utility. + + -- Santiago Vila Thu, 13 Jan 2000 12:18:39 +0100 + +mbr (1.0.1-1) unstable; urgency=low + + * New upstream release, containing a lot of fixes + from Kalle Olavi Niemitalo . + + -- Santiago Vila Tue, 21 Sep 1999 11:48:57 +0200 + +mbr (1.0.0-7) unstable; urgency=low + + * Updated source URL in copyright file (Bug #34874). + * Pristine source. + + -- Santiago Vila Wed, 7 Apr 1999 17:19:51 +0200 + +mbr (1.0.0-6) unstable; urgency=low + + * Allow building with both old and new as86 (thanks to Juan Cespedes). + * Removed debstd dependency. + * Compressed changelog.Debian. + * New maintainer. + + -- Santiago Vila Fri, 12 Dec 1997 13:45:35 +0100 + +mbr (1.0.0-5) unstable; urgency=low + + * Rebuilt with debmake 3.2.0 to change md5sums filename. + + -- Santiago Vila Wed, 19 Feb 1997 21:44:28 +0100 + +mbr (1.0.0-4) unstable; urgency=low + + * Remade .orig source from original HTTP site. There was a missing file. + * Rewritten using debmake. This fixes a typo in Standards Version + number, makes debian/rules clean target to actually remove + debian/files, copies changelog.Debian to /usr/doc/mbr and + adds MD5 sums automatically. + * Added README-1st.Debian, following a suggestion by Ian Jackson. + + -- Santiago Vila Sat, 15 Feb 1997 18:48:48 +0100 + +mbr (1.0.0-3) unstable; urgency=low + + * Upgraded to new packaging standards. + + -- Shaya Potter Thu, 23 Jan 1997 13:16:08 -0500 --- mbr-1.1.11.orig/debian/compat +++ mbr-1.1.11/debian/compat @@ -0,0 +1 @@ +7 --- mbr-1.1.11.orig/debian/control +++ mbr-1.1.11/debian/control @@ -0,0 +1,25 @@ +Source: mbr +Section: admin +Priority: optional +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Santiago Garcia Mantinan +Standards-Version: 3.9.3 +Build-Depends: debhelper(>= 7), bin86, util-linux (>= 2.13) | linux32 + +Package: mbr +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Master Boot Record for IBM-PC compatible computers. + The MBR is used in booting operating systems from the hard disk. It + runs first, then transfers control to the operating system's loader + which transfers control to the kernel. + +Package: mbr-udeb +Architecture: i386 amd64 lpia +Depends: ${shlibs:Depends}, ${misc:Depends} +Priority: extra +Section: debian-installer +XC-Package-Type: udeb +XB-Installer-Menu-Item: 99999 +Description: Master Boot Record for IBM-PC compatible computers + --- mbr-1.1.11.orig/debian/copyright +++ mbr-1.1.11/debian/copyright @@ -0,0 +1,31 @@ +This is Debian GNU/Linux's prepackaged version of the MBR Master Boot +Record for IBM PC compatible computers, by Neil Turton. MBR is used +in conjunction with other boot loaders such as LILO and the DOS boot +loader, which are installed on hard disk partitions. MBR makes it possible +to select one of these partition boot loaders for booting. + +The author of this program is Neil Turton . + +This package was first put together by Bruce Perens , +then it was maintained by Santiago Vila and it is +currently maintained by Santiago García Mantiñán . + +The source for this release was taken from: + +http://www.chiark.greenend.org.uk/~neilt/mbr/ + +Program Copyright (C) 1995, 1999-2001 Neil Turton. +Modifications for Debian GNU/Linux Copyright (C) 1995 Bruce Perens. + +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 2, 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. + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. --- mbr-1.1.11.orig/debian/rules +++ mbr-1.1.11/debian/rules @@ -0,0 +1,67 @@ +#!/usr/bin/make -f + +KERNEL_ARCH := $(shell linux64 uname -m) + +CC := gcc -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 + +CFLAGS := -g -Wall -W +INSTALL_PROGRAM := install + +ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O2 +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif + +build: build-arch build-indep + +build-arch: build-stamp + +build-indep: build-stamp + +build-stamp: + ./configure --exec-prefix=`pwd`/debian/mbr/ --prefix=`pwd`/debian/mbr/usr + $(MAKE) CC="$(CC)" LD="$(LD)" CFLAGS="$(CFLAGS)" +ifneq (,$(findstring x86_64,$(KERNEL_ARCH))) + # Limit the tests on x86_64 kernels +else ifeq (i386,$(DEB_BUILD_ARCH)) + $(MAKE) check +else + # Limit the tests on non i386 +endif + touch build + +clean: + dh_testdir + dh_testroot + dh_clean + [ ! -f Makefile ] || $(MAKE) distclean + rm -f build + +install: build + dh_testdir + dh_testroot + dh_prep + dh_installdirs -p mbr-udeb sbin + dh_installdocs -p mbr debian/README-1st.Debian NEWS README AUTHORS + dh_installchangelogs + $(MAKE) install INSTALL_PROGRAM="$(INSTALL_PROGRAM)" + cp `pwd`/debian/mbr/sbin/install-mbr `pwd`/debian/mbr-udeb/sbin/ + +binary-indep: build + dh_testdir + +binary-arch: build install + dh_testdir + dh_testroot + dh_compress + dh_fixperms + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch + +.PHONY: binary binary-arch binary-indep clean --- mbr-1.1.11.orig/debian/watch +++ mbr-1.1.11/debian/watch @@ -0,0 +1,5 @@ + +version=3 + +http://www.chiark.greenend.org.uk/~neilt/mbr/mbr-(.*)\.tar\.gz + --- mbr-1.1.11.orig/harness/Makefile.am +++ mbr-1.1.11/harness/Makefile.am @@ -12,4 +12,4 @@ time.c \ vm86.c -AM_CFLAGS = -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -g -m32 +AM_CFLAGS = -Wall -Wstrict-prototypes -Wmissing-prototypes -g -m32 --- mbr-1.1.11.orig/harness/Makefile.in +++ mbr-1.1.11/harness/Makefile.in @@ -154,7 +154,7 @@ time.c \ vm86.c -AM_CFLAGS = -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -g -m32 +AM_CFLAGS = -Wall -Wstrict-prototypes -Wmissing-prototypes -g -m32 all: all-am .SUFFIXES: --- mbr-1.1.11.orig/install-mbr.8 +++ mbr-1.1.11/install-mbr.8 @@ -17,7 +17,6 @@ .\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. .\" .TH INSTALL\-MBR 8 "16 April 2006" "Linux" "Linux Administrator's Manual" -.. .SH NAME install\-mbr \- install a Master Boot Record manager .SH SYNOPSIS @@ -50,7 +49,6 @@ .RI < partition >] .RB " [" --timeout .RI < timeout >] -.. .SH DESCRIPTION .B install\-mbr installs and configures a Master Boot Record manager on a device. The @@ -59,7 +57,6 @@ .RI < target > is the path specifying the device (or file) that the boot manager should be installed onto. -.. .SH MBR BEHAVIOUR When the MBR is first loaded it waits for a configurable length of time (1 second by default), monitoring the keyboard for key presses. @@ -70,7 +67,6 @@ will load the first sector of the default partition and execute it. If a disk error occurs or the boot signature is missing, the prompt will be displayed. -.. .SS The boot prompt The boot prompt looks something like this: .IP @@ -91,7 +87,6 @@ .P The list of valid partitions and the default partition can be configured through the -e and -p options to install-mbr. -.. .SH OPTIONS .SS Installation options These options change the way the installation program operates. @@ -99,7 +94,6 @@ .BR --force ", " -f This option currently overrides a check to make sure the specified target is valid. -.. .HP .B --install .RI < path >, @@ -112,12 +106,10 @@ It is mainly useful for testing, but may be used to install older versions of the MBR. .RE -.. .TP .BR --keep ", " -k This option instructs the installer to modify the parameters stored in the MBR without updating the code. -.. .TP .BR --list ", " -l This option may be used to view the parameters being installed in the @@ -126,12 +118,10 @@ flags unless an option other than .BR --offset , " --verbose " or " --list" is given. This allows the contents of the MBR to be examined. -.. .TP .BR --no\-act ", " -n This option ensures that the target is not modified, as it is opened in read-only mode. -.. .HP .B --offset .RI < offset >, @@ -143,7 +133,6 @@ the start of the target at which the MBR should be installed. For example, an offset of 128 may be used for DOSEMU disk images. .RE -.. .TP .BR --y2kbug [ =utc | =local | =off "], " -y [ u | l | - ] .RS @@ -161,7 +150,6 @@ boots. If the argument is .BR "=off " or " -" the Y2K bug fix is disabled. -.. .BR WARNING: The Y2K bug fix will work fine until you want to set the date backwards. When you do want to do this, you will need to reinstall @@ -169,7 +157,6 @@ point of this option is that the year provided by the BIOS is ignored). .RE -.. .HP .B --parameters .RI < path >, @@ -181,14 +168,12 @@ has been installed and parameters are read from there. It could be used to copy parameters from one disk to another disk. .RE -.. .TP .BR --reset ", " -r This option is used to reset the boot parameters to the state found in the code being installed (or code which would be installed if .B --keep were not specified). -.. .HP .B --table .RI < path >, @@ -207,29 +192,24 @@ made to the original partition table will not be noticed. This option is only provided to make installation to floppy easy. .RE -.. .TP .BR --verbose ", " -v When invoked with this option, .B install\-mbr will display some information about what it is doing. -.. .TP .BR --version ", " -V This option will cause .B install\-mbr to display it's version number and exit. -.. .TP .BR --help ", " -h This option will cause .B install\-mbr to display a help message and exit. -.. .SS Parameter options These options change the parameters stored within the Master Boot Record. -.. .HP .B --drive .RI < drive >, @@ -240,7 +220,6 @@ hard disk. It may be specified in decimal or hexadecimal if prefixed with 0x. Hard disks are numbered starting from 128 (0x80). .RE -.. .HP .B --enable .RI < option >, @@ -259,7 +238,6 @@ .RI < spec >. .RI < spec > may contain: -.. .TP .BR 1 ", " 2 ", " 3 ", " 4 The specified partition number. @@ -270,7 +248,6 @@ .B A Advanced mode (not a boot sector). .RE -.. .HP .B --interrupt .RI < mode >, @@ -280,7 +257,6 @@ This option sets the list of events which will cause the MBR to display it's prompt. Use -i + to add an event to the list or -i - to remove an event from the list. Values of are: -.. .TP .B s A shift or control key is pressed. @@ -294,7 +270,6 @@ .B n Never display the prompt (unless an error occurs). .RE -.. .HP .B -p .RI < partn >, @@ -304,7 +279,6 @@ This specifies the default boot sector to load. Valid values of .RI < partn > are: -.. .TP .BR 1 ", " 2 ", " 3 ", " 4 The specified partition number. @@ -315,7 +289,6 @@ .B D The partition marked with the bootable flag in the partition table. .RE -.. .HP .B -t .RI < timeout >, @@ -326,7 +299,6 @@ the default partition to the value specified in 1/18 seconds (approx). The maximum timeout that can be specified is 65534 which is about an hour. .RE -.. .SH EXAMPLES .B install\-mbr /dev/fd0 -T /dev/hda @@ -348,7 +320,7 @@ taking code from .BR my\-mbr , partition table from -.B/dev/hda +.B /dev/hda and parameters from my\-parameters. .B install\-mbr -l -o 128 hdimage @@ -379,7 +351,6 @@ Enabled booting from the floppy drive, and disable advanced mode. Display the prompt if any shift, control or non shift-like key is pressed. Other settings are untouched. -.. .SH DIAGNOSTICS .TP .B Cannot handle MBR version n (backwards compatible to n) @@ -391,16 +362,13 @@ .B --reset option (without specifying .BR --keep ). -.. .SH "SEE ALSO" .BR grub (8), .BR lilo (8) -.. .SH BUGS The operation of .B --list may be confusing. -.. .SH AUTHOR .B install\-mbr was written for the Debian project by Neil Turton --- mbr-1.1.11.orig/install-mbr.c +++ mbr-1.1.11/install-mbr.c @@ -132,6 +132,8 @@ struct mbr_params_v1 *params; uint ver_compat; + (void)quiet; + #if 0 fprintf(stderr, "Looking for params at %p\n", mbr); #endif @@ -172,6 +174,8 @@ static const char sig[] = MP_V2_SIG; struct mbr_params_v2 *params = (void*)(dsc->data + offset); + (void)quiet; + /* Check the signature. */ if (memcmp(params->sig, sig, sizeof(sig))) return NULL; @@ -1220,39 +1224,30 @@ if (!optarg) { /* Try to determine the which timezone the RTC is set to. */ - FILE *debdef=fopen("/etc/default/rcS", "r"); + FILE *adjtime=fopen("/etc/adjtime", "r"); /* Default to UTC */ optarg="u"; - if(debdef == NULL) + if(adjtime == NULL) { if (errno!=ENOENT) { - perror("Could not open /etc/default/rcS"); + perror("Could not open /etc/adjtime"); exit(1); } } else { - char line[8]; - int c; - while (fgets(line, 8, debdef)) - { - if (!memcmp("UTC=no\n", line, 7)) { - optarg="l"; - break; - } - if (strchr(line, '\n') == NULL) - { - do { c = getc(debdef); } while (c != EOF && c != '\n'); - if (c == EOF) - break; - } - } - if (ferror (debdef) || fclose(debdef)) + char buffer[1024]; + size_t r; + r = fread(buffer, 1, sizeof(buffer), adjtime); + if (ferror (adjtime) || fclose(adjtime)) { - perror("Error reading /etc/default/rcS"); + perror("Error reading /etc/adjtime"); exit(1); } + buffer[r] = '\0'; /* ensure it's terminated */ + if (strstr(buffer, "LOCAL")) + optarg="l"; } } if (!strcmp(optarg, "-") || --- mbr-1.1.11.orig/tests/inst-1 +++ mbr-1.1.11/tests/inst-1 @@ -2,7 +2,7 @@ # Basic installation tests. set -e dd if=/dev/zero of=test-old bs=510 count=1 2>/dev/null -echo -ne '\0125\0252' >>test-old +printf '\125\252' >>test-old # Do install dd if=test-old of=test-mbr 2>/dev/null --- mbr-1.1.11.orig/wraptest.in +++ mbr-1.1.11/wraptest.in @@ -1,21 +1,21 @@ #! /bin/sh set -e -function do_cmp { +do_cmp () { local X Y ; X=$1 ; Y=$2 ; shift ; shift dd if=$X of=test-x "$@" 2>/dev/null dd if=$Y of=test-y "$@" 2>/dev/null cmp test-x test-y } -function do_install { +do_install () { ./install-mbr "$@" } -function run_dos { +run_dos () { exit 1 } -function harness { +harness () { @HAVE_VM86_FALSE@ exit 77 @HAVE_VM86_TRUE@ harness/harness "$@" } @@ -23,7 +23,7 @@ for TEST in "$@" do rm -f test-* dd if=/dev/zero of=test-old bs=510 count=1 2>/dev/null - echo -ne '\0125\0252' >>test-old + printf '\125\252' >>test-old dd if=table.b of=test-mbr bs=512 count=1 2>/dev/null . $TEST done