Compare commits

...

10 Commits

Author SHA1 Message Date
Darren Shepherd
9755a37fe6 Merge pull request #1325 from ibuildthecloud/kernel
Kernel Ubuntu-4.4.0-42.62-rancher1-1
2016-10-14 12:21:45 -07:00
Darren Shepherd
e3df9911bc Merge pull request #1313 from joshwget/bad-state-tests
Add tests for when state fails to mount
2016-10-14 11:37:25 -07:00
Darren Shepherd
0c32665255 Merge pull request #1324 from joshwget/console-done-before-rc-local
Write /run/console-done before executing /etc/rc.local
2016-10-14 11:37:17 -07:00
Darren Shepherd
6f9bab57e3 Kernel Ubuntu-4.4.0-42.62-rancher1-1 2016-10-14 11:35:26 -07:00
Josh Curl
e608377088 Write /run/console-done before executing /etc/rc.local 2016-10-14 10:48:32 -07:00
Darren Shepherd
200052dd56 Merge pull request #1322 from ibuildthecloud/new-kernel2
kernel v4.4.24-rancher1
2016-10-13 19:10:58 -07:00
Darren Shepherd
0107f361bb kernel v4.4.24-rancher1 2016-10-13 18:38:41 -07:00
Darren Shepherd
ea86e4e087 Merge pull request #1306 from rancher/revert-1263-efi-live-boot-support
Revert "Add EFI live boot support"
2016-10-13 18:36:22 -07:00
Josh Curl
a90d93691f Add tests for when state fails to mount 2016-10-11 15:30:00 -07:00
Darren Shepherd
ddbedb9b31 Revert "Add EFI live boot support" 2016-10-10 15:23:15 -07:00
9 changed files with 27 additions and 99 deletions

View File

@@ -20,7 +20,6 @@ RUN apt-get update && \
gccgo \
genisoimage \
git \
grub-efi \
isolinux \
less \
libblkid-dev \
@@ -54,7 +53,7 @@ ARG DOCKER_BUILD_VERSION=1.10.3
ARG DOCKER_BUILD_PATCH_VERSION=v${DOCKER_BUILD_VERSION}-ros1
ARG SELINUX_POLICY_URL=https://github.com/rancher/refpolicy/releases/download/v0.0.3/policy.29
ARG KERNEL_URL_amd64=https://github.com/rancher/os-kernel/releases/download/Ubuntu-4.4.0-37.56-rancher1/linux-4.4.19-rancher-x86.tar.gz
ARG KERNEL_URL_amd64=https://github.com/rancher/os-kernel/releases/download/Ubuntu-4.4.0-42.62-rancher1-1/linux-4.4.21-rancher-x86.tar.gz
ARG KERNEL_URL_arm64=https://github.com/imikushin/os-kernel/releases/download/Estuary-4.4.0-arm64.8/linux-4.4.0-rancher-arm64.tar.gz
ARG DOCKER_URL_amd64=https://get.docker.com/builds/Linux/x86_64/docker-${DOCKER_VERSION}.tgz

View File

@@ -111,6 +111,11 @@ func Main() {
if err := runScript(startScript); err != nil {
log.Error(err)
}
if err := ioutil.WriteFile(consoleDone, []byte(cfg.Rancher.Console), 0644); err != nil {
log.Error(err)
}
if err := runScript("/etc/rc.local"); err != nil {
log.Error(err)
}
@@ -122,10 +127,6 @@ func Main() {
log.Fatal(err)
}
if err := ioutil.WriteFile(consoleDone, []byte(cfg.Rancher.Console), 0644); err != nil {
log.Error(err)
}
log.Fatal(syscall.Exec(respawnBinPath, []string{"respawn", "-f", "/etc/respawn.conf"}, os.Environ()))
}

28
efi.txt
View File

@@ -1,28 +0,0 @@
To install with EFI:
A: install grub-efi
apt install grub-efi
B: Add to the installation process in scripts/package-iso
1. Make directories ${CD}/boot/grub and ${CD}/EFI/BOOT
2. Install the various grub modules from /usr/lib/grub/x86_64-efi/ to ${CD}/boot/grub/x86_64-efi/
3. Copy scripts/grub.cfg to ${CD}/boot/grub/grub.cfg
4. Run grub-mkimage to create the grub image:
(cd ${CD} && grub-mkimage -O x86_64-efi -o EFI/BOOT/BOOTX64.EFI --config=boot/grub/grub.cfg --compression=auto --prefix='()/boot/grub' disk part_msdos fat iso9660 )
NOTE: do *NOT* try to install the linux module directly in the grub image; it causes command-line options not to be passed and is a known bug.
5. Add the following xorriso options
-eltorito-alt-boot -e EFI/BOOT/BOOTX64.EFI -no-emul-boot \
-isohybrid-gpt-basdat \
This installation includes *no* additional icons or drivers. It is just meant to get RancherOS booted on an EFI system.
If you want to add support for graphical installations, additional filesystems, and everything else.... you will need a lot more

View File

@@ -1,14 +0,0 @@
set default="0"
set timeout=10
set gfxmode=auto
insmod efi_gop
insmod efi_uga
menuentry "Rancher" {
set gfxpayload=keep
linux /boot/vmlinuz quiet rancher.autologin=tty1 rancher.autologin=ttyS0
initrd /boot/initrd
}

View File

