Commit 0defd544 authored by Mike Hibler's avatar Mike Hibler

Merge branch 'master' of gitlab.flux.utah.edu:emulab/emulab-grub2

parents 48c09f48 a2496434
Pipeline #3147 passed with stages
in 4 minutes and 29 seconds
stages:
- build
- deploy
emulab-grub2-tftpboot-x86:
stage: build
image: gitlab.flux.utah.edu:4567/emulab/emulab-grub2/u16-grub2-builder:latest
script:
- mkdir -p $CI_PROJECT_DIR/$CI_JOB_NAME-$CI_COMMIT_REF_NAME/tftpboot
- ./autogen.sh
- ./configure && make && make install
- grub-mknetdir --net-directory=/tftpboot --subdir=grub2.0
- grub-mknetdir --net-directory=/tftpboot --subdir=grub2pxe-bios-vga
- grub-mknetdir --net-directory=/tftpboot --subdir=grub2pxe-bios-sio1
- grub-mknetdir --net-directory=/tftpboot --subdir=grub2pxe-bios-sio2
- grub-mknetdir --net-directory=/tftpboot --subdir=grub2pxe-native-vga
- grub-mknetdir --net-directory=/tftpboot --subdir=grub2pxe-native-sio1
- grub-mknetdir --net-directory=/tftpboot --subdir=grub2pxe-native-sio2
- make clean
- ./configure --with-platform=efi --target=x86_64 && make && make install
- grub-mknetdir --net-directory=/tftpboot -d /usr/local/lib/grub/x86_64-efi --subdir=grub2.0
- grub-mknetdir --net-directory=/tftpboot --subdir=grub2pxe-efi-vga
- grub-mknetdir --net-directory=/tftpboot --subdir=grub2pxe-efi-sio1
- grub-mknetdir --net-directory=/tftpboot --subdir=grub2pxe-efi-sio2
- for tdir in /tftpboot/grub2pxe-{bios,native}-* ; do cp -p $tdir/i386-pc/core.0 $tdir/grub2pxe ; rm -rf $tdir/{i386-pc,fonts,locale} ; cd $tdir && ln -s ../grub2.0/locale . && ln -s ../grub2.0/i386-pc . && ln -s ../grub2.0/fonts . ; done
- for tdir in /tftpboot/grub2pxe-efi-* ; do cp -p $tdir/x86_64-efi/core.efi $tdir/grub2pxe ; rm -rf $tdir/{i386-pc,x86_64-efi,fonts,locale} ; cd $tdir && ln -s ../grub2.0/locale . && ln -s ../grub2.0/x86_64-efi . && ln -s ../grub2.0/fonts . ; done
- for tdir in /tftpboot/grub2pxe* ; do cp -p $CI_PROJECT_DIR/emulab/grub.cfg $tdir ; chmod 664 $tdir/grub.cfg ; btype=`basename $tdir | cut -d- -f2` ; ctype=`basename $tdir | cut -d- -f3` ; ntype=pxe ; if [ $ctype = "efi" ]; then ntype=efi ; fi ; echo $btype $ctype $ntype ; sed -i -e "s/^set console=.*$/set console=$ctype/" $tdir/grub.cfg ; sed -i -e "s/^set diskdrivers=.*$/set diskdrivers=$btype/" $tdir/grub.cfg ; sed -i -e "s/^set netdrivers=.*$/set netdrivers=$ntype/" $tdir/grub.cfg ; done
- rsync -a /tftpboot/ $CI_PROJECT_DIR/$CI_JOB_NAME-$CI_COMMIT_REF_NAME/tftpboot/
artifacts:
paths:
- $CI_JOB_NAME-$CI_COMMIT_REF_NAME
only:
- master
.deploy_template:
stage: deploy
image: gitlab.flux.utah.edu:4567/emulab/emulab-grub2/u16-grub2-builder:latest
variables:
GIT_STRATEGY: none
dependencies:
- emulab-grub2-tftpboot-x86
before_script:
- eval $(ssh-agent -s)
- echo "$GRUB_UPLOAD_PRIVKEY" | tr -d '\r' | ssh-add - >/dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
only:
- master
deploy_testing:
extends: .deploy_template
script:
- echo 'put ./emulab-grub2-tftpboot-x86-master' | sftp -o StrictHostKeyChecking=no -r $GRUB_UPLOAD_USER@$GRUB_UPLOAD_HOST:$GRUB_TESTING_DIR
- 'for file in `find emulab-grub2-tftpboot-x86-master -type l`; do dir=`dirname $file`; fname=`basename $file`; rlink=`readlink $file`; echo cd $GRUB_TESTING_DIR/$dir; echo symlink $rlink $fname ; done | sftp -o StrictHostKeyChecking=no -r $GRUB_UPLOAD_USER@$GRUB_UPLOAD_HOST:$GRUB_TESTING_DIR'
environment:
name: testing
deploy_production:
extends: .deploy_template
script:
- echo 'put ./emulab-grub2-tftpboot-x86-master' | sftp -o StrictHostKeyChecking=no -r $GRUB_UPLOAD_USER@$GRUB_UPLOAD_HOST:$GRUB_PROD_DIR
- 'for file in `find emulab-grub2-tftpboot-x86-master -type l`; do dir=`dirname $file`; fname=`basename $file`; rlink=`readlink $file`; echo cd $GRUB_TESTING_DIR/$dir; echo symlink $rlink $fname ; done | sftp -o StrictHostKeyChecking=no -r $GRUB_UPLOAD_USER@$GRUB_UPLOAD_HOST:$GRUB_PROD_DIR'
environment:
name: production
when: manual
......@@ -15,18 +15,28 @@ set diskdrivers=efi
set netdrivers=efi
if [ $console = vga ]; then
set linuxconsoleargs="console=tty0"
true
elif [ $console = sio1 ]; then
serial --unit=0 --speed=115200
terminal_input serial
terminal_output serial
set linuxconsoleargs="console=tty0 console=ttyS0,115200"
elif [ $console = sio2 ]; then
serial --unit=1 --speed=115200
terminal_input serial
terminal_output serial
set linuxconsoleargs="console=tty0 console=ttyS1,115200"
else
set linuxconsoleargs="console=tty0"
echo "Unknown console $console, using VGA"
fi
#
# Export this so that other grub.cfg files we load over the network
# (e.g. as part of the Emulab bootinfo process, to netboot other
# initramfses) have the right console settings.
#
export linuxconsoleargs
insmod ext2
insmod ufs1
......
......@@ -24,7 +24,9 @@
#include <grub/misc.h>
#include <grub/time.h>
#include <grub/term.h>
#if (!defined(__powerpc__) && !defined(__ppc__))
#include <grub/machine/memory.h>
#endif
#include <grub/mm.h>
#include <grub/device.h>
#include <grub/disk.h>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment