# Remix Any Linux with JWM window manager HOW-TO #
# This work is based off Ubuntu 16.04. May differ for others distros #
# Written by Security XIII on 25 April 2016 #
# I wanted to make small distro with presentation software to boot fast and start presentation out of the box
# So I hope this will help those who are unaware of the process. Here are some useful links:
# 1. LiveCD customization (a bit outdated, see above) - https://help.ubuntu.com/community/LiveCDCustomization
# 2. Installing JWM - http://ubuntuforums.org/showthread.php?t=174188
# Following is instructions themselves. Before start, grab your remix ISO from your source.
# Let's say we have remixing iso in a directory ~/remix
cd ~/remix
mkdir mnt # Make directory to mount the ISO disk
mount -o loop your-remix.iso mnt # Mount the disk to mnt dir
mkdir extract-cd # Directory to unpack ISO
sudo rsync -a mnt/ extract-cd # Copy ISO to our directory
sudo unsquashfs mnt/casper/filesystem.squashfs # Unpack the squashfs
sudo mv squashfs-root edit # Let's name our unpacked FS "edit" for convenience
sudo cp /etc/resolv.conf edit/etc/ # Make the internet work in chroot
sudo cp /etc/hosts edit/etc/
sudo mount --bind /dev/ edit/dev # Mount the important filesystems
sudo mount --bind /proc/ edit/proc
sudo mount -o bind /run/ edit/run # Mount additional filesystems
sudo chroot edit # Chroot inside the unpacked squashfs
# WE ARE IN CHROOT NOW! #
export HOME=/root
export LC_ALL=C
apt install xorg nano wget xz-utils build-essential libx11-dev gettext
apt install libreoffice-impress
cd home
wget https://joewing.net/projects/jwm/releases/jwm-2.3.5.tar.xz --no-check-certificate
tar xf jwm*.tar.xz
cd jwm
./configure # Hope everything went okay here!
make # Compilation should take few minutes or less
make install # Let's install the JWM
mkdir /usr/share/xsession
nano /usr/share/xsession/jwm.desktop
# Insert following text into the file - double check JWM exists, then save file Ctrl+O [enter]
[Desktop Entry]
Encoding=UTF-8
Name=JWM
Comment=This is the JWM window manager
Exec=/usr/local/bin/jwm
Type=Application
# End of text file
echo "exec /usr/local/bin/jwm" > ~/.xsession
# Let's say we finished our changes. Cleaning up procedure (to make resulting ISO lighter)
apt clean
apt autoclean
rm -rf /tmp/*
rm /var/lib/dbus/machine-id
umount /proc || umount -lf /proc # Start to unmount our filesystem
umount /sys
umount /dev/pts
exit # Let's finally exist chroot and get back to our env
# WE ARE NOT IN CHROOT NOW! Chroot has ended here. #
sudo umount edit/dev
sudo chmod +w extract-cd/casper/filesystem.manifest
sudo su
chroot edit dpkg-query -W --showformat='${Package} ${Version}\n' > extract-cd/casper/filesystem.manifest
exit
sudo cp extract-cd/casper/filesystem.manifest extract-cd/install/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
sudo rm extract-cd/casper/filesystem.squashfs
sudo mksquashfs edit extract-cd/casper/filesystem.squashfs
sudo su
printf $(du -sx --block-size=1 edit | cut -f1) > extract-cd/casper/filesystem.size
exit
sudo nano extract-cd/README.diskdefines # Edit DISKNAME here if you like
cd extract-cd # Let's recreate all the MD5SUMs
sudo rm md5sum.txt # We need to remove the old onces to start
find -type f -print0 | sudo xargs -0 md5sum | grep -v isolinux/boot.cat | sudo tee md5sum.txt
#
# CONGRADULATIONS IF YOU GET HERE! NOW LET'S BUILD THE OUR VERY-OWN CUSTOM-CRAFTED ISO! #
#
sudo mkisofs -D -r -V "$IMAGE_NAME" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ../mytestrelease.iso .
# If everything went well, you will have the "mytestrelease.iso" laying in the ~/remix folder.
# Good luck in your own way! Contact me if needed at securityxiii at gmail dot com.
Comments