From: Joachim Wiedorn Date: Sun, 22 Nov 2015 00:41:18 +0000 (+0100) Subject: Imported Upstream version 24.2 X-Git-Tag: upstream/24.2^0 X-Git-Url: https://git.rrq.au/?a=commitdiff_plain;h=6474a619fc4572914f921cbff9d72784c1792966;p=rrq%2Fmaintain_lilo.git Imported Upstream version 24.2 --- diff --git a/CHANGELOG b/CHANGELOG index b9a3bc7..657a0fd 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,23 @@ +Changes for version 24.2 (22-November-2015) - Joachim Wiedorn + + Sources + ------- + - Remove compile date and time in binary to support reproducible + builds (thanks to Dmitry Bogatov). + - Remove obsolete hints to /boot/boot.b and other files in README. + - Use system derived types to make code safe for both the 32-bit and + the 64-bit compilation environment. (thanks to TAMUKI Shoichi) + + General + ------- + - Update sample config file lilo.example.conf and config element + 'password'. + - Upgrade of script liloconfig: + * three steps of tests with three-state exit code + to give the admin more information about failure. + - Update manpage pod files and its manpages. + + Changes for version 24.1 (17-October-2014) - Joachim Wiedorn Documentations diff --git a/Makefile b/Makefile index c7f931c..593ce11 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # -*- makefile -*- # -# Copyright 2009-2014 Joachim Wiedorn +# Copyright 2009-2015 Joachim Wiedorn # All rights reserved. # # Licensed under the terms contained in the file 'COPYING' diff --git a/NEWS b/NEWS index bf32875..eba887e 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,12 @@ NEWS about project LILO (For details see file 'CHANGELOG' in the source directory) +Version 24.2 (minor and bugfix update of 24.1) + + o Remove compile date and time in binary. + o Add 'password' element into example config file. + o Upgrade of liloconfig script and manpage. + Version 24.1 (minor and bugfix update of 24.0) o Install .dat files of images, too. diff --git a/TODO b/TODO index 66ac4b9..cb6fc39 100644 --- a/TODO +++ b/TODO @@ -7,6 +7,6 @@ TODO for project LILO * patching sources because of some warnings while compiling with gcc 4.4.x and higher -* Upgrade of all manpages (move to po files). +* Upgrade of all manpages (move to pot files). * code cleanup. diff --git a/TOOLS b/TOOLS index de53440..9a0df15 100644 --- a/TOOLS +++ b/TOOLS @@ -8,17 +8,17 @@ they can be found in: at least tested programs package version until inside ----------------------------------------------------------------- -coreutils 6.4.10 8.13 (general) +coreutils 6.4.10 8.23 (general) bcc 0.16.14 0.16.17 bcc bin86 0.16.14 0.16.17 as86, ld86 -gcc 3.3.5 4.9.1 gcc +gcc 3.3.5 5.2.1 gcc -sharutils 4.6.3 4.14 uuencode, uudecode +sharutils 4.6.3 4.15.2 uuencode, uudecode -perl 5.8.4 5.14.2 pod2man +perl 5.8.4 5.20.2 pod2man @@ -32,8 +32,8 @@ they can be found in: at least tested programs package version until inside ----------------------------------------------------------------- -perl 5.8.8 5.14.2 (general) +perl 5.8.8 5.20.2 (general) -perl-modules 5.8.8 5.14.2 Getopt::Std, +perl-modules 5.8.8 5.20.2 Getopt::Std, Pod::Usage File::Copy diff --git a/lilo.lsm b/lilo.lsm index 0fd040b..b1363e2 100644 --- a/lilo.lsm +++ b/lilo.lsm @@ -1,16 +1,16 @@ Begin4 Title: LILO -Version: 24.1 -Entered-date: 2014-10-17 +Version: 24.2 +Entered-date: 2015-11-22 Description: Generic boot loader for Linux. Distribution includes full source, documentation and support files. Keywords: Linux, boot loader, LILO Author: Joachim Wiedorn -Maintained-by: Joachim Wiedorn +Maintained-by: Joachim Wiedorn Primary-site: http://lilo.alioth.debian.org/ Original-site: http://lilo.alioth.debian.org/ Alternate-site: http://alioth.debian.org/projects/lilo/ (developer's site) -Files: 754kB lilo-24.1.tar.gz +Files: 766kB lilo-24.2.tar.gz Platforms: Linux (>= 2.4.0), gcc (>= 3.3.5), as86 (>= 0.16.14) needed to compile. bcc (0.16.14) needed to compile diagnostic disk 2 & DOS *.com. diff --git a/man/lilo-uuid-diskid.8 b/man/lilo-uuid-diskid.8 index 13aa424..3c1a88b 100644 --- a/man/lilo-uuid-diskid.8 +++ b/man/lilo-uuid-diskid.8 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== @@ -38,6 +38,8 @@ . ds PI \(*p . ds L" `` . ds R" '' +. ds C` +. ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. @@ -48,21 +50,28 @@ .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. -.ie \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" +.\" +.\" Avoid warning from groff about undefined register 'F'. +.de IX .. -. nr % 0 -. rr F -.\} -.el \{\ -. de IX +.nr rF 0 +.if \n(.g .if rF .nr rF 1 +.if (\n(rF:(\n(.g==0)) \{ +. if \nF \{ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" .. +. if !\nF==2 \{ +. nr % 0 +. nr F 2 +. \} +. \} .\} +.rr rF .\" ======================================================================== .\" .IX Title "LILO-UUID-DISKID 8" -.TH LILO-UUID-DISKID 8 "2014-10-13" "24.1" "lilo documentation" +.TH LILO-UUID-DISKID 8 "2015-11-22" "24.2" "lilo documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/man/lilo-uuid-diskid.pod b/man/lilo-uuid-diskid.pod index 27fb4b9..2fd9a12 100644 --- a/man/lilo-uuid-diskid.pod +++ b/man/lilo-uuid-diskid.pod @@ -2,8 +2,8 @@ manpage: LILO-UUID-DISKID section: 8 title: lilo documentation -version: 24.1 -datum: 2014-10-13 +version: 24.2 +datum: 2015-11-22 =encoding utf8 diff --git a/man/lilo.8 b/man/lilo.8 index c16e6da..b12bc79 100644 --- a/man/lilo.8 +++ b/man/lilo.8 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== @@ -38,6 +38,8 @@ . ds PI \(*p . ds L" `` . ds R" '' +. ds C` +. ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. @@ -48,21 +50,28 @@ .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. -.ie \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" +.\" +.\" Avoid warning from groff about undefined register 'F'. +.de IX .. -. nr % 0 -. rr F -.\} -.el \{\ -. de IX +.nr rF 0 +.if \n(.g .if rF .nr rF 1 +.if (\n(rF:(\n(.g==0)) \{ +. if \nF \{ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" .. +. if !\nF==2 \{ +. nr % 0 +. nr F 2 +. \} +. \} .\} +.rr rF .\" ======================================================================== .\" .IX Title "LILO 8" -.TH LILO 8 "2014-10-15" "24.1" "lilo documentation" +.TH LILO 8 "2015-11-22" "24.2" "lilo documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -113,7 +122,7 @@ Normally, only primary partitions [1..4] may be activated, but if the 'Extended Master Boot Loader' is present on the Master Boot Record (\s-1MBR\s0) of the device (see the \-M option), any partition may be made active. Whether the actual \s-1OS\s0 in the partition will boot from a logical partition depends on the characteristics -of the \s-1OS\s0. \s-1LILO\s0 boot records for Linux may be booted from a logical partition. +of the \s-1OS. LILO\s0 boot records for Linux may be booted from a logical partition. .IP "\fB\-b\fR \fIbootdev\fR" 4 .IX Item "-b bootdev" Set the boot device where the boot loader will be installed. For example @@ -173,7 +182,7 @@ Compare with \fI\-P ignore\fR, which bypasses certain partition table checks. .IP "\fB\-g\fR" 4 .IX Item "-g" Generate 'cylinder/head/sector' (\s-1CHS\s0 geometric) disk addresses. Limited to cylinders -up to 1023. Forces compatibility with very old versions of \s-1LILO\s0 \fI(obsolete switch)\fR. +up to 1023. Forces compatibility with very old versions of \s-1LILO \s0\fI(obsolete switch)\fR. .IP "\fB\-H\fR" 4 .IX Item "-H" Override fatal halt if a \s-1RAID\s0 array does not have all disks active. @@ -201,7 +210,7 @@ Use another map file instead of the default file /boot/map. Install a Master Boot Record on the device specified as master-device, selecting the Standard or Extended Master Boot Loader per option. The primary partition table on master-device is undisturbed. If no valid Volume-ID (serial number) is -present, then generate one and write it to the \s-1MBR\s0. If \fImbr\fR is set, the +present, then generate one and write it to the \s-1MBR.\s0 If \fImbr\fR is set, the Standard Master Boot Loader will search partitions 1\-4 for an active flag, and boot the flagged partition. Only one active flag is allowed. If \fIext\fR is set, the search for an active partition will include logical partitions as well. @@ -327,7 +336,7 @@ versions is achieved using the \fI'\-x mbr\-only'\fR switch. .IX Item "-X" Reserved for \s-1LILO\s0 internal use. May produce different output for different \s-1LILO\s0 versions. The line beginning \*(L"CFLAGS=\*(R" will contain the compiler options used to -generate this version of \s-1LILO\s0. +generate this version of \s-1LILO.\s0 .IP "\fB\-z\fR" 4 .IX Item "-z" When used with the '\-M' switch, clears the Volume-ID. Usually used in the @@ -340,7 +349,7 @@ following sequence to generate a new Volume-ID: .IP "\fB\-Z\fR \fIoption\fR" 4 .IX Item "-Z option" Tells the boot installer whether special precautions need to be taken because -the \s-1BIOS\s0 fails to pass the correct device code in \s-1DL\s0 (\-Z0). Or may specify +the \s-1BIOS\s0 fails to pass the correct device code in \s-1DL \s0(\-Z0). Or may specify that the \s-1BIOS\s0 always gets \s-1DL\s0 right (\-Z1). Corresponds to, and overrides, the configuration file option 'bios\-passes\-dl='. .SH "CONFIG OPTIONS" @@ -372,7 +381,7 @@ indicated below. .SH "BOOT OPTIONS" .IX Header "BOOT OPTIONS" The options described here may be specified at boot time on the command line -when a kernel image is booted. These options are processed by \s-1LILO\s0, and are +when a kernel image is booted. These options are processed by \s-1LILO,\s0 and are removed from the command line before it is passed to the kernel, unless otherwise noted. .IP "\fBlock\fR" 4 @@ -392,13 +401,13 @@ non-IBM-compliant \s-1BIOS\s0's which hang with the lines: \& Loading............... \& BIOS data check .Ve -.IP "\fBvga=[\s-1ASK\s0,EXT,EXTENDED,NORMAL,###,0x###]\fR" 4 +.IP "\fBvga=[\s-1ASK,EXT,EXTENDED,NORMAL\s0,###,0x###]\fR" 4 .IX Item "vga=[ASK,EXT,EXTENDED,NORMAL,###,0x###]" Allows overriding the default video mode upon kernel startup. .SH "BOOT ERRORS" .IX Header "BOOT ERRORS" The boot process takes place in two stages. The first stage loader is a single -sector, and is loaded by the \s-1BIOS\s0 or by the loader in the \s-1MBR\s0. It loads the +sector, and is loaded by the \s-1BIOS\s0 or by the loader in the \s-1MBR.\s0 It loads the multi-sector second stage loader, but is very space limited. When the first stage loader gets control, it types the letter 'L'; when it is ready to transfer control to the second stage loader it types the letter 'I'. If any @@ -426,19 +435,19 @@ codes follows: \& FF sense operation failed .Ve .PP -Error code 40 is generated by the \s-1BIOS\s0, or by \s-1LILO\s0 during the conversion of a +Error code 40 is generated by the \s-1BIOS,\s0 or by \s-1LILO\s0 during the conversion of a linear (24\-bit) disk address to a geometric (C:H:S) address. On older systems which do not support lba32 (32\-bit) addressing, this error may also be generated. Errors 99 and 9A usually mean the map file ('\-m' or 'map=') is not readable, likely because \s-1LILO\s0 was not re-run after some system change, or there is a geometry mismatch between what \s-1LILO\s0 used (lilo \-v3 to display) and what is -actually being used by the \s-1BIOS\s0 (one of the lilo diagnostic disks, available +actually being used by the \s-1BIOS \s0(one of the lilo diagnostic disks, available in the source distribution, may be needed to diagnose this problem). .PP When the second stage loader has received control from the first stage, it prints the letter 'L', and when it has initialized itself, including verifying the \*(L"Descriptor Table\*(R" \- the list of kernels/others to boot \- it will print -the letter \*(L"O\*(R", to form the full word \*(L"\s-1LILO\s0\*(R", in uppercase. +the letter \*(L"O\*(R", to form the full word \*(L"\s-1LILO\*(R",\s0 in uppercase. .PP All second stage loader error messages are English text and try to pinpoint, more or less successfully, the point of failure. diff --git a/man/lilo.pod b/man/lilo.pod index 39e6f68..cf2c194 100644 --- a/man/lilo.pod +++ b/man/lilo.pod @@ -2,8 +2,8 @@ manpage: LILO section: 8 title: lilo documentation -version: 24.1 -datum: 2014-10-15 +version: 24.2 +datum: 2015-11-22 =encoding utf8 diff --git a/man/liloconfig.8 b/man/liloconfig.8 index b11d2dd..e080bcc 100644 --- a/man/liloconfig.8 +++ b/man/liloconfig.8 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== @@ -38,6 +38,8 @@ . ds PI \(*p . ds L" `` . ds R" '' +. ds C` +. ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. @@ -48,21 +50,28 @@ .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. -.ie \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" +.\" +.\" Avoid warning from groff about undefined register 'F'. +.de IX .. -. nr % 0 -. rr F -.\} -.el \{\ -. de IX +.nr rF 0 +.if \n(.g .if rF .nr rF 1 +.if (\n(rF:(\n(.g==0)) \{ +. if \nF \{ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" .. +. if !\nF==2 \{ +. nr % 0 +. nr F 2 +. \} +. \} .\} +.rr rF .\" ======================================================================== .\" .IX Title "LILOCONFIG 8" -.TH LILOCONFIG 8 "2014-10-13" "24.1" "liloconfig documentation" +.TH LILOCONFIG 8 "2015-11-22" "24.2" "liloconfig documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -108,7 +117,8 @@ Lines in the configuration file /etc/lilo.conf: \& \& #large\-memory \& lba32 -\& boot = /dev/sda +\& #boot = /dev/sda +\& boot = /dev/disk/by\-id/ata\-SAMSUNG_SV1604N_S01FJ10X999999 \& #root = /dev/sda1 \& root = "UUID=18843936\-00f9\-4df0\-a373\-000d05a5dd44" \& map = /boot/map @@ -117,14 +127,12 @@ Lines in the configuration file /etc/lilo.conf: \& prompt \& timeout = 100 \& vga = normal +\& #password = \& #default = Linux \& \& ### LILO per\-image section ### \& -\& #boot = /dev/sda -\& boot = /dev/disk/by\-id/ata\-SAMSUNG_SV1604N_S01FJ10X999999 -\& -\& image = /boot/vmlinuz\-3.12\-trunk\-686 +\& image = /boot/vmlinuz\-3.17\-trunk\-686 \& label = "Linux" \& #root = /dev/sda1 \& #root = "UUID=18843936\-00f9\-4df0\-a373\-000d05a5dd44" @@ -132,9 +140,9 @@ Lines in the configuration file /etc/lilo.conf: \& # restricted \& # alias = 1 \& # optional -\& initrd = /boot/initrd.img\-3.12\-trunk\-686 +\& initrd = /boot/initrd.img\-3.17\-trunk\-686 \& -\& image = /boot/vmlinuz\-3.2.0\-4\-686 +\& image = /boot/vmlinuz\-3.14\-trunk\-686 \& label = "Linux Old" \& #root = /dev/sda1 \& #root = "UUID=18843936\-00f9\-4df0\-a373\-000d05a5dd44" @@ -142,11 +150,11 @@ Lines in the configuration file /etc/lilo.conf: \& # restricted \& # alias = 2 \& # optional -\& initrd = /boot/initrd.img\-3.2.0\-4\-686 +\& initrd = /boot/initrd.img\-3.14\-trunk\-686 .Ve .SH "COPYRIGHT and LICENSE" .IX Header "COPYRIGHT and LICENSE" -Copyright (C) 2011\-2014 Joachim Wiedorn +Copyright (C) 2011\-2015 Joachim Wiedorn .PP This script is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License as published by @@ -154,7 +162,7 @@ the Free Software Foundation; either version 2 of the License, or (at your option) any later version. .SH "AUTHOR" .IX Header "AUTHOR" -\&\fBlilconfig\fR was written by Joachim Wiedorn. +\&\fBliloconfig\fR was written by Joachim Wiedorn. .PP This manual page was written by Joachim Wiedorn . .SH "SEE ALSO" diff --git a/man/liloconfig.pod b/man/liloconfig.pod index ce1b31a..b5c9161 100644 --- a/man/liloconfig.pod +++ b/man/liloconfig.pod @@ -2,8 +2,8 @@ manpage: LILOCONFIG section: 8 title: liloconfig documentation -version: 24.1 -datum: 2014-10-13 +version: 24.2 +datum: 2015-11-22 =encoding utf8 @@ -59,7 +59,8 @@ Lines in the configuration file /etc/lilo.conf: #large-memory lba32 - boot = /dev/sda + #boot = /dev/sda + boot = /dev/disk/by-id/ata-SAMSUNG_SV1604N_S01FJ10X999999 #root = /dev/sda1 root = "UUID=18843936-00f9-4df0-a373-000d05a5dd44" map = /boot/map @@ -68,14 +69,12 @@ Lines in the configuration file /etc/lilo.conf: prompt timeout = 100 vga = normal + #password = #default = Linux ### LILO per-image section ### - #boot = /dev/sda - boot = /dev/disk/by-id/ata-SAMSUNG_SV1604N_S01FJ10X999999 - - image = /boot/vmlinuz-3.12-trunk-686 + image = /boot/vmlinuz-3.17-trunk-686 label = "Linux" #root = /dev/sda1 #root = "UUID=18843936-00f9-4df0-a373-000d05a5dd44" @@ -83,9 +82,9 @@ Lines in the configuration file /etc/lilo.conf: # restricted # alias = 1 # optional - initrd = /boot/initrd.img-3.12-trunk-686 + initrd = /boot/initrd.img-3.17-trunk-686 - image = /boot/vmlinuz-3.2.0-4-686 + image = /boot/vmlinuz-3.14-trunk-686 label = "Linux Old" #root = /dev/sda1 #root = "UUID=18843936-00f9-4df0-a373-000d05a5dd44" @@ -93,11 +92,11 @@ Lines in the configuration file /etc/lilo.conf: # restricted # alias = 2 # optional - initrd = /boot/initrd.img-3.2.0-4-686 + initrd = /boot/initrd.img-3.14-trunk-686 =head1 COPYRIGHT and LICENSE -Copyright (C) 2011-2014 Joachim Wiedorn +Copyright (C) 2011-2015 Joachim Wiedorn This script is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -106,7 +105,7 @@ the Free Software Foundation; either version 2 of the License, or =head1 AUTHOR -B was written by Joachim Wiedorn. +B was written by Joachim Wiedorn. This manual page was written by Joachim Wiedorn . diff --git a/readme/README b/readme/README index aee428c..0c61779 100644 --- a/readme/README +++ b/readme/README @@ -214,14 +214,13 @@ LILO is a collection of several programs and other files: LILO primarily accesses the following parts of the system: - The root file system partition is important for two reasons: first, LILO + The root file system partition is important for two reasons: first, LILO sometimes has to tell the kernel where to look for it. Second, it is frequently a convenient place for many other items LILO uses, such as the boot sector, the /boot directory, and the kernels. - The boot sector contains the first part of LILO's boot loader. It loads - the much larger second-stage loader. Both loaders are typically stored - in the file /boot/boot.b - The kernel is loaded and started by the boot loader. Kernels typically + The boot sector contains the first part of LILO's boot loader. It loads + the much larger second-stage loader. + The kernel is loaded and started by the boot loader. Kernels typically reside in the root directory or in /boot. Note that many of the files LILO needs at boot time have to be accessible @@ -713,7 +712,6 @@ There are four approaches of how such problems can be solved: LILO depends on the BIOS to load the following items: - - /boot/boot.b - /boot/map (created when running /sbin/lilo) - all kernels - the boot sectors of all other operating systems it boots @@ -786,11 +784,10 @@ This case is equivalent to the configurations where only one disk is in the system. The Linux boot sector resides on the first hard disk and the second disk is used later in the boot process. -Only the location of the boot sector matters - everything else -(/boot/boot.b, /boot/map, the root file system, a swap partition, other -Linux file systems, etc.) can be located anywhere on the second disk, -provided that the constraints described in section "BIOS restrictions" are -met. +Only the location of the boot sector matters - everything else (/boot/map, +the root file system, a swap partition, other Linux file systems, etc.) +can be located anywhere on the second disk, provided that the constraints +described in section "BIOS restrictions" are met. Two disks, Linux on second disk, first disk has an extended partition @@ -2216,21 +2213,12 @@ Some of the files contained in lilo-21.tar.gz: Perl script to convert the LaTeX source of the user's guide to plain ASCII. -Files created after make in lilo/ (among others): +Files created after make in lilo source directory (among others): - lilo/boot.b - Combined boot sector. make install puts this file into /boot - lilo/chain.b - Generic chain loader. make install puts this file into /boot - lilo/os2_d.b - Chain loader to load OS/2 from the second hard disk. make install - puts this file into /boot lilo/lilo LILO (map) installer. make install puts this file into /sbin - lilo/activate - Simple boot partition setter. lilo/dparam.com - MS-DOS executable of the disk parameter dumper. + MS-DOS executable of the disk parameter dumper (optional). Normal first-time installation @@ -2243,8 +2231,8 @@ First, you have to install the LILO files: - run make to compile and assemble all parts. - run make install to copy all LILO files to the directories where they're installed. /sbin should now contain the file lilo, /usr/sbin - should contain keytab-lilo.pl, and /boot should contain boot.b, - chain.b, and os2_d.b. + should contain keytab-lilo.pl and /boot should contain some image + files (.bmp). * E.g. /usr/src/lilo @@ -2380,7 +2368,7 @@ The basic procedure is quite straightforward (see also section "BIOS restrictions"): - a file system has to be created on the file system - - the kernel and boot.b have to be copied to the floppy disk + - the kernel has to be copied to the floppy disk - /sbin/lilo has to be run to create the map file This can be as easy as @@ -2388,17 +2376,15 @@ This can be as easy as /sbin/mke2fs /dev/fd0 [ -d /fd ] || mkdir /fd mount /dev/fd0 /fd -cp /boot/boot.b /fd cp /zImage /fd echo image=/fd/zImage label=linux | - /sbin/lilo -C - -b /dev/fd0 -i /fd/boot.b -c -m /fd/map + /sbin/lilo -C - -b /dev/fd0 -c -m /fd/map umount /fd The command line of /sbin/lilo is a little tricky. -C - takes the configuration from standard input (naturally, one could also write the -configuration into a file), -b /dev/fd0 specifies that the boot sector is -written to the floppy disk, -i /fd/boot.b takes the first and second -stage loaders from the floppy, -c speeds up the load process, and -m +configuration into a file), -b /dev/fd0 specifies that the boot sector +is written to the floppy disk, -c speeds up the load process and -m /fd/map puts the map file on the floppy too. diff --git a/readme/README.raid1 b/readme/README.raid1 index 62c57e7..c2e1915 100644 --- a/readme/README.raid1 +++ b/readme/README.raid1 @@ -98,7 +98,7 @@ primary partitions will be described later. MORE TERMINOLOGY ================ -A boot record is "accessible", if it exists on a primary parition, +A boot record is "accessible", if it exists on a primary partition, which may be marked "active"; or it is a Master Boot Record (MBR), written to sector 0 of a drive. @@ -310,7 +310,7 @@ location is acceptable, as long as they are within the same RAID partition which you are making bootable. LILO variations: version 22.2 enforces the placement of the map file -on the RAID parition. Version 22.3 eliminates the need for the +on the RAID partition. Version 22.3 eliminates the need for the boot.b and chain.b files, and relaxes the restriction that the message file be on the RAID partition by copying it into the map file. Likewise, any bitmap= file is copied into the map file, so it diff --git a/sample/lilo.example.conf b/sample/lilo.example.conf index 3bc6724..18f9cac 100644 --- a/sample/lilo.example.conf +++ b/sample/lilo.example.conf @@ -1,4 +1,4 @@ -# /etc/lilo.conf - systemwide LILO configuration (LILO 23) +# /etc/lilo.conf - systemwide LILO configuration (LILO 24) # details see in manpages: lilo(8) and lilo.conf(5) # +-------------------------------------------------------------+ @@ -70,7 +70,8 @@ install = menu # The first character of each part sets the text frontcolor, # the second character of earch part sets the text backcolor, # an upper-case character sets bold face text (frontcolor). -# i.g. 'menu-scheme=wm:rw:wm:Wm'. Possible colors: +# +# E.g. 'menu-scheme=wm:rw:wm:Wm'. Possible colors: # k=black, b=blue, g=green, c=cyan, r=red, m=magenta, y=yellow, w=white. menu-scheme = Wb:Yr:Wb:Wb #menu-title = " DESDEMONA Boot-Manager " @@ -110,19 +111,40 @@ timeout = 100 # vga=ask stop and ask for user input: choice of text mode # vga= use the corresponding text mode number. A list of # available modes can be obtained by booting with -# vga=ask' and then pressing [Enter]. +# 'vga=ask' and then pressing [Enter]. +# # Another way is the use of frame buffer mode. Then the kernel # will switch from the normal vga text mode (80x25) to the frame -# buffer mode (if frame buffer support is in the kernel): -# vga=0x314 800x600 @ 16 bit -# vga=0x317 1024x768 @ 16 bit -# vga=0x318 1024x768 @ 24 bit +# buffer (if frame buffer support is in the kernel): +# 16bit: 32bit: +# 640x480 : 0x311 0x312 +# 800x600 : 0x314 0x315 +# 1024x768 : 0x317 0x318 +# 1280x960 : 0x365 0x366 +# 1280x1024: 0x31A 0x31B +# 1400x1050: 0x345 0x346 +# 1600x1200: 0x333 0x334 +# 1680x1050: 0x3D2 0x3D4 +# 1920x1440: 0x337 0x338 #vga = ask vga = normal #vga = 0x317 # --------------------------------------------------------------- +# Set a password here and uncomment the 'restricted' lines in +# the image definitions below. Then a password must be typed +# to boot anything but a default configuration. If a command +# line is given, other than one specified by an 'append' +# statement in this lilo.conf, the password is required, but +# a standard default boot will not require one. +# +# If anyone have access to the console, with this password and +# the 'restricted' option you prevent booting with something +# like 'Linux init=/bin/sh' and thus becoming `root' without +# proper authorization. +#password = count4this + # Kernel command line options that apply to all installed images go # here. See 'kernel-parameters.txt' in the Linux kernel 'Documentation' # directory. I.g. for start into 'init 5' write: append="5" @@ -143,6 +165,8 @@ vga = normal # usually with the initrd file. Configure all GNU/Linux systems # on other partitions, too. +# Warning: labels must be less than 16 characters long. + # first example (default) image = /boot/vmlinuz-3.12-1-generic label = "Linux" diff --git a/scripts/liloconfig b/scripts/liloconfig index 8bb0d11..55bc593 100644 --- a/scripts/liloconfig +++ b/scripts/liloconfig @@ -3,7 +3,7 @@ # liloconfig - creating a new lilo.conf file # # -# Copyright 2011-2014 Joachim Wiedorn +# Copyright 2011-2015 Joachim Wiedorn # # 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 @@ -31,7 +31,7 @@ use File::Copy; #---- global variables my $prog = $0; $prog =~ s#.*/##; -my $version = "0.4"; +my $version = "0.5"; #---- parameter check # h: help, v: verbose, f: force @@ -87,36 +87,59 @@ sub main { #-------------------- subroutines -------------------- sub create_lilo_conf { - - my $found = 0; - my $exit = 1; - - # search for root device in fstab and convert it - $found = detect_root_device(); - - # convert root device to boot device - if ($found) { $found = convert_boot_device(); } - # finally write new lilo.conf file - if ($found) { - if ($opt_u) { $exit = update_lilo_conf(); } - else { $exit = write_lilo_conf(); } + my $exit = 1; + my $found1 = 0; + my $found2 = 0; + my $found3 = 0; + + # read fstab and search for root device + $found1 = read_fstab(); + + ## STEP 1 ## + if ($found1 == 0) + # nothing found, exit by error + { $found2 = 0;} + elsif ($found1 == 1) + # identify root device: root_dev and root_id + { $found2 = convert_root_device(); } + elsif ($found1 == 2) + # nothing found, but exit successfully + { $exit = 0; $found2 = 0;} + + ## STEP 2 ## + if ($found2 == 0) + # nothing found, exit by error + { $found3 = 0;} + elsif ($found2 == 1) + # convert root device to boot device + { $found3 = convert_boot_device(); } + elsif ($found2 == 2) + # nothing found, but exit successfully + { $exit = 0; $found2 = 3;} + + ## STEP 3 ## + if ($found3 == 0) + # nothing found, exit by error + { $exit = 1;} + elsif ($found3 == 1) { + if ((-f $liloconf) and not (-w $liloconf)) { + print "E: Have no write permissions to $liloconf !\n"; + $exit = 1; + } + else { + # finally write new/updated lilo.conf file + if ($opt_u) { $exit = update_lilo_conf(); } + else { $exit = write_lilo_conf(); } + } } + elsif ($found3 == 2) + # nothing found, but exit successfully + { $exit = 0;} return $exit; } -sub detect_root_device { - - # read fstab and find root device; - my $found = read_fstab(); - - # identify root device: root_dev and root_id - if ($found) { $found = convert_root_device(); } - - return $found; -} - sub read_fstab { my $root_part; @@ -152,7 +175,7 @@ sub read_fstab { print "E: It seems you want configure the base filesystem \n" . "and I'm therefore simply going to exit successfully \n" . "without trying to actually configure LILO properly. \n"; - $found = 0; + $found = 2; } if ($broken_fstab) { print "E: It seems the file /etc/fstab is not properly \n" . @@ -182,8 +205,7 @@ sub convert_root_device { if (not -l "$uuidpath/$root_id") { if($opt_v) { print "W: could not find UUID for $root_disk!\n"; } - ## than we want use root_dev in lilo.conf - #$found = 0; + # than we will use root_dev in lilo.conf } else { # finally add uuid label @@ -300,8 +322,7 @@ sub convert_boot_device { if(not -l "$boot_id") { if($opt_v) { print "W: could not find DISK ID for $boot_disk!\n"; } - ## not so important, than using boot_dev in lilo.conf - #$found = 0; + # not so important. Then using boot_dev in lilo.conf } } @@ -506,6 +527,7 @@ sub write_bootroot_option { print MYFH_NEW $oldline; } } + close(MYFH_TMP); close(MYFH_NEW); } @@ -515,7 +537,7 @@ sub update_bootroot_option { my $oldline = ''; my $newline = ''; my $ok = 0; - + open(MYFH_NEW, "> $liloconfnew") or die "Cannot open file: $!"; open(MYFH_TMP, "< $conftmp_2") or die "Cannot read file: $!"; @@ -572,6 +594,7 @@ sub update_bootroot_option { print MYFH_NEW $oldline; } } + close(MYFH_TMP); close(MYFH_NEW); } @@ -791,7 +814,8 @@ Lines in the configuration file /etc/lilo.conf: #large-memory lba32 - boot = /dev/sda + #boot = /dev/sda + boot = /dev/disk/by-id/ata-SAMSUNG_SV1604N_S01FJ10X999999 #root = /dev/sda1 root = "UUID=18843936-00f9-4df0-a373-000d05a5dd44" map = /boot/map @@ -800,14 +824,12 @@ Lines in the configuration file /etc/lilo.conf: prompt timeout = 100 vga = normal + #password = #default = Linux ### LILO per-image section ### - #boot = /dev/sda - boot = /dev/disk/by-id/ata-SAMSUNG_SV1604N_S01FJ10X999999 - - image = /boot/vmlinuz-3.5.0-trunk-686 + image = /boot/vmlinuz-3.17-trunk-686 label = "Linux" #root = /dev/sda1 #root = "UUID=18843936-00f9-4df0-a373-000d05a5dd44" @@ -815,9 +837,9 @@ Lines in the configuration file /etc/lilo.conf: # restricted # alias = 1 # optional - initrd = /boot/initrd.img-3.5.0-trunk-686 + initrd = /boot/initrd.img-3.17-trunk-686 - image = /boot/vmlinuz-3.2.0-4-686 + image = /boot/vmlinuz-3.14-trunk-686 label = "Linux Old" #root = /dev/sda1 #root = "UUID=18843936-00f9-4df0-a373-000d05a5dd44" @@ -825,11 +847,11 @@ Lines in the configuration file /etc/lilo.conf: # restricted # alias = 2 # optional - initrd = /boot/initrd.img-3.2.0-4-686 + initrd = /boot/initrd.img-3.14-trunk-686 =head1 COPYRIGHT and LICENSE -Copyright (C) 2011-2014 Joachim Wiedorn +Copyright (C) 2011-2015 Joachim Wiedorn This script is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/Makefile b/src/Makefile index 0e766bb..9ac890a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,6 +1,6 @@ # -*- makefile -*- # -# Copyright 2009-2014 Joachim Wiedorn +# Copyright 2009-2015 Joachim Wiedorn # All rights reserved. # # Licensed under the terms contained in the file 'COPYING' diff --git a/src/common.c b/src/common.c index cc25207..1a86aa1 100644 --- a/src/common.c +++ b/src/common.c @@ -2,7 +2,7 @@ * * Copyright 1992-1998 Werner Almesberger * Copyright 1999-2005 John Coffman - * Copyright 2009-2011 Joachim Wiedorn + * Copyright 2009-2015 Joachim Wiedorn * All rights reserved. * * Licensed under the terms contained in the file 'COPYING' @@ -276,7 +276,7 @@ int main(int argc, char *argv[]) fprintf(stderr, "*****Fatal: INT != 4\n"); return 1; } - if (sizeof(long)>sizeof(int)) + if (sizeof(int32_t)>sizeof(int)) fprintf(stderr, "**Note: LONG is bigger than INT\n"); return 0; diff --git a/src/common.h b/src/common.h index fb715ea..29bbaec 100644 --- a/src/common.h +++ b/src/common.h @@ -2,7 +2,7 @@ * * Copyright 1992-1998 Werner Almesberger * Copyright 1999-2005 John Coffman - * Copyright 2009-2011 Joachim Wiedorn + * Copyright 2009-2015 Joachim Wiedorn * All rights reserved. * * Licensed under the terms contained in the file 'COPYING' @@ -19,6 +19,9 @@ #include #endif +#include +#define PTR_WIDTH ((int) (sizeof(intptr_t) * 2)) + #ifndef PAGE_SIZE # define PAGE_SIZE 4096U #endif diff --git a/src/device.c b/src/device.c index 459851a..3abb836 100644 --- a/src/device.c +++ b/src/device.c @@ -2,7 +2,7 @@ * * Copyright 1992-1997 Werner Almesberger * Copyright 1999-2006 John Coffman - * Copyright 2009-2014 Joachim Wiedorn + * Copyright 2009-2015 Joachim Wiedorn * All rights reserved. * * Licensed under the terms contained in the file 'COPYING' @@ -886,7 +886,7 @@ static int warned = 0, called = 0; struct stat st; int duplicate = 0, invalid = 0, ret = 0, ntcaution = 0; int raidcaution = 0; - long codes = 0L; + int32_t codes = 0L; /* called from raid_setup & from geo_open */ /* allow only 1 call */ @@ -1167,7 +1167,7 @@ static int warned = 0, called = 0; walk->next = disktab; vm[j].dt = disktab = walk; #if BETA_TEST - if (verbose >= 4) printf("Allocated DT entry for device %04X ptr=%08lx\n", vm[j].device, (long)walk); + if (verbose >= 4) printf("Allocated DT entry for device %04X ptr=%0*" PRIxPTR "\n", vm[j].device, , PTR_WIDTH, (intptr_t)walk); #endif } @@ -1281,7 +1281,7 @@ static int warned = 0, called = 0; - if (verbose>=2) printf("device codes (user assigned pf) = %lX\n", codes); + if (verbose>=2) printf("device codes (user assigned pf) = %" PRIX32 "\n", codes); /* mark those BIOS codes that are already used in the disk=/bios= table */ @@ -1311,7 +1311,7 @@ static int warned = 0, called = 0; } } - if (verbose>=2) printf("device codes (user assigned) = %lX\n", codes); + if (verbose>=2) printf("device codes (user assigned) = %" PRIX32 "\n", codes); for (i=0; i=2) printf("device codes (BIOS assigned) = %lX\n", codes); + if (verbose>=2) printf("device codes (BIOS assigned) = %" PRIX32 "\n", codes); for (bios=i=0; inext = disktab; vm[i].dt = disktab = walk; #if BETA_TEST - if (verbose >= 4) printf("Allocated DT entry for device %04X ptr=%08lx\n", vm[i].device, (long)walk); + if (verbose >= 4) printf("Allocated DT entry for device %04X ptr=%0*" PRIxPTR "\n", vm[i].device, PTR_WIDTH, (intptr_t)walk); #endif } j = vm[i].dt->bios = vm[i].bios.actual; @@ -1376,7 +1376,7 @@ static int warned = 0, called = 0; inited = 1; } - if (verbose>=2) printf("device codes (canonical) = %lX\n", codes); + if (verbose>=2) printf("device codes (canonical) = %" PRIX32 "\n", codes); for (bios=8*sizeof(codes)-1; !(codes&(1L<=0; ) bios--; diff --git a/src/edit.c b/src/edit.c index 1fa45f2..ded9c38 100644 --- a/src/edit.c +++ b/src/edit.c @@ -1,7 +1,7 @@ /* edit.c - Bitmap file manipulation and editing * * Copyright 2002-2004 John Coffman - * Copyright 2009-2011 Joachim Wiedorn + * Copyright 2009-2015 Joachim Wiedorn * All rights reserved. * * Licensed under the terms contained in the file 'COPYING' @@ -193,7 +193,7 @@ static union { } tm; static MENUTABLE *menu = &tm.mt; static BITMAPLILOHEADER *lh = (void*)(tm.buffer + - ((long)&tm.mt.row - (long)&tm.bmlh.row)); + ((intptr_t)&tm.mt.row - (intptr_t)&tm.bmlh.row)); /* a convenience definition */ #define mn tm.mt diff --git a/src/geometry.c b/src/geometry.c index f033f83..196a892 100644 --- a/src/geometry.c +++ b/src/geometry.c @@ -2,7 +2,7 @@ * * Copyright 1992-1998 Werner Almesberger * Copyright 1999-2005 John Coffman - * Copyright 2009-2014 Joachim Wiedorn + * Copyright 2009-2015 Joachim Wiedorn * All rights reserved. * * Licensed under the terms contained in the file 'COPYING' @@ -55,7 +55,7 @@ #endif #ifndef REISERFS_IOC_UNPACK -#define REISERFS_IOC_UNPACK _IOW(0xCD,1,long) +#define REISERFS_IOC_UNPACK _IOW(0xCD,1,int32_t) #endif #ifndef REISER4_SUPER_MAGIC @@ -63,7 +63,7 @@ /* (*(__u32 *)"R4Sb"); */ #endif #ifndef REISER4_IOC_UNPACK -#define REISER4_IOC_UNPACK _IOW(0xCD,1,long) +#define REISER4_IOC_UNPACK _IOW(0xCD,1,int32_t) #endif #endif @@ -1268,7 +1268,7 @@ int pass; for (walk = disktab; walk; walk = walk->next) if (walk->device == (device & D_MASK(device))) break; #if BETA_TEST - if (verbose>=5) printf("walk=%08lx\n", (long)walk); + if (verbose>=5) printf("walk=%0*" PRIxPTR "\n", PTR_WIDTH, (intptr_t)walk); #endif #if 1 diff --git a/src/geometry.h b/src/geometry.h index a1c4758..64ca4fe 100644 --- a/src/geometry.h +++ b/src/geometry.h @@ -2,7 +2,7 @@ * * Copyright 1992-1998 Werner Almesberger * Copyright 1999-2005 John Coffman - * Copyright 2009-2011 Joachim Wiedorn + * Copyright 2009-2015 Joachim Wiedorn * All rights reserved. * * Licensed under the terms contained in the file 'COPYING' @@ -22,7 +22,7 @@ struct hd_geometry { unsigned char heads; unsigned char sectors; unsigned short cylinders; - unsigned long start; + uint32_t start; }; /* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x030n/0x031n */ @@ -58,8 +58,8 @@ struct floppy_struct { #define MAJOR(dev) (unsigned int)((((dev_t)(dev) >> 8) & 0xfff) | ((unsigned int) ((dev_t)(dev) >> 32) & ~0xfff)) #define MINOR(dev) (unsigned int)(((dev_t)(dev) & 0xff) | ((unsigned int) ((dev_t)(dev) >> 12) & ~0xff)) #define MKDEV(major,minor) (((minor & 0xff) | ((major & 0xfff) << 8) \ - | (((unsigned long long int) (minor & ~0xff)) << 12) \ - | (((unsigned long long int) (major & ~0xfff)) << 32))) + | (((uint64_t) (minor & ~0xff)) << 12) \ + | (((uint64_t) (major & ~0xfff)) << 32))) #else #include #ifdef major diff --git a/src/lilo.c b/src/lilo.c index 4cc4694..a7db803 100644 --- a/src/lilo.c +++ b/src/lilo.c @@ -2,7 +2,7 @@ * * Copyright 1992-1998 Werner Almesberger * Copyright 1999-2007 John Coffman - * Copyright 2009-2014 Joachim Wiedorn + * Copyright 2009-2015 Joachim Wiedorn * All rights reserved. * * Licensed under the terms contained in the file 'COPYING' @@ -193,11 +193,12 @@ extern int has_partitions_beta(dev_t dev); /* defined in geometry.c */ "l=%d, ll=%d, f=%d, d=%d, ld=%d\n", MAX_IMAGES, (int)sizeof(char), (int)sizeof(short), (int)sizeof(int), - (int)sizeof(long), (int)sizeof( + (int)sizeof(int32_t), (int)sizeof( #if !__MSDOS__ - long + int64_t), +#else + int32_t), #endif /* !__MSDOS__ */ - long), (int)sizeof(float), (int)sizeof(double), (int)sizeof(long double) ); @@ -719,7 +720,7 @@ fprintf(errstd,"argc=%d, *argv=%s, ch=%c param=%s\n", argc, *argv, ch, param); if (*(param = (*argv)+2)) argc++; else if (argc) param = *++argv; else reboot_arg = ""; - + while (argc) { if (!reboot_arg) *(reboot_arg = alloc(strlen(param)+1)) = 0; @@ -731,9 +732,6 @@ fprintf(errstd,"argc=%d, *argv=%s, ch=%c param=%s\n", argc, *argv, ch, param); strcat(reboot_arg, param); argc--; } -#if 0 -fprintf(errstd,"REBOOT=\"%s\"\n", reboot_arg); -#endif break; #if !__MSDOS__ case 's': @@ -767,7 +765,7 @@ fprintf(errstd,"REBOOT=\"%s\"\n", reboot_arg); param = *++argv; argc--; } - if (param) + if (param) verbose = to_number(param); else if (verbose<0) verbose = 1; @@ -829,18 +827,15 @@ fprintf(errstd,"REBOOT=\"%s\"\n", reboot_arg); } printf(" * Copyright (C) 1992-1998 Werner Almesberger (until v20)\n" " * Copyright (C) 1999-2007 John Coffman (until v22)\n" - " * Copyright (C) 2009-2014 Joachim Wiedorn (since v23)\n" + " * Copyright (C) 2009-2015 Joachim Wiedorn (since v23)\n" "This program comes with ABSOLUTELY NO WARRANTY. This is free software \n" "distributed under the BSD License (3-clause). Details can be found in \n" "the file COPYING, which is distributed with this software.\n" ); if (verbose>0) { #if !__MSDOS__ -#include + #include struct utsname buf; -#endif - printf("Compiled at %s on %s%s\n", __TIME__, __DATE__, semi); -#if !__MSDOS__ if (verbose>=2 && uname(&buf)==0) { printf("Running %s kernel %s on %s\n", buf.sysname, buf.release, buf.machine); diff --git a/src/lilo.h b/src/lilo.h index 102769c..e3d6e93 100644 --- a/src/lilo.h +++ b/src/lilo.h @@ -2,7 +2,7 @@ * * Copyright 1992-1998 Werner Almesberger * Copyright 1999-2006 John Coffman - * Copyright 2009-2014 Joachim Wiedorn + * Copyright 2009-2015 Joachim Wiedorn * All rights reserved. * * Licensed under the terms contained in the file 'COPYING' @@ -19,7 +19,7 @@ #if !__MSDOS__ #define INT4 int #else -#define INT4 long +#define INT4 int32_t #endif /* !__MSDOS__ */ /* This is the stuff to check the configuration: diff --git a/src/mbr.S b/src/mbr.S index 15902cf..984c01f 100644 --- a/src/mbr.S +++ b/src/mbr.S @@ -1,7 +1,7 @@ ; mbr.S - Master Boot Record to boot first partition marked active ; ; Copyright 2002-2004 John Coffman -; Copyright 2009-2011 Joachim Wiedorn +; Copyright 2009-2015 Joachim Wiedorn ; All rights reserved. ; ; Licensed under the terms contained in the file 'COPYING' @@ -53,7 +53,7 @@ _main: cli ! NT 4 blows up if this is missing #if EXT_PART stage: .byte STAGE_MBR2 ! search extended partitions, too #else -stage: .byte STAGE_MBR ! search primary parition only +stage: .byte STAGE_MBR ! search primary partition only #endif .org PARTS_LOAD+6 diff --git a/src/partition.c b/src/partition.c index 329a90f..dcd6ded 100644 --- a/src/partition.c +++ b/src/partition.c @@ -2,7 +2,7 @@ * * Copyright 1992-1998 Werner Almesberger * Copyright 1999-2005 John Coffman - * Copyright 2009-2014 Joachim Wiedorn + * Copyright 2009-2015 Joachim Wiedorn * All rights reserved. * * Licensed under the terms contained in the file 'COPYING' @@ -575,7 +575,7 @@ void do_activate(char *part, char *which) #if 1 int part_max, count, number, fd; struct partition pt [PART_MAX_MAX+1]; - long long daddr [PART_MAX_MAX+1]; + int64_t daddr [PART_MAX_MAX+1]; int modify=0; part_max = read_partitions(part, extended_pt ? PART_MAX_MAX : 0, @@ -683,7 +683,7 @@ void do_install_mbr(char *part, char *what) if (fstat(fd,&st) < 0) die("stat: %s : %s", part,strerror(errno)); if (!S_ISBLK(st.st_mode) && !force_fs) die("%s not a block device",part); if (st.st_rdev != (st.st_rdev & has_partitions(st.st_rdev))) - die("%s is not a master device with a primary parition table",part); + die("%s is not a master device with a primary partition table",part); if (read(fd,&buf,SECTOR_SIZE) != SECTOR_SIZE) die("read %s: %s",part, strerror(errno)); cp = cfg_get_strg(cf_options,"force-backup"); @@ -740,7 +740,7 @@ void do_install_mbr(char *part, char *what) /* partition table read */ int read_partitions(char *part, int max, int *volid, - struct partition *p, long long *where) + struct partition *p, int64_t *where) { int fd, i; unsigned int second, base; @@ -748,7 +748,7 @@ int read_partitions(char *part, int max, int *volid, struct partition pt[PART_MAX]; BOOT_PARAMS_1 hdr; struct stat st; - long long daddr; + int64_t daddr; if ((fd=open(part,O_RDONLY))<0) die("Cannot open '%s'", part); if (fstat(fd,&st)<0) die("Cannot fstat '%s'", part); diff --git a/src/partition.h b/src/partition.h index e3c2fa3..c84a540 100644 --- a/src/partition.h +++ b/src/partition.h @@ -2,7 +2,7 @@ * * Copyright 1992-1998 Werner Almesberger * Copyright 1999-2004 John Coffman - * Copyright 2009-2011 Joachim Wiedorn + * Copyright 2009-2015 Joachim Wiedorn * All rights reserved. * * Licensed under the terms contained in the file 'COPYING' @@ -26,10 +26,10 @@ enum {PTW_OKAY=0, PTW_DOS=1, PTW_OS2=2, PTW_SWAP, PTW_XFS, PTW_mask=7, PTW_NTFS=8}; -#define LLSECTORSIZE ((long long)SECTOR_SIZE) +#define LLSECTORSIZE ((int64_t)SECTOR_SIZE) #if __GLIBC__ < 2 || __GLIBC_MINOR__ < 1 -typedef long long lloff_t; +typedef int64_t lloff_t; #ifdef _syscall5 lloff_t lseek64(unsigned int fd, lloff_t offs, unsigned int whence); @@ -80,7 +80,7 @@ void do_install_mbr(char *where, char *what); /* Install a new MBR (Master Boot Record) */ int read_partitions(char *part, int max, int *volid, - struct partition *p, long long *where); + struct partition *p, int64_t *where); /* read all partitions & partition tables */ #endif diff --git a/src/probe.c b/src/probe.c index 4457263..a4f1f31 100644 --- a/src/probe.c +++ b/src/probe.c @@ -1,7 +1,7 @@ /* probe.c - BIOS probe utility * * Copyright 1999-2006 John Coffman - * Copyright 2009-2013 Joachim Wiedorn + * Copyright 2009-2015 Joachim Wiedorn * All rights reserved. * * Licensed under the terms contained in the file 'COPYING' @@ -675,7 +675,7 @@ static void do_table(char *part) { struct partition pt [PART_MAX_MAX+1]; int volid; - long long where[PART_MAX_MAX+1]; + int64_t where[PART_MAX_MAX+1]; int i,j; int extd = (extended_pt || verbose>0); @@ -693,7 +693,7 @@ static void do_table(char *part) } if (verbose>=5) { printf("\n"); - for (i=0; i= 0x80) { get_geom(bios, &bdata); if (verbose>=5) { - printf("bios_dev: (0x%02X) vol-ID=%08X *PT=%08lX\n", - bios, bdata.serial_no, (long)bdata.pt); + printf("bios_dev: (0x%02X) vol-ID=%08X *PT=%0*" PRIXPTR "\n", + bios, bdata.serial_no, PTR_WIDTH, (intptr_t)bdata.pt); #ifdef DEBUG_PROBE dump_pt((void*)bdata.pt); #endif diff --git a/src/probe.h b/src/probe.h index 1b86d99..edd5f8d 100644 --- a/src/probe.h +++ b/src/probe.h @@ -1,7 +1,7 @@ /* probe.h - BIOS probe utility * * Copyright 1999-2005 John Coffman - * Copyright 2009-2011 Joachim Wiedorn + * Copyright 2009-2015 Joachim Wiedorn * All rights reserved. * * Licensed under the terms contained in the file 'COPYING' @@ -34,7 +34,7 @@ struct disk_param { unsigned int n_cyl; unsigned int n_head; unsigned int n_sect; - long long n_sectors; + int64_t n_sectors; short n_byte; unsigned int edd_config_ptr; }; @@ -210,7 +210,7 @@ struct Edd { unsigned int cylinders; unsigned int heads; unsigned int sectors; - long long total_sectors; + int64_t total_sectors; unsigned short sector_size; unsigned short offset, diff --git a/src/shs2.c b/src/shs2.c index 5b20c2f..4674f3f 100644 --- a/src/shs2.c +++ b/src/shs2.c @@ -125,7 +125,7 @@ static void shsTransform(void) /* Step A. Copy the data buffer into the work buffer */ /* done */ #if SHS_DEBUG>=1 - for (i=0; i<16; i++) printf("W[%d] = %08lX\n", i, W[i]); + for (i=0; i<16; i++) printf("W[%d] = %08" PRIX32 "\n", i, W[i]); #endif /* Step B. Expand the 16 words into 64 temporary data words */ diff --git a/src/version.h b/src/version.h index a488909..eef80b1 100644 --- a/src/version.h +++ b/src/version.h @@ -1,7 +1,7 @@ /* version.h * * Copyright 2005-2007 John Coffman - * Copyright 2009-2014 Joachim Wiedorn + * Copyright 2009-2015 Joachim Wiedorn * All rights reserved. * * Licensed under the terms contained in the file 'COPYING' @@ -12,8 +12,8 @@ #define VERSION_H #define VERSION_MAJOR 24 -#define VERSION_MINOR 1 +#define VERSION_MINOR 2 #define VERSION_EDIT "" -#define VERSION_DATE "17-October-2014" +#define VERSION_DATE "22-November-2015" #endif