efi-reader-0.13/0000755000000000000000000000000012144722016010325 5ustar efi-reader-0.13/config.h0000644000000000000000000000000011515465077011745 0ustar efi-reader-0.13/efi-reader.c0000644000000000000000000000514312144716574012513 0ustar /* @file efi-reader.c * * Read EFI variables and populate debconf database for debian-installer * Copyright (C) 2003, Alastair McKinstry * Released under the GNU Public License; see file COPYING for details */ #include #include #include #include #include #include #include #include #include "table.h" /* snarfed from linux kernel efivars.c */ typedef u_int16_t efi_char16_t; #if 0 typedef u_int8_t __u8; typedef u_int32_t __u32; #endif typedef struct { __u8 b[16]; } efi_guid_t; typedef unsigned long efi_status_t; typedef struct _efi_variable_t { efi_char16_t VariableName[1024/sizeof(efi_char16_t)]; efi_guid_t VendorGuid; unsigned long DataSize; __u8 Data[1024]; efi_status_t Status; __u32 Attributes; } __attribute__((packed)) efi_variable_t; /** * Get the three-letter lang code from /proc * return 1 if error, 0 on success */ int get_efi_lang_code (char *lang_code) { int fd, err, sz; efi_variable_t var_data; /* Snarfed variable def. from linux/arch/ia64/kernel/efivars.c * Probably should check out a more official interface, in case the format * of /proc changes. */ fd = open ("/proc/efi/vars/Lang-8be4df61-93ca-11d2-aa0d-00e098032b8c", O_RDONLY); if (fd < 0) { err = errno; di_error ("Failed to open /proc/efi/vars/Lang-*"); di_error (strerror (err)); return 1; } sz = read (fd, &var_data, sizeof (efi_variable_t)); close (fd); if (sz == sizeof (efi_variable_t)) { // success strncpy (lang_code, (const char *) var_data.Data, 3); return 0; } return 1; } /** * locales prefer the language to be a two-letter code; * translate three-letter -> two-letter if possible (eg eng -> en) */ char *two_code (char *three_code) { int t = 0; while (trans_table[t].threecode[0] != '\0' ) { if (strcmp (three_code, trans_table[t].threecode) == 0) return trans_table[t].twocode; t++; } return three_code; } #define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) /* Read certain variables from EFI and populate debian-installer, as required. * At the moment, just read Lang" * Check out the */ int main (int argc ATTRIBUTE_UNUSED, char *argv[] ATTRIBUTE_UNUSED) { char lang_code[4]; static struct debconfclient *client; di_system_init("efi-reader"); client = debconfclient_new (); if (get_efi_lang_code(lang_code)) exit (1); debconf_set (client, "debian-installer/language", two_code (lang_code)); exit (0); } /* * Local Variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: */ efi-reader-0.13/create-table.sh0000644000000000000000000000045611515465077013232 0ustar #!/bin/sh # Build iso-639-2 to iso-639-1 table for efi-reader # # cat > table.h << EOF struct { char threecode[4]; char twocode[3]; } trans_table[] = { EOF isoquery -i 639 -c | cut -f1,3 | \ sed -r '/\t$/d; s/(.+)\t(.+)/{"\1"\,"\2"}\,/' \ >> table.h cat >> table.h << EOF { "","" }, }; EOF efi-reader-0.13/Makefile0000644000000000000000000000154211515465077012003 0ustar ifdef DEBUG DEB_BUILD_OPTIONS := debug:${DEB_BUILD_OPTIONS} endif CFLAGS := -W -Wall -I. ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) CFLAGS += -g -DDEBUG=1 OBJS += xmalloc.o STRIP= /bin/true else CFLAGS += -fomit-frame-pointer -Os STRIPTOOL=strip STRIP= $(STRIPTOOL) --remove-section=.note --remove-section=.comment endif LDOPTS = -ldebian-installer -ldebconfclient all: efi-reader efi-reader: table.h efi-reader.c $(CC) $(CFLAGS) efi-reader.c -o $@ $(LDOPTS) $(STRIP) $@ table.h: sh ./create-table.sh clean: rm -f *~ table.h efi-reader demo.templates demo install: efi-reader install -m 755 efi-reader ${DESTDIR}/usr/bin/efi-reader .PHONY: demo ln -sf debian/templates demo.templates chmod a+x debian/postinst rm -f demo ln -s debian/postinst demo DEBCONF_DEBUG=developer /usr/share/debconf/frontend ./demo rm -f demo.templates demo efi-reader-0.13/debian/0000755000000000000000000000000012170504141011543 5ustar efi-reader-0.13/debian/control0000644000000000000000000000120012170474710013147 0ustar Source: efi-reader Section: debian-installer Priority: optional Maintainer: Debian Install System Team Uploaders: dann frazier , Christian Perrier Build-Depends: debhelper (>= 9), libdebconfclient0-dev (>= 0.47), libdebian-installer4-dev, po-debconf (>= 0.5.0), iso-codes (>= 0.012), isoquery Vcs-Browser: http://anonscm.debian.org/gitweb/?p=d-i/efi-reader.git Vcs-Git: git://anonscm.debian.org/d-i/efi-reader.git Package: efi-reader Architecture: ia64 amd64 i386 Depends: ${shlibs:Depends} Description: Select default values from EFI configuration. Package-Type: udeb efi-reader-0.13/debian/copyright0000644000000000000000000000040511515465077013515 0ustar This module reads default configuration from EFI for the Debian GNU/Linux installer. Author(s): Alastair McKinstry Copyright (c) 2003 Alastair McKinstry The copyright of this package is GPL, version 2 or later. efi-reader-0.13/debian/dirs0000644000000000000000000000001011515465077012436 0ustar usr/bin efi-reader-0.13/debian/links0000644000000000000000000000010211515465077012617 0ustar /usr/bin/efi-reader /lib/debian-installer-startup.d/S40efi-reader efi-reader-0.13/debian/source/0000755000000000000000000000000012170223343013045 5ustar efi-reader-0.13/debian/source/format0000644000000000000000000000001512170223343014254 0ustar 3.0 (native) efi-reader-0.13/debian/changelog0000644000000000000000000000661712170504133013430 0ustar efi-reader (0.13) unstable; urgency=low [ Dmitrijs Ledkovs ] * Set debian source format to '3.0 (native)'. * Bump debhelper compat level to 9. * Set Vcs-* to canonical format. [ Christian Perrier ] * Add myself to Uploaders -- Christian Perrier Sun, 14 Jul 2013 13:15:39 +0200 efi-reader (0.12) unstable; urgency=low * Team upload [ Colin Watson ] * Fix a few compiler warnings. [ Christian Perrier ] * Replace XC-Package-Type by Package-Type in debian/control -- Christian Perrier Wed, 15 May 2013 16:36:54 +0200 efi-reader (0.11) unstable; urgency=low [ Steve McIntyre ] * Build on amd64 and i386 as well as ia64, now we have EFI support there too. Closes: #512348. -- Cyril Brulebois Thu, 20 Sep 2012 12:18:47 +0200 efi-reader (0.10) unstable; urgency=low [ Frans Pop ] * Remove Alastair McKinstry as Uploader with many thanks for his past contributions. [ Colin Watson ] * Upgrade to debhelper v7. * /usr/share/iso-codes/iso_639.tab no longer exists; use isoquery. [ Frans Pop ] * Remove Standards-Version field. -- dann frazier Mon, 15 Nov 2010 11:23:08 -0700 efi-reader (0.9) unstable; urgency=low * Performing a "clean" upload - last version had .svn goo in it -- dann frazier Tue, 31 Oct 2006 16:09:32 -0700 efi-reader (0.8) unstable; urgency=low * Include for __u8 and friends. -- Alastair McKinstry Thu, 7 Sep 2006 08:02:43 +0100 efi-reader (0.7) unstable; urgency=low * Colin Watson - Spell "Debian GNU/Linux" thus in debian/copyright. * Alastair McKinstry - Build out of the _current_ SVN to get Colin Watson's correction. -- Alastair McKinstry Tue, 12 Jul 2005 07:37:20 +0100 efi-reader (0.6) unstable; urgency=low * Alastair McKinstry - Now use /lib/debian-installer-startup.d instead of /etc/rcS.d Closes: #260815. - Move to Standards-Version: 3.6.2 -- Alastair McKinstry Sun, 17 Oct 2004 20:00:00 +0100 efi-reader (0.5) unstable; urgency=low * Joshua Kwan - Use debhelper's new udeb support. * Joey Hess - Fix use of udeb support. -- Joey Hess Wed, 6 Oct 2004 16:18:34 -0400 efi-reader (0.4) unstable; urgency=low * Use the new debconf_* macros * Move to new libdebian-installer API. * Richard Hirst - Make it compile with libdebian-installer4 and current linux-kernel-headers. - Change table.h generation to end with null string, not 0, to fix compiler warnings. Change code to match. * Thiemo Seufer - Add CFLAGS -W. * Add myself to Uploaders & Release 0.4 -- dann frazier Sun, 14 Dec 2003 19:19:36 -0700 efi-reader (0.3) unstable; urgency=low * Changed dependency from libcdebconf-dev to libddebconfclient0-dev. Closes: #212072. * Moved to Standards-Version: 3.6.1 ; no changes required. -- Alastair McKinstry Mon, 22 Sep 2003 13:07:38 +0000 efi-reader (0.2) unstable; urgency=low * Moved Standards-Version to 3.6.0; no changes required. -- Alastair McKinstry Tue, 29 Jul 2003 20:34:35 +0100 efi-reader (0.1) unstable; urgency=low * Initial Release. -- Alastair McKinstry Fri, 7 Mar 2003 20:28:31 +1100 Local variables: mode: debian-changelog End: efi-reader-0.13/debian/compat0000644000000000000000000000000212170223343012743 0ustar 9 efi-reader-0.13/debian/rules0000755000000000000000000000003611515465077012642 0ustar #! /usr/bin/make -f %: dh $@