summaryrefslogtreecommitdiffstats
path: root/scripts/mk-images
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2005-12-01 19:56:13 +0000
committerJeremy Katz <katzj@redhat.com>2005-12-01 19:56:13 +0000
commitceaec5f19d53a4cf5fd958bf45ea5dc39ac2ac73 (patch)
treea4bfc1093eede678c5d3ae6668557c1c813c3386 /scripts/mk-images
parent711e47f62e5a3bd36ce6d7dacf5fd6d63c6101b3 (diff)
downloadanaconda-ceaec5f19d53a4cf5fd958bf45ea5dc39ac2ac73.tar.gz
anaconda-ceaec5f19d53a4cf5fd958bf45ea5dc39ac2ac73.tar.xz
anaconda-ceaec5f19d53a4cf5fd958bf45ea5dc39ac2ac73.zip
2005-12-01 Jeremy Katz <katzj@redhat.com>
* scripts/mk-images: Add squashfs to module list. Build images as squashfs.
Diffstat (limited to 'scripts/mk-images')
-rwxr-xr-xscripts/mk-images19
1 files changed, 15 insertions, 4 deletions
diff --git a/scripts/mk-images b/scripts/mk-images
index 03f9bc597..2a691bfda 100755
--- a/scripts/mk-images
+++ b/scripts/mk-images
@@ -31,7 +31,7 @@ fi
TOPDIR=$(cd $TOPDIR; pwd)
# modules that are needed. this is the generic "needed for every arch" stuff
-COMMONMODS="fat vfat nfs sunrpc lockd floppy cramfs loop edd pcspkr"
+COMMONMODS="fat vfat nfs sunrpc lockd floppy cramfs loop edd pcspkr squashfs"
USBMODS="ohci-hcd uhci-hcd ehci-hcd hid mousedev usb-storage sd_mod sr_mod"
FIREWIREMODS="ieee1394 ohci1394 sbp2"
IDEMODS="ide-cd"
@@ -676,6 +676,7 @@ EOF
makeinstimage () {
imagename=$1
+ type=$2
tmpdir=/tmp/instimage.dir.$$
rm -rf $tmpimage $tmpdir
@@ -685,8 +686,13 @@ makeinstimage () {
(cd $INSTIMGTEMPLATE; find . | cpio --quiet -p $tmpdir)
makeproductfile $tmpdir
- echo "Running mkcramfs $CRAMBS $tmpdir $INSTIMGPATH/${imagename}2.img"
- mkfs.cramfs $CRAMBS $tmpdir /tmp/${imagename}2.img.$$
+ if [ -z "$type" -o "$type" = "cramfs" ]; then
+ echo "Running mkcramfs $CRAMBS $tmpdir $INSTIMGPATH/${imagename}2.img"
+ mkfs.cramfs $CRAMBS $tmpdir /tmp/${imagename}2.img.$$
+ elif [ "$type" = "squashfs" ]; then
+ echo "Running mksquashfs -all-root $tmpdir /tmp/${imagename}2.img"
+ mksquashfs -all-root $tmpdir /tmp/${imagename}2.img.$$
+ fi
cp /tmp/${imagename}2.img.$$ $INSTIMGPATH/${imagename}2.img
size=$(ls -l $INSTIMGPATH/${imagename}2.img | awk '{print $5}')
size=$(expr $size / 1024)
@@ -719,6 +725,11 @@ makemainimage () {
makeproductfile $mmi_mntpoint
umount $mmi_mntpoint
rmdir $mmi_mntpoint
+ elif [ $type = "squashfs" ]; then
+ makeproductfile $IMGPATH
+ echo "Running mksquashfs -all-root $IMGPATH $mmi_tmpimage"
+ mksquashfs -all-root $IMGPATH $mmi_tmpimage
+ SIZE=$(expr `cat $mmi_tmpimage | wc -c` / 1024)
elif [ $type = "cramfs" ]; then
makeproductfile $IMGPATH
echo "Running mkcramfs $CRAMBS $IMGPATH $mmi_tmpimage"
@@ -739,7 +750,7 @@ makeSecondStage() {
makeinstimage "minstg"
[ $? = 0 ] || exit 1
echo "Building stage2.img"
- makemainimage "stage2" "cramfs"
+ makemainimage "stage2" "squashfs"
[ $? = 0 ] || exit 1
}