Freaknet / Poetry Bricolab Distro

by Asbesto, MAY 2013

Description

Fetch your favorite iso, in the following examples we will take Linux Mint 14.1 iso but this procedures can apply to a lot of different iso/systems.

The basic procedure is simple:

Requirements

You need the squashfs-tools.

apt-get install squashfs-tools

HOWTO

You can cut'n paste from here to your shell, as you need. ;)

# CREATING THE DEVELOPMENT SYSTEM FROM THE ISO IMAGE
# we choose pd/ as our working directory, so...

mkdir pd
cd pd

sudo mount linuxmint-14.1-mate-dvd-32bit.iso /mnt -o loop
mkdir extract-cd
rsync --exclude=/casper/filesystem.squashfs -a /mnt/ extract-cd

sudo unsquashfs /mnt/casper/filesystem.squashfs

sudo mv squashfs-root edit
# ISO IMAGE CREATED!

# USE YOUR DEVELOPMENT SYSTEM
# use resolv.conf and hosts from your system, or edit them by hand...
sudo cp /etc/resolv.conf edit/etc/
sudo cp /etc/hosts edit/etc/

# if you are into your pd/ directory with 
# the system extracted as above, 
# just cut'n paste from here to start 
# working on the system.

sudo mount --bind /dev/ edit/dev
sudo chroot edit

mount -t proc none /proc
mount -t sysfs none /sys
mount -t devpts none /dev/pts

# To avoid locale problems during installation
# of new packages, you need to export 2 
# system variables:

export HOME=/root
export LC_ALL=C

# You also need to do this as root (that's for some 
# reasons connected with a couple of dbus bugs).
# If you are re-chrooting to a system you're working 
# on, don't mind about warnings or errors.

dbus-uuidgen > /var/lib/dbus/machine-id
dpkg-divert --local --rename --add /sbin/initctl
ln -s /bin/true /sbin/initctl

#done! 

NOTE: if the above dpkg-divert fail with a "not allowed" message, just remove /sbin/initctl.distrib

rm /sbin/initctl
dpkg-divert --local --rename --add /sbin/initctl
ln -s /bin/true /sbin/initctl

That's all folks! ;)

Suggestions

font console setup:

wopr ~ # dpkg-reconfigure console-setup

When you want to remove packages remember to use purge I investigated a bit the matter, not enough to know whats going on but enough to know is a good practice.

Once in the chroot start poking:

# refresh your list
apt-get update

# some must have
apt-get install htop modconf

# some multimedia 
apt-get install cinelerra sox twolame mpeg2dec a52dec libsox-fmt-all a52dec darkice darksnow

rsync to carry the pack for working out of home

rsync --exclude=/edit/dev --exclude=/edit/proc --exclude=/edit/sys  -auvz /home/youruser/wherever/src/pd/ /media/usbdisk/pd/

In this way you rsync your pd/ working directory on a same pd/ dir on your usb key, so you can work everywhere on your eeepc. ;)

Closing

cd /
aptitude clean
rm -rf /tmp/* ~/.bash_history
# tolgo rm /etc/resolv.conf perche comunque ci metto i dns dell'MIT
rm /var/lib/dbus/machine-id
rm /sbin/initctl
dpkg-divert --rename --remove /sbin/initctl
dpkg -l > packages.txt
umount /proc
umount /sys
umount /dev/pts
exit
sudo umount edit/dev
sudo mv edit/packages.txt extract-cd/casper/

# Into the pd dir: 

# creiamo il file
sudo touch extract-cd/casper/filesystem.manifest
sudo chmod a+w extract-cd/casper/filesystem.manifest
#
sudo chroot edit dpkg-query -W --showformat='${Package} ${Version}\n' > extract-cd/casper/filesystem.manifest
sudo cp extract-cd/casper/filesystem.manifest extract-cd/casper/filesystem.manifest-desktop
sudo sed -i '/ubiquity/d' extract-cd/casper/filesystem.manifest-desktop
sudo sed -i '/casper/d' extract-cd/casper/filesystem.manifest-desktop

# Compress the filesystem

# cancelliamo il vecchio squashfs eventualmente in mezzo alle palle
sudo rm extract-cd/casper/filesystem.squashfs

# creiamo il nuovo squashfs
sudo mksquashfs edit extract-cd/casper/filesystem.squashfs

# Remove old md5sum.txt and calculate new md5 sums
cd extract-cd
sudo rm md5sum.txt
find -type f -print0 | sudo xargs -0 md5sum | grep -v isolinux/boot.cat | sudo tee md5sum.txt

# From inside the extract-cd directory:
sudo mkisofs -D -r -V "fplinux" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ../fplinux-01alpha.iso .
sudo isohybrid ../fplinux-01alpha.iso

# HASTA SIEMPRE, COMANDANTE CHE GUEVARA!

Per creare una chiavetta avviabile, basta fare

sudo dd if=fplinux-01alpha of=/dev/sdXX bs=8192k

Per quel che riguarda le customizzazioni relative a d:b si rimanda all'articolo precedente, DyneBolicCreate :)

Hints

Settare l'editor default da console

Si usa update-alternatives --config editor che ti fa scegliere l'editor preferito tramite un menu.

DyneBolicCreate/mint (last edited 2013-05-14 16:51:11 by asbesto)