diff options
60 files changed, 573 insertions, 23 deletions
diff --git a/docs/install/bbb_setup.md b/docs/install/bbb_setup.md index 18f0c7be..df293f96 100644 --- a/docs/install/bbb_setup.md +++ b/docs/install/bbb_setup.md @@ -328,7 +328,10 @@ PSU to pin 2 on the BBB (P9 header). It is safe to install this now should.* if you need to extend the 3.3v psu leads, just use the same colour M-F -leads, *but* keep all other leads short (10cm or less) +leads, *but* keep all other leads short and equal length (30cm or less). +Keep in mind that length isn't inversely proportional to signal quality, +so trying out different lengths will yield different results. +Same goes for spispeed. You should now have something that looks like this:\   diff --git a/docs/install/t400_external.md b/docs/install/t400_external.md index d48c15d4..9fa5cf3e 100644 --- a/docs/install/t400_external.md +++ b/docs/install/t400_external.md @@ -12,7 +12,7 @@ An ["HMM"](https://download.lenovo.com/ibmdl/pub/pc/pccbbs/mobiles_pdf/43y6629_05.pdf#page=386) (Hardware Maintenance Manual) detailing the process of \[dis\]assembly is available for this model. Be careful when reassembling the laptop as -the screws on page 144 (with title "1130 Keyboard bezel") are swapped +the screws on page 114 (with title "1130 Keyboard bezel") are swapped and if you follow the HMM you will punch a hole through the bezel in the upper right corner. @@ -200,6 +200,25 @@ tool_action_arguments_recursive() { fi } +tool_arguments_targets() { + local tool="$1" + shift + + local tool_path="$(tool_path "${tool}")" + local targets_path="${tool_path}/${CONFIGS}" + local argument + + for argument in "$@"; do + targets_path="${targets_path}/${argument}" + done + + targets_path="${targets_path}/${TARGETS}" + + if [[ -f "${targets_path}" ]]; then + cat "${targets_path}" + fi +} + tool_path() { local tool=$1 diff --git a/projects/grub/grub b/projects/grub/grub index 16b63634..c444841b 100755 --- a/projects/grub/grub +++ b/projects/grub/grub @@ -75,29 +75,21 @@ build() { grub_build_utils + if [[ "${target}" == 'bios' ]]; then + grub_build_floppy_image + else + grub_build_standalone_image + fi + for raw_keymap in "${raw_keymap_path}"/*; do grub_build_layout "${raw_keymap}" done - case "${target}" in - bios) - grub_build_floppy_image - grub_build_font - grub_copy_modules - ;; - *) - grub_build_standalone_image - grub_build_font - grub_copy_modules - ;; - esac - - # Temporary until the function project_make_distclean is written - ( - cd "${sources_path}" || return - - make distclean - ) + grub_build_font + + grub_copy_modules + + make -C "${sources_path}" distclean } build_check() { diff --git a/projects/grub/grub-helper b/projects/grub/grub-helper index e7e8a1fe..604d4a54 100755 --- a/projects/grub/grub-helper +++ b/projects/grub/grub-helper @@ -114,6 +114,10 @@ grub_build_layout() { if ! [[ -e "${keymap_out_path}" ]]; then mkdir -p "${keymap_out_path}" + elif ! [[ -d "${keymap_out_path}" ]]; then + printf '\n%s\n' "Error: File ${keymap_out_path} is not a directory" 1>&2 + + return 1 fi "${grub_mklayout}" --output="${grub_kbd_layout}" --input="${raw_layout_path}" @@ -148,8 +152,9 @@ grub_build_floppy_image() { local grubimg="${build_path}/grub2" local tempfile="${build_path}/temp.file" - if ! ( grub_build_bootable_image "$@" ); then + if ! grub_build_bootable_image "$@"; then printf '\n%s\n\n' "Error: Failed to build a GRUB image" 1>&2 + return 1 fi @@ -161,6 +166,7 @@ grub_build_floppy_image() { dd if=/dev/zero of="${tempfile}" bs=1024 count="${size:-160}" else printf '\n%s\n\n' "Error: File ${tempfile} already exists!" 1>&2 + return 1 fi @@ -175,7 +181,8 @@ grub_build_floppy_image() { mv "${tempfile}" "${grubimg}" else printf '\n%s' "Error: Image ${grubimg##*/} is too large; " 1>&2 - printf '%s\n\n' "it must be less than ${size}KiB in size." 1>&2 + printf '%s\n\n' "it must be less than ${size}KiB in size" 1>&2 + return 1 fi } diff --git a/tools/dependencies/configs/parabola/i386/README b/tools/dependencies/configs/parabola/i386/README new file mode 100644 index 00000000..3a920465 --- /dev/null +++ b/tools/dependencies/configs/parabola/i386/README @@ -0,0 +1,24 @@ +Each file in this directory contains a list of dependencies that +should be installed before compiling the program indicated by the +filename's suffix, with a few exceptions; these exceptions being +"deps-documentation", "deps-download", and "deps-generic" for reasons +noted below: + +* "deps-documentation" contains a general list of packages that are + needed to build Libreboot documentation. +* "deps-download" contains packages necessary for downloading either + source code repositories and/or supporting files from a remote + source. +* "deps-generic" contains generic dependencies that didn't quite fit + (i.e. listed) under any of the other dependency lists but are + necessary nonetheless. + +It is expected that these files are updated whenever upstream projects +change dependency requirements. + +Any duplications between files are intentional; in order to provide a +clear picture as to which dependencies are needed by individual +programs, any attempt to consolidate these lists is dissuaded. + +This README is released under Creative Commons Zero 1.0: +https://creativecommons.org/publicdomain/zero/1.0/ diff --git a/tools/dependencies/configs/parabola/i386/deps-bucts b/tools/dependencies/configs/parabola/i386/deps-bucts new file mode 100644 index 00000000..6bce532b --- /dev/null +++ b/tools/dependencies/configs/parabola/i386/deps-bucts @@ -0,0 +1,4 @@ +gcc +make +pciutils +zlib diff --git a/tools/dependencies/configs/parabola/i386/deps-coreboot b/tools/dependencies/configs/parabola/i386/deps-coreboot new file mode 100644 index 00000000..cbfb7ddc --- /dev/null +++ b/tools/dependencies/configs/parabola/i386/deps-coreboot @@ -0,0 +1,11 @@ +bison +doxygen +flex +gcc +gdb +g++ +iasl +make +ncurses +openssl +pkg-config diff --git a/tools/dependencies/configs/parabola/i386/deps-crossgcc-arm b/tools/dependencies/configs/parabola/i386/deps-crossgcc-arm new file mode 100644 index 00000000..6e476970 --- /dev/null +++ b/tools/dependencies/configs/parabola/i386/deps-crossgcc-arm @@ -0,0 +1 @@ +arm-none-eabi-gcc diff --git a/tools/dependencies/configs/parabola/i386/deps-dejavu-fonts b/tools/dependencies/configs/parabola/i386/deps-dejavu-fonts new file mode 100644 index 00000000..1bba66d1 --- /dev/null +++ b/tools/dependencies/configs/parabola/i386/deps-dejavu-fonts @@ -0,0 +1,3 @@ +fontforge +perl-font-ttf +perl-io-string diff --git a/tools/dependencies/configs/parabola/i386/deps-documentation b/tools/dependencies/configs/parabola/i386/deps-documentation new file mode 100644 index 00000000..4a59b54c --- /dev/null +++ b/tools/dependencies/configs/parabola/i386/deps-documentation @@ -0,0 +1 @@ +pandoc diff --git a/tools/dependencies/configs/parabola/i386/deps-download b/tools/dependencies/configs/parabola/i386/deps-download new file mode 100644 index 00000000..880fb73e --- /dev/null +++ b/tools/dependencies/configs/parabola/i386/deps-download @@ -0,0 +1,2 @@ +git +wget diff --git a/tools/dependencies/configs/parabola/i386/deps-flashrom b/tools/dependencies/configs/parabola/i386/deps-flashrom new file mode 100644 index 00000000..c325a6f1 --- /dev/null +++ b/tools/dependencies/configs/parabola/i386/deps-flashrom @@ -0,0 +1,7 @@ +libftdi +libftdi-compat +libusb +make +pciutils +pkg-config +zlib diff --git a/tools/dependencies/configs/parabola/i386/deps-generic b/tools/dependencies/configs/parabola/i386/deps-generic new file mode 100644 index 00000000..162dc51d --- /dev/null +++ b/tools/dependencies/configs/parabola/i386/deps-generic @@ -0,0 +1,10 @@ +autogen +binutils +coreutils +fakeroot +gawk +help2man +libfaketime +m4 +texinfo +xz diff --git a/tools/dependencies/configs/parabola/i386/deps-grub b/tools/dependencies/configs/parabola/i386/deps-grub new file mode 100644 index 00000000..59119a22 --- /dev/null +++ b/tools/dependencies/configs/parabola/i386/deps-grub @@ -0,0 +1,17 @@ +autoconf +automake +bdf-unifont +bison +device-mapper +flex +freetype2 +gcc +gettext +glibc +libpciaccess +libusb +make +pciutils +python +qemu +sdl diff --git a/tools/dependencies/configs/parabola/i386/deps-i945-pwm b/tools/dependencies/configs/parabola/i386/deps-i945-pwm new file mode 100644 index 00000000..079b0d7d --- /dev/null +++ b/tools/dependencies/configs/parabola/i386/deps-i945-pwm @@ -0,0 +1,5 @@ +gcc +gdb +pciutils +make +zlib diff --git a/tools/dependencies/configs/parabola/i386/deps-memtest86plus b/tools/dependencies/configs/parabola/i386/deps-memtest86plus new file mode 100644 index 00000000..89ffe213 --- /dev/null +++ b/tools/dependencies/configs/parabola/i386/deps-memtest86plus @@ -0,0 +1,2 @@ +gcc +make diff --git a/tools/dependencies/configs/parabola/i686 b/tools/dependencies/configs/parabola/i686 new file mode 120000 index 00000000..fd32fa4e --- /dev/null +++ b/tools/dependencies/configs/parabola/i686 @@ -0,0 +1 @@ +i386
\ No newline at end of file diff --git a/tools/dependencies/configs/parabola/x86_64/README b/tools/dependencies/configs/parabola/x86_64/README new file mode 100644 index 00000000..3a920465 --- /dev/null +++ b/tools/dependencies/configs/parabola/x86_64/README @@ -0,0 +1,24 @@ +Each file in this directory contains a list of dependencies that +should be installed before compiling the program indicated by the +filename's suffix, with a few exceptions; these exceptions being +"deps-documentation", "deps-download", and "deps-generic" for reasons +noted below: + +* "deps-documentation" contains a general list of packages that are + needed to build Libreboot documentation. +* "deps-download" contains packages necessary for downloading either + source code repositories and/or supporting files from a remote + source. +* "deps-generic" contains generic dependencies that didn't quite fit + (i.e. listed) under any of the other dependency lists but are + necessary nonetheless. + +It is expected that these files are updated whenever upstream projects +change dependency requirements. + +Any duplications between files are intentional; in order to provide a +clear picture as to which dependencies are needed by individual +programs, any attempt to consolidate these lists is dissuaded. + +This README is released under Creative Commons Zero 1.0: +https://creativecommons.org/publicdomain/zero/1.0/ diff --git a/tools/dependencies/configs/parabola/x86_64/deps-bucts b/tools/dependencies/configs/parabola/x86_64/deps-bucts new file mode 100644 index 00000000..6bce532b --- /dev/null +++ b/tools/dependencies/configs/parabola/x86_64/deps-bucts @@ -0,0 +1,4 @@ +gcc +make +pciutils +zlib diff --git a/tools/dependencies/configs/parabola/x86_64/deps-coreboot b/tools/dependencies/configs/parabola/x86_64/deps-coreboot new file mode 100644 index 00000000..cbfb7ddc --- /dev/null +++ b/tools/dependencies/configs/parabola/x86_64/deps-coreboot @@ -0,0 +1,11 @@ +bison +doxygen +flex +gcc +gdb +g++ +iasl +make +ncurses +openssl +pkg-config diff --git a/tools/dependencies/configs/parabola/x86_64/deps-crossgcc-arm b/tools/dependencies/configs/parabola/x86_64/deps-crossgcc-arm new file mode 100644 index 00000000..6e476970 --- /dev/null +++ b/tools/dependencies/configs/parabola/x86_64/deps-crossgcc-arm @@ -0,0 +1 @@ +arm-none-eabi-gcc diff --git a/tools/dependencies/configs/parabola/x86_64/deps-crossgcc-i386 b/tools/dependencies/configs/parabola/x86_64/deps-crossgcc-i386 new file mode 100644 index 00000000..82ca6997 --- /dev/null +++ b/tools/dependencies/configs/parabola/x86_64/deps-crossgcc-i386 @@ -0,0 +1,9 @@ +gcc-libs-multilib +gcc-multilib +lib32-fakeroot +lib32-glibc +lib32-libltdl +lib32-libpciaccess +lib32-libstdc++5 +lib32-openssl +lib32-ncurses diff --git a/tools/dependencies/configs/parabola/x86_64/deps-dejavu-fonts b/tools/dependencies/configs/parabola/x86_64/deps-dejavu-fonts new file mode 100644 index 00000000..1bba66d1 --- /dev/null +++ b/tools/dependencies/configs/parabola/x86_64/deps-dejavu-fonts @@ -0,0 +1,3 @@ +fontforge +perl-font-ttf +perl-io-string diff --git a/tools/dependencies/configs/parabola/x86_64/deps-documentation b/tools/dependencies/configs/parabola/x86_64/deps-documentation new file mode 100644 index 00000000..4a59b54c --- /dev/null +++ b/tools/dependencies/configs/parabola/x86_64/deps-documentation @@ -0,0 +1 @@ +pandoc diff --git a/tools/dependencies/configs/parabola/x86_64/deps-download b/tools/dependencies/configs/parabola/x86_64/deps-download new file mode 100644 index 00000000..880fb73e --- /dev/null +++ b/tools/dependencies/configs/parabola/x86_64/deps-download @@ -0,0 +1,2 @@ +git +wget diff --git a/tools/dependencies/configs/parabola/x86_64/deps-flashrom b/tools/dependencies/configs/parabola/x86_64/deps-flashrom new file mode 100644 index 00000000..c325a6f1 --- /dev/null +++ b/tools/dependencies/configs/parabola/x86_64/deps-flashrom @@ -0,0 +1,7 @@ +libftdi +libftdi-compat +libusb +make +pciutils +pkg-config +zlib diff --git a/tools/dependencies/configs/parabola/x86_64/deps-generic b/tools/dependencies/configs/parabola/x86_64/deps-generic new file mode 100644 index 00000000..162dc51d --- /dev/null +++ b/tools/dependencies/configs/parabola/x86_64/deps-generic @@ -0,0 +1,10 @@ +autogen +binutils +coreutils +fakeroot +gawk +help2man +libfaketime +m4 +texinfo +xz diff --git a/tools/dependencies/configs/parabola/x86_64/deps-grub b/tools/dependencies/configs/parabola/x86_64/deps-grub new file mode 100644 index 00000000..59119a22 --- /dev/null +++ b/tools/dependencies/configs/parabola/x86_64/deps-grub @@ -0,0 +1,17 @@ +autoconf +automake +bdf-unifont +bison +device-mapper +flex +freetype2 +gcc +gettext +glibc +libpciaccess +libusb +make +pciutils +python +qemu +sdl diff --git a/tools/dependencies/configs/parabola/x86_64/deps-i945-pwm b/tools/dependencies/configs/parabola/x86_64/deps-i945-pwm new file mode 100644 index 00000000..079b0d7d --- /dev/null +++ b/tools/dependencies/configs/parabola/x86_64/deps-i945-pwm @@ -0,0 +1,5 @@ +gcc +gdb +pciutils +make +zlib diff --git a/tools/dependencies/configs/parabola/x86_64/deps-memtest86plus b/tools/dependencies/configs/parabola/x86_64/deps-memtest86plus new file mode 100644 index 00000000..89ffe213 --- /dev/null +++ b/tools/dependencies/configs/parabola/x86_64/deps-memtest86plus @@ -0,0 +1,2 @@ +gcc +make diff --git a/tools/dependencies/configs/targets b/tools/dependencies/configs/targets new file mode 100644 index 00000000..33794c27 --- /dev/null +++ b/tools/dependencies/configs/targets @@ -0,0 +1,2 @@ +parabola +trisquel7 diff --git a/tools/dependencies/configs/trisquel7/i386/README b/tools/dependencies/configs/trisquel7/i386/README new file mode 100644 index 00000000..3a920465 --- /dev/null +++ b/tools/dependencies/configs/trisquel7/i386/README @@ -0,0 +1,24 @@ +Each file in this directory contains a list of dependencies that +should be installed before compiling the program indicated by the +filename's suffix, with a few exceptions; these exceptions being +"deps-documentation", "deps-download", and "deps-generic" for reasons +noted below: + +* "deps-documentation" contains a general list of packages that are + needed to build Libreboot documentation. +* "deps-download" contains packages necessary for downloading either + source code repositories and/or supporting files from a remote + source. +* "deps-generic" contains generic dependencies that didn't quite fit + (i.e. listed) under any of the other dependency lists but are + necessary nonetheless. + +It is expected that these files are updated whenever upstream projects +change dependency requirements. + +Any duplications between files are intentional; in order to provide a +clear picture as to which dependencies are needed by individual +programs, any attempt to consolidate these lists is dissuaded. + +This README is released under Creative Commons Zero 1.0: +https://creativecommons.org/publicdomain/zero/1.0/ diff --git a/tools/dependencies/configs/trisquel7/i386/deps-bucts b/tools/dependencies/configs/trisquel7/i386/deps-bucts new file mode 100644 index 00000000..538d83f7 --- /dev/null +++ b/tools/dependencies/configs/trisquel7/i386/deps-bucts @@ -0,0 +1,6 @@ +gcc +libpci3 +libpci-dev +make +zlib1g +zlib1g-dev diff --git a/tools/dependencies/configs/trisquel7/i386/deps-coreboot b/tools/dependencies/configs/trisquel7/i386/deps-coreboot new file mode 100644 index 00000000..bd78c637 --- /dev/null +++ b/tools/dependencies/configs/trisquel7/i386/deps-coreboot @@ -0,0 +1,13 @@ +bison +doxygen +flex +gcc +gdb +g++ +iasl +libncurses5 +libncurses5-dev +libssl-dev +make +ncurses-base +pkg-config diff --git a/tools/dependencies/configs/trisquel7/i386/deps-crossgcc-arm b/tools/dependencies/configs/trisquel7/i386/deps-crossgcc-arm new file mode 100644 index 00000000..f4629ab5 --- /dev/null +++ b/tools/dependencies/configs/trisquel7/i386/deps-crossgcc-arm @@ -0,0 +1 @@ +gcc-arm-linux-gnueabi diff --git a/tools/dependencies/configs/trisquel7/i386/deps-dejavu-fonts b/tools/dependencies/configs/trisquel7/i386/deps-dejavu-fonts new file mode 100644 index 00000000..30157ccf --- /dev/null +++ b/tools/dependencies/configs/trisquel7/i386/deps-dejavu-fonts @@ -0,0 +1,2 @@ +fontforge +libfont-ttf-perl diff --git a/tools/dependencies/configs/trisquel7/i386/deps-documentation b/tools/dependencies/configs/trisquel7/i386/deps-documentation new file mode 100644 index 00000000..4a59b54c --- /dev/null +++ b/tools/dependencies/configs/trisquel7/i386/deps-documentation @@ -0,0 +1 @@ +pandoc diff --git a/tools/dependencies/configs/trisquel7/i386/deps-download b/tools/dependencies/configs/trisquel7/i386/deps-download new file mode 100644 index 00000000..880fb73e --- /dev/null +++ b/tools/dependencies/configs/trisquel7/i386/deps-download @@ -0,0 +1,2 @@ +git +wget diff --git a/tools/dependencies/configs/trisquel7/i386/deps-flashrom b/tools/dependencies/configs/trisquel7/i386/deps-flashrom new file mode 100644 index 00000000..e469c651 --- /dev/null +++ b/tools/dependencies/configs/trisquel7/i386/deps-flashrom @@ -0,0 +1,10 @@ +libftdi1 +libftdi-dev +libpci3 +libpci-dev +libusb-1.0-0 +libusb-1.0-0-dev +pciutils +pkg-config +zlib1g +zlib1g-dev diff --git a/tools/dependencies/configs/trisquel7/i386/deps-generic b/tools/dependencies/configs/trisquel7/i386/deps-generic new file mode 100644 index 00000000..b04512a4 --- /dev/null +++ b/tools/dependencies/configs/trisquel7/i386/deps-generic @@ -0,0 +1,17 @@ +autogen +binutils +build-essential +coreutils +fakeroot +gawk +help2man +libfakeroot +libfaketime +libltdl-dev +liblzma-dev +libopts25 +libopts25-dev +libtool +m4 +texinfo +xz-utils diff --git a/tools/dependencies/configs/trisquel7/i386/deps-grub b/tools/dependencies/configs/trisquel7/i386/deps-grub new file mode 100644 index 00000000..c54e7627 --- /dev/null +++ b/tools/dependencies/configs/trisquel7/i386/deps-grub @@ -0,0 +1,17 @@ +autoconf +automake +bison +flex +gcc +gettext +libdevmapper-dev +libfreetype6 +libfreetype6-dev +libpciaccess0 +libpciaccess-dev +libusb-1.0-0 +libusb-1.0-0-dev +python +qemu-system-x86 +ttf-unifont +xorriso diff --git a/tools/dependencies/configs/trisquel7/i386/deps-i945-pwm b/tools/dependencies/configs/trisquel7/i386/deps-i945-pwm new file mode 100644 index 00000000..538d83f7 --- /dev/null +++ b/tools/dependencies/configs/trisquel7/i386/deps-i945-pwm @@ -0,0 +1,6 @@ +gcc +libpci3 +libpci-dev +make +zlib1g +zlib1g-dev diff --git a/tools/dependencies/configs/trisquel7/i386/deps-memtest86plus b/tools/dependencies/configs/trisquel7/i386/deps-memtest86plus new file mode 100644 index 00000000..89ffe213 --- /dev/null +++ b/tools/dependencies/configs/trisquel7/i386/deps-memtest86plus @@ -0,0 +1,2 @@ +gcc +make diff --git a/tools/dependencies/configs/trisquel7/i686 b/tools/dependencies/configs/trisquel7/i686 new file mode 120000 index 00000000..fd32fa4e --- /dev/null +++ b/tools/dependencies/configs/trisquel7/i686 @@ -0,0 +1 @@ +i386
\ No newline at end of file diff --git a/tools/dependencies/configs/trisquel7/x86_64/README b/tools/dependencies/configs/trisquel7/x86_64/README new file mode 100644 index 00000000..3a920465 --- /dev/null +++ b/tools/dependencies/configs/trisquel7/x86_64/README @@ -0,0 +1,24 @@ +Each file in this directory contains a list of dependencies that +should be installed before compiling the program indicated by the +filename's suffix, with a few exceptions; these exceptions being +"deps-documentation", "deps-download", and "deps-generic" for reasons +noted below: + +* "deps-documentation" contains a general list of packages that are + needed to build Libreboot documentation. +* "deps-download" contains packages necessary for downloading either + source code repositories and/or supporting files from a remote + source. +* "deps-generic" contains generic dependencies that didn't quite fit + (i.e. listed) under any of the other dependency lists but are + necessary nonetheless. + +It is expected that these files are updated whenever upstream projects +change dependency requirements. + +Any duplications between files are intentional; in order to provide a +clear picture as to which dependencies are needed by individual +programs, any attempt to consolidate these lists is dissuaded. + +This README is released under Creative Commons Zero 1.0: +https://creativecommons.org/publicdomain/zero/1.0/ diff --git a/tools/dependencies/configs/trisquel7/x86_64/deps-bucts b/tools/dependencies/configs/trisquel7/x86_64/deps-bucts new file mode 100644 index 00000000..538d83f7 --- /dev/null +++ b/tools/dependencies/configs/trisquel7/x86_64/deps-bucts @@ -0,0 +1,6 @@ +gcc +libpci3 +libpci-dev +make +zlib1g +zlib1g-dev diff --git a/tools/dependencies/configs/trisquel7/x86_64/deps-coreboot b/tools/dependencies/configs/trisquel7/x86_64/deps-coreboot new file mode 100644 index 00000000..bd78c637 --- /dev/null +++ b/tools/dependencies/configs/trisquel7/x86_64/deps-coreboot @@ -0,0 +1,13 @@ +bison +doxygen +flex +gcc +gdb +g++ +iasl +libncurses5 +libncurses5-dev +libssl-dev +make +ncurses-base +pkg-config diff --git a/tools/dependencies/configs/trisquel7/x86_64/deps-crossgcc-arm b/tools/dependencies/configs/trisquel7/x86_64/deps-crossgcc-arm new file mode 100644 index 00000000..f4629ab5 --- /dev/null +++ b/tools/dependencies/configs/trisquel7/x86_64/deps-crossgcc-arm @@ -0,0 +1 @@ +gcc-arm-linux-gnueabi diff --git a/tools/dependencies/configs/trisquel7/x86_64/deps-crossgcc-i386 b/tools/dependencies/configs/trisquel7/x86_64/deps-crossgcc-i386 new file mode 100644 index 00000000..2fa4385b --- /dev/null +++ b/tools/dependencies/configs/trisquel7/x86_64/deps-crossgcc-i386 @@ -0,0 +1,10 @@ +gcc-multilib +lib32ncurses5 +lib32ncurses5-dev +lib32stdc++6 +lib32tinfo-dev +lib32tinfo5 +lib32z1 +lib32z1-dev +libc6-dev-i386 +libc6-i386 diff --git a/tools/dependencies/configs/trisquel7/x86_64/deps-dejavu-fonts b/tools/dependencies/configs/trisquel7/x86_64/deps-dejavu-fonts new file mode 100644 index 00000000..30157ccf --- /dev/null +++ b/tools/dependencies/configs/trisquel7/x86_64/deps-dejavu-fonts @@ -0,0 +1,2 @@ +fontforge +libfont-ttf-perl diff --git a/tools/dependencies/configs/trisquel7/x86_64/deps-documentation b/tools/dependencies/configs/trisquel7/x86_64/deps-documentation new file mode 100644 index 00000000..4a59b54c --- /dev/null +++ b/tools/dependencies/configs/trisquel7/x86_64/deps-documentation @@ -0,0 +1 @@ +pandoc diff --git a/tools/dependencies/configs/trisquel7/x86_64/deps-download b/tools/dependencies/configs/trisquel7/x86_64/deps-download new file mode 100644 index 00000000..880fb73e --- /dev/null +++ b/tools/dependencies/configs/trisquel7/x86_64/deps-download @@ -0,0 +1,2 @@ +git +wget diff --git a/tools/dependencies/configs/trisquel7/x86_64/deps-flashrom b/tools/dependencies/configs/trisquel7/x86_64/deps-flashrom new file mode 100644 index 00000000..e469c651 --- /dev/null +++ b/tools/dependencies/configs/trisquel7/x86_64/deps-flashrom @@ -0,0 +1,10 @@ +libftdi1 +libftdi-dev +libpci3 +libpci-dev +libusb-1.0-0 +libusb-1.0-0-dev +pciutils +pkg-config +zlib1g +zlib1g-dev diff --git a/tools/dependencies/configs/trisquel7/x86_64/deps-generic b/tools/dependencies/configs/trisquel7/x86_64/deps-generic new file mode 100644 index 00000000..b04512a4 --- /dev/null +++ b/tools/dependencies/configs/trisquel7/x86_64/deps-generic @@ -0,0 +1,17 @@ +autogen +binutils +build-essential +coreutils +fakeroot +gawk +help2man +libfakeroot +libfaketime +libltdl-dev +liblzma-dev +libopts25 +libopts25-dev +libtool +m4 +texinfo +xz-utils diff --git a/tools/dependencies/configs/trisquel7/x86_64/deps-grub b/tools/dependencies/configs/trisquel7/x86_64/deps-grub new file mode 100644 index 00000000..c54e7627 --- /dev/null +++ b/tools/dependencies/configs/trisquel7/x86_64/deps-grub @@ -0,0 +1,17 @@ +autoconf +automake +bison +flex +gcc +gettext +libdevmapper-dev +libfreetype6 +libfreetype6-dev +libpciaccess0 +libpciaccess-dev +libusb-1.0-0 +libusb-1.0-0-dev +python +qemu-system-x86 +ttf-unifont +xorriso diff --git a/tools/dependencies/configs/trisquel7/x86_64/deps-i945-pwm b/tools/dependencies/configs/trisquel7/x86_64/deps-i945-pwm new file mode 100644 index 00000000..538d83f7 --- /dev/null +++ b/tools/dependencies/configs/trisquel7/x86_64/deps-i945-pwm @@ -0,0 +1,6 @@ +gcc +libpci3 +libpci-dev +make +zlib1g +zlib1g-dev diff --git a/tools/dependencies/configs/trisquel7/x86_64/deps-memtest86plus b/tools/dependencies/configs/trisquel7/x86_64/deps-memtest86plus new file mode 100644 index 00000000..89ffe213 --- /dev/null +++ b/tools/dependencies/configs/trisquel7/x86_64/deps-memtest86plus @@ -0,0 +1,2 @@ +gcc +make diff --git a/tools/dependencies/dependencies b/tools/dependencies/dependencies new file mode 100755 index 00000000..13d56f74 --- /dev/null +++ b/tools/dependencies/dependencies @@ -0,0 +1,57 @@ +#!/usr/bin/env bash + +# Copyright (C) 2017 Andrew Robbins <contact@andrewrobbins.info> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +arguments() { + tool_arguments_targets "${tool}" "$@" +} + +usage() { + tool_usage_actions "${tool}" 'print' + tool_usage_arguments "${tool}" "$@" +} + +print() { + local distro="$1" + + local arch="$(uname -i || uname -m)" + local tool_path="$(tool_path "${tool}")" + + if [[ -z "${arch}" ]]; then + printf '\n%s\n' 'uname(1) produced no output. Exiting' 1>&2 + + return 1 + fi + + dependencies_host_supported "${distro}" "${arch}" || return + + local -a dependencies + + for dependency_file in "${tool_path}/${CONFIGS}/${distro}/${arch}"/*; do + if [[ "${dependency_file##*/}" != 'README' ]]; then + local -i origin="${#dependencies[@]}" + + mapfile -tO "${origin}" dependencies < "${dependency_file}" + else + continue + fi + done + + local -a sorted + mapfile -t sorted < <(printf '%s\n' "${dependencies[@]}" | sort | uniq) + + dependencies_print "${distro}" "${sorted[@]}" +} diff --git a/tools/dependencies/dependencies-helper b/tools/dependencies/dependencies-helper new file mode 100755 index 00000000..36d2f3ea --- /dev/null +++ b/tools/dependencies/dependencies-helper @@ -0,0 +1,73 @@ +#!/usr/bin/env bash + +# Copyright (C) 2017 Andrew Robbins <contact@andrewrobbins.info> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +dependencies_print() { + local distro="$1" + shift + + if [[ "${distro}" == 'parabola' ]]; then + printf '\n%s\n' 'Enable the multilib repository in /etc/pacman.conf' + printf '\n%s\n' 'Then, run the following command as root:' + printf '\n%s%s\n' 'pacman -S --needed ' "$*" + else + printf '\n%s\n' 'You will need to run the following command as root:' + printf '\n%s%s\n' 'apt-get -y install ' "$*" + fi +} + +dependencies_host_supported() { + local distro="$1" + local arch="$2" + + dependencies_distro_supported "${distro}" || return + dependencies_arch_supported "${distro}" "${arch}" || return +} + +dependencies_arch_supported() { + local distro="$1" + local arch="$2" + + local tool_path="$(tool_path "${tool}")" + local distro_dir="${tool_path}/${CONFIGS}/${distro}" + + if ! [[ -d "${distro_dir}/${arch}" ]]; then + printf '\n%s\n' "Architecture \"${arch}\" is not supported" 1>&2 + + return 1 + fi +} + +dependencies_distro_supported() { + local distro="$1" + + local tool_path="$(tool_path "${tool}")" + local targets_path="${tool_path}/${CONFIGS}/${TARGETS}" + + local -a targets_list + mapfile -t targets_list < "${targets_path}" + + # Necessary to properly format the string for extglob use below + IFS='|' eval 'local distro_list="${targets_list[*]}"' + + if [[ "${distro}" != @(${distro_list}) ]]; then + printf '\n%s' "Argument \"${distro}\" is not supported. " 1>&2 + printf '%s\n' 'Check spelling?' 1>&2 + + usage + return 1 + fi +} |