How do I customize Wicker?

Asked by ekan

I'd like to customize Wicker to add FTP, SSH, Flash, etc. to it. What do I do?

Question information

Language:
English Edit question
Status:
Solved
For:
Wicker Edit question
Assignee:
No assignee Edit question
Solved by:
ekan
Solved:
Last query:
Last reply:
Revision history for this message
ekan (eric-theredpost) said :
#1

Prerequisites:
- host kernel must support squashfs
- squashfs-tools
- mkisofs
- qemu (optional, for testing virtually)

Initial preparation:

mkdir remaster
cd remaster
download and decompress the latest version of wicker
mv wicker-beta (or whatever it decompresses as) extract-cd
mkdir edit
mkdir squashfs
mount -t squashfs -o loop extract-cd/casper/filesystem.squashfs squashfs
cp -a squashfs/* edit/

To customize the squashfs (to apt-get install packages), you can now:
sudo chroot edit

Rebuilding initramfs:
sudo chroot edit
mkinitramfs -o /initrd.gz 2.6.22-14-generic
exit
mv edit/initrd.gz extract-cd/casper/

Rebuilding squashfs (**this is the part you'll do a lot**):
chmod +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 rm extract-cd/casper/filesystem.squashfs)
sudo mksquashfs -nolzma edit extract-cd/casper/filesystem.squashfs [-nolzma only needed for newer mksquashfs]

Final wicker-master directory includes the following:
- some contents from livecd iso (copied via instructions at https://wiki.ubuntu.com/LiveUsbPendrivePersistent)
- a few tweaks to syslinux (new wicker.rle boot image, small change to isolinux.txt, decreased timeout)
- casper/initrd.gz and casper/filesystem.* from processes above
- ldlinux.sys installed by running syslinux /dev/sdX

Revision history for this message
ekan (eric-theredpost) said :
#2

A couple scripts I've created to make rebuilding/reloading/updating from SVN easier:

#!/bin/bash
# load_usb:
# - formats drive (partitions have to be set up beforehand)
# - copies files to drive
# - sets up boot record
# Note: assumes flash drive is at /dev/sdb

mkfs.vfat -F 32 -n ubuntu /dev/sdb1
mkfs.ext2 -b 4096 -L casper-rw /dev/sdb2
mkdir /media/ubuntu
mount /dev/sdb1 /media/ubuntu
rsync --progress -r extract-cd/* /media/ubuntu/
umount /dev/sdb1
rmdir /media/ubuntu
syslinux /dev/sdb1
lilo -M /dev/sdb

#!/bin/bash
# reload_usb
# - backs up redpost_config.js file
# - copies over latest squash and initrd.gz files to ubuntu paritition
# - reformats casper-rw paritition
# Note: assumes flash drive mountpoint is /dev/sdb

cp /media/casper-rw/home/ubuntu/config/redpost_config.js /media/ubuntu/redpost_config.js.bak
rm /media/ubuntu/casper/filesystem.squashfs
rm /media/ubuntu/casper/initrd.gz
rsync --progress extract-cd/casper/filesystem.squashfs /media/ubuntu/casper/
rsync --progress extract-cd/casper/initrd.gz /media/ubuntu/casper/
umount /dev/sdb1
umount /dev/sdb2
mkfs.ext2 -b 4096 -L casper-rw /dev/sdb2

#!/bin/bash
# rebuild_squashfs: is as named
# run as root from the remaster dir

chmod +w extract-cd/casper/filesystem.manifest
chroot edit dpkg-query -W --showformat='${Package} ${Version}\n' > extract-cd/casper/filesystem.manifest
cp extract-cd/casper/filesystem.manifest extract-cd/casper/filesystem.manifest-desktop
sed -i '/ubiquity/d' extract-cd/casper/filesystem.manifest-desktop
rm extract-cd/casper/filesystem.squashfs
mksquashfs edit extract-cd/casper/filesystem.squashfs

#!/bin/bash
# update_from_svn
# - updates files from SVN
# - must be in remaster dir
# - need to figure out how to get it to rebuild initrd.gz as well

SOURCE_FOLDER="redpost_sourceforge"

# copy files
cp $SOURCE_FOLDER/etc/skel/.mozilla/firefox/1whd3ziw.default/prefs.js edit/etc/skel/.mozilla/firefox/1whd3ziw.default/
rm -r edit/etc/skel/redpost/*
cp $SOURCE_FOLDER/etc/skel/redpost/* edit/etc/skel/redpost/
cp $SOURCE_FOLDER/etc/sudoers edit/etc/sudoers
cp $SOURCE_FOLDER/etc/init.d/endboot_sync edit/etc/init.d/
cp $SOURCE_FOLDER/etc/crontab edit/etc/crontab
cp $SOURCE_FOLDER/usr/share/initramfs-tools/scripts/casper-bottom/* edit/usr/share/initramfs-tools/scripts/casper-bottom/

# rebuild initrd.gz
#chroot edit
#mkinitramfs -o /initrd.gz 2.6.22-14-generic
#exit
#mv edit/initrd.gz extract-cd/casper/