Move all netboot logic from catalyst into gk
authorAndrew Gaffney <agaffney@gentoo.org>
Sun, 7 Dec 2008 04:01:10 +0000 (22:01 -0600)
committerAndrew Gaffney <agaffney@gentoo.org>
Sun, 7 Dec 2008 04:01:10 +0000 (22:01 -0600)
ChangeLog
gen_initramfs.sh
netboot/linuxrc.x

index e2d45ad29c68bcf604edb739ccf83087d4e2b9ef..3be0db1f177acaabe500f1bb3626df01635c7af2 100644 (file)
--- 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 <agaffney@gentoo.org> gen_initramfs.sh,
+  netboot/linuxrc.x:
+  Move all netboot logic from catalyst into gk
+
   07 Dec 2008; Andrew Gaffney <agaffney@gentoo.org> defaults/udhcpc.scripts,
   gen_cmdline.sh, gen_determineargs.sh, netboot/linuxrc.x:
   Initial support for --netboot option integrate functionality from netboot
index 73e30e68a537d154f57340a993dca558fbe838a2..10dc2cd0bed9add520e0bff230e4195b588717e8 100644 (file)
@@ -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}"
index 0fe3cd9a7494fb803ca93c078a1af2094afaf1e2..87d04b9fa56a31acab9c1259e7a915bcbb5b1908 100644 (file)
@@ -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)"