From f82aebc40c911bd43870172fe8b9e2e9a53309b3 Mon Sep 17 00:00:00 2001 From: Andrew Gaffney Date: Sat, 6 Dec 2008 22:01:10 -0600 Subject: [PATCH] Move all netboot logic from catalyst into gk --- ChangeLog | 4 ++++ gen_initramfs.sh | 22 +++++++++++++++++++--- netboot/linuxrc.x | 2 +- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index e2d45ad..3be0db1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,10 @@ # Copyright 1999-2008 Gentoo Foundation; 2008 Chris Gianelloni, Andrew Gaffney # Distributed under the GPL v2 + 07 Dec 2008; Andrew Gaffney gen_initramfs.sh, + netboot/linuxrc.x: + Move all netboot logic from catalyst into gk + 07 Dec 2008; Andrew Gaffney defaults/udhcpc.scripts, gen_cmdline.sh, gen_determineargs.sh, netboot/linuxrc.x: Initial support for --netboot option integrate functionality from netboot diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 73e30e6..10dc2cd 100644 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -7,6 +7,7 @@ append_base_layout() { then rm -rf "${TEMP}/initramfs-base-temp" > /dev/null fi + mkdir -p ${TEMP}/initramfs-base-temp/dev mkdir -p ${TEMP}/initramfs-base-temp/bin mkdir -p ${TEMP}/initramfs-base-temp/etc @@ -28,6 +29,9 @@ append_base_layout() { mknod -m 660 console c 5 1 mknod -m 660 null c 1 3 mknod -m 600 tty1 c 4 1 + + date '+%Y%m%d' > ${TEMP}/initramfs-base-temp/etc/build_date + cd "${TEMP}/initramfs-base-temp/" find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" rm -rf "${TEMP}/initramfs-base-temp" > /dev/null @@ -412,11 +416,16 @@ append_auxilary() { cp "${CMD_LINUXRC}" "${TEMP}/initramfs-aux-temp/init" print_info 2 " >> Copying user specified linuxrc: ${CMD_LINUXRC} to init" else - if [ -f "${GK_SHARE}/arch/${ARCH}/linuxrc" ] + if isTrue ${NETBOOT} then - cp "${GK_SHARE}/arch/${ARCH}/linuxrc" "${TEMP}/initramfs-aux-temp/init" + cp "${GK_SHARE}/netboot/linuxrc.x" "${TEMP}/initramfs-aux-temp/init" else - cp "${GK_SHARE}/defaults/linuxrc" "${TEMP}/initramfs-aux-temp/init" + if [ -f "${GK_SHARE}/arch/${ARCH}/linuxrc" ] + then + cp "${GK_SHARE}/arch/${ARCH}/linuxrc" "${TEMP}/initramfs-aux-temp/init" + else + cp "${GK_SHARE}/defaults/linuxrc" "${TEMP}/initramfs-aux-temp/init" + fi fi fi @@ -476,6 +485,13 @@ append_auxilary() { chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.scripts" chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" + + if isTrue ${NETBOOT} + then + cd "${GK_SHARE}/netboot/misc" + cp -pPRf * "${TEMP}/initramfs-aux-temp/" + fi + cd "${TEMP}/initramfs-aux-temp/" find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" cd "${TEMP}" diff --git a/netboot/linuxrc.x b/netboot/linuxrc.x index 0fe3cd9..87d04b9 100644 --- a/netboot/linuxrc.x +++ b/netboot/linuxrc.x @@ -12,7 +12,7 @@ BasicSetup() { export PATH=/usr/sbin:/usr/bin:/sbin:/bin #// Copyright year, Build date in YYYYMMDD format, and in MMDDYYYY to make busybox 'date' happy - MYDATE="@@MYDATE@@" + MYDATE="`cat /etc/build_date`" CPYYEAR="$(echo ${MYDATE} | cut -c 1-4)" BBDATE="$(echo ${MYDATE} | cut -c 5-8)$(echo ${MYDATE} | cut -c 1-4)" DISDATE="$(echo ${MYDATE} | cut -c 7-8) $(echo ${MYDATE} | cut -c 5-6) $(echo ${MYDATE} | cut -c 1-4)" -- 2.26.2