2007-07-07 23:48:08 by steve
INITIAL COMMIT: Support for arbitary partitioning systems. Patch from Sascha Kettler.
This commit is contained in:
@@ -41,7 +41,16 @@ linux_modules_package="linux-modules-$(uname -r)"
|
||||
# Attempt to install that package. This will either work on an Etch
|
||||
# system, or fail on a Sarge/custom kernel.
|
||||
#
|
||||
if chroot ${prefix} /usr/bin/apt-cache show ${linux_modules_package} >/dev/null 2>/dev/null; then
|
||||
if [ -n "${modules}" -a -d "${modules}" ]; then
|
||||
|
||||
#
|
||||
# Modules path was specified during install
|
||||
#
|
||||
logMessage "Copying modules from ${modules}"
|
||||
|
||||
mkdir -p ${prefix}/lib/modules
|
||||
cp -au ${modules} ${prefix}/lib/modules
|
||||
elif chroot ${prefix} /usr/bin/apt-cache show ${linux_modules_package} >/dev/null 2>/dev/null; then
|
||||
|
||||
logMessage "Package '${linux_modules_package}' is available - installing"
|
||||
|
||||
|
||||
@@ -30,24 +30,6 @@ fi
|
||||
logMessage Script $0 starting
|
||||
|
||||
|
||||
#
|
||||
# Options to mount the root filesystem with, we need to have
|
||||
# different options for xfs.
|
||||
#
|
||||
# The default option works for ext2 & ext3.
|
||||
#
|
||||
options="errors=remount-ro"
|
||||
|
||||
case "${fs}" in
|
||||
xfs)
|
||||
options="defaults"
|
||||
;;
|
||||
reiserfs)
|
||||
options="defaults"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
#
|
||||
# Make sure we use ide style device names if required
|
||||
#
|
||||
@@ -59,35 +41,52 @@ fi
|
||||
#
|
||||
# Now we have the options we can create the fstab.
|
||||
#
|
||||
has_xfs=0
|
||||
has_reiserfs=0
|
||||
cat <<E_O_FSTAB > ${prefix}/etc/fstab
|
||||
/dev/${device}1 / ${fs} ${options} 0 1
|
||||
proc /proc proc rw,nodev,nosuid,noexec 0 0
|
||||
E_O_FSTAB
|
||||
|
||||
# /etc/fstab: static file system information.
|
||||
#
|
||||
# Add in the swap unless it is disabled
|
||||
#
|
||||
if [ "${noswap}" ]; then
|
||||
:
|
||||
else
|
||||
cat <<E_O_FSTAB >> ${prefix}/etc/fstab
|
||||
/dev/${device}2 none swap sw 0 0
|
||||
# <file system> <mount point> <type> <options> <dump> <pass>
|
||||
proc /proc proc defaults 0 0
|
||||
E_O_FSTAB
|
||||
fi
|
||||
for part in `seq 1 ${NUMPARTITIONS}`; do
|
||||
eval "PARTITION=\"\${PARTITION${part}}\""
|
||||
OLDIFS="${IFS}"
|
||||
IFS=:
|
||||
x=0
|
||||
for partdata in ${PARTITION}; do
|
||||
eval "partdata${x}=\"${partdata}\""
|
||||
x=$(( x+1 ))
|
||||
done
|
||||
IFS="${OLDIFS}"
|
||||
|
||||
case "${partdata2}" in
|
||||
xfs)
|
||||
has_xfs=1
|
||||
;;
|
||||
reiserfs)
|
||||
has_reiserfs=1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "${partdata2}" = "swap" ]; then
|
||||
echo "/dev/${device}${part} none swap sw 0 0" >> ${prefix}/etc/fstab
|
||||
else
|
||||
echo "/dev/${device}${part} ${partdata3} ${partdata2} ${partdata4} 0 1" >> ${prefix}/etc/fstab
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
#
|
||||
# Finally we can install any required packages for the given root
|
||||
# filesystem
|
||||
#
|
||||
case "${fs}" in
|
||||
xfs)
|
||||
installDebianPackage ${prefix} xfsprogs
|
||||
;;
|
||||
reiserfs)
|
||||
installDebianPackage ${prefix} reiserfsprogs
|
||||
;;
|
||||
esac
|
||||
if [ $has_xfs -eq 1 ]; then
|
||||
installDebianPackage ${prefix} xfsprogs
|
||||
fi
|
||||
if [ $has_reiserfs -eq 1 ]; then
|
||||
installDebianPackage ${prefix} reiserfsprogs
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user