From 6860a04023cb2e3b60d31f792e35e59fc7ca7344 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sun, 5 Dec 2010 18:45:49 +0100 Subject: introduce experimental Nilfs2 support --- src/core/libs/lib-blockdevices-filesystems.sh | 30 ++++++++++++++++----------- src/core/libs/lib-ui-interactive.sh | 9 ++++++-- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh index 897c97e..4038edb 100644 --- a/src/core/libs/lib-blockdevices-filesystems.sh +++ b/src/core/libs/lib-blockdevices-filesystems.sh @@ -483,6 +483,7 @@ process_filesystems () [ $fs_type = 'xfs' ] && needs_pkg=xfsprogs [ $fs_type = 'jfs' ] && needs_pkg=jfsutils [ $fs_type = 'reiserfs' ] && needs_pkg=reiserfsprogs + [ $fs_type = 'nilfs2' ] && needs_pkg=nilfs-utils [[ $fs_type =~ ext.* ]] && needs_pkg=e2fsprogs [ $fs_type = 'vfat' ] && needs_pkg=dosfstools [ $fs_type = 'dm_crypt' ] && needs_pkg=cryptsetup @@ -742,6 +743,7 @@ process_filesystem () ext2) mke2fs "$part" $fs_opts >$LOG 2>&1; ret=$? ;; ext3) mke2fs -j $part $fs_opts >$LOG 2>&1; ret=$? ;; ext4) mkfs.ext4 $part $fs_opts >$LOG 2>&1; ret=$? ;; #TODO: installer.git uses mke2fs -t ext4 -O dir_index,extent,uninit_bg , which is best? + nilfs2) mkfs.nilfs2 "$part" $fs_opts >$LOG 2>&1; ret=$? ;; vfat) mkfs.vfat $part $fs_opts >$LOG 2>&1; ret=$? ;; swap) if [ -z "$fs_label" ]; then mkswap $part $fs_opts >$LOG 2>&1; ret=$? @@ -781,6 +783,9 @@ process_filesystem () elif [ "$fs_type" = reiserfs ] then reiserfstune -l $fs_label $part >$LOG 2>&1; ret=$? + elif [ "$fs_type" = nilfs2 ] + then + nilfs-tune -L $fs_label $part >$LOG 2>&1; ret=$? elif [ "$fs_type" = ext2 -o "$fs_type" = ext3 -o "$fs_type" = ext4 ] then tune2fs -L $fs_label $part >$LOG 2>&1; ret=$? @@ -849,18 +854,19 @@ process_filesystem () get_filesystem_program () { [ -z "$1" ] && die_error "get_filesystem_program needs a filesystem id as \$1" - [ $1 = swap ] && echo mkswap && return 0 - [ $1 = ext2 ] && echo mkfs.ext2 && return 0 - [ $1 = ext3 ] && echo mkfs.ext3 && return 0 - [ $1 = ext4 ] && echo mkfs.ext4 && return 0 - [ $1 = reiserfs ] && echo mkreiserfs && return 0 - [ $1 = xfs ] && echo mkfs.xfs && return 0 - [ $1 = jfs ] && echo mkfs.jfs && return 0 - [ $1 = vfat ] && echo mkfs.vfat && return 0 - [ $1 = lvm-pv ] && echo pvcreate && return 0 - [ $1 = lvm-vg ] && echo vgcreate && return 0 - [ $1 = lvm-lv ] && echo lvcreate && return 0 - [ $1 = dm_crypt ] && echo cryptsetup && return 0 + [ $1 = swap ] && echo mkswap && return 0 + [ $1 = ext2 ] && echo mkfs.ext2 && return 0 + [ $1 = ext3 ] && echo mkfs.ext3 && return 0 + [ $1 = ext4 ] && echo mkfs.ext4 && return 0 + [ $1 = reiserfs ] && echo mkreiserfs && return 0 + [ $1 = nilfs2 ] && echo mkfs.nilfs2 && return 0 + [ $1 = xfs ] && echo mkfs.xfs && return 0 + [ $1 = jfs ] && echo mkfs.jfs && return 0 + [ $1 = vfat ] && echo mkfs.vfat && return 0 + [ $1 = lvm-pv ] && echo pvcreate && return 0 + [ $1 = lvm-vg ] && echo vgcreate && return 0 + [ $1 = lvm-lv ] && echo lvcreate && return 0 + [ $1 = dm_crypt ] && echo cryptsetup && return 0 return 1 } diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 4351e48..6ac2478 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -263,6 +263,7 @@ interactive_autoprepare() which `get_filesystem_program xfs` &>/dev/null && FSOPTS="$FSOPTS xfs XFS" which `get_filesystem_program jfs` &>/dev/null && FSOPTS="$FSOPTS jfs JFS" which `get_filesystem_program vfat` &>/dev/null && FSOPTS="$FSOPTS vfat VFAT" + which `get_filesystem_program nilfs2` &>/dev/null && FSOPTS="$FSOPTS nilfs2 Nilfs2_EXPERIMENTAL" ask_number "Enter the size (MiB) of your /boot partition. Recommended size: 100MiB\n\nDisk space left: $BLOCKDEVICE_SIZE MiB" 16 $BLOCKDEVICE_SIZE 100 || return 1 BOOT_PART_SIZE=$ANSWER_NUMBER @@ -401,6 +402,7 @@ interactive_filesystem () # ext 3 raw/lvm-lv/dm_crypt optional optional no no optional no # ext 4 raw/lvm-lv/dm_crypt optional optional no no optional no # reiserFS raw/lvm-lv/dm_crypt optional optional no no optional no + # Nilfs2 raw/lvm-lv/dm_crypt optional optional no no optional no # xfs raw/lvm-lv/dm_crypt optional optional no no optional no # jfs raw/lvm-lv/dm_crypt optional optional no no optional no # vfat raw/lvm-lv/dm_crypt optional opt i guess no no optional no @@ -417,6 +419,7 @@ interactive_filesystem () [ $part_type = raw -o $part_type = lvm-lv -o $part_type = dm_crypt ] && which `get_filesystem_program ext3` &>/dev/null && FSOPTS="$FSOPTS ext3 Ext3" [ $part_type = raw -o $part_type = lvm-lv -o $part_type = dm_crypt ] && which `get_filesystem_program ext4` &>/dev/null && FSOPTS="$FSOPTS ext4 Ext4" [ $part_type = raw -o $part_type = lvm-lv -o $part_type = dm_crypt ] && which `get_filesystem_program reiserfs` &>/dev/null && FSOPTS="$FSOPTS reiserfs Reiser3" + [ $part_type = raw -o $part_type = lvm-lv -o $part_type = dm_crypt ] && which `get_filesystem_program nilfs2` &>/dev/null && FSOPTS="$FSOPTS nilfs2 Nilfs2_EXPERIMENTAL" [ $part_type = raw -o $part_type = lvm-lv -o $part_type = dm_crypt ] && which `get_filesystem_program xfs` &>/dev/null && FSOPTS="$FSOPTS xfs XFS" [ $part_type = raw -o $part_type = lvm-lv -o $part_type = dm_crypt ] && which `get_filesystem_program jfs` &>/dev/null && FSOPTS="$FSOPTS jfs JFS" [ $part_type = raw -o $part_type = lvm-lv -o $part_type = dm_crypt ] && which `get_filesystem_program vfat` &>/dev/null && FSOPTS="$FSOPTS vfat VFAT" @@ -458,13 +461,15 @@ interactive_filesystem () fi # ask label, if relevant - if [ "$fs_create" == yes ] && [ "$fs_type" = lvm-vg -o "$fs_type" = lvm-lv -o "$fs_type" = dm_crypt ] + fs_label_mandatory=('lvm-vg' 'lvm-lv' 'dm_crypt') + fs_label_optional=('ext2' 'ext3' 'ext4' 'reiserfs' 'nilfs2' 'xfs' 'jfs' 'vfat') + if [ "$fs_create" == yes ] && check_is_in "$fs_type" "${fs_label_mandatory[@]}" then default= [ -n "$fs_label" ] && default="$fs_label" ask_string "Enter the label/name for this $fs_type on $part (Mandatory for this type of FS!)" "$default" || return 1 #TODO: check that you can't give LV's labels that have been given already or the installer will break. fs_label=$ANSWER_STRING - elif [ "$fs_create" == yes ] && [ "$fs_type" = ext2 -o "$fs_type" = ext3 -o "$fs_type" = ext4 -o "$fs_type" = reiserfs -o "$fs_type" = xfs -o "$fs_type" = jfs -o "$fs_type" = vfat ] + elif [ "$fs_create" == yes ] && check_is_in "$fs_type" "${fs_label_optional[@]}" then default= [ -n "$fs_label" ] && default="$fs_label" -- cgit v1.2.3-54-g00ecf