From 8c3af60790f0669453c0418638d301e336af9ac5 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sat, 12 Dec 2020 18:37:19 -0500 Subject: cmd/installer-pc: Support foreign installation --- diff --git a/NEWS b/NEWS index 9e19e63..ca1b39d 100644 --- a/NEWS +++ b/NEWS @@ -21,6 +21,8 @@ New features: packages marked "Essential: yes" and their dependencies were installed, which was a long-standing misuse of the "Essential" field. + * "prokit installer-pc" now supports foreign installations using an + "-F" option. Error handling and bug fixes: diff --git a/locale/en_US.sh b/locale/en_US.sh index 9897086..60772c2 100644 --- a/locale/en_US.sh +++ b/locale/en_US.sh @@ -105,7 +105,7 @@ msg_prokit_cmd_build_not_a_dir='Not a directory: %s' # src/cmd/installer-pc.sh msg_prokit_cmd_installer_pc_summary='install a PC system onto a block device' -msg_prokit_cmd_installer_pc_usage='-a -p [-m ] '\ +msg_prokit_cmd_installer_pc_usage='-a -p [-m ] [-F] '\ ' ' msg_prokit_cmd_installer_pc_dd='Clearing MBR and partition table...' msg_prokit_cmd_installer_pc_dd_fail='Failed to clear MBR and partition table' diff --git a/src/cmd/installer-pc.sh b/src/cmd/installer-pc.sh index d85558b..fc58331 100644 --- a/src/cmd/installer-pc.sh +++ b/src/cmd/installer-pc.sh @@ -18,7 +18,7 @@ # along with the ProteanOS Development Kit. If not, see # . -cmd_installer_pc_optstring='a:p:m:' +cmd_installer_pc_optstring='a:p:m:F' _cmd_installer_pc_log_print() { @@ -76,6 +76,7 @@ _cmd_installer_pc_make_partition_and_fs() cmd_installer_pc_main() { + local foreign= local suite= local dev= local profile= @@ -104,6 +105,12 @@ cmd_installer_pc_main() return 1 fi + if [ "x${cmd_installer_pc_opt_F+set}" = 'xset' ]; then + foreign=true + else + foreign=false + fi + suite="${1}" dev="${2}" shift 2 @@ -133,7 +140,7 @@ cmd_installer_pc_main() if ! install_system "${cmd_installer_pc_opt_m-}" "${suite}" \ "${cmd_installer_pc_opt_a-}" \ "${cmd_installer_pc_opt_p-}" \ - "${root}" false; then + "${root}" "${foreign}"; then block_umount "${root}" return 2 fi -- cgit v0.9.1