KVM host image creator.Jessica Lockwood
Révision | 5f490af6e4ff89322e3850114a6ed056515a9bba (tree) |
---|---|
l'heure | 2020-06-28 21:16:42 |
Auteur | Tatsuki SUGIURA <sugi@osdn...> |
Commiter | Tatsuki SUGIURA |
Fix rewriting loopback device name on grub config.
@@ -167,7 +167,7 @@ class ImageCreator | ||
167 | 167 | system("chroot", dir, "grub-mkconfig", "-o", "/boot/grub/grub.cfg") or raise "grub-mkconfig fails." |
168 | 168 | system(*%W(grub-install --no-floppy --grub-mkdevicemap=#{dir}/boot/grub/device.map --root-directory=#{dir} #{root_dev})) or raise "grub-install failed." |
169 | 169 | cfg = File.read "#{dir}/boot/grub/grub.cfg" |
170 | - cfg.gsub! %r{mapper/loop0p}, "sda" | |
170 | + cfg.gsub! %r{mapper/loop\d+p}, "sda" | |
171 | 171 | File.write "#{dir}/boot/grub/grub.cfg", cfg |
172 | 172 | |
173 | 173 | unless Array(run_cmds).empty? |