aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCem Keylan <cem@ckyln.com>2020-01-10 23:30:19 +0300
committerCem Keylan <cem@ckyln.com>2020-01-10 23:30:19 +0300
commit5ca15c7f2c277ecdfe8c4a43bd4fdd1c5d56e86c (patch)
tree82428f8fb655ca431d0a0ea85b2bf7b7d6a72a7f
parentcaf0c3f0af4ec61f8cf159c9b8e6cf100636716a (diff)
downloadrepository-5ca15c7f2c277ecdfe8c4a43bd4fdd1c5d56e86c.tar.gz
baselayout: add installkernel
-rwxr-xr-xcore/baselayout/build3
-rw-r--r--core/baselayout/checksums1
-rwxr-xr-xcore/baselayout/files/installkernel50
-rw-r--r--core/baselayout/sources1
-rw-r--r--core/baselayout/version2
5 files changed, 56 insertions, 1 deletions
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 <version> <image> <System.map> <directory>\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