From 5ca15c7f2c277ecdfe8c4a43bd4fdd1c5d56e86c Mon Sep 17 00:00:00 2001 From: Cem Keylan Date: Fri, 10 Jan 2020 23:30:19 +0300 Subject: baselayout: add installkernel --- core/baselayout/build | 3 +++ core/baselayout/checksums | 1 + core/baselayout/files/installkernel | 50 +++++++++++++++++++++++++++++++++++++ core/baselayout/sources | 1 + core/baselayout/version | 2 +- 5 files changed, 56 insertions(+), 1 deletion(-) create mode 100755 core/baselayout/files/installkernel (limited to 'core/baselayout') diff --git a/core/baselayout/build b/core/baselayout/build index 91aff2ca..a6b66a5c 100755 --- a/core/baselayout/build +++ b/core/baselayout/build @@ -53,6 +53,9 @@ for f in fstab group host.conf hosts issue keymap os-release \ install -m 644 "$f" "$1/etc" done +# Install installkernel +install -Dm755 installkernel "$1/usr/bin/installkernel" + for f in crypttab shadow; do install -m 600 "$f" "$1/etc" done diff --git a/core/baselayout/checksums b/core/baselayout/checksums index 9a7938d6..66f82f7f 100644 --- a/core/baselayout/checksums +++ b/core/baselayout/checksums @@ -3,6 +3,7 @@ f85cb0b07f49ff20c4838c267ffb093a136fb5bfdf01badcb03eced852ffea89 fstab 38c9f4047ba597248ef199a77afbd36f873cfa4aeb70de90bac7f237faf2ecba group a0fa9cd303cf7f1718f51e5624a671a418946718b790508b8988bccd542c6451 host.conf eda9afe39a3562406f14cb8a5a142922b63e68467d3ba4821c02eaa142d9c4da hosts +60399d8357f694135d4c3f74255d4e753ceb7f4b33ccbba0f2de6a063999479e installkernel 0b8b86f6556ed9016a5017fd7afec6edb02a8012d0b2086027622aba9b032f38 issue d54c9b8393f53dbda0984c7cffcd748f1188f98d4bd40d90ca8d366a816f9352 keymap 0bde8ace73d58897e85c82eb96690bbfd1a4231949d3523d5950ba1910b08892 mime.types diff --git a/core/baselayout/files/installkernel b/core/baselayout/files/installkernel new file mode 100755 index 00000000..153e00af --- /dev/null +++ b/core/baselayout/files/installkernel @@ -0,0 +1,50 @@ +#!/bin/sh -e +# +# Copyright © 2020 Cem Keylan + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +# Installs the kernel on Carbs Linux. + +usage() { printf "Usage: \033[1;32m${0##*/}\033[0;00m \n"; exit 1;} +out() { printf "\033[1;36m-> \033[0;00m$1\n" ;} +error() { printf "\033[1;31m-> ERROR: \033[0;00m$1\n" ;} >&2 +die() { error "$1" ; exit 1 ;} + +[ $# -gt 2 ] || usage + +version="$1" +image="$2" +map="$3" +directory="${4-/boot}" + +out "Installing $image-$version to $directory" + +updatever() { + [ -f "$directory/$1-$version" ] && out "Moving $directory/$1-$version to $directory/$1-$version.old" \ + && mv "$directory/$1-$version" "$directory/$1-$version.old" + + cp "$2" "$directory/$1-$version" +} + +updatever "$(basename "$image")" "$image" +updatever System.map "$map" + +config="$(dirname "$map")/.config" +[ -f "$config" ] && updatever config "$config" diff --git a/core/baselayout/sources b/core/baselayout/sources index a663d479..d009cdbd 100644 --- a/core/baselayout/sources +++ b/core/baselayout/sources @@ -3,6 +3,7 @@ files/fstab files/group files/host.conf files/hosts +files/installkernel files/issue files/keymap files/mime.types diff --git a/core/baselayout/version b/core/baselayout/version index 0d6a524b..32ac9cc4 100644 --- a/core/baselayout/version +++ b/core/baselayout/version @@ -1 +1 @@ -1 5 +1 6 -- cgit v1.2.3