X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=chroot-script;h=e499c9568fd3b84a65d367e0888553678411501d;hb=4a2a0b29d90cc55c1e1083350a3279cc669720dc;hp=cba0428552ea6c549b4996ed0f5ece7c18c140e4;hpb=4deb6e8e1b4ddb29e7c1725729267b589eb404d0;p=grml-debootstrap.git diff --git a/chroot-script b/chroot-script index cba0428..e499c95 100755 --- a/chroot-script +++ b/chroot-script @@ -479,11 +479,16 @@ createfstab(){ EOF if [ -n "$TARGET_UUID" ] ; then - local rootfs_mount_options=",errors=remount-ro" + local rootfs_mount_options="" + + if [ -z "${FILESYSTEM}" ] ; then + FILESYSTEM="$(blkid -o value -s TYPE /dev/disk/by-uuid/"${TARGET_UUID}")" + fi + case "${FILESYSTEM}" in - f2fs) - # errors=remount-ro is unsupported, see https://github.com/grml/grml-debootstrap/issues/163 - rootfs_mount_options="" + # errors=remount-ro is supported only by a few file systems + ext*|exfat|fat|jfs|nilfs2|vfat) + rootfs_mount_options=",errors=remount-ro" ;; esac @@ -525,6 +530,28 @@ fstab() { } # }}} +# ensure we have according filesystem tools available {{{ +install_fs_tools() { + local pkg="" + + # note: this is supposed to be coming either via command lines' + # $_opt_filesystem or via createfstab() + case "${FILESYSTEM}" in + jfs) + pkg="jfsutils" + ;; + xfs) + pkg="xfsprogs" + ;; + esac + + if [ -n "${pkg:-}" ] && ! dpkg --list "${pkg}" 2>/dev/null | grep -q '^ii' ; then + echo "Filesystem package ${pkg} not present, installing now" + DEBIAN_FRONTEND=$DEBIAN_FRONTEND $APTINSTALL "${pkg}" + fi +} +# }}} + # set up hostname {{{ hostname() { if [ -n "$HOSTNAME" ] ; then @@ -576,7 +603,7 @@ initrd() { echo "Generating initrd." if [ "$INITRD_GENERATOR" = 'dracut' ] ; then DEBIAN_FRONTEND=$DEBIAN_FRONTEND $APTINSTALL dracut - dracut -N --kver "$KERNELVER" --fstab --add-fstab /etc/fstab --force $INITRD_GENERATOR_OPTS + dracut --no-hostonly --kver "$KERNELVER" --fstab --add-fstab /etc/fstab --force --reproducible $INITRD_GENERATOR_OPTS else update-initramfs -c -t -k "$KERNELVER" $INITRD_GENERATOR_OPTS fi @@ -751,7 +778,8 @@ trap signal_handler HUP INT QUIT TERM for i in chrootmirror grmlrepos backportrepos kernelimg_conf \ kernel packages extrapackages reconfigure hosts \ - default_locales timezone fstab hostname initrd grub_install passwords \ + default_locales timezone fstab install_fs_tools hostname \ + initrd grub_install passwords \ custom_scripts upgrade_system remove_apt_cache services \ remove_chrootmirror; do if stage $i ; then