- Added policy-rc.d file.
- Added various hacks to make the install process happy.
- Reverted apt sources to the standard ones.
1 parent f5de183 commit 75d528d8dbc8d8297e34a26d76e588d2b7e2134d
nstanger authored on 12 Jun 2007
Showing 4 changed files
View
56
OARiNZ/DIY/LiveCD/Makefile
NEW_SQUASH=new-squashfs
 
# Miscellaneous files.
REMOVE_FILES=${NEW_SQUASH}/etc/resolv.conf ${NEW_SQUASH}/etc/apt/apt.conf \
${NEW_SQUASH}/Makefile.chroot
${NEW_SQUASH}/Makefile.chroot ${NEW_SQUASH}/usr/sbin/policy-rc.d
 
# Commands locations.
ECHO=/bin/echo
SUDO=/usr/bin/sudo
UMOUNT=/bin/umount
MKDIR=/bin/mkdir
SED=/bin/sed
DD=/bin/dd
CHMOD=/bin/chmod
 
 
.PHONY: filesystem squashfs iso cleanup
 
@# Mount squashfs source filesystem and set up work environment.
@${ECHO}
@${ECHO} "=== Initialising."
@${SUDO} ${MOUNT} -o loop $< ${NEW_SQUASH}
${SUDO} ${CP} /etc/resolv.conf ${NEW_SQUASH}/etc
${SUDO} ${MOUNT} -t proc -o bind /proc ${NEW_SQUASH}/proc
${SUDO} ${CP} -p /etc/resolv.conf ${NEW_SQUASH}/etc
${SUDO} ${MOUNT} -t proc --bind /proc ${NEW_SQUASH}/proc
 
@# Copy in cached .deb files to save on downloads and set up apt
@# sources, etc. An appropriate sources.list can be generated
@# using the utility at http://www.ubuntu-nl.org/source-o-matic/.
@${ECHO}
@${ECHO} "=== Setting up apt (takes about 10 seconds)."
${SUDO} ${CP} -a apt-cache/. ${NEW_SQUASH}/var/cache/apt/archives
${SUDO} ${CP} /etc/apt/apt.conf ${NEW_SQUASH}/etc/apt
${SUDO} ${CP} -b --suffix=.old sources.list ${NEW_SQUASH}/etc/apt
@# HACK: I've been having problems with the update servers. Since it
@# takes so long to get back to this point in the process, I've
@# cheated and pre-generated the various index files. Just drop 'em
@# in! They should be safe to leave there afterwards.
${SUDO} ${CP} -a apt-lists/. ${NEW_SQUASH}/var/lib/apt/lists
${SUDO} ${CP} -p /etc/apt/apt.conf ${NEW_SQUASH}/etc/apt
${SUDO} ${CP} sources.list ${NEW_SQUASH}/etc/apt
@# The following stops the daemons from attempting to restart, which
@# will fail miserably in a chroot environment. Make sure to set the
@# permissions correctly, just in case they've been eaten by CVS or
@# something.
${SUDO} ${CP} policy-rc.d ${NEW_SQUASH}/usr/sbin
${SUDO} ${CHMOD} 755 ${NEW_SQUASH}/usr/sbin/policy-rc.d
@# Finally, preseed the debconf database so that we don't get asked
@# any annoying configuration questions during installs.
${SUDO} ${CP} -a debconf-db/. ${NEW_SQUASH}/var/cache/debconf
 
@# Chroot to the squashfs source filesystem and reconfigure
@# installed packages.
@# installed packages. Note that we need to stop Webmin for the
@# duration, otherwise installing Webmin in the chroot fails ("port
@# 10000 is already in use").
@${ECHO}
@${ECHO} "=== Reconfiguring installed packages (takes about xx minutes)."
@${SUDO} /etc/init.d/webmin stop
@${SUDO} ${CP} Makefile.chroot ${NEW_SQUASH}
time ${SUDO} chroot ${NEW_SQUASH} /usr/bin/env HOME=/root LC_ALL=C \
make -f Makefile.chroot
DEBIAN_FRONTEND=noninteractive make -f Makefile.chroot
@${SUDO} /etc/init.d/webmin start
 
