diff options
author | Ludovic Pouzenc <ludovic@pouzenc.fr> | 2016-12-18 12:38:27 +0100 |
---|---|---|
committer | Ludovic Pouzenc <ludovic@pouzenc.fr> | 2016-12-18 12:38:27 +0100 |
commit | b3a9876b9e402297678924cbd5ada197055d3f94 (patch) | |
tree | ff60835408a35826b6746986a45230e315c79bfa | |
parent | 6458f90a8d76b9b85cff0f22cbb6c2d683d2dfd0 (diff) | |
download | eficast-b3a9876b9e402297678924cbd5ada197055d3f94.tar.gz eficast-b3a9876b9e402297678924cbd5ada197055d3f94.tar.bz2 eficast-b3a9876b9e402297678924cbd5ada197055d3f94.zip |
make-boot-image : merge all debug things in $DEVEL_MODE conf var
-rwxr-xr-x | make-boot-image.sh | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/make-boot-image.sh b/make-boot-image.sh index 62a588e..f7959ee 100755 --- a/make-boot-image.sh +++ b/make-boot-image.sh @@ -5,8 +5,7 @@ WORKDIR=./work DLDIR=./downloads OUTDIR=./out OUTUSB=/dev/sdb1 -KERNEL_TOOLS=y -RUN_QEMU=y +DEVEL_MODE=y ROOTCMD=sudo WGET="wget --no-check-certificate" KERNEL_TARBALL_URL=https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.6.tar.xz @@ -73,10 +72,10 @@ then $ROOTCMD apt-get update # Dependencies for kernel building $ROOTCMD apt-get build-dep linux-source # Dependancies for kernel tools - [ "x$KERNEL_TOOLS" == "xy" ] && $ROOTCMD apt-get install libelf-dev libunwind-dev \ + [ "x$DEVEL_MODE" == "xy" ] && $ROOTCMD apt-get install libelf-dev libunwind-dev \ libdw-dev libaudit-dev libssl-dev libslang2-dev libiberty-dev # Optionnally qemu to run the result for santity checking - [ "x$RUN_QEMU" = "xy" ] && $ROOTCMD apt-get install qemu-system-x86 + [ "x$DEVEL_MODE" = "xy" ] && $ROOTCMD apt-get install qemu-system-x86 # Dependencies to put into the initrd $ROOTCMD apt-get install dmidecode pciutils usbutils lshw sysstat iftop strace $ROOTCMD apt-get install partclone udpcast gdisk efibootmgr tcpdump @@ -119,6 +118,7 @@ def sset(sym, value=None): sym.set_user_value(value) return True +debug = '--debug' in sys.argv; conf = kconfiglib.Config(sys.argv[1]) conf.load_config('.config') support_xz = conf['KERNEL_XZ'] is not None @@ -143,6 +143,10 @@ while more_work and i < 10: # Make kernel directly loadable by EFI, add USB3, Dell flash... more_work = sset(sym) or more_work + if debug and name in ['VIRTIO_PCI', 'VIRTIO_MMIO', 'VIRTIO_NET', 'VIRTIO_BLK', 'SCSI_LOWLEVEL', 'SCSI_VIRTIO']: + # Make kernel aware of virtual drivers (used for testing eficast on qemu/kvm) + more_work = sset(sym) or more_work + if name in ['LOGO', 'SUSPEND', 'HIBERNATION', 'CPU_FREQ', 'PCCARD', 'HAMRADIO', 'WIRELESS', 'RFKILL', 'WLAN', 'SOUND', 'NETWORK_FILESYSTEMS', 'KEYS', 'SECURITY', 'VIRTUALIZATION']: more_work = sset(sym, 'n') or more_work @@ -179,11 +183,15 @@ chmod +x "$WORKDIR/kernel/scripts/Kconfiglib/customize.py" cd "$WORKDIR/kernel" if [ ! -f .config ] then make defconfig - make scriptconfig SCRIPT=scripts/Kconfiglib/customize.py + if [ "x$DEVEL_MODE" == "xy" ] + then extra="SCRIPT_ARG=--debug" + else extra="" + fi + make scriptconfig SCRIPT=scripts/Kconfiglib/customize.py $extra fi ) -if [ "x$KERNEL_TOOLS" == "xy" ] +if [ "x$DEVEL_MODE" == "xy" ] then ( cd "$WORKDIR/kernel" make tools/perf @@ -223,7 +231,7 @@ fi mkchroot "$WORKDIR/initrd" /lib/x86_64-linux-gnu/libusb-1.0.so.0 ) -if [ "x$KERNEL_TOOLS" == "xy" ] +if [ "x$DEVEL_MODE" == "xy" ] then ( p="$WORKDIR/kernel/tools/perf/perf" cp -a "$p" "$WORKDIR/initrd/sbin/" @@ -361,5 +369,5 @@ then [ -d "$WORKDIR/mountpoint" ] || mkdir "$WORKDIR/mountpoint" $ROOTCMD umount "$WORKDIR/mountpoint" fi -[ "x$RUN_QEMU" == "xy" ] && qemu-system-x86_64 -M q35 -m 256 -kernel "$OUTDIR/BOOTX64.EFI" +[ "x$DEVEL_MODE" == "xy" ] && qemu-system-x86_64 -M q35 -m 256 -kernel "$OUTDIR/BOOTX64.EFI" |