11#! /bin/bash
22
3+ # import LAPAS config
4+ . $( dirname " $0 " ) /config;
5+
36if [ " $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;
58fi
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
1216kernelVersion=" $1 " ;
1317
1418if [ " $# " != " 1" ]; then
15- echo " Usage: $0 <KERNEL_VERSION>"
16- exit 1;
19+ echo " Usage: $0 <KERNEL_VERSION>"
20+ exit 1;
1721fi
1822
1923# #########################################################################
2024
21- pushd " ${LAPAS_GUESTROOT_DIR} /usr/src/" ;
25+ pushd " ${LAPAS_GUESTROOT_DIR} /usr/src/" || exit 1 ;
2226
2327rm " ./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
3438if [ -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" ;
3842else
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" ;
4044fi
4145
4246# build new kernel
4953# update bootmenu
5054echo " ####################" ;
5155echo " Updating bootmenu..." ;
52- " ${LAPAS_SCRIPTS_DIR} /updateBootmenus.sh" || exit $?
56+ " ${LAPAS_SCRIPTS_DIR} /updateBootmenus.sh" || exit $?
0 commit comments