gnewsense-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gNewSense-users] custom build method


From: meandean
Subject: [gNewSense-users] custom build method
Date: Sun, 1 Jun 2008 21:20:33 -0700

The method I use to create custom builds of gnewsense...

-------------------------------------------------------------------
#create a directory to work in
mkdir work

#change to work directory
cd work

#change to root since some of the commands require root privys
su

#unpack the ISO
mkdir iso
mkdir temp
mount iso_to_modify.iso -o loop temp/
cp -a temp/* iso/
umount temp/

#Unpack the squash file system. This is the actual filesystem that is run when 
you use the livecd.
mount -t squashfs -o loop iso/casper/filesystem.squashfs temp/
mkdir fs
cp -a temp/* fs/
umount temp/
rm -rf temp/

#remove the old squash from the iso since we will build a new one with our 
changes
rm iso/casper/filesystem.squashfs

#may need/want to copy a couple of files from our system to the extracted 
filesystem for name resolution
cp /etc/hosts fs/etc/
cp /etc/resolv.conf fs/etc/

#mount dev,sys,proc
mount -t tmpfs --bind /dev/ fs/dev/
mount -t sysfs --bind /sys/ fs/sys/
mount -t proc --bind /proc/ fs/proc/

#change root to the extracted filesystem so we can work in it
chroot fs

#export our locale thingy so we dont get irritating messages when we install 
software
export LC_ALL=C

## add/remove software, edit files, do whatever...

#exit the chroot back to our system
exit

#unmount
umount fs/dev
umount fs/proc
umount fs/sys

#delete any temp files
rm -rf fs/tmp/*

#remove the files that were copied over...if they were copied over...
rm fs/etc/resolv.conf
rm fs/etc/hosts

#make the new squash filesystem from the folder we have been making changes to
mksquashfs fs/ iso/casper/filesystem.squashfs

#make the new ISO
mkisofs -r -V "cd" -cache-inodes -J -l -o newcd.iso \
-b isolinux/isolinux.bin -c isolinux/boot.cat \
-no-emul-boot -boot-load-size 4 -boot-info-table iso/

#newcd.iso should be in your working directory, it is owned by root so we need 
to chown/chgrp it
chown YourUserName:YourUserGroup newcd.iso

If you aren't happy with the newcd (forgot to include something or forgot to 
tweak something) delete newcd.iso and you can keep the work you have done so 
far by starting back at rm iso/casper/filesystem.squashfs

#if done, remove the following folders
rm -rf fs/
rm -rf iso/

exit

All done!
------------------------------------
Any custom files to include in the build should be moved into the extracted 
squash filesystem in the fs folder.

To customize the user environment move custom configuration files into 
fs/etc/skel being sure they are owned by root.

You can actually start the graphical environment of the extracted filesystem 
using a couple methods but the way I do it is - after I mount dev/sys/proc I 
logout of my environment and kill X then chroot fs and then just startx.


Hope this is useful to someone.....have fun!!!

meandean






reply via email to

[Prev in Thread] Current Thread [Next in Thread]