From 90457beee3dd82cff9eeb23ec9c6dc826de652f8 Mon Sep 17 00:00:00 2001 From: Rene Rebe Date: Mon, 8 Sep 2003 00:49:54 +0000 Subject: [PATCH] bootdisk target cleanup and tiny refactoring to make it possible to skip the /boot directory content from the bootdisk (on PowerPC the 2nd stage increased to over 64MB ...) git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@1334 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- Documentation/Developers/CHANGELOG-RENE | 3 +++ target/bootdisk/build.sh | 3 ++- target/bootdisk/build_stage1.sh | 8 +++++--- target/bootdisk/build_stage2.sh | 6 +++++- target/bootdisk/powerpc/build.sh | 10 ++++++---- target/bootdisk/x86/build.sh | 10 ++++++---- 6 files changed, 27 insertions(+), 13 deletions(-) diff --git a/Documentation/Developers/CHANGELOG-RENE b/Documentation/Developers/CHANGELOG-RENE index 97633b8f8..4502197d9 100644 --- a/Documentation/Developers/CHANGELOG-RENE +++ b/Documentation/Developers/CHANGELOG-RENE @@ -7,6 +7,9 @@ - disabled arithmethic (libm) functions in gawk when dietlibc is used - non-x86 architectures do not have a libm when dietlibc is used (this is a hack and should be fixed with real support inside dietlibc ...) + - bootdisk target cleanup and tiny refactoring to make it possible to skip + the /boot directory content from the bootdisk (on PowerPC the 2nd stage + increased to over 64MB ...) *) 2003-09-06 (2.0.0-rc1 - 2.0.0-rc2) diff --git a/target/bootdisk/build.sh b/target/bootdisk/build.sh index 5964973f7..297c73007 100644 --- a/target/bootdisk/build.sh +++ b/target/bootdisk/build.sh @@ -34,7 +34,8 @@ echo_header "Creating ISO filesystem description." cd $disksdir; rm -rf isofs; mkdir -p isofs echo_status "Creating bootdisk/isofs directory.." -ln 2nd_stage.tar.gz 2nd_stage_small.tar.gz *.img isofs/ +ln 2nd_stage.tar.gz 2nd_stage_small.tar.gz isofs/ +ln *.img isofs/ 2>/dev/null || true # might not exist on some architectures echo_status "Creating isofs.txt file .." echo "DISK1 build/${ROCKCFG_ID}/bootdisk/isofs/ ` diff --git a/target/bootdisk/build_stage1.sh b/target/bootdisk/build_stage1.sh index b25efa4cc..b68a4c604 100644 --- a/target/bootdisk/build_stage1.sh +++ b/target/bootdisk/build_stage1.sh @@ -34,9 +34,11 @@ for x in ../2nd_stage/lib/modules/*/kernel/drivers/{scsi,net}/*.o; do mkdir -p $( dirname $xx ) ; cp $x $xx strip $xx # --strip-debug --strip-unneeded $xx done -cp ../2nd_stage/lib/modules/*/modules.dep lib/modules/[0-9]*/ -cp ../2nd_stage/lib/modules/*/modules.pcimap lib/modules/[0-9]*/ -cp ../2nd_stage/lib/modules/*/modules.isapnpmap lib/modules/[0-9]*/ +# +for x in ../2nd_stage/lib/modules/*/modules.{dep,pcimap,isapnpmap} ; do + cp $x ${x#../2nd_stage/} +done +# for x in lib/modules/*/kernel/drivers/{scsi,net}; do ln -s ${x#lib/modules/} lib/modules/ done diff --git a/target/bootdisk/build_stage2.sh b/target/bootdisk/build_stage2.sh index dca43d184..4c49cdb35 100644 --- a/target/bootdisk/build_stage2.sh +++ b/target/bootdisk/build_stage2.sh @@ -55,11 +55,15 @@ do fi done # +echo_status "Saving boot/* - we do not need this on the 2nd stage ..." +rm -rf ../boor ; mkdir ../boot +mv -v boot/* ../boot/ +# echo_status "Remove the stuff we don't need ..." rm -rf home usr/{local,doc,man,info,games,share} rm -rf var/adm/* var/games var/adm var/mail var/opt rm -rf usr/{include,src} usr/*-linux-gnu usr/lib/*.{a,la,o} -rm -rf usr/lib/*/ boot/*-rock boot/System.map +rm -rf usr/lib/*/ # echo_status "Installing some terminfo databases ..." tar $taropt ../../pkgs/ncurses.tar.bz2 \ diff --git a/target/bootdisk/powerpc/build.sh b/target/bootdisk/powerpc/build.sh index d6f2f7662..ff4a4c23e 100644 --- a/target/bootdisk/powerpc/build.sh +++ b/target/bootdisk/powerpc/build.sh @@ -1,8 +1,10 @@ use_yaboot=1 -echo "Copying vmlinux." -cp -v 2nd_stage/boot/vmlinux . +cd $disksdir + +echo_header "Creating cleaning boot directory:" +rm -rfv boot/*-rock boot/System.map boot/kconfig* if [ $use_yaboot -eq 1 ] then @@ -18,8 +20,8 @@ then cp -v $base/target/$target/powerpc/{yaboot.conf,boot.msg,ofboot.b} \ boot # - echo_status "Copy images (initrd,vmlinux) to yaboot directory." - cp -v initrd.img vmlinux boot/ + echo_status "Moving image (initrd) to yaboot directory." + mv -v initrd.img boot/ # echo_status "Copy more config files." cp -v $base/target/$target/powerpc/mapping . diff --git a/target/bootdisk/x86/build.sh b/target/bootdisk/x86/build.sh index 75554a2fd..27ad52b10 100644 --- a/target/bootdisk/x86/build.sh +++ b/target/bootdisk/x86/build.sh @@ -2,12 +2,14 @@ use_isolinux=1 use_mdlbl=1 -echo_header "Creating floppy disk images:" -cd $disksdir; mkdir -p boot +cd $disksdir + +echo_header "Creating lilo config and cleaning boot directory:" cp $base/target/$target/x86/lilo-* boot/ +rm -rfv boot/*-rock boot/grub boot/System.map boot/kconfig* + +echo_header "Creating floppy disk images:" cp $base/target/$target/x86/makeimages.sh . -cp 2nd_stage/boot/memtest86.bin boot/ -cp 2nd_stage/boot/vmlinuz boot/ chmod +x makeimages.sh if [ $use_mdlbl -eq 1 ]