@# Clean up.
@${ECHO}
@${ECHO} "=== Cleaning up."
${SUDO} ${UMOUNT} ${NEW_SQUASH}/proc
${SUDO} ${RM} -f ${REMOVE_FILES}
${SUDO} /bin/mv ${NEW_SQUASH}/etc/apt/sources.list.old \
${NEW_SQUASH}/etc/apt/sources.list
${SUDO} ${RM} -rf ${NEW_SQUASH}/tmp/*
 
@# Update manifest and disk name.
@${ECHO}
 
${INSTANT_EPRINTS}_work.ext2: ${INSTANT_EPRINTS}.ext2
@${ECHO}
@${ECHO} "=== Making working copy of original filesystem (takes about 2.5 minutes)."
time ${SUDO} ${CP} $< $@
${SUDO} ${CP} $< $@
 
 
# Build source filesystem.
 
@${SUDO} ${MOUNT} -t iso9660 -o loop $< /cdrom
@${MKDIR} -p ${LIVECD}
${SUDO} ${RM} -rf ${LIVECD}/*
${CP} -a /cdrom/. ${LIVECD}
/bin/chmod -R u+w ${LIVECD}
${CHMOD} -R u+w ${LIVECD}
@${SUDO} ${UMOUNT} /cdrom
 
@# Remove unnecessary Windows cruft.
@${ECHO}
View
23
OARiNZ/DIY/LiveCD/Makefile.chroot
# Commands.
APTGET=/usr/bin/apt-get -q
APTGET_REM=${APTGET} remove --purge --assume-yes
APTGET_INS=${APTGET} install --assume-yes
DPKG=/usr/bin/dpkg
 
 
# Packages to be removed using apt-get. Note that some additional
# dependent packages will be automatically removed as well.
REM_MISC=diveintopython ubuntu-artwork ubuntu-docs gaim gaim-data \
screensaver-default-images sound-juicer totem-gstreamer \
totem-mozilla totem rhythmbox
totem-mozilla totem rhythmbox linux-headers-2.6.17-10 \
linux-headers-2.6.17-10-generic linux-headers-generic \
xsane-common
 
REM_GNOME=gnome-games gnome-games-data gnome2-user-guide
 
REM_OPENOFFICE=openoffice.org openoffice.org-base openoffice.org-calc \
 
add:
@echo
@echo "=== Add apt-get packages here."
${APTGET} update
@# Normally you'd apt-get update here, but I've been having
@# problems with the servers. Since it takes so long to get
@# back to this point in the process, I've cheated and pre-generated
@# the cache index files. They were copied in before this Makefile
@# was called.
@#${APTGET} update
${APTGET_INS} ${ADD_EPRINTS}
${APTGET_INS} ${ADD_WEBMIN}
${APTGET_INS} ${ADD_ECONFIG}
${APTGET_INS} ${ADD_MISC}
dpkg-add:
@echo
@echo "=== Add dpkg packages here."
# In order: eprints, webmin, oarinz-eprints-config, webmin-eprints
${DPKG} -i ${APT_CACHE}/eprints_3.0-0ubuntu1_all.deb
${DPKG} -i ${APT_CACHE}/webmin_1.340_all.deb
${DPKG} -i ${APT_CACHE}/oarinz-eprints-config_0.0.1-2_all.deb
${DPKG} -i ${APT_CACHE}/webmin-eprints_0.0.1-1_all.deb
 
 
cleanup:
${APTGET} clean
View
OARiNZ/DIY/LiveCD/policy-rc.d 0 → 100755
View
OARiNZ/DIY/LiveCD/sources.list