diff options
40 files changed, 398 insertions, 153 deletions
diff --git a/docs/gnulinux/guix_system.md b/docs/gnulinux/guix_system.md index f754dcdc..2fad5d99 100644 --- a/docs/gnulinux/guix_system.md +++ b/docs/gnulinux/guix_system.md @@ -179,7 +179,7 @@ desired partition name. Make filesystem on the respective partition, where “fsname” is any desired filesystem name. -`mkfs.ext4 -L fsname /dev/mapper/partname` +`mkfs.btrfs -L fsname /dev/mapper/partname` Mount the respective filesystem under the current system. @@ -254,7 +254,7 @@ Snippet: (device (file-system-label "fsname")) (mount-point "/") - (type "ext4") + (type "btrfs") (dependencies mapped-devices))) %base-file-systems)) (users @@ -269,8 +269,7 @@ Snippet: (packages (append (list - nss-certs - gvfs) + nss-certs) %base-packages)) (services (append @@ -347,7 +346,7 @@ regular boot steps without requiring manual intervention. You can start logging in as regualar user with the respective "username". You will have to periodically (at your convenient time) login as root -and do the latter part of post-installation section, to keep your +and do the update/upgrade part of post-installation section, to keep your guix distribution and guix system updated. That is it! You have now setup guix system with full-disk encryption @@ -373,7 +372,7 @@ libreboot’s functionalities better. License ======= -Copyright (C) 2019 RAGHAV "RG/RVGN" GURURAJAN (rg@rvgn.net). +Copyright (C) 2019 RAGHAV "RG" GURURAJAN (raghavgururajan@disroot.org). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 @@ -381,4 +380,4 @@ or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license can be found at -"https://www.gnu.org/licenses/fdl-1.3.en.html". +"https://www.gnu.org/licenses/fdl-1.3.en.html".
\ No newline at end of file diff --git a/docs/install/x200_external.md b/docs/install/x200_external.md index 327d8b88..0b574a68 100644 --- a/docs/install/x200_external.md +++ b/docs/install/x200_external.md @@ -216,22 +216,28 @@ Intel Turbo Memory ================== Some X200 devices were sold with Intel Turbo Memory installed in the top-most -mini PCI-e slot. This has been [shown to be -ineffective](http://www.anandtech.com/show/2252) at disk caching or battery -saving in most use cases. While there are [Linux -drivers](https://github.com/yarrick/turbomem) available, it is blacklisted in -at least GNU+Trisquel, and possibly other free operating systems. It should -probably be removed. +mini PCI-e slot. + +If you have one installed, you should probably remove it as it mostly likely +brings no benefits, while having many issues: +- It has been [shown to be + ineffective](http://www.anandtech.com/show/2252) at disk caching or battery + saving in most use cases. Having it installed might lead to more + battery consumption. +- Using it will most likely lead to data loss because with its + [driver](https://github.com/yarrick/turbomem), + "data cannot be written/read back reliably". The driver development + has also stopped. +- It might also be a security risk as it may have access to the system + RAM through the PCIe bus. Memory ====== You need DDR3 SODIMM PC3-8500 RAM installed, in matching pairs -(speed/size). Non-matching pairs won't work. You can also install a -single module (meaning, one of the slots will be empty) in slot 0. - -NOTE: according to users repors, non matching pairs (e.g. 1+2 GiB) might -work in some cases. +(speed/size) as some non-matching pairs are known not to work. +You can also install a single module (meaning, one of the +slots will be empty) in slot 0. Make sure that the RAM you buy is the 2Rx8 density. @@ -100,8 +100,8 @@ libreboot_project() { if ! project_function_check "$project" "$action"; then libreboot_usage exit 1 - elif [[ "$action" == 'usage' ]]; then - project_action "$action" "$project" "$@" + elif [[ $action == usage ]]; then + project_action_usage "$project" "$@" else project_action_arguments "$action" "$project" "$@" fi diff --git a/libs/common b/libs/common index 06b411e1..b1091e4f 100755 --- a/libs/common +++ b/libs/common @@ -117,6 +117,13 @@ diff_patch() { patch -fd "$sources_path" -r - < "$patch_path" } +diff_patch_check() { + local sources_path=$1 + local patch_path=$2 + + patch -sfd "$sources_path" --dry-run < "$patch_path" > /dev/null 2>&1 +} + path_wildcard_expand() { local path=$@ @@ -312,7 +312,7 @@ git_project_patch_recursive() { git_patch "$repository_path" "$branch" "$patch" || return 1 done - if [[ $path != . ]]; then + if [[ -n $path && $path != . ]]; then git_project_patch_recursive "$project" "$repository" "$branch" "$(dirname "$path")" fi } diff --git a/libs/project b/libs/project index 8f4ef233..d884556d 100755 --- a/libs/project +++ b/libs/project @@ -60,46 +60,114 @@ project_dependencies() { local project=$1 shift - local -a dependencies - mapfile -t dependencies < <(project_file_contents_herit "$project" "$CONFIGS" "$DEPENDENCIES" "$@") + if [[ -n "${PROJECTS_FORCE[*]}" ]]; then + local expanded + local project_force - if [[ -n ${dependencies[*]} ]]; then - printf '%s\n' "${dependencies[@]}" + for project_force in "${PROJECTS_FORCE[@]}"; do + project_arguments_expand_recursive $project_force | while IFS='' read -r expanded; do + project_dependencies_sort $expanded + done + done fi + + project_dependencies_sort "$project" "$@" | head -n -1 } -project_dependencies_check() { +project_dependencies_collect() { local project=$1 shift - local -a dependencies - mapfile -t dependencies < <(project_dependencies "$project" "$@") + local argument + local path - local -i missing=0 + for argument in "" "$@"; do + if [[ -z $argument ]]; then + path=$CONFIGS + else + path=$path/$argument + fi + + project_file_contents "$project" "$path" "$DEPENDENCIES" + done + + project_dependencies_collect_recursive "$project" "$@" +} + +project_dependencies_collect_recursive() { + local project=$1 + shift + + local argument + local path - for ((i = 0, nodeps = ${#dependencies[@]}; i < nodeps; ++i)); do - local -a dependency=(${dependencies[i]}) + for argument in "" "$@"; do + if [[ -z $argument ]]; then + path=$CONFIGS + else + path=$path/$argument + fi + done - project_check "${dependency[0]}" || let ++missing + project_action_helper arguments "$project" "$@" | while IFS='' read -r argument; do + project_file_contents "$project" "$path/$argument" "$DEPENDENCIES" + project_dependencies_collect_recursive "$project" "$@" "$argument" done +} - return $missing +project_dependencies_encode_recursive() { + local project=$1 + shift + + local project_arguments=$(arguments_concat ' ' "$project" "$@") + local project_arguments_encoded=$(base64 -w0 <<< "$project_arguments") + + local dependency + + project_dependencies_collect "$project" "$@" | while IFS='' read -r dependency; do + local dependency_arguments=$(arguments_concat ' ' $dependency) + local dependency_arguments_encoded=$(base64 -w0 <<< "$dependency_arguments") + + printf '%s\n' "$project_arguments_encoded $dependency_arguments_encoded" + + project_dependencies_encode_recursive $dependency + done } -project_dependencies_sources_check() { +project_dependencies_sort() { local project=$1 shift - local -a dependencies - mapfile -t dependencies < <(project_dependencies "$project" "$@") + ( + set -o pipefail + + project_dependencies_encode_recursive "$project" "$@" | tsort | base64 -d -w0 | tac + ) +} +project_dependencies_check() { + local project=$1 + shift + + local dependency local -i missing=0 - for ((i = 0, nodeps = ${#dependencies[@]}; i < nodeps; ++i)); do - local -a dependency=(${dependencies[i]}) + project_dependencies "$project" "$@" | while read -r dependency; do + project_check $dependency || let ++missing + done + + return $missing +} + +project_dependencies_sources_check() { + local project=$1 + shift + + local dependency + local -i missing=0 - project_sources_directory_filled_check "${dependency[0]}" || - let ++missing + project_dependencies "$project" "$@" | while read -r dependency; do + project_sources_directory_filled_check $dependency || let ++missing done return $missing @@ -110,12 +178,9 @@ project_dependencies_action_arguments() { local project=$2 shift 2 - local -a dependencies - mapfile -t dependencies < <(project_dependencies "$project" "$@") - - for ((i = 0, nodeps = ${#dependencies[@]}; i < nodeps; ++i)); do - local -a dependency=(${dependencies[i]}) + local -a dependency + project_dependencies "$project" "$@" | while read -ra dependency; do if project_function_check "${dependency[0]}" "$action"; then project_action_arguments "$action" "${dependency[@]}" fi @@ -126,14 +191,13 @@ project_function_check() { local project=$1 local function=$2 - project_include "$project" - - if ! function_check "$function" - then - return 1 - fi + ( + project_include "$project" - return 0 + if ! function_check "$function"; then + exit 1 + fi + ) } project_action() { @@ -153,6 +217,8 @@ project_action() { printf '%s\n' "Project $project $action (with ${arguments:-no argument})" ( + set -e + "$action" "$@" ) @@ -201,11 +267,15 @@ project_action_helper() { local project="$1" shift - if ! function_check "$helper"; then - return 0 - fi + ( + project_include "$project" - "$helper" "$@" + if ! function_check "$helper"; then + exit 0 + fi + + "$helper" "$@" + ) } project_action_arguments() { @@ -214,10 +284,12 @@ project_action_arguments() { local project="$1" shift - project_include "$project" + ( + project_include "$project" - project_action_arguments_verify_recursive "$action" "$project" "$@" - project_action_arguments_recursive "$action" "$project" "$@" + project_action_arguments_verify_recursive "$action" "$project" "$@" + project_action_arguments_recursive "$action" "$project" "$@" + ) } project_action_arguments_verify_recursive() { @@ -308,6 +380,17 @@ project_action_projects() { done < "$path" } +project_action_usage() { + local project=$1 + shift + + ( + project_include "$project" + + project_action usage "$project" "$@" + ) +} + project_path() { local project=$1 @@ -521,23 +604,75 @@ project_sources_archive_missing_check() { project_sources_prepare() { local project="$1" - local sources_path="$2" + shift + + project_sources_prepare_blobs "$project" "$@" + project_sources_prepare_patch "$project" "$@" +} + +project_sources_prepare_blobs() { + local project=$1 + shift - # Not implemented yet / May end up not being needed - #project_sources_prepare_blobs - project_sources_prepare_patch "$project" "$sources_path" "$@" + local sources_path=$(project_sources_path "$project" "$project" "$@") + + ( + cd "$sources_path" || exit 1 + + project_blobs "$project" "$@" | while IFS='' read -r blob; do + rm -f -- "$blob" + done + ) } project_sources_prepare_patch() { local project="$1" - local sources_path="$2" + shift - local project_path="$(project_path "$project")" - local patches_path="$project_path/$PATCHES" + local argument + local path + + for argument in "$@"; do + if [[ -z $path ]]; then + path=$argument + else + path=$path/$argument + fi + done + + if [[ -n $project ]]; then + project_sources_patch_recursive "$project" "$path" + fi +} + +project_sources_prepare_check() { + local project=$1 + shift + + local sources_path=$(project_sources_path "$project" "$project" "$@") + + directory_filled_check "$sources_path" +} + +project_sources_patch_recursive() { + local project=$1 + local path=$2 + + local project_path=$(project_path "$project") + local sources_path=$(project_sources_path "$project" "$project" "$@") + local patches_path=$project_path/$PATCHES/$path + + if ! [[ -d $project_path/$PATCHES ]]; then + return 0 + fi for patch in "$patches_path"/[!.]*.@(patch|diff); do - diff_patch "$sources_path" "$patch" + project_sources_patch "$sources_path" "$patch" || return 1 done + + if [[ -n $path && $path != . ]]; then + project_sources_patch_recursive "$project" "$(dirname "$path")" + fi } project_blobs() { @@ -556,6 +691,17 @@ project_blobs() { fi } +project_sources_patch() { + local sources_path=$1 + local patch_path=$2 + + if diff_patch_check "$sources_path" "$patch_path"; then + diff_patch "$sources_path" "$patch_path" + else + return 1 + fi +} + project_blobs_path() { local project=$1 shift @@ -639,6 +785,26 @@ project_arguments_targets() { fi } +project_arguments_expand_recursive() { + local project=$1 + shift + + local -a arguments + readarray -t arguments < <(project_action_helper arguments "$project" "$@") + + if [[ -z "${arguments[*]}" ]]; then + echo "$project" "$@" + + return 0 + fi + + local argument + + for argument in "${arguments[@]}"; do + project_arguments_expand_recursive "$project" "$@" "$argument" + done +} + project_usage_actions() { local project="$1" shift @@ -751,8 +917,7 @@ project_download_archive() { mv "${archive_path%.tar*}" "$sources_path" fi - # Patch the source, if necessary - project_sources_prepare "$project" "$sources_path" + project_sources_prepare "$project" } project_download_check_archive() { diff --git a/projects/cbfstool/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch b/projects/cbfstool/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch deleted file mode 120000 index 627443a5..00000000 --- a/projects/cbfstool/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch +++ /dev/null @@ -1 +0,0 @@ -../../coreboot/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch
\ No newline at end of file diff --git a/projects/cbfstool/patches/0001-Don-t-pull-in-3rdparty-git-submodules.patch b/projects/cbfstool/patches/0001-Don-t-pull-in-3rdparty-git-submodules.patch new file mode 120000 index 00000000..250b848b --- /dev/null +++ b/projects/cbfstool/patches/0001-Don-t-pull-in-3rdparty-git-submodules.patch @@ -0,0 +1 @@ +../../coreboot/patches/0001-Don-t-pull-in-3rdparty-git-submodules.patch
\ No newline at end of file diff --git a/projects/cbmem/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch b/projects/cbmem/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch deleted file mode 120000 index 627443a5..00000000 --- a/projects/cbmem/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch +++ /dev/null @@ -1 +0,0 @@ -../../coreboot/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch
\ No newline at end of file diff --git a/projects/cbmem/patches/0001-Don-t-pull-in-3rdparty-git-submodules.patch b/projects/cbmem/patches/0001-Don-t-pull-in-3rdparty-git-submodules.patch new file mode 120000 index 00000000..250b848b --- /dev/null +++ b/projects/cbmem/patches/0001-Don-t-pull-in-3rdparty-git-submodules.patch @@ -0,0 +1 @@ +../../coreboot/patches/0001-Don-t-pull-in-3rdparty-git-submodules.patch
\ No newline at end of file diff --git a/projects/coreboot/configs/qemu_i440fx_piix4/16MiB/corebootfb/grub/dependencies b/projects/coreboot/configs/qemu_i440fx_piix4/16MiB/corebootfb/grub/dependencies new file mode 100644 index 00000000..6640cb8d --- /dev/null +++ b/projects/coreboot/configs/qemu_i440fx_piix4/16MiB/corebootfb/grub/dependencies @@ -0,0 +1 @@ +grub coreboot diff --git a/projects/coreboot/configs/qemu_i440fx_piix4/16MiB/corebootfb/seabios/dependencies b/projects/coreboot/configs/qemu_i440fx_piix4/16MiB/corebootfb/seabios/dependencies new file mode 100644 index 00000000..41f077c0 --- /dev/null +++ b/projects/coreboot/configs/qemu_i440fx_piix4/16MiB/corebootfb/seabios/dependencies @@ -0,0 +1 @@ +seabios diff --git a/projects/coreboot/configs/qemu_i440fx_piix4/16MiB/textmode/grub/dependencies b/projects/coreboot/configs/qemu_i440fx_piix4/16MiB/textmode/grub/dependencies new file mode 100644 index 00000000..6640cb8d --- /dev/null +++ b/projects/coreboot/configs/qemu_i440fx_piix4/16MiB/textmode/grub/dependencies @@ -0,0 +1 @@ +grub coreboot diff --git a/projects/coreboot/configs/qemu_i440fx_piix4/16MiB/textmode/seabios/dependencies b/projects/coreboot/configs/qemu_i440fx_piix4/16MiB/textmode/seabios/dependencies new file mode 100644 index 00000000..41f077c0 --- /dev/null +++ b/projects/coreboot/configs/qemu_i440fx_piix4/16MiB/textmode/seabios/dependencies @@ -0,0 +1 @@ +seabios diff --git a/projects/coreboot/configs/qemu_i440fx_piix4/8MiB/corebootfb/grub/dependencies b/projects/coreboot/configs/qemu_i440fx_piix4/8MiB/corebootfb/grub/dependencies new file mode 100644 index 00000000..6640cb8d --- /dev/null +++ b/projects/coreboot/configs/qemu_i440fx_piix4/8MiB/corebootfb/grub/dependencies @@ -0,0 +1 @@ +grub coreboot diff --git a/projects/coreboot/configs/qemu_i440fx_piix4/8MiB/corebootfb/seabios/dependencies b/projects/coreboot/configs/qemu_i440fx_piix4/8MiB/corebootfb/seabios/dependencies new file mode 100644 index 00000000..41f077c0 --- /dev/null +++ b/projects/coreboot/configs/qemu_i440fx_piix4/8MiB/corebootfb/seabios/dependencies @@ -0,0 +1 @@ +seabios diff --git a/projects/coreboot/configs/qemu_i440fx_piix4/8MiB/textmode/grub/dependencies b/projects/coreboot/configs/qemu_i440fx_piix4/8MiB/textmode/grub/dependencies new file mode 100644 index 00000000..6640cb8d --- /dev/null +++ b/projects/coreboot/configs/qemu_i440fx_piix4/8MiB/textmode/grub/dependencies @@ -0,0 +1 @@ +grub coreboot diff --git a/projects/coreboot/configs/qemu_i440fx_piix4/8MiB/textmode/seabios/dependencies b/projects/coreboot/configs/qemu_i440fx_piix4/8MiB/textmode/seabios/dependencies new file mode 100644 index 00000000..41f077c0 --- /dev/null +++ b/projects/coreboot/configs/qemu_i440fx_piix4/8MiB/textmode/seabios/dependencies @@ -0,0 +1 @@ +seabios diff --git a/projects/coreboot/configs/qemu_q35_ich9/16MiB/corebootfb/grub/dependencies b/projects/coreboot/configs/qemu_q35_ich9/16MiB/corebootfb/grub/dependencies new file mode 100644 index 00000000..6640cb8d --- /dev/null +++ b/projects/coreboot/configs/qemu_q35_ich9/16MiB/corebootfb/grub/dependencies @@ -0,0 +1 @@ +grub coreboot diff --git a/projects/coreboot/configs/qemu_q35_ich9/16MiB/corebootfb/seabios/dependencies b/projects/coreboot/configs/qemu_q35_ich9/16MiB/corebootfb/seabios/dependencies new file mode 100644 index 00000000..41f077c0 --- /dev/null +++ b/projects/coreboot/configs/qemu_q35_ich9/16MiB/corebootfb/seabios/dependencies @@ -0,0 +1 @@ +seabios diff --git a/projects/coreboot/configs/qemu_q35_ich9/16MiB/textmode/grub/dependencies b/projects/coreboot/configs/qemu_q35_ich9/16MiB/textmode/grub/dependencies new file mode 100644 index 00000000..6640cb8d --- /dev/null +++ b/projects/coreboot/configs/qemu_q35_ich9/16MiB/textmode/grub/dependencies @@ -0,0 +1 @@ +grub coreboot diff --git a/projects/coreboot/configs/qemu_q35_ich9/16MiB/textmode/seabios/dependencies b/projects/coreboot/configs/qemu_q35_ich9/16MiB/textmode/seabios/dependencies new file mode 100644 index 00000000..41f077c0 --- /dev/null +++ b/projects/coreboot/configs/qemu_q35_ich9/16MiB/textmode/seabios/dependencies @@ -0,0 +1 @@ +seabios diff --git a/projects/coreboot/configs/qemu_q35_ich9/8MiB/corebootfb/grub/dependencies b/projects/coreboot/configs/qemu_q35_ich9/8MiB/corebootfb/grub/dependencies new file mode 100644 index 00000000..6640cb8d --- /dev/null +++ b/projects/coreboot/configs/qemu_q35_ich9/8MiB/corebootfb/grub/dependencies @@ -0,0 +1 @@ +grub coreboot diff --git a/projects/coreboot/configs/qemu_q35_ich9/8MiB/corebootfb/seabios/dependencies b/projects/coreboot/configs/qemu_q35_ich9/8MiB/corebootfb/seabios/dependencies new file mode 100644 index 00000000..41f077c0 --- /dev/null +++ b/projects/coreboot/configs/qemu_q35_ich9/8MiB/corebootfb/seabios/dependencies @@ -0,0 +1 @@ +seabios diff --git a/projects/coreboot/configs/qemu_q35_ich9/8MiB/textmode/grub/dependencies b/projects/coreboot/configs/qemu_q35_ich9/8MiB/textmode/grub/dependencies new file mode 100644 index 00000000..6640cb8d --- /dev/null +++ b/projects/coreboot/configs/qemu_q35_ich9/8MiB/textmode/grub/dependencies @@ -0,0 +1 @@ +grub coreboot diff --git a/projects/coreboot/configs/qemu_q35_ich9/8MiB/textmode/seabios/dependencies b/projects/coreboot/configs/qemu_q35_ich9/8MiB/textmode/seabios/dependencies new file mode 100644 index 00000000..41f077c0 --- /dev/null +++ b/projects/coreboot/configs/qemu_q35_ich9/8MiB/textmode/seabios/dependencies @@ -0,0 +1 @@ +seabios diff --git a/projects/coreboot/coreboot b/projects/coreboot/coreboot index 046a4de1..e224cccc 100755 --- a/projects/coreboot/coreboot +++ b/projects/coreboot/coreboot @@ -28,10 +28,6 @@ dependencies() { project_dependencies "$project" "$@" } -dependencies_check() { - project_dependencies_check "$project" "$@" -} - download() { local repository=$project diff --git a/projects/cros-ec/cros-ec b/projects/cros-ec/cros-ec index 1df44feb..55dc676e 100755 --- a/projects/cros-ec/cros-ec +++ b/projects/cros-ec/cros-ec @@ -23,10 +23,6 @@ dependencies() { project_dependencies "$project" "$@" } -dependencies_check() { - project_dependencies_check "$project" "$@" -} - usage() { project_usage_actions "$project" project_usage_arguments "$project" "$@" diff --git a/projects/dejavu-fonts/dejavu-fonts b/projects/dejavu-fonts/dejavu-fonts index c3d76cf9..1e91362f 100755 --- a/projects/dejavu-fonts/dejavu-fonts +++ b/projects/dejavu-fonts/dejavu-fonts @@ -23,10 +23,6 @@ dependencies() { project_dependencies "$project" "$@" } -dependencies_check() { - project_dependencies_check "$project" "$@" -} - usage() { project_usage_actions "$project" project_usage_arguments "$project" "$@" diff --git a/projects/depthcharge/depthcharge b/projects/depthcharge/depthcharge index 6a58d305..17057e69 100755 --- a/projects/depthcharge/depthcharge +++ b/projects/depthcharge/depthcharge @@ -23,10 +23,6 @@ dependencies() { project_dependencies "$project" "$@" } -dependencies_check() { - project_dependencies_check "$project" "$@" -} - usage() { project_usage_actions "$project" project_usage_arguments "$project" "$@" diff --git a/projects/grub/grub b/projects/grub/grub index 3daca888..ada5c338 100755 --- a/projects/grub/grub +++ b/projects/grub/grub @@ -23,10 +23,6 @@ dependencies() { project_dependencies "$project" "$@" } -dependencies_check() { - project_dependencies_check "$project" "$@" -} - usage() { project_usage_actions "$project" project_usage_arguments "$project" "$@" @@ -79,28 +75,24 @@ build() { local build_path="$(project_build_path "$project" "$@")" local raw_keymap_path="$project_path/$CONFIGS/keymaps" - ( - set -e + mkdir -p "$build_path" - mkdir -p "$build_path" + grub_build_utils - grub_build_utils - - if [[ "$target" == 'bios' ]]; then - grub_build_floppy_image - else - grub_build_standalone_image - fi + 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 + for raw_keymap in "$raw_keymap_path"/*; do + grub_build_layout "$raw_keymap" + done - grub_build_font - grub_copy_modules + grub_build_font + grub_copy_modules - make -C "$sources_path" distclean - ) + make -C "$sources_path" distclean } build_check() { diff --git a/projects/ich9gen/ich9gen b/projects/ich9gen/ich9gen index 71567329..5ba9ae2f 100755 --- a/projects/ich9gen/ich9gen +++ b/projects/ich9gen/ich9gen @@ -58,23 +58,20 @@ build() { fi local sources_path="$(project_sources_path "$project" "$repository" "$@")" - local build_path="$(project_build_path "$project" "$@")" mkdir -p "$build_path" make -C "$sources_path" -j"$TASKS" ich9gen - ( - local macaddress="$(ich9gen_macaddress)" + local macaddress="$(ich9gen_macaddress)" - cd "$build_path" + cd "$build_path" - if [[ -n $macaddress ]]; then - "$sources_path"/ich9gen --macaddress "$macaddress" - else - "$sources_path"/ich9gen - fi - ) + if [[ -n $macaddress ]]; then + "$sources_path"/ich9gen --macaddress "$macaddress" + else + "$sources_path"/ich9gen + fi cp "$sources_path/ich9gen" "$build_path" make -C "$sources_path" clean diff --git a/projects/libreboot-dependencies/libreboot-dependencies b/projects/libreboot-dependencies/libreboot-dependencies new file mode 100755 index 00000000..ae50406c --- /dev/null +++ b/projects/libreboot-dependencies/libreboot-dependencies @@ -0,0 +1,52 @@ +#!/usr/bin/env bash + +# Copyright (C) 2019 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/>. + +usage() { + project_usage_actions "$project" +} + +collect() { + project_dependencies "$@" +} + +download() { + project_dependencies_action_arguments "$action" "$@" +} + +extract() { + project_dependencies_action_arguments "$action" "$@" +} + +update() { + project_dependencies_action_arguments "$action" "$@" +} + +build() { + project_dependencies_action_arguments "$action" "$@" +} + +install() { + project_dependencies_action_arguments "$action" "$@" +} + +release() { + project_dependencies_action_arguments "$action" "$@" +} + +clean() { + project_dependencies_action_arguments "$action" "$@" +} diff --git a/projects/mosys/mosys b/projects/mosys/mosys index fecf9267..4407d784 100755 --- a/projects/mosys/mosys +++ b/projects/mosys/mosys @@ -23,10 +23,6 @@ dependencies() { project_dependencies "$project" "$@" } -dependencies_check() { - project_dependencies_check "$project" "$@" -} - download() { local repository=$project diff --git a/projects/nvramtool/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch b/projects/nvramtool/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch deleted file mode 120000 index 627443a5..00000000 --- a/projects/nvramtool/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch +++ /dev/null @@ -1 +0,0 @@ -../../coreboot/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch
\ No newline at end of file diff --git a/projects/nvramtool/patches/0001-Don-t-pull-in-3rdparty-git-submodules.patch b/projects/nvramtool/patches/0001-Don-t-pull-in-3rdparty-git-submodules.patch new file mode 120000 index 00000000..250b848b --- /dev/null +++ b/projects/nvramtool/patches/0001-Don-t-pull-in-3rdparty-git-submodules.patch @@ -0,0 +1 @@ +../../coreboot/patches/0001-Don-t-pull-in-3rdparty-git-submodules.patch
\ No newline at end of file diff --git a/resources/libreboot/patch/crossgcc/gccfix.diff b/resources/libreboot/patch/crossgcc/gccfix.diff deleted file mode 100644 index 49e6227b..00000000 --- a/resources/libreboot/patch/crossgcc/gccfix.diff +++ /dev/null @@ -1,27 +0,0 @@ -From ea0c2d76c4f16eccaafcb2c0741f76825505bafc Mon Sep 17 00:00:00 2001 -From: Nico Huber <nico.huber@secunet.com> -Date: Thu, 22 Dec 2016 16:05:54 +0100 -Subject: [PATCH] DONOTMERGE buildgcc: Build GMP `--with-pic` if GCC defaults to `-pie` - -Change-Id: I5f3185af9c8d599379a628e18724b217b88be974 -Signed-off-by: Nico Huber <nico.huber@secunet.com> ---- - -diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc -index 97c38b8..4eefd43 100755 ---- a/util/crossgcc/buildgcc -+++ b/util/crossgcc/buildgcc -@@ -515,6 +515,13 @@ - } - - build_GMP() { -+ # Check if GCC enables `-pie` by default (likely on Debian Stretch). -+ # We have to use `--with-pic` then. -+ if "${CC}" -dumpspecs 2>/dev/null | grep -q '[{;][[:space:]]*:-pie\>' -+ then -+ OPTIONS="$OPTIONS --with-pic" -+ fi -+ - CC="$CC" ../${GMP_DIR}/configure --disable-shared --enable-fat \ - --prefix=$TARGETDIR $OPTIONS \ - || touch .failed diff --git a/resources/libreboot/patch/crossgcc/libelf.patch b/resources/libreboot/patch/crossgcc/libelf.patch new file mode 100644 index 00000000..af954446 --- /dev/null +++ b/resources/libreboot/patch/crossgcc/libelf.patch @@ -0,0 +1,25 @@ +From e2896721cff5af4d869a7c900e748c803f25a2ce Mon Sep 17 00:00:00 2001 +From: Andrew Robbins <contact@andrewrobbins.info> +Date: Thu, 26 Sep 2019 18:19:07 -0500 +Subject: [PATCH] buildgcc: Replace dead libelf archive URI + +--- + util/crossgcc/buildgcc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc +index 97c38b8d95..54f87972e6 100755 +--- a/util/crossgcc/buildgcc ++++ b/util/crossgcc/buildgcc +@@ -57,7 +57,7 @@ MAKE_VERSION=4.2.1 + GMP_ARCHIVE="http://ftpmirror.gnu.org/gmp/gmp-${GMP_VERSION}.tar.xz" + MPFR_ARCHIVE="http://ftpmirror.gnu.org/mpfr/mpfr-${MPFR_VERSION}.tar.xz" + MPC_ARCHIVE="http://ftpmirror.gnu.org/mpc/mpc-${MPC_VERSION}.tar.gz" +-LIBELF_ARCHIVE="http://www.mr511.de/software/libelf-${LIBELF_VERSION}.tar.gz" ++LIBELF_ARCHIVE="https://fossies.org/linux/misc/old/libelf-${LIBELF_VERSION}.tar.gz" + GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" + BINUTILS_ARCHIVE="http://ftpmirror.gnu.org/binutils/binutils-${BINUTILS_VERSION}.tar.bz2" + GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" +-- +2.23.0 + diff --git a/resources/libreboot/patch/crossgcc/looking_for_pie.patch b/resources/libreboot/patch/crossgcc/looking_for_pie.patch new file mode 100644 index 00000000..942edac2 --- /dev/null +++ b/resources/libreboot/patch/crossgcc/looking_for_pie.patch @@ -0,0 +1,32 @@ +From e64fb0ce10d01d99154fb4bd95529e5cd8dfd4be Mon Sep 17 00:00:00 2001 +From: Andrew Robbins <contact@andrewrobbins.info> +Date: Fri, 27 Sep 2019 09:38:09 -0500 +Subject: [PATCH] buildgcc: Check for '-pie' when building gmp + +The regex formerly used was not flexible enough to catch some +instances where the '-pie' flag would be enabled. +--- + util/crossgcc/buildgcc | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc +index 97c38b8d95..a6e4728514 100755 +--- a/util/crossgcc/buildgcc ++++ b/util/crossgcc/buildgcc +@@ -515,6 +515,13 @@ set_hostcflags_from_gmp() { + } + + build_GMP() { ++ # Check if GCC enables `-pie` by default (possible since GCC 6). ++ # We need PIC in all static libraries then. ++ if $CC -dumpspecs 2>/dev/null | grep -q '[{;][[:space:]]*\(!no-pie\)\?:-pie\>' ++ then ++ OPTIONS="$OPTIONS --with-pic" ++ fi ++ + CC="$CC" ../${GMP_DIR}/configure --disable-shared --enable-fat \ + --prefix=$TARGETDIR $OPTIONS \ + || touch .failed +-- +2.23.0 + diff --git a/resources/scripts/helpers/download/crossgcc b/resources/scripts/helpers/download/crossgcc index 54f55439..8522458a 100755 --- a/resources/scripts/helpers/download/crossgcc +++ b/resources/scripts/helpers/download/crossgcc @@ -46,9 +46,10 @@ rm -Rf "crossgcc/" cd 3rdparty/vboot/ git reset --hard ${vbootrevision} ) - # workaround to fix the error on debian stretch and later, when building - # GMP. If -pie is enabled in GCC, then --with-pic must be used when compiling - git am ../resources/libreboot/patch/crossgcc/gccfix.diff + # If -pie is enabled in GCC, then --with-pic must be used when compiling + git am ../resources/libreboot/patch/crossgcc/looking_for_pie.patch + # Update URI pointing to the version of libelf we need + git am ../resources/libreboot/patch/crossgcc/libelf.patch #Patch to add hash checking to buildgcc git apply ../resources/libreboot/patch/crossgcc/buildgcc_hash_patch.diff rm -Rf .git* */*/.git* |