From 8b619dd8609e4acaa58af11ba5aa52087c020e8e Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 1 Nov 2008 17:41:41 +0100 Subject: several fixes and stuff related to partitions and filesystems --- src/lib/lib-blockdevices-filesystems.sh | 16 +++++----------- src/profiles/profile-dieter | 30 ++++++++++++++++++++++++------ 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/src/lib/lib-blockdevices-filesystems.sh b/src/lib/lib-blockdevices-filesystems.sh index e038ddc..182c4a2 100644 --- a/src/lib/lib-blockdevices-filesystems.sh +++ b/src/lib/lib-blockdevices-filesystems.sh @@ -1,6 +1,6 @@ #!/bin/sh -# procedural code from quickinst functionized. +# procedural code from quickinst functionized and fixed. # there were functions like this in the setup script too, with some subtle differences. see below # NOTE: why were the functions in the setup called CHROOT_mount/umount? this is not chrooting ? target_special_fs () @@ -189,7 +189,7 @@ mapdev() { # Create and mount filesystems in our destination system directory. # # args: -# $1 domk: Whether to make the filesystem or use what is already there +# $1 domk: Whether to make the filesystem or use what is already there (yes/no) # $2 device: Device filesystem is on # $3 fstype: type of filesystem located at the device (or what to create) # $4 dest: Mounting location for the destination system @@ -217,7 +217,7 @@ _mkfs() { [ "${_fstype}" = "${fs}" ] && knownfs=1 && break done - [ $knownfs -eq 0 ] && DIALOG --msgbox "unknown fstype ${_fstype} for ${_device}" 0 0 && return 1 + [ $knownfs -eq 0 ] && show_warning "unknown fstype ${_fstype} for ${_device}" && return 1 # if we were tasked to create the filesystem, do so if [ "${_domk}" = "yes" ]; then local ret @@ -230,20 +230,14 @@ _mkfs() { vfat) mkfs.vfat ${_device} >$LOG 2>&1; ret=$? ;; # don't handle anything else here, we will error later esac - if [ $ret != 0 ]; then - DIALOG --msgbox "Error creating filesystem ${_fstype} on ${_device}" 0 0 - return 1 - fi + [ $ret != 0 ] && show_warning "Error creating filesystem ${_fstype} on ${_device}" && return 1 sleep 2 fi # create our mount directory mkdir -p ${_dest}${_mountpoint} # mount the bad boy mount -t ${_fstype} ${_device} ${_dest}${_mountpoint} >$LOG 2>&1 - if [ $? != 0 ]; then - DIALOG --msgbox "Error mounting ${_dest}${_mountpoint}" 0 0 - return 1 - fi + [ $? != 0 ] && show_warning "Error mounting ${_dest}${_mountpoint}" && return 1 fi # add to temp fstab diff --git a/src/profiles/profile-dieter b/src/profiles/profile-dieter index 6bd4dda..05e03fc 100644 --- a/src/profiles/profile-dieter +++ b/src/profiles/profile-dieter @@ -7,6 +7,7 @@ phase_preparation () notify "A few manual things need to happen first..." if ask_yesno "Do you want to (re)-configure your networking?" then + #TODO: which function do i need here? donetwork #configure network by using library else notify "Ok. skipping network config" @@ -19,18 +20,35 @@ phase_preparation () #TODO: find something against svn's interactive ssl cert checking. http://www.7php.net/svn-client-certificate-authentication-cache/ might help - notify "**** From now on. everything will be automatic. Enjoy the show!" + notify "**** From now on. everything will be automatic. Enjoy the show!" # not true: svn will complain about ssl cert + you need pass for dm_crypt execute worker runtime_packages } worker_prepare_disks () { - #TODO: fix all this, using the libs - #cfdisk - #encrypt lvm - #make fs - #mount, where? /mnt? + #TODO: integrate this stuff into the functions in the libs + do error checking and handling + sfdisk /dev/sda << EOF +,10,L,* +,,L +EOF + modprobe dm-crypt || die_error "Cannot modprobe dm-crypt" + modprobe aes-x86-64 || modprobe aes-i586 || die_error "Cannot modprobe aes-x86-64 or aes-i586" + cryptsetup -c aes-xts-plain -y -s 512 luksFormat /dev/sda2 + cryptsetup luksOpen /dev/sda2 sda2_crypt + pvcreate /dev/mapper/sda2_crypt + vgcreate cryptpool /dev/mapper/sda2_crypt + lvcreate -L 2G -n swap cryptpool + lvcreate -L 500M -n tmp cryptpool + lvcreate -L 10G -n home cryptpool + lvcreate -L 10G -n root cryptpool + lvcreate -L 3G -n var cryptpool + mke2fs -j /dev/cryptpool/home && mount /dev/cryptpool/home $TARGET_DIR/home + mke2fs -j /dev/cryptpool/root + mke2fs -j /dev/cryptpool/tmp + mke2fs -j /dev/cryptpool/var + + #TODO fstab? auto-add to fstab with libs? auto mkdir's on target_dir? true } -- cgit v1.2.3-54-g00ecf