diff --git a/x230/README.md b/x230/README.md index fd4308a..7d538d9 100644 --- a/x230/README.md +++ b/x230/README.md @@ -33,7 +33,7 @@ beautiful: * [How to rebuild](#how-to-reproduce-the-release-images) ## TL;DR -1. run `sudo ./x230_before_first_install.sh` on your current X230 Linux system +1. run `sudo ./x230_skulls.sh` on your current X230 Linux system 2. Power down, remove the battery. Remove the keyboard and palmrest. Connect a hardware flasher to an external PC (or a Raspberry Pi with a SPI 8-pin chip clip can directly be used), and run @@ -48,7 +48,7 @@ branch is _not_ meant to be stable. Use it for testing only. ## First-time installation #### before you begin Before starting, run Linux on your X230, install `dmidecode` and run -`sudo ./x230_before_first_install.sh`. It simply prints system information and +`sudo ./x230_skulls.sh`. It simply prints system information and helps you to be up to date. Also make sure you have the latest skulls-x230 package release by running `./upgrade.sh`. diff --git a/x230/release.sh b/x230/release.sh index 7cb8f72..2bab160 100755 --- a/x230/release.sh +++ b/x230/release.sh @@ -133,7 +133,7 @@ cp ../SOURCE.md "$RELEASE_DIR" # copy in x230 stuff cp -a README.md NEWS util LICENSE* functions.sh \ - x230_before_first_install.sh x230_skulls.sh x230_heads.sh \ + x230_skulls.sh x230_heads.sh \ external_install_bottom.sh external_install_top.sh \ upgrade.sh \ "$RELEASE_DIR" diff --git a/x230/x230_before_first_install.sh b/x230/x230_before_first_install.sh deleted file mode 100755 index 39d772e..0000000 --- a/x230/x230_before_first_install.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-3.0+ -# Copyright (C) 2018, Martin Kepplinger - -source functions.sh -set -e - -usage() -{ - echo "Skulls for the X230" - echo " Run this script on the X230 directly." - echo " It checks BIOS and hardware for relevant" - echo " things if you plan to install Skulls" - echo " please make sure dmidecode is installed" - echo "" - echo "Usage: $0" -} - -args=$(getopt -o h -- "$@") -if [ $? -ne 0 ] ; then - usage - exit 1 -fi - -eval set -- "$args" -while [ $# -gt 0 ] -do - case "$1" in - -h) - usage - exit 1 - ;; - --) - shift - break - ;; - *) - echo "Invalid option: $1" - exit 1 - ;; - esac - shift -done - -force_x230_and_root - -BIOS_VENDOR=$(dmidecode -t bios | grep Vendor | cut -d':' -f2) -if [[ $BIOS_VENDOR = *"coreboot"* ]] ; then - echo "coreboot already installed. Ready to use x230_skulls.sh" - exit 0 -fi - -BIOS_VERSION=$(dmidecode -s bios-version | grep -o '[1-2].[0-7][0-9]') -bios_major=$(echo "$BIOS_VERSION" | cut -d. -f1) -bios_minor=$(echo "$BIOS_VERSION" | cut -d. -f2) - -if [ "${bios_minor}" -ge "60" ] ; then - echo "Ready to use external_install_bottom.sh and external_install_top.sh" -else - echo -e "The installed original BIOS is very old and doesn't include the latest Embedded Controller Firmware." - echo -e "${RED}Please upgrade${NC} before installing coreboot." -fi diff --git a/x230/x230_skulls.sh b/x230/x230_skulls.sh index 8410285..6dbf954 100755 --- a/x230/x230_skulls.sh +++ b/x230/x230_skulls.sh @@ -52,6 +52,23 @@ done force_x230_and_root +BIOS_VENDOR=$(dmidecode -t bios | grep Vendor | cut -d':' -f2) +if [[ $BIOS_VENDOR != *"coreboot"* ]] ; then + BIOS_VERSION=$(dmidecode -s bios-version | grep -o '[1-2].[0-7][0-9]') + bios_major=$(echo "$BIOS_VERSION" | cut -d. -f1) + bios_minor=$(echo "$BIOS_VERSION" | cut -d. -f2) + + if [ "${bios_minor}" -ge "60" ] ; then + echo "Ready to use external_install_bottom.sh and external_install_top.sh" + echo "Please run both scripts from a different computer with a" + echo "hardware SPI flasher." + else + echo -e "The installed original BIOS is very old." + echo -e "${RED}Please upgrade${NC} from lenovo.com before installing coreboot." + fi + exit 0 +fi + if [ ! "$have_input_image" -gt 0 ] ; then image_available=$(ls -1 | grep x230_coreboot_seabios || true) if [ -z "${image_available}" ] ; then