Skip to content

Commit 95ee597

Browse files
committed
Fix installKernel scripts after move to iscsi guest root
1 parent 4804287 commit 95ee597

1 file changed

Lines changed: 15 additions & 11 deletions

File tree

res/lapas/scripts/installKernel.sh

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
11
#!/bin/bash
22

3+
# import LAPAS config
4+
. $(dirname "$0")/config;
5+
36
if [ "$USER" != "root" ]; then
4-
echo "You have to be logged in as root to use this. Hint: use 'su - root' instead of su root"; exit 1;
7+
echo "You have to be logged in as root to use this. Hint: use 'su - root' instead of su root"; exit 1;
58
fi
69

7-
# import LAPAS config
8-
. $(dirname "$0")/config;
10+
if [ ! -d "${LAPAS_GUESTROOT_DIR}" ]; then
11+
echo "You have to run this script inside scripts/withGuestFs.sh"; exit 1;
12+
fi
913

1014
##########################################################################
1115

1216
kernelVersion="$1";
1317

1418
if [ "$#" != "1" ]; then
15-
echo "Usage: $0 <KERNEL_VERSION>"
16-
exit 1;
19+
echo "Usage: $0 <KERNEL_VERSION>"
20+
exit 1;
1721
fi
1822

1923
##########################################################################
2024

21-
pushd "${LAPAS_GUESTROOT_DIR}/usr/src/";
25+
pushd "${LAPAS_GUESTROOT_DIR}/usr/src/" || exit 1;
2226

2327
rm "./linux-${kernelVersion}/.config";
2428

@@ -32,11 +36,11 @@ rm "./linux-${kernelVersion}.tar.xz" || exit 1;
3236

3337
# copy over config from previous version and open config editor
3438
if [ -n "$newestInstalledPath" ] && [ -d "$newestInstalledPath" ]; then
35-
echo "Copying config file from previous version: $newestInstalledPath";
36-
cp "${newestInstalledPath}/.config" "./linux-${kernelVersion}/" || exit 1;
37-
"${LAPAS_GUESTROOT_DIR}/bin/arch-chroot" "${LAPAS_GUESTROOT_DIR}" bash -c "cd /usr/src/linux-${kernelVersion} && make oldconfig";
39+
echo "Copying config file from previous version: $newestInstalledPath";
40+
cp "${newestInstalledPath}/.config" "./linux-${kernelVersion}/" || exit 1;
41+
"${LAPAS_GUESTROOT_DIR}/bin/arch-chroot" "${LAPAS_GUESTROOT_DIR}" bash -c "cd /usr/src/linux-${kernelVersion} && make oldconfig";
3842
else
39-
"${LAPAS_GUESTROOT_DIR}/bin/arch-chroot" "${LAPAS_GUESTROOT_DIR}" bash -c "cd /usr/src/linux-${kernelVersion} && make menuconfig";
43+
"${LAPAS_GUESTROOT_DIR}/bin/arch-chroot" "${LAPAS_GUESTROOT_DIR}" bash -c "cd /usr/src/linux-${kernelVersion} && make menuconfig";
4044
fi
4145

4246
# build new kernel
@@ -49,4 +53,4 @@ popd;
4953
# update bootmenu
5054
echo "####################";
5155
echo "Updating bootmenu...";
52-
"${LAPAS_SCRIPTS_DIR}/updateBootmenus.sh" || exit $?
56+
"${LAPAS_SCRIPTS_DIR}/updateBootmenus.sh" || exit $?

0 commit comments

Comments
 (0)