From: <ale...@us...> - 2004-02-29 23:50:27
|
Update of /cvsroot/morphix/morph-scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22276 Modified Files: isomorph.pl minimod-gen.pl Added Files: install2mainmod Log Message: adding install2mainmod (converts a normal install to a mainmodule, pretty untested), small fixes to isomorph and minimod-gen --- NEW FILE: install2mainmod --- #!/bin/sh # Generate a Morphix mainmodule from the current installed linux # # Copyright Alex de Landgraaf, 2004 <alextreme at xs4all dot nl> # licensed under the GNU GPL v2, see www.gnu.org for details # With thanks to the makers of the ABS guide # Usage: install2mainmod [/tmp/destination.mod] if [ $# -ne 0 ]; then if [ -e "$1" ]; then echo "File already exists, please choose a different destination" exit 1 fi if [ "$1" -eq "-h" -o $1 -eq "--help" ]; then echo "Builds a mainmodule from your current install" echo "Note that you need enough freespace and RAM" echo " Usage: install2mainmod [/tmp/destination.mod]" exit 1 fi fi if [ -n "$1" ]; then DESTMOD=$1 else DESTMOD="/tmp/MorphixMain-generated.mod" fi echo "Ready to start mainmodule generating from current installed Linux" echo "Press enter to continue, Ctrl-C to abort" read echo echo "Copying files, please wait..." MODDIR=`mktemp -d i2m.XXXXXX` mkdir $MODDIR/MorphixCD mkdir $MODDIR/boot mkdir $MODDIR/cdrom mkdir $MODDIR/cdrom1 mkdir $MODDIR/dev mkdir $MODDIR/floppy mkdir $MODDIR/home mkdir $MODDIR/mnt mkdir $MODDIR/proc mkdir $MODDIR/root mkdir $MODDIR/tmp if [ -e /morphix ]; then cp -af /morphix $MODDIR/ else NOMORPHDIR=yes mkdir $MODDIR/morphix echo "#!/bin/sh" >> $MODDIR/morphix/loadmod.sh echo "echo \"Chrooting to MainModule\"" >> $MODDIR/morphix/loadmod.sh echo "chroot /mnt/main sh /morphix/init.sh" >> $MODDIR/morphix/loadmod.sh echo "#!/bin/sh" >> $MODDIR/morphix/init.sh echo "# Put stuff to load at boottime here" >> $MODDIR/morphix/init.sh echo "MyLivecd" >> $MODDIR/morphix/main_module echo "This mainmodule has been auto-generated by install2mainmod" >> $MODDIR/morphix/main_module fi cp -af /bin $MODDIR/ cp -af /etc $MODDIR/ cp -af /lib $MODDIR/ rm -rf $MODDIR/lib/modules/* cp -af /sbin $MODDIR/ cp -af /usr $MODDIR/ cp -af /var $MODDIR/ # applying libGL patch mkdir $MODDIR/usr/lib/backup mv $MODDIR/usr/lib/libGL.* $MODDIR/usr/lib/backup mkdir $MODDIR/usr/X11R6/lib/backup mv $MODDIR/usr/X11R6/lib/libGL.* $MODDIR/usr/X11R6/lib/backup/ mkdir $MODDIR/usr/X11R6/lib/modules/extensions/backup mv $MODDIR/usr/X11R6/lib/modules/extensions/libGLcore.a $MODDIR/usr/X11R6/lib/modules/extensions/backup/ mv $MODDIR/usr/X11R6/lib/modules/extensions/libglx.a $MODDIR/usr/X11R6/lib/modules/extensions/backup/ echo "Done creating the uncompressed livecd in $MODDIR" echo "You now have the possibility to make manual changes" if [ -n "$NOMORPHDIR" ]; then echo "As your system didn't have a /morphix directory, I made one for you" echo "However, you'll have to manually edit the $MODDIR/morphix/init.sh script" echo "in order for anything to load at boottime." echo "See www.morphix.org for examples" fi echo "Press enter to continue and compress the filesystem, press Ctrl-C to abort" read `mkisofs -R -U -V "Morphix" -P "Morphix" -hide-rr-moved -cache-inodes -no-bak -pad $MODDIR | nice -5 create_compressed_fs - 65536 > $DESTMOD` echo echo "Compressing complete" echo "Your module is available as $DESTMOD" echo "Have a nice day, and happy morphing!" echo Index: isomorph.pl =================================================================== RCS file: /cvsroot/morphix/morph-scripts/isomorph.pl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** isomorph.pl 12 Jun 2003 22:39:13 -0000 1.1.1.1 --- isomorph.pl 29 Feb 2004 23:32:01 -0000 1.2 *************** *** 131,135 **** } if ($mode eq "add-mini") { ! if ( -e $main) { system("cp $mini $newmountpoint/minimod/"); } else { isodie("Minimodule not found!"); } --- 131,135 ---- } if ($mode eq "add-mini") { ! if ( -e $mini) { system("cp $mini $newmountpoint/minimod/"); } else { isodie("Minimodule not found!"); } Index: minimod-gen.pl =================================================================== RCS file: /cvsroot/morphix/morph-scripts/minimod-gen.pl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** minimod-gen.pl 6 Dec 2003 15:49:55 -0000 1.4 --- minimod-gen.pl 29 Feb 2004 23:32:01 -0000 1.5 *************** *** 36,40 **** our @localfilelist; # option 5: homedir ! our $homedir; if ($> != 0) { --- 36,40 ---- our @localfilelist; # option 5: homedir ! our $homedir = ""; if ($> != 0) { *************** *** 304,308 **** print "All packages in this list will be downloaded from your apt\n"; print "mirror in /etc/apt/sources.list and unpacked into a minimod\n"; ! print "Make sure you have apt-get update && apt-get upgrade ed your system\n"; print "> "; chomp($src = <STDIN>); --- 304,308 ---- print "All packages in this list will be downloaded from your apt\n"; print "mirror in /etc/apt/sources.list and unpacked into a minimod\n"; ! print "Make sure you updated using dselect beforehand, please note only ftp repositories are used atm\n"; print "> "; chomp($src = <STDIN>); *************** *** 369,372 **** --- 369,375 ---- next; } + if ($line eq "") { + next; + } @stuff = $line =~ /^deb ftp:\/\/(\S+) (\S+)/g; print @stuff; *************** *** 635,640 **** print OUT "cp -r \"\$1\"/homedir/.[a-zA-Z]* /home/morph/\n"; print OUT "cp -r \"\$1\"/homedir/* /home/morph\n"; ! print OUT "cp -r \"\$1\"/homedir/.[a-zA-Z]* /etc/skel/\n"; ! print OUT "cp -r \"\$1\"/homedir/* /etc/skel\n"; print OUT "chown -R morph.users /home/morph\n"; } --- 638,642 ---- print OUT "cp -r \"\$1\"/homedir/.[a-zA-Z]* /home/morph/\n"; print OUT "cp -r \"\$1\"/homedir/* /home/morph\n"; ! print OUT "mount --bind \"\$1\"/homedir /etc/skel\n"; print OUT "chown -R morph.users /home/morph\n"; } |