mirror of
https://github.com/rancher/os.git
synced 2025-06-27 15:26:50 +00:00
Started separating out the kernel modules from initrd, but there are some details that will delay it
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
parent
cc78ff7bd1
commit
f5193d065a
@ -1,5 +1,8 @@
|
|||||||
default rancheros
|
timeout 10 #1s
|
||||||
label rancheros
|
prompt 1
|
||||||
kernel /boot/vmlinuz-${KERNEL_VERSION}
|
|
||||||
initrd /boot/initrd
|
# doesn't work as a softlink?
|
||||||
append quiet rancher.autologin=tty1 rancher.autologin=ttyS0
|
default rancheros-${KERNEL_VERSION}
|
||||||
|
INCLUDE isolinux-current.cfg
|
||||||
|
|
||||||
|
#INCLUDE isolinux-previous.cfg
|
||||||
|
8
scripts/isolinux_label.cfg
Normal file
8
scripts/isolinux_label.cfg
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
# TODO: should add ros-version
|
||||||
|
label rancheros-${KERNEL_VERSION}
|
||||||
|
say Booting ... RancherOS ${VERSION} ${KERNEL_VERSION}
|
||||||
|
kernel /boot/vmlinuz-${KERNEL_VERSION}
|
||||||
|
initrd /boot/initrd
|
||||||
|
#TODO,/boot/linuxmods-${KERNEL_VERSION}
|
||||||
|
append quiet rancher.autologin=tty1 rancher.autologin=ttyS0
|
@ -4,6 +4,7 @@ set -e
|
|||||||
source $(dirname $0)/version
|
source $(dirname $0)/version
|
||||||
cd $(dirname $0)/..
|
cd $(dirname $0)/..
|
||||||
|
|
||||||
|
ARTIFACTS=$(pwd)/dist/artifacts
|
||||||
BUILD=build
|
BUILD=build
|
||||||
INITRD_DIR=${BUILD}/initrd
|
INITRD_DIR=${BUILD}/initrd
|
||||||
|
|
||||||
@ -43,29 +44,50 @@ if [ -e ${DOWNLOADS}/kernel.tar.gz ]; then
|
|||||||
|
|
||||||
for i in vmlinuz vmlinux; do
|
for i in vmlinuz vmlinux; do
|
||||||
if [ -e ${BUILD}/kernel/boot/${i}-* ]; then
|
if [ -e ${BUILD}/kernel/boot/${i}-* ]; then
|
||||||
mkdir -p dist/artifacts
|
mkdir -p ${ARTIFACTS}
|
||||||
# frustratingly, the vmlinuz versioned filename != the tag name, so we need to do some guessing
|
# frustratingly, the vmlinuz versioned filename != the tag name, so we need to do some guessing
|
||||||
# for eg, 4.9-rc8-rancher2 is called vmlinuz-4.9.0-rc8-rancher
|
# for eg, 4.9-rc8-rancher2 is called vmlinuz-4.9.0-rc8-rancher
|
||||||
echo "Copy ${BUILD}/kernel/boot/${i}-* to dist/artifacts/vmlinuz-${KERNEL_VERSION}"
|
echo "Copy ${BUILD}/kernel/boot/${i}-* to ${ARTIFACTS}/vmlinuz-${KERNEL_VERSION}"
|
||||||
cp ${BUILD}/kernel/boot/${i}-* "dist/artifacts/vmlinuz-${KERNEL_VERSION}"
|
cp ${BUILD}/kernel/boot/${i}-* ${ARTIFACTS}/vmlinuz-${KERNEL_VERSION}
|
||||||
|
# use an unversioned filename for `scripts/run`
|
||||||
cp ${BUILD}/kernel/boot/${i}-* ${BUILD}/kernel/vmlinuz
|
cp ${BUILD}/kernel/boot/${i}-* ${BUILD}/kernel/vmlinuz
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# TODO: move these into a separate tar.gz and add to the syslinux initrd line
|
||||||
if [ -d ${BUILD}/kernel/lib ]; then
|
if [ -d ${BUILD}/kernel/lib ]; then
|
||||||
rm -rf ${INITRD_DIR}/usr/lib
|
rm -rf ${INITRD_DIR}/usr/lib
|
||||||
cp -rf ${BUILD}/kernel/lib ${INITRD_DIR}/usr/
|
cp -rf ${BUILD}/kernel/lib ${INITRD_DIR}/usr/
|
||||||
depmod -b ${INITRD_DIR}/usr $(basename ${INITRD_DIR}/usr/lib/modules/*)
|
depmod -b ${INITRD_DIR}/usr $(basename ${INITRD_DIR}/usr/lib/modules/*)
|
||||||
|
|
||||||
|
#TODO:
|
||||||
|
# new: put the kernel modules into their own initrd file
|
||||||
|
#mkdir -p ${BUILD}/kernel-fs/usr/
|
||||||
|
#pushd .
|
||||||
|
#cp -rf ${BUILD}/kernel/lib ${BUILD}/kernel-fs/usr/
|
||||||
|
#depmod -b ${BUILD}/kernel-fs/usr $(basename ${BUILD}/kernel-fs/usr/lib/modules/*)
|
||||||
|
## and then package it up cpio
|
||||||
|
#cd ${BUILD}/kernel-fs/
|
||||||
|
#echo Creating kernel ${ARTIFACTS}/linuxmods-${KERNEL_VERSION}
|
||||||
|
|
||||||
|
#if [ "$COMPRESS" == "" ]; then
|
||||||
|
# COMPRESS="gzip -1"
|
||||||
|
#fi
|
||||||
|
#find | cpio -H newc -o | ${COMPRESS} > ${ARTIFACTS}/linuxmods-${KERNEL_VERSION}
|
||||||
|
#popd
|
||||||
|
#echo Done creating kernel ${ARTIFACTS}/linuxmods-${KERNEL_VERSION}
|
||||||
|
## use an unversioned filename for `scripts/run`
|
||||||
|
#cp ${ARTIFACTS}/linuxmods-${KERNEL_VERSION} ${BUILD}/kernel/linuxmods
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "no ${DOWNLOADS}/kernel.tar.gz found"
|
echo "no ${DOWNLOADS}/kernel.tar.gz found"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ls -lah dist/artifacts/vmlinuz-*
|
ls -lah ${ARTIFACTS}/vmlinuz-*
|
||||||
if [ ! -e "dist/artifacts/vmlinuz-${KERNEL_VERSION}" ]; then
|
if [ ! -e "${ARTIFACTS}/vmlinuz-${KERNEL_VERSION}" ]; then
|
||||||
echo "Can't find dist/artifacts/vmlinuz-${KERNEL_VERSION}"
|
echo "Can't find ${ARTIFACTS}/vmlinuz-${KERNEL_VERSION}"
|
||||||
exit -1
|
exit -1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -18,13 +18,23 @@ if [ ! -f ${ARTIFACTS}/vmlinuz-${KERNEL_VERSION} ] || [ ! -f ${ARTIFACTS}/initrd
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
cp ${ARTIFACTS}/initrd ${CD}/boot
|
cp ${ARTIFACTS}/initrd ${CD}/boot
|
||||||
cp ${ARTIFACTS}/vmlinuz-${KERNEL_VERSION} ${CD}/boot
|
|
||||||
|
# TODO: these move to os-kernel
|
||||||
|
pwd
|
||||||
|
ls dist/artifacts/vmlinuz-${KERNEL_VERSION}
|
||||||
|
|
||||||
|
cp ${ARTIFACTS}/vmlinuz-${KERNEL_VERSION} ${CD}/boot/
|
||||||
|
#TODO cp ${ARTIFACTS}/linuxmods-${KERNEL_VERSION} ${CD}/boot/
|
||||||
|
|
||||||
cat scripts/isolinux.cfg | envsubst > ${CD}/boot/isolinux/isolinux.cfg
|
cat scripts/isolinux.cfg | envsubst > ${CD}/boot/isolinux/isolinux.cfg
|
||||||
cp /usr/lib/ISOLINUX/isolinux.bin ${CD}/boot/isolinux
|
cat scripts/isolinux_label.cfg | envsubst > ${CD}/boot/isolinux/isolinux-${KERNEL_VERSION}.cfg
|
||||||
cp /usr/lib/syslinux/modules/bios/ldlinux.c32 ${CD}/boot/isolinux
|
cp ${CD}/boot/isolinux/isolinux-${KERNEL_VERSION}.cfg ${CD}/boot/isolinux/isolinux-current.cfg
|
||||||
|
|
||||||
|
cp /usr/lib/ISOLINUX/isolinux.bin ${CD}/boot/isolinux/
|
||||||
|
cp /usr/lib/syslinux/modules/bios/ldlinux.c32 ${CD}/boot/isolinux/
|
||||||
# add the installer image to the iso for non-network / dev/test
|
# add the installer image to the iso for non-network / dev/test
|
||||||
cp ${ARTIFACTS}/installer.tar ${CD}/rancheros
|
cp ${ARTIFACTS}/installer.tar ${CD}/rancheros/
|
||||||
cp assets/bootinfoscript ${CD}/rancheros
|
cp assets/bootinfoscript ${CD}/rancheros/
|
||||||
gzip ${CD}/rancheros/installer.tar
|
gzip ${CD}/rancheros/installer.tar
|
||||||
cd ${CD} && xorriso \
|
cd ${CD} && xorriso \
|
||||||
-as mkisofs \
|
-as mkisofs \
|
||||||
|
@ -37,6 +37,7 @@ BUILD_ID=
|
|||||||
HERE
|
HERE
|
||||||
|
|
||||||
# need to make relative links to the os-release file
|
# need to make relative links to the os-release file
|
||||||
|
mkdir -p ${INITRD_DIR}/usr/lib
|
||||||
cd ${INITRD_DIR}/usr/lib
|
cd ${INITRD_DIR}/usr/lib
|
||||||
ln -s ../share/rancher/os-release os-release
|
ln -s ../share/rancher/os-release os-release
|
||||||
cd $(dirname $0)/..
|
cd $(dirname $0)/..
|
||||||
|
@ -34,10 +34,11 @@ BUILD=build
|
|||||||
BASE=$(pwd)
|
BASE=$(pwd)
|
||||||
UNAME=$(uname)
|
UNAME=$(uname)
|
||||||
|
|
||||||
#KERNEL=${BASE}/dist/artifacts/vmlinuz-${KERNEL_VERSION}*
|
|
||||||
KERNEL=${BASE}/build/kernel/vmlinuz
|
KERNEL=${BASE}/build/kernel/vmlinuz
|
||||||
INITRD_SRC=${BASE}/build/initrd
|
INITRD_SRC=${BASE}/build/initrd
|
||||||
INITRD=${BASE}/build/initrd.tmp
|
INITRD=${BASE}/build/initrd.tmp
|
||||||
|
#LINUXMOD=${BASE}/build/kernel/linuxmods
|
||||||
|
|
||||||
|
|
||||||
QEMU=1
|
QEMU=1
|
||||||
FORMAT=1
|
FORMAT=1
|
||||||
|
Loading…
Reference in New Issue
Block a user