From: Michael Prokop Date: Fri, 25 Nov 2022 13:32:00 +0000 (+0100) Subject: Merge remote-tracking branch 'origin/pr/202' X-Git-Tag: v0.101~2 X-Git-Url: http://git.grml.org/?a=commitdiff_plain;h=7bab80c89ec11649062162119e0ba28d18e9fa58;hp=-c;p=grml-debootstrap.git Merge remote-tracking branch 'origin/pr/202' --- 7bab80c89ec11649062162119e0ba28d18e9fa58 diff --combined chroot-script index 498451f,a033d8d..007792f --- a/chroot-script +++ b/chroot-script @@@ -479,16 -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 @@@ -530,6 -525,28 +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 @@@ -751,7 -768,8 +773,8 @@@ trap signal_handler HUP INT QUIT TER 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