@@ -9,7 +9,7 @@ CD=${BUILD}/cd
ISO=${ARTIFACTS}/$(echo ${DISTRIB_ID} | tr '[:upper:]' '[:lower:]').iso
CHECKSUM=iso-checksums.txt
## TRADITIONAL MBR BOOT
mkdir -p ${CD}/boot/isolinux
mkdir -p ${CD}/boot/isolinux
if [ ! -f ${ARTIFACTS}/vmlinuz ] || [ ! -f ${ARTIFACTS}/initrd ]; then
@@ -21,42 +21,12 @@ cp ${ARTIFACTS}/vmlinuz ${CD}/boot
cp scripts/isolinux.cfg ${CD}/boot/isolinux
cp /usr/lib/ISOLINUX/isolinux.bin ${CD}/boot/isolinux
cp /usr/lib/syslinux/modules/bios/ldlinux.c32 ${CD}/boot/isolinux
## EFI BOOT
mkdir -p ${CD}/EFI/BOOT
mkdir -p ${CD}/boot/grub
cp scripts/grub.cfg ${CD}/boot/grub
cp -r /usr/lib/grub/x86_64-efi/ ${CD}/boot/grub
(cd ${CD} && grub-mkimage -O x86_64-efi -o EFI/BOOT/BOOTX64.EFI --config=boot/grub/grub.cfg --compression=auto --prefix='()/boot/grub' disk part_msdos fat iso9660 )
# make the EFI FAT filesystem to boot
EFIIMG=boot/efiboot.img
CDEFI=${CD}/${EFIIMG}
rm -f ${CDEFI}
dd if=/dev/zero of=${CDEFI} bs=4k count=1000
mkfs.vfat ${CDEFI}
mkdir -p tmp/
mount -o loop ${CDEFI} tmp/
cp -r ${CD}/EFI tmp/
umount tmp/
rmdir tmp/
rm -rf ${CD}/EFI
## BUILD THE ISO IMAGE
cd ${CD} && xorriso \
-as mkisofs \
-l -J -R -V "${DISTRIB_ID}" \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat \
-isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \
-eltorito-alt-boot \
-e ${EFIIMG} -no-emul-boot \
-isohybrid-gpt-basdat \
-o $ISO ${CD}
cd $(dirname $ISO)

View File

@@ -41,21 +41,6 @@ while [ "$#" -gt 0 ]; do
--kvm)
KVM=1
;;
--efi)
# set where our EFI firmware binary is
EFIFIRMWARE="./build/OVMF.fd"
# create the command-line to pass to qemu
EFI="--bios $EFIFIRMWARE"
# if the firmware does not yet exist, download it
if [[ ! -e "$EFIFIRMWARE" ]]; then
echo "Downloading OVMF EFI firmware"
# because unzip does not support streaming from stdin...
curl --location http://downloads.sourceforge.net/project/edk2/OVMF/OVMF-X64-r15214.zip > ./build/ovmf.zip
unzip ./build/ovmf.zip -d ./build OVMF.fd
rm -f ./build/ovmf.zip
echo "Download OVMF EFI firmware complete"
fi
;;
--no-format)
FORMAT=0
;;
@@ -153,7 +138,6 @@ if [ "$QEMU" == "1" ]; then
${CPU} \
${machine["$ARCH"]} \
-m 2048 \
${EFI} \
${network["$ARCH"]} \
$(eval "${hd["$ARCH"]} ${HD}") \
${SECOND_DRIVE_ENABLE} \
@@ -176,7 +160,6 @@ if [ "$QEMU" == "1" ]; then
-kernel ${KERNEL} \
-initrd ${INITRD} \
-m 2048 \
${EFI} \
${network["$ARCH"]} \
$(eval "${hd["$ARCH"]} ${HD}") \
${SECOND_DRIVE_ENABLE} \

View File

@@ -15,13 +15,14 @@ write_files:
permissions: "0755"
owner: root
content: |
touch /home/rancher/test4
wait-for-docker
docker run -d nginx
- path: /var/lib/rancher/conf/cloud-config-script
permissions: "0755"
owner: root
content: |
#!/bin/bash
touch /home/rancher/test5
touch /home/rancher/test4
runcmd:
- []
- [ test ]

15
tests/bad_state_test.go Normal file
View File

@@ -0,0 +1,15 @@
package integration
import . "gopkg.in/check.v1"
func (s *QemuSuite) TestBadState(c *C) {
err := s.RunQemu("--no-format", "--append", "rancher.state.dev=LABEL=BAD_STATE")
c.Assert(err, IsNil)
s.CheckCall(c, "mount | grep /var/lib/docker | grep rootfs")
}
func (s *QemuSuite) TestBadStateWithWait(c *C) {
err := s.RunQemu("--no-format", "--append", "rancher.state.dev=LABEL=BAD_STATE", "--append", "rancher.state.wait")
c.Assert(err, IsNil)
s.CheckCall(c, "mount | grep /var/lib/docker | grep rootfs")
}

View File

@@ -10,7 +10,8 @@ func (s *QemuSuite) TestStartCommands(c *C) {
err := s.RunQemu("--cloud-config", "./tests/assets/test_26/cloud-config.yml")
c.Assert(err, IsNil)
for i := 1; i < 6; i++ {
for i := 1; i < 5; i++ {
s.CheckCall(c, fmt.Sprintf("ls /home/rancher | grep test%d", i))
}
s.CheckCall(c, "docker ps | grep nginx")
}