Merge remote-tracking branch 'origin/pr/196'
authorMichael Prokop <mika@grml.org>
Fri, 25 Nov 2022 13:33:35 +0000 (14:33 +0100)
committerMichael Prokop <mika@grml.org>
Fri, 25 Nov 2022 13:33:35 +0000 (14:33 +0100)
chroot-script
packer/Makefile
packer/debian64.bats
packer/debian64.json
packer/debian64_provision.sh

index 20638a5..e499c95 100755 (executable)
@@ -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
@@ -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
index 9d60c35..27f91b0 100644 (file)
@@ -25,6 +25,10 @@ clean:
        $(RM) *.o *.so
        rm -rf local_dir
 
+# Debian 12
+bookworm: clean fake-uname.so install
+       packer build -var debian_version=$@ -var grml_debootstrap_version=$(GRML_DEBOOTSTRAP_VERSION) -var grml_debootstrap_local_path=$(GRML_DEBOOTSTRAP_LOCAL_PATH) debian64.json
+
 # Debian 11
 bullseye: clean fake-uname.so install
        packer build -var debian_version=$@ -var grml_debootstrap_version=$(GRML_DEBOOTSTRAP_VERSION) -var grml_debootstrap_local_path=$(GRML_DEBOOTSTRAP_LOCAL_PATH) debian64.json
index 80481a5..3e5818c 100644 (file)
@@ -17,7 +17,7 @@ teardown() {
 @test "debian_version exists and is valid version" {
   run cat "${mountpath}/etc/debian_version"
   [ "$status" -eq 0 ]
-  [[ "$output" == [0-9]*.[0-9]* ]] || [[ "$output" == 'bullseye/sid' ]]
+  [[ "$output" == [0-9]*.[0-9]* ]] || [[ "$output" == 'bookworm/sid' ]]
 }
 
 @test "kernel exists" {
index 15c14bd..37c71d8 100644 (file)
@@ -11,7 +11,7 @@
       "hard_drive_interface": "sata",
       "headless": false,
       "iso_checksum": "sha1:{{ user `grml_iso_checksum` }}",
-      "iso_url": "http://download.grml.org/{{ user `grml_type` }}_{{ user `grml_version` }}.iso",
+      "iso_url": "http://download.grml.org/devel/{{ user `grml_type` }}_{{ user `grml_version` }}.iso",
       "output_directory": "{{ user `grml_type` }}_output",
       "shutdown_command": "shutdown -h now",
       "ssh_password": "grml",
@@ -74,9 +74,9 @@
     "debian_version": "bullseye",
     "grml_debootstrap_local_path": "doesnotexist",
     "grml_debootstrap_version": "latest",
-    "grml_iso_checksum": "c1d94bb237d75ec326fb9a3b2bb980c93b1eb23c",
+    "grml_iso_checksum": "813a999762a4b1ff20a3d7a757339d3ae822c547",
     "grml_type": "grml64-full",
-    "grml_version": "2021.07"
+    "grml_version": "2022.11-rc1"
   }
 }
 
index 2a416de..98b4d37 100644 (file)
@@ -234,7 +234,7 @@ grml_debootstrap_execution() {
 apply_nic_workaround() {
   # release specific stuff
   case "$DEBIAN_VERSION" in
-    stretch|buster|bullseye|unstable|sid)
+    stretch|buster|bullseye|bookworm|unstable|sid)
       ;;
     *)
       echo "* Debian $DEBIAN_VERSION doesn't require NIC workaround"