Disk creation

From MAGEEC
Revision as of 17:23, 28 January 2014 by James (talk | contribs) (Prepare and chroot stage)
Jump to: navigation, search

A page just listing the commands necessary to create a ubuntu MAGEEC iso.

Prepare and chroot stage

# Setup chroot
sudo cp /etc/resolv.conf edit/etc/
sudo cp /etc/hosts edit/etc/
sudo mount --bind /dev/ edit/dev
sudo chroot edit bash
# Inside the chroot
mount -t proc none /proc
mount -t sysfs none /sys
mount -t devpts none /dev/pts
export HOME=/root
export LC_ALL=C
dbus-uuidgen > /var/lib/dbus/machine-id
dpkg-divert --local --rename --add /sbin/initctl
ln -s /bin/true /sbin/initctl
# Install packages
add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"
add-apt-repository ppa:terry.guo/gcc-arm-embedded
sed -i 's/saucy/raring/' /etc/apt/sources.list.d/terry_guo-gcc-arm-embedded-saucy.list
apt-get update
apt-get -y install python-setuptools && easy_install pyusb
apt-get -y dist-upgrade && apt-get -y install gcc-avr build-essential gdb-avr avr-libc avrdude git vim arduino python-numpy python-scipy gcc-arm-none-eabi nautilus-open-terminal autoconf automake autotools-dev libtool libusb-1.0-0-dev libusb-0.1-4 python-matplotlib
# Edit unity
# Change background
# copy file into /usr/share/backgrounds/...
# Remove ubiquity
apt-get purge ubiquity
# Add files to desktop
cd /etc/skel
mkdir Desktop
rm example.desktop
cd Desktop
git clone https://github.com/libopencm3/libopencm3
git clone https://github.com/jpallister/stlink
git clone https://github.com/jpallister/stm32f4-energy-monitor/
git clone https://github.com/mageec/beebs
# Copy udev rules
# copy into chroot
# place in /etc/udev/rules.d
# Make smaller if need to put on 1gb usb
apt-get purge language-pack-es-base language-pack-gnome-en-base language-pack-gnome-es-base language-pack-gnome-zh-hans-base language-pack-zh-hans-base libreoffice-calc libreoffice-core libreoffice-draw libreoffice-impress libreoffice-math libreoffice-writer thunderbird libreoffice-common
# Clean
apt-get clean
rm /etc/hosts
touch /etc/hosts
rm /etc/resolv.conf
ln -s /run/resolvconf/resolv.conf /etc
#rm /var/lib/dbus/machine-id
rm /sbin/initctl
dpkg-divert --rename --remove /sbin/initctl
umount /proc || umount -lf /proc
umount /sys
umount /dev/pts
exit

Set up plymouth

# Edit plymouth
cd extract-cd/casper
mkdir lztempdir 
cd lztempdir
lzma -dc -S .lz ../initrd.lz | cpio -imvd --no-absolute-filenames
# copy mageec theme into /lib/plymouth/themes
# link default.plymouth to mageec.plymouth
cp ../initrd.lz ../inird.lz.orig
find . | cpio --quiet --dereference -o -H newc | lzma -7 > ../initrd.lz

Build iso

# Follow steps on first link