From: Christian Hofstaedtler Date: Mon, 3 Oct 2011 20:46:09 +0000 (+0200) Subject: Remove static lilo binaries and lilo support X-Git-Tag: v0.9.35~7 X-Git-Url: https://git.grml.org/?p=grml2usb.git;a=commitdiff_plain;h=7874f974499ad214ef6d0f8ae726317f78df453d Remove static lilo binaries and lilo support --- diff --git a/debian/copyright b/debian/copyright index f62c834..b823be3 100644 --- a/debian/copyright +++ b/debian/copyright @@ -12,9 +12,6 @@ Copyright: images/: taken from asciidoc Debian package, Copyright 2008 by Stuart Rackham - lilo/: taken from the lilo Debian package, see lilo/COPYING for - licensing information - mbr/mbr.S: Copyright (c) 2009 Thorsten Glaser , licensing information available in mbr/mbr.S diff --git a/debian/overrides b/debian/overrides index debadc1..64de68e 100644 --- a/debian/overrides +++ b/debian/overrides @@ -1,8 +1 @@ -grml2usb: arch-dependent-file-in-usr-share usr/share/grml2usb/lilo/lilo.static.amd64 -grml2usb: arch-dependent-file-in-usr-share usr/share/grml2usb/lilo/lilo.static.i386 -grml2usb: arch-independent-package-contains-binary-or-object usr/share/grml2usb/lilo/lilo.static.amd64 -grml2usb: arch-independent-package-contains-binary-or-object usr/share/grml2usb/lilo/lilo.static.i386 -grml2usb: extra-license-file usr/share/grml2usb/lilo/COPYING -grml2usb: statically-linked-binary usr/share/grml2usb/lilo/lilo.static.amd64 -grml2usb: statically-linked-binary usr/share/grml2usb/lilo/lilo.static.i386 grml2usb: unknown-section grml diff --git a/debian/rules b/debian/rules index 5011c4a..8657cad 100755 --- a/debian/rules +++ b/debian/rules @@ -35,7 +35,7 @@ install: build dh_testdir dh_testroot dh_clean -k - dh_installdirs usr/share/grml2usb/lilo usr/share/grml2usb/grub usr/share/grml2usb/mbr + dh_installdirs usr/share/grml2usb/grub usr/share/grml2usb/mbr # Add here commands to install the package into debian/grml2usb. install -m 755 grml2usb debian/grml2usb/usr/sbin/grml2usb @@ -43,7 +43,6 @@ install: build install -m 755 grml2iso debian/grml2usb/usr/sbin/grml2iso install -m 644 mbr/mbrmgr debian/grml2usb/usr/share/grml2usb/mbr/mbrmgr install -m 644 mbr/mbrldr debian/grml2usb/usr/share/grml2usb/mbr/mbrldr - cp -a lilo/ debian/grml2usb/usr/share/grml2usb/ cp -a grub/ debian/grml2usb/usr/share/grml2usb/ # Build architecture-dependent files here. diff --git a/grml2usb b/grml2usb index d63d60a..5feb238 100755 --- a/grml2usb +++ b/grml2usb @@ -77,8 +77,6 @@ parser.add_option("--grub", dest="grub", action="callback", help="install grub bootloader instead of (default) syslinux") parser.add_option("--grub-mbr", dest="grubmbr", action="store_true", help="install grub into MBR instead of (default) PBR") -parser.add_option("--lilo-binary", dest="lilobin", action="store", type="string", - help="lilo executable to be used for installing MBR") parser.add_option("--mbr-menu", dest="mbrmenu", action="store_true", help="enable interactive boot menu in MBR") parser.add_option("--quiet", dest="quiet", action="store_true", @@ -649,52 +647,7 @@ def install_bootloader(device): sys.exit(1) -def execute_lilo(lilo, device): - """execute lilo for activating the partitions in the MBR - - @lilo: path of lilo executable - @device: device where lilo should be executed on""" - - # to support -A for extended partitions: - logging.info("Activating partitions in MBR via lilo") - logging.debug("%s -S /dev/null -M %s ext", lilo, device) - proc = subprocess.Popen([lilo, "-S", "/dev/null", "-M", device, "ext"]) - proc.wait() - if proc.returncode != 0: - raise Exception("error executing lilo") - - # activate partition: - logging.debug("%s -S /dev/null -A %s 1", lilo, device) - proc = subprocess.Popen([lilo, "-S", "/dev/null", "-A", device, "1"]) - proc.wait() - if proc.returncode != 0: - raise Exception("error executing lilo") - - -def install_syslinux_mbr(device): - """install syslinux's master boot record (MBR) on the specified device - - @device: device where MBR of syslinux should be installed to""" - - # make sure we have syslinux available - if not which("syslinux") and not options.copyonly: - raise Exception("syslinux not available (either install it or consider using the --grub option)") - - # lilo's mbr is broken, use the one from syslinux instead: - if not os.path.isfile("/usr/lib/syslinux/mbr.bin"): - raise Exception("/usr/lib/syslinux/mbr.bin can not be read") - - logging.info("Installing syslinux MBR") - logging.debug("cat /usr/lib/syslinux/mbr.bin > %s", device) - try: - retcode = subprocess.call("cat /usr/lib/syslinux/mbr.bin > "+ device, shell=True) - if retcode < 0: - logging.critical("Error copying MBR to device (%s)", retcode) - except OSError, error: - logging.critical("Execution failed: %s", error) - - -def install_mir_mbr(mbrtemplate, device, partition, ismirbsdmbr=True): +def install_mbr(mbrtemplate, device, partition, ismirbsdmbr=True): """install 'mbr' master boot record (MBR) on a device Retrieve the partition table from "device", install an MBR from the @@ -722,10 +675,11 @@ def install_mir_mbr(mbrtemplate, device, partition, ismirbsdmbr=True): if not os.path.isfile(mbrtemplate): logging.critical("Error: %s can not be read.", mbrtemplate) - raise CriticalException("Error installing MBR (either try --syslinux-mbr or install missing file?)") + raise CriticalException("Error installing MBR (either try --syslinux-mbr or install missing file \"%s\"?)" % mbrtemplate) - if (partition < 0) or (partition > 3): - raise ValueError("partition must be between 0 and 3") + if partition is not None and ((partition < 0) or (partition > 3)): + logging.warn("Cannot activate partition %d" % partition) + partition = None if ismirbsdmbr: nmbrbytes = 439 @@ -753,18 +707,19 @@ def install_mir_mbr(mbrtemplate, device, partition, ismirbsdmbr=True): if len(mbrcode) < 512: raise EOFError("MBR size (%d) < 512" % len(mbrcode)) - if ismirbsdmbr: - mbrcode = mbrcode[0:439] + chr(partition) + \ - mbrcode[440:510] + "\x55\xAA" - else: - actives = ["\x00", "\x00", "\x00", "\x00"] - actives[partition] = "\x80" - mbrcode = mbrcode[0:446] + actives[0] + \ - mbrcode[447:462] + actives[1] + \ - mbrcode[463:478] + actives[2] + \ - mbrcode[479:494] + actives[3] + \ - mbrcode[495:510] + "\x55\xAA" - + if partition is not None: + if ismirbsdmbr: + mbrcode = mbrcode[0:439] + chr(partition) + \ + mbrcode[440:510] + "\x55\xAA" + else: + actives = ["\x00", "\x00", "\x00", "\x00"] + actives[partition] = "\x80" + mbrcode = mbrcode[0:446] + actives[0] + \ + mbrcode[447:462] + actives[1] + \ + mbrcode[463:478] + actives[2] + \ + mbrcode[479:494] + actives[3] + \ + mbrcode[495:510] + "\x55\xAA" + tmpf.file.seek(0) tmpf.file.truncate() tmpf.file.write(mbrcode) @@ -779,39 +734,6 @@ def install_mir_mbr(mbrtemplate, device, partition, ismirbsdmbr=True): del tmpf -def handle_syslinux_mbr(device): - """Install syslinux master boot record on given device - - @device: device where MBR should be installed to""" - - if not is_writeable(device): - raise IOError("device not writeable for user") - - # try to use system's lilo - if which("lilo"): - lilo = which("lilo") - else: - # otherwise fall back to our static version - from platform import architecture - if architecture()[0] == '64bit': - lilo = GRML2USB_BASE + '/lilo/lilo.static.amd64' - else: - lilo = GRML2USB_BASE + '/lilo/lilo.static.i386' - # finally prefer a specified lilo executable - if options.lilobin: - lilo = options.lilobin - - if not is_exe(lilo): - raise Exception("lilo executable can not be execute") - - if options.dryrun: - logging.info("Would install MBR running lilo and using syslinux.") - return 0 - - execute_lilo(lilo, device) - install_syslinux_mbr(device) - - def is_writeable(device): """Check if the device is writeable for the current user @@ -1800,23 +1722,24 @@ def handle_mbr(device): if device[-1:].isdigit(): mbr_device = re.match(r'(.*?)\d*$', device).group(1) partition_number = int(device[-1:]) - 1 - skip_install_mir_mbr = False + else: + logging.warn("Could not detect partition number, not activating partition") + partition_number = None # if we get e.g. /dev/loop1 as device we don't want to put the MBR # into /dev/loop of course, therefore use /dev/loop1 as mbr_device if mbr_device == "/dev/loop": mbr_device = device logging.info("Detected loop device - using %s as MBR device therefore", mbr_device) - skip_install_mir_mbr = True + + mbrcode = GRML2USB_BASE + '/mbr/mbrldr' + if options.syslinuxmbr: + mbrcode = '/usr/lib/syslinux/mbr.bin' + elif options.mbrmenu: + mbrcode = GRML2USB_BASE + '/mbr/mbrldr' try: - if options.syslinuxmbr: - handle_syslinux_mbr(mbr_device) - elif not skip_install_mir_mbr: - if options.mbrmenu: - install_mir_mbr(GRML2USB_BASE + '/mbr/mbrmgr', mbr_device, partition_number, True) - else: - install_mir_mbr(GRML2USB_BASE + '/mbr/mbrldr', mbr_device, partition_number, False) + install_mbr(mbrcode, mbr_device, partition_number, True) except IOError, error: logging.critical("Execution failed: %s", error) sys.exit(1) diff --git a/grml2usb.8.txt b/grml2usb.8.txt index 0d2bebb..e246c7c 100644 --- a/grml2usb.8.txt +++ b/grml2usb.8.txt @@ -110,14 +110,6 @@ option *--initrd* as well. (Be aware when using multiboot setup.) [Notice: not implemented yet.] ////////////////////////////////////////////////////////////////////////// - *\--lilo-binary=...*:: - -Use specified lilo executable for installing master boot record (MBR) when using -the '--syslinux-mbr' option. By default any system wide (from $PATH) lilo -executable is taken. If there can not be find any lilo executable the -statically compiled version of the grml2usb Debian package (see -/usr/share/grml2usb/lilo/lilo.static.[amd64|i386]) is taken. - *\--mbr-menu*:: Install master boot record (MBR) with integrated boot menu: interactively choose @@ -171,8 +163,7 @@ Install syslinux' master boot record (MBR, which is booting from the partition with the "active" flag set) instead of the default one. If you encounter any problems with the default MBR you can try using the syslinux MBR instead. If that works for you please <> so we can adjust our default -MBR accordingly. Note: When using the '--syslinux-mbr' option lilo is executed -before the MBR is installed so the according partitions are set active. +MBR accordingly. ////////////////////////////////////////////////////////////////////////// *\--squashfs=*:: diff --git a/lilo/COPYING b/lilo/COPYING deleted file mode 100644 index fae625a..0000000 --- a/lilo/COPYING +++ /dev/null @@ -1,52 +0,0 @@ -LInux LOader (LILO) program code, documentation, and auxiliary programs are -Copyright 1992-1998 Werner Almesberger. -Copyright 1999-2005 John Coffman. -All rights reserved. - - - -License -======= - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -* Redistributions of source code must retain the above copyright notice, -this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -* Neither the names of the author(s) nor the names of other contributors -may be used to endorse or promote products derived from this software -without specific prior written permission. - - - -Disclaimer -========== - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - - - -(Note: The above license is copied from the BSD license at: - http://www.opensource.org/licenses/bsd-license.html, -substituting the appropriate references in the template.) - -(end) - - diff --git a/lilo/build_info.txt b/lilo/build_info.txt deleted file mode 100644 index 7b545d4..0000000 --- a/lilo/build_info.txt +++ /dev/null @@ -1,3 +0,0 @@ -apt-get source lilo # version 22.8-7 -cd lilo-22.8 -make alles diff --git a/lilo/lilo.static.amd64 b/lilo/lilo.static.amd64 deleted file mode 100755 index e0f22da..0000000 Binary files a/lilo/lilo.static.amd64 and /dev/null differ diff --git a/lilo/lilo.static.i386 b/lilo/lilo.static.i386 deleted file mode 100755 index 56c6e80..0000000 Binary files a/lilo/lilo.static.i386 and /dev/null differ diff --git a/tarball.sh b/tarball.sh index 895d3ed..f259f8f 100755 --- a/tarball.sh +++ b/tarball.sh @@ -67,12 +67,6 @@ install -m 644 \${BASE}/splash.xpm.gz /usr/share/grml2usb/grub/splash.xpm.gz printf " - /usr/share/grml2usb/grub/grml.png\n" install -m 644 \${BASE}/grml.png /usr/share/grml2usb/grub/grml.png -[ -d /usr/share/grml2usb/lilo ] || mkdir -p /usr/share/grml2usb/lilo -printf " - /usr/share/grml2usb/lilo/lilo.static.amd64\n" -install -m 755 \${BASE}/lilo.static.amd64 /usr/share/grml2usb/lilo/lilo.static.amd64 -printf " - /usr/share/grml2usb/lilo/lilo.static.i386\n" -install -m 755 \${BASE}/lilo.static.i386 /usr/share/grml2usb/lilo/lilo.static.i386 - [ -d /usr/share/grml2usb/mbr ] || mkdir -p /usr/share/grml2usb/mbr printf " - /usr/share/grml2usb/mbr/mbrmgr\n" install -m 644 \${BASE}/mbrmgr /usr/share/grml2usb/mbr/mbrmgr @@ -104,8 +98,6 @@ for file in \\ /usr/sbin/grml2iso \\ /usr/share/grml2usb/grub/splash.xpm.gz \\ /usr/share/grml2usb/grub/grml.png \\ - /usr/share/grml2usb/lilo/lilo.static.amd64 \\ - /usr/share/grml2usb/lilo/lilo.static.i386 \\ /usr/share/grml2usb/mbr/mbrmgr \\ /usr/share/grml2usb/mbr/mbrldr \\ /usr/share/man/man8/grml2usb.8.gz \\ @@ -127,8 +119,8 @@ gzip -9 --to-stdout grml2usb-$VERSION/grml2iso.8.txt > grml2usb-$VERSION/grml2is rm grml2usb-$VERSION/grml2usb.8.txt rm grml2usb-$VERSION/grml2iso.8.txt -# binaries, grub, lilo -cp grml2usb grml2usb-compat grml2iso mbr/mbrldr mbr/mbrmgr grub/* lilo/lilo.static.* grml2usb-$VERSION/ +# binaries, grub +cp grml2usb grml2usb-compat grml2iso mbr/mbrldr mbr/mbrmgr grub/* grml2usb-$VERSION/ tar zcf grml2usb.tgz "${DIR}" diff --git a/zsh/_grml2usb b/zsh/_grml2usb index 4d0813b..d2b202d 100644 --- a/zsh/_grml2usb +++ b/zsh/_grml2usb @@ -19,7 +19,7 @@ for dev in /dev/sd* /dev/hd* ; do done # TODO: -# * handling of --bootoptions=BOOTOPTIONS and --lilo-binary=LILOBIN +# * handling of --bootoptions=BOOTOPTIONS # * $devices should also list directories as valid target # * as output before :device:.... ISO files and/or /live/image should be suggested @@ -31,7 +31,6 @@ arguments=( '--dry-run[avoid executing commands]' '--fat16[format specified partition with FAT16]' '--force[force any actions requiring manual interaction]' - '--lilo-binary=LILOBIN[lilo executable to be used for installing MBR]:' '--mbr-manager[enable interactive boot manager menu in MBR]' '--quiet[do not output anything but just errors on console]' '--skip-addons[do not install /boot/addons/ files]'