Debian LiveCD: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
(→USB) |
||
Line 133: | Line 133: | ||
* Create '''debianlive''' directory on your USB drive. | * Create '''debianlive''' directory on your USB drive. | ||
* Put vmlinux-3.4.9 (extract xz archive), initramfs.cpio.gz and root.sfs into this directory. | * Put vmlinux-3.4.9 (extract xz archive), initramfs.cpio.gz and root.sfs into this directory. | ||
<pre> | |||
[glevand@korriban ~]$ ls -l /mnt/usb/debianlive/ | |||
total 257696 | |||
-rwxr-xr-x 1 root root 6746154 Aug 18 17:44 initramfs.cpio.gz | |||
-rwxr-xr-x 1 root root 249835520 Aug 18 17:15 root.sfs | |||
-rwxr-xr-x 1 root root 7288832 Aug 18 17:31 vmlinux-3.4.9 | |||
</pre> | |||
* And create kboot.conf in the root directory of your USB drive with this content: | * And create kboot.conf in the root directory of your USB drive with this content: | ||
Revision as of 18:57, 24 August 2012
Introduction
- Sometimes we need to boot Linux without HDD e.g. if you want to experiment with HDD encryption, enable/disable it without causing damage to your data. For such cases we need a LiveCD which doesn't mount HDD at boot.
Creating Initial System with debootstrap
apt-get install debootstrap mkdir livecd debootstrap --arch powerpc squeeze /root/livecd http://ftp.us.debian.org/debian # Grab a beer and reverse some PS3 stuff in the meantime :) # Enter chroot environment mount -t proc none /root/livecd/proc mount --rbind /dev /root/livecd/dev LANG=C chroot /root/livecd /bin/bash export TERM=xterm-color echo "debian" > /etc/hostname dpkg-reconfigure tzdata # Configure network interfaces cat /etc/network/interfaces --- auto lo iface lo inet loopback allow-hotplug eth0 iface eth0 inet dhcp allow-hotplug wlan0 iface wlan0 inet dhcp wpa-ssid ssid wpa-psk psk -EOF- # Configure APT cat /etc/apt/sources.list --- deb http://ftp.us.debian.org/debian squeeze main deb-src http://ftp.us.debian.org/debian squeeze main deb http://security.debian.org squeeze/updates main deb-src http://security.debian.org squeeze/updates main -EOF- aptitude update aptitude install locales dpkg-reconfigure locales aptitude install console-data dpkg-reconfigure console-data tasksel install standard aptitude install binutils gcc make git vim openssh-server sudo wpasupplicant libssl-dev aptitude install gcc-spu g++-spu newlib-spu spu-tools # Make SSH server start at boot so we could ssh to our LiveCD update-rc.d ssh defaults aptitude clean
Creating Root Filesystem
cd /root/livecd mksquashfs * ../root.sfs
Modifying Root Filesystem
cd /root unsquashfs root.sfs cd squashfs-root # Make your changes mksquashfs * ../root-changed.sfs
Linux 3 Kernel
- We need a Linux 3 kernel with overlayfs support so we could create a tmpfs over our read-only base filesystem.
- At the moment overlayfs is not supported on Linux 3.5 so it leaves us with Linux 3.4 which doesn't really matter because all my Linux 3 drivers are supported on Linux 3.4 just fine.
- Furthermore, we want to compile PS3 HDD driver as module because in this case we can easily change HDD region flags.
Initramfs
# Populate initramfs mkdir initramfs cd initramfs mkdir -p bin dev etc lib/modules/3.4.9 mnt proc sbin sys usr for mod in fat vfat isofs crc-ccitt crc-itu-t lzo_compress udf squashfs overlayfs \ ps3_gelic ps3stor_lib sg ps3rom usb-common usbcore ehci-hcd ohci-hcd usb-storage; do path=`find /home/glevand/linux-3.4.9-build/lib/modules/3.4.9 -name $mod.ko` cp $path lib/modules/3.4.9/ done # Create initramfs find . | cpio -H newc -o > ../initramfs.cpio cd .. cat initramfs.cpio | gzip > initramfs.cpio.gz
Images
- vmlinux-3.4.9.xz: http://www.multiupload.nl/9C1XVAB3RU (MD5 c15903c28b4eaff3524f3c32f491e25e)
- root.sfs: http://www.multiupload.nl/NERXNME3JJ (MD5 e2ed20d27092105961507de5d7b49ed3)
- Tools available on the root filesystem: gcc, spu-gcc, spuisofs, spuldrfs, ps3vuart-tools, ps3sed and all my other PS3 Linux drivers. Everything you need to compile and test various PS3 stuff.
USB
- initramfs.cpio.gz: http://www.multiupload.nl/KROXJ799N6 (MD5 8da82022b1c2541dc419619e710a0a3f)
- Create debianlive directory on your USB drive.
- Put vmlinux-3.4.9 (extract xz archive), initramfs.cpio.gz and root.sfs into this directory.
[glevand@korriban ~]$ ls -l /mnt/usb/debianlive/ total 257696 -rwxr-xr-x 1 root root 6746154 Aug 18 17:44 initramfs.cpio.gz -rwxr-xr-x 1 root root 249835520 Aug 18 17:15 root.sfs -rwxr-xr-x 1 root root 7288832 Aug 18 17:31 vmlinux-3.4.9
- And create kboot.conf in the root directory of your USB drive with this content:
debianlive=/debianlive/vmlinux-3.4.9 initrd=/debianlive/initramfs.cpio.gz