diff --git a/README.md b/README.md index e8e02e9..b2c5b87 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,22 @@ # Debian-CD-Scripts A set of simple scripts for modifying and working with the Debian installer CDs. + +This repo is divided into i386 and amd64 versions as the CDs use different directories, though the process aside from that is the same. + +## Dependancies + - rsync + - cpio + - genisoimage (cdrkit) + +## Usage +`./extractcd.sh debian-8.2.0-i386-netinst.iso` +To extract a CD into the cd/ directory + +`./extractrd.sh` +To extract an init RAMdisk into the irmod/ directory + +`./genrd.sh` +To convert the irmod directory back into a RAMdisk in the cd/ directory + +`./gencd.sh custom.iso` +To convert the cd/ directory back into a CD image for use. diff --git a/amd64/extractcd.sh b/amd64/extractcd.sh new file mode 100755 index 0000000..5bbfb68 --- /dev/null +++ b/amd64/extractcd.sh @@ -0,0 +1,10 @@ +#!/bin/bash +if [ ! -d iso ]; then + mkdir iso +fi +if [ ! -d cd ]; then + mkdir cd +fi +mount $1 iso/ +rsync -aP -H --exclude=TRANS.TBL iso/ cd +umount iso diff --git a/amd64/extractrd.sh b/amd64/extractrd.sh new file mode 100755 index 0000000..27b136d --- /dev/null +++ b/amd64/extractrd.sh @@ -0,0 +1,6 @@ +if [ ! -f irmod ]; then + mkdir irmod +fi +cd irmod +gzip -d < ../cd/install.amd/initrd.gz | cpio --extract --verbose --make-directories --no-absolute-filenames +cd .. diff --git a/amd64/gencd.sh b/amd64/gencd.sh new file mode 100755 index 0000000..fc54e1c --- /dev/null +++ b/amd64/gencd.sh @@ -0,0 +1,9 @@ +#!/bin/bash +if [ -d cd ]; then + cd cd + md5sum `find -follow -type f` | tee md5sum.txt + cd .. + genisoimage -o $1 -r -J -no-emul-boot -boot-load-size 4 -boot-info-table -b isolinux/isolinux.bin -c isolinux/boot.cat ./cd +else + echo "wat error (cd directory not found)" +fi diff --git a/amd64/genrd.sh b/amd64/genrd.sh new file mode 100755 index 0000000..f592160 --- /dev/null +++ b/amd64/genrd.sh @@ -0,0 +1,8 @@ +#!/bin/bash +if [ -d irmod ]; then + cd irmod + find . | cpio -H newc --create --verbose | gzip -9 > ../cd/install.amd/initrd.gz + cd .. +else + echo "wat error (irmod directory not found)" +fi diff --git a/i386/extractcd.sh b/i386/extractcd.sh new file mode 100755 index 0000000..5bbfb68 --- /dev/null +++ b/i386/extractcd.sh @@ -0,0 +1,10 @@ +#!/bin/bash +if [ ! -d iso ]; then + mkdir iso +fi +if [ ! -d cd ]; then + mkdir cd +fi +mount $1 iso/ +rsync -aP -H --exclude=TRANS.TBL iso/ cd +umount iso diff --git a/i386/extractrd.sh b/i386/extractrd.sh new file mode 100755 index 0000000..73334b0 --- /dev/null +++ b/i386/extractrd.sh @@ -0,0 +1,6 @@ +if [ ! -f irmod ]; then + mkdir irmod +fi +cd irmod +gzip -d < ../cd/install.386/initrd.gz | cpio --extract --verbose --make-directories --no-absolute-filenames +cd .. diff --git a/i386/gencd.sh b/i386/gencd.sh new file mode 100755 index 0000000..fc54e1c --- /dev/null +++ b/i386/gencd.sh @@ -0,0 +1,9 @@ +#!/bin/bash +if [ -d cd ]; then + cd cd + md5sum `find -follow -type f` | tee md5sum.txt + cd .. + genisoimage -o $1 -r -J -no-emul-boot -boot-load-size 4 -boot-info-table -b isolinux/isolinux.bin -c isolinux/boot.cat ./cd +else + echo "wat error (cd directory not found)" +fi diff --git a/i386/genrd.sh b/i386/genrd.sh new file mode 100755 index 0000000..d3ea172 --- /dev/null +++ b/i386/genrd.sh @@ -0,0 +1,8 @@ +#!/bin/bash +if [ -d irmod ]; then + cd irmod + find . | cpio -H newc --create --verbose | gzip -9 > ../cd/install.386/initrd.gz + cd .. +else + echo "wat error (irmod directory not found)" +fi