Author: nick
Date: 2010-06-19 14:28:52 +0100 (Sat, 19 Jun 2010)
New Revision: 1170
Modified:
balloon/branches/menuconfig/initrd/Makefile
balloon/branches/menuconfig/initrd/S99custom
Log:
add ability to specify command line to kexec
Modified: balloon/branches/menuconfig/initrd/Makefile
===================================================================
--- balloon/branches/menuconfig/initrd/Makefile 2010-06-19 13:28:02 UTC (rev 1169)
+++ balloon/branches/menuconfig/initrd/Makefile 2010-06-19 13:28:52 UTC (rev 1170)
@@ -21,7 +21,7 @@
initrd: $(RES)/unpacked.stamp $(RES)/quilt.stamp $(RES)/rootfs.arm.cpio
#need to split this into actual buildroot rebuilding and skel copying
-$(RES)/rootfs.arm.cpio: $(BUILDDIR)/kernel/modules.tgz initrdmodules-$(KERNVER).list $(RES)/quilt.stamp
+$(RES)/rootfs.arm.cpio-old: $(BUILDDIR)/kernel/modules.tgz initrdmodules-$(KERNVER).list $(RES)/quilt.stamp
#to make sure the skel is copied over again we need to delete the working dir
rm -rf $(BUILD)/build_arm/root
#And if we don't remake the toolchain too then libgcc1 gets left out - investigate!
@@ -66,9 +66,27 @@
(cd $(BUILD)/; unset CFLAGS CXXFLAGS; if ! [ -f .config ]; then make defconfig; fi; make )
cp $(BUILD)/$(BUILDROOTIMAGEPATH)rootfs.arm.cpio $(RES)/
+$(RES)/rootfs.arm.cpio: $(BUILDDIR)/kernel/modules.tgz initrdmodules-$(KERNVER).list $(RES)/quilt.stamp
+ #to make sure the skel is copied over again we need to delete the working dir
+ rm -rf $(BUILD)/build_arm/root
+ #And if we don't remake the toolchain too then libgcc1 gets left out - investigate!
+ rm -rf $(BUILD)/build_arm/staging_dir
+ #unpack minimal module set into skeleton rootfs
+#ifeq ($(BUILDROOT_ADD_CUSTOM),y)
+ cp S99custom $(TARGETSKEL)/etc/init.d/
+#endif
+ #fix up permissions on installed files
+ chmod 755 $(TARGETSKEL)/usr/bin/setup
+ chmod 755 $(TARGETSKEL)/etc/init.d/*
+ $(FAKEROOT) mkdir -p $(TARGETSKEL)/mnt/sda1
+ $(FAKEROOT) mkdir -p $(TARGETSKEL)/mnt/sda2
+ $(FAKEROOT) mkdir -p $(TARGETSKEL)/mnt/boot
+ $(FAKEROOT) mkdir -p $(TARGETSKEL)/mnt/root
+ (cd $(BUILD)/; unset CFLAGS CXXFLAGS; if ! [ -f .config ]; then make defconfig; fi; make )
+ cp $(BUILD)/$(BUILDROOTIMAGEPATH)rootfs.arm.cpio $(RES)/
+
$(RES)/unpacked.stamp:
mkdir -p $(RES)
-# (cd $(RES); svn co svn://uclibc.org/trunk/buildroot -r$(BUILDROOTVER))
(cd $(RES) && \
(wget -N $(RELEASESITE)/sources/initrd/buildroot$(BUILDROOTVER).tar.bz2 && tar -xjf buildroot$(BUILDROOTVER).tar.bz2) || \
(wget -N http://buildroot.uclibc.org/downloads/buildroot$(BUILDROOTVER).tar.bz2 && tar -xjf buildroot$(BUILDROOTVER).tar.bz2) \
Modified: balloon/branches/menuconfig/initrd/S99custom
===================================================================
--- balloon/branches/menuconfig/initrd/S99custom 2010-06-19 13:28:02 UTC (rev 1169)
+++ balloon/branches/menuconfig/initrd/S99custom 2010-06-19 13:28:52 UTC (rev 1170)
@@ -54,14 +54,24 @@
# execute any (pre?)boot script
if [ -x /mnt/boot/boot.sh ]; then
- cd /mnt/boot
+ cd /mnt/boot;
./boot.sh
fi
# chain boot detected
if [ -r /mnt/boot/vmlinuz ]; then
+ # read in command line if any
+ if [ -r /mnt/boot/vmlinuz.cmdline ]; then
+ TEMP=`cat /mnt/boot/vmlinuz.cmdline`
+ CMDLINE="--command-line=\"$TEMP\""
+ fi
# try and load kernel
- kexec -l /mnt/boot/vmlinuz || true
+# the line below should be fine but doesn't seem to set the command line correctly"
+# kexec -l /mnt/boot/vmlinuz "$CMDLINE" || true
+ cd /tmp
+ echo "kexec -l /mnt/boot/vmlinuz "$CMDLINE"" > chain_load
+ chmod +x chain_load
+ ./chain_load
# then execute it
kexec -e || true
fi