mirror of
https://github.com/rancher/os.git
synced 2025-05-10 00:56:20 +00:00
Add version string to the initrd file so we can have 2 modern initrd's on the disk
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
parent
e2992d1626
commit
b3a9893fcf
@ -975,6 +975,7 @@ func installRancher(baseName, bootDir, VERSION, DIST, kappend string) error {
|
||||
log.Errorf("copy %s: %s", file.Name(), err)
|
||||
return err
|
||||
}
|
||||
log.Debugf("copied %s to %s as %s", filepath.Join(DIST, file.Name()), filepath.Join(baseName, bootDir), file.Name())
|
||||
}
|
||||
// the general INCLUDE syslinuxcfg
|
||||
if err := dfs.CopyFile(filepath.Join(DIST, "isolinux", "isolinux.cfg"), filepath.Join(baseName, bootDir, "syslinux"), "syslinux.cfg"); err != nil {
|
||||
|
@ -10,7 +10,7 @@ source $(dirname $0)/version
|
||||
|
||||
cd $(dirname $0)/../tests
|
||||
|
||||
if [ ! -e ../dist/artifacts/initrd ]; then
|
||||
if [ ! -e "$INITRD" ]; then
|
||||
../scripts/dev
|
||||
fi
|
||||
|
||||
|
@ -4,8 +4,6 @@ DEFAULT rancheros-${LABEL}
|
||||
LABEL rancheros-${LABEL}
|
||||
SAY rancheros-${LABEL}: RancherOS ${VERSION} ${KERNEL_VERSION}
|
||||
KERNEL /boot/vmlinuz-${KERNEL_VERSION}
|
||||
INITRD /boot/initrd
|
||||
#TODO - once we work out how to append it for qemu-dev,/boot/linuxmods-${KERNEL_VERSION}
|
||||
#APPEND quiet rancher.autologin=tty1 rancher.autologin=ttyS0 ${APPEND}
|
||||
#INCLUDE global.cfg
|
||||
INITRD /boot/initrd-${VERSION}
|
||||
# see global.cfg for kernel boot parameters
|
||||
|
||||
|
@ -3,10 +3,11 @@ set -e
|
||||
|
||||
cd $(dirname $0)/..
|
||||
|
||||
source scripts/version
|
||||
|
||||
BUILD=$(pwd)/build
|
||||
INITRD_DIR=${BUILD}/initrd
|
||||
ARTIFACTS=$(pwd)/dist/artifacts
|
||||
INITRD=${ARTIFACTS}/initrd
|
||||
|
||||
mkdir -p ${ARTIFACTS}
|
||||
|
||||
|
@ -8,11 +8,14 @@ source ./scripts/version
|
||||
BASEDOCKERFILE=./scripts/installer/BaseDockerfile.${ARCH}
|
||||
DOCKERFILE=./scripts/installer/Dockerfile.${ARCH}
|
||||
|
||||
if [ ! -f $DOCKERFILE ] || [ ! -f dist/artifacts/vmlinuz-${KERNEL_VERSION} ] || [ ! -f dist/artifacts/initrd ]; then
|
||||
exit 0
|
||||
if [ ! -f $DOCKERFILE ] || [ ! -f dist/artifacts/vmlinuz-${KERNEL_VERSION} ] || [ ! -f ${INITRD} ]; then
|
||||
echo "ERROR: ${ARTIFACTS}/vmlinuz-${KERNEL_VERSION} or ${INITRD} not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# TODO maybe extract the creation of the syslinux cfg files
|
||||
DIST=$(pwd)/dist
|
||||
echo "mkdir -p ${DIST}/boot/isolinux/"
|
||||
mkdir -p ${DIST}/boot/isolinux/
|
||||
cat scripts/isolinux.cfg | envsubst > ${DIST}/boot/isolinux/isolinux.cfg
|
||||
cat scripts/isolinux_label.cfg | LABEL=${VERSION} envsubst > ${DIST}/boot/linux-current.cfg
|
||||
@ -35,7 +38,7 @@ docker build \
|
||||
docker save -o dist/artifacts/installer.tar ${OS_REPO}/os-installer
|
||||
cp $DOCKERFILE dist/artifacts/
|
||||
|
||||
cp ./dist/artifacts/initrd ./scripts/installer/build/boot
|
||||
cp ${INITRD} ./scripts/installer/build/boot
|
||||
cp ./dist/artifacts/vmlinuz-${KERNEL_VERSION} ./scripts/installer/build/boot
|
||||
cp -r ${DIST}/boot/* ./scripts/installer/build/boot
|
||||
cp $DOCKERFILE ./scripts/installer/build/Dockerfile
|
||||
|
@ -13,11 +13,12 @@ CHECKSUM=iso-checksums.txt
|
||||
mkdir -p ${CD}/boot/isolinux
|
||||
mkdir -p ${CD}/rancheros
|
||||
|
||||
if [ ! -f ${ARTIFACTS}/vmlinuz-${KERNEL_VERSION} ] || [ ! -f ${ARTIFACTS}/initrd ]; then
|
||||
exit 0
|
||||
if [ ! -f ${ARTIFACTS}/vmlinuz-${KERNEL_VERSION} ] || [ ! -f ${INITRD} ]; then
|
||||
echo "ERROR: ${ARTIFACTS}/vmlinuz-${KERNEL_VERSION} or ${INITRD} not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cp ${ARTIFACTS}/initrd ${CD}/boot
|
||||
cp ${INITRD} ${CD}/boot
|
||||
|
||||
# TODO: these move to os-kernel
|
||||
pwd
|
||||
@ -26,6 +27,7 @@ cp ${ARTIFACTS}/vmlinuz-${KERNEL_VERSION} ${CD}/boot/
|
||||
#TODO cp ${ARTIFACTS}/linuxmods-${KERNEL_VERSION} ${CD}/boot/
|
||||
|
||||
# cfg files creation moved to package-installer
|
||||
DIST=$(pwd)/dist
|
||||
cp -r ${DIST}/boot/* ${CD}/boot/
|
||||
|
||||
cp /usr/lib/ISOLINUX/isolinux.bin ${CD}/boot/isolinux/
|
||||
|
@ -1,3 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
|
||||
DIRTY="-dirty"
|
||||
fi
|
||||
@ -13,7 +15,8 @@ if [ -z "$VERSION" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
export VERSION COMMIT
|
||||
INITRD=${ARTIFACTS}/initrd-${VERSION}
|
||||
export VERSION COMMIT INITRD
|
||||
|
||||
# Suffix
|
||||
export SUFFIX=""
|
||||
|
Loading…
Reference in New Issue
Block a user