aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/bsdinstall/scripts/zfsboot
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix error in bsdinstall where additional filesystems cannot be mountedAllan Jude2016-05-231-1/+5
| | | | | | | | | | | | | | Do not set canmount=noauto on the boot environment at create time, because this causes / to not be mounted, and since the chroot is read only, new mountpoints cannot be created. The property is set later, when other properties are adjusted Reported by: HardenedBSD Sponsored by: ScaleEngine Inc. Notes: svn path=/head/; revision=300509
* bsdinstall/zfsboot GPT+BIOS+GELI installs now make use of GELIBOOTAllan Jude2016-05-221-60/+84
| | | | | | | | | | | | | | | In this configuration, a separate bootpool is not required. This allows ZFS Boot Environments to be used with GELI encrypted ZFS pools. Support for GPT+EFI+GELI is planned for the future. Tested by: Joseph Mingrone, HardenedBSD Relnotes: yes Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D5869 Notes: svn path=/head/; revision=300436
* Fix default ZFS layout to work better by default with sysutils/beadmAllan Jude2016-05-221-1/+1
| | | | | | | | | | | | The root file system is mounted early via vfs.root.mountfrom. The canmount=noauto property only affects the zfs rc.d script. This ensures that the 'default' BE is not mounted overtop of another BE when one is selected from the beastie menu Sponsored by: ScaleEngine Inc. Notes: svn path=/head/; revision=300425
* Fix typo in comments for the zfsboot scriptBaptiste Daroussin2016-05-221-1/+1
| | | | | | | Submitted by: Colby Swandale <colby@taplaboratories.com.au> (via github) Notes: svn path=/head/; revision=300417
* bsdinstall/zfsboot: Do not mirror swap when swapsize is 0Allan Jude2016-05-101-1/+1
| | | | | | | | | PR: 209415 Submitted by: Ganael LAPLANCHE <ganael.laplanche@corp.ovh.com> MFC after: 2 weeks Notes: svn path=/head/; revision=299366
* usr.sbin/bsdconfig: minor spelling fixes on comments.Pedro F. Giffuni2016-05-011-1/+1
| | | | | | | No functional change. Notes: svn path=/head/; revision=298884
* Add a new installation type to bsdinstall/zfsboot: BIOS+UEFIAllan Jude2016-04-191-16/+52
| | | | | | | | | | | | | | Installs both pmbr+gptzfsboot as well as boot1.efifat in separate partitions The resulting system can be booted with either UEFI or BIOS/CSM. Preference is controlled by the user's firmware boot settings. This is now the default for zfsboot installs PR: 208629 Submitted by: Galael LAPLANCHE <ganael.laplanche@corp.ovh.com> (original version) Notes: svn path=/head/; revision=298243
* bsdinstall/zfsboot should create /tmp and /var/tmp if they do not existAllan Jude2016-04-081-0/+2
| | | | | | | | | | PR: 208629 PR: 208568 Submitted by: Galael LAPLANCHE <ganael.laplanche@corp.ovh.com> MFC after: 2 weeks Notes: svn path=/head/; revision=297713
* Do not add swap to fstab when swapsize is 0Allan Jude2016-04-081-2/+2
| | | | | | | | | | | | If a user requested encrypted swap, but 0 sized, it would still be added to fstab PR: 208630 Submitted by: Ganael LAPLANCHE <ganael.laplanche@corp.ovh.com> MFC after: 2 weeks Sponsored by: ScaleEngine Inc. Notes: svn path=/head/; revision=297712
* Remove 50% ZFS conditional from bsdinstall/zfsbootAllan Jude2016-03-171-5/+5
| | | | | | | | | | | Remove the requirement that the resulting partition table be atleast 50% ZFS PR: 208094 Requested by: brooks Sponsored by: ScaleEngine Inc. Notes: svn path=/head/; revision=296988
* The zfsboot automated part of bsdinstall now supports UEFIAllan Jude2016-01-301-68/+47
| | | | | | | | | MFC after: 3 days Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D4960 Notes: svn path=/head/; revision=295074
* Never 4k align the MBR bootpool because zfsldr can not deal with a gapAllan Jude2016-01-161-1/+3
| | | | | | | | | | | | | | | | | | | If the bootpool does not start at the first sector of the BSD partition then zfsldr seeks to the wrong offset inside the ZFS vdev label, and is unable to find zfsboot, so the system does not boot If 4k alignment is requested, align the BSD partition in the MBR table, and align the swap and data pool, but the bootpool must start at sector 1 While here, if 4k alignment is requested, disable MBR CHS alignment, as this results in not-4k aligned partitions. Reported by: Alex Wilkinson MFC after: 5 days Sponsored by: ScaleEngine Inc. Notes: svn path=/head/; revision=294191
* Replace `return' outside of function with exitDevin Teske2015-09-111-1/+1
| | | | | | | | | MFC after: 3 days X-MFC-to: stable/10 Pointy hat to: me Notes: svn path=/head/; revision=287695
* Add support for two workarounds for known issues booting GPT in legacy mode ↵Allan Jude2015-07-181-3/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on some hardware For Lenovo laptops with buggy bios (x220, t420, t520): Write the 0xee entry into the second slot in the pmbr instead of the first For some Dell and HP models: The BIOS gives a warning message when booting in legacy mode from a GPT partitioned disk where the 0xee partition in the pmbr is not flagged active For models known to have this problem, mark the pmbr active during installation Use smbios data to identify machines known to be affected by any of the above, and offer the user the option to apply the workaround In bsdinstall's ufs auto mode (autopart partition wizard): Allow users to select which type of partition table to use Keep current defaults: MBR for BIOS, GPT for UEFI This allows users to choose GPT for legacy boot if they wish PR: 184910 PR: 194359 Reviewed by: Michael Dexter Approved by: marcel MFC after: 3 days X-MFC-With: r285594 Relnotes: yes Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D3091 Notes: svn path=/head/; revision=285679
* Make bsdinstall's zfsboot script align partitions to 4k/1m when the user ↵Allan Jude2015-07-141-22/+39
| | | | | | | | | | | | | | | requests it PR: 195174 Reviewed by: darius Approved by: brueffer MFC after: 3 days Relnotes: yes Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D3062 Notes: svn path=/head/; revision=285557
* Set a mountpoint on the root of the pool so user-created datasets have a ↵Allan Jude2015-07-141-1/+10
| | | | | | | | | | | | | | mountpoint to inherit Reviewed by: darius Approved by: brueffer MFC after: 3 days Relnotes: yes Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D3063 Notes: svn path=/head/; revision=285554
* Have bsdinstall's zfsboot script make /var/audit its own dataset, so it is ↵Allan Jude2015-07-141-0/+1
| | | | | | | | | | | | | | not part of the OS boot environment PR: 199864 Submitted by: Jason Unovitch Approved by: brueffer MFC after: 3 days Relnotes: yes Differential Revision: https://reviews.freebsd.org/D2861 Notes: svn path=/head/; revision=285553
* Fix a typo in bsdinstallAllan Jude2015-07-131-1/+1
| | | | | | | | | | | | | | A variable was misspelled resulting in chmod executing on the installer instead of on the target chroot PR: 191402 Submitted by: Martin Simmons <martin@lispworks.com> Approved by: brueffer MFC after: 3 days Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D3061 Notes: svn path=/head/; revision=285482
* Fix a syntax error in bsdinstall/zfsbootAllan Jude2015-05-221-1/+1
| | | | | | | | | | | | Differential Revision: https://reviews.freebsd.org/D2571 Submitted by: Michael Dexter Approved by: dteske MFC after: 1 week X-MFC-With: r283023, r282443 Sponsored by: ScaleEngine Inc. Notes: svn path=/head/; revision=283288
* bsdinstall/zfsboot: Skip adding swap lines to /etc/fstab if swap is 0 sizedAllan Jude2015-05-171-0/+4
| | | | | | | | | | Differential Revision: https://reviews.freebsd.org/D2571 Reviewed by: dim Approved by: eadler (mentor) Sponsored by: ScaleEngine Inc. Notes: svn path=/head/; revision=283023
* Add a sanity check to the swap size in zfsboot of bsdinstallAllan Jude2015-05-051-4/+22
| | | | | | | | | | | | | | Loop until the user enters a valid size (>100mb or 0) Differential Revision: https://reviews.freebsd.org/D2299 Reported By: Shawn Webb Reviewed by: roberto Approved by: brd MFC after: 2 weeks Sponsored by: ScaleEngine Inc. Notes: svn path=/head/; revision=282443
* Add "GELI Passphrase:" prompt to boot loader.Devin Teske2015-04-161-0/+3
| | | | | | | | | | | | | | | | | | A new loader.conf(5) option of geom_eli_passphrase_prompt="YES" will now allow you to enter your geli(8) root-mount credentials prior to invoking the kernel. See check-password.4th(8) for details. Differential Revision: https://reviews.freebsd.org/D2105 Reviewed by: imp, kmoore Discussed on: -current MFC after: 3 days X-MFC-to: stable/10 Relnotes: yes Notes: svn path=/head/; revision=281616
* Unbreak ZFS+GELI install option.Devin Teske2015-04-061-1/+1
| | | | | | | | | | | | Reported by: delphij Submitted by: delphij Pointy hat to: dteske (me) MFC after: 3 days X-MFC-to: stable/10 stable/9 X-MFC-with: r281160 Notes: svn path=/head/; revision=281167
* Fix permissions on ZFS root encryption key (644 -> 600).Devin Teske2015-04-061-0/+3
| | | | | | | | | | MFC after: 3 days X-MFC-to: stable/10 stable/9 Security: CVE-2015-1415 Reported by: Pierre Kim Notes: svn path=/head/; revision=281160
* Whoops! "arc commit --revision" != "arc diff --update"Devin Teske2015-04-011-3/+0
| | | | Notes: svn path=/head/; revision=280939
* Add "GELI Passphrase:" prompt to boot loader.Devin Teske2015-04-011-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Add "GELI Passphrase:" prompt to boot loader. A new loader.conf(5) option of geom_eli_passphrase_prompt="YES" will now allow you to enter your geli(8) root-mount credentials prior to invoking the kernel. See check-password.4th(8) for details. Differential Revision: https://reviews.freebsd.org/D2105 Reviewed by: (your name[s] here) MFC after: 3 days X-MFC-to: stable/10 Relnotes: yes Test Plan: Drop a head copy of check-password.4th into /boot and then apply the patch (only the patch to /boot/check-password.4th is required; no other changes are required but you do have to have a HEAD copy of check-password.4th to apply the patch). NB: The rest of your /boot files can be up to 2 years old but no older. NB: The test won't work unless your kernel has the following change https://svnweb.freebsd.org/base?view=revision&revision=273489 Now, put into /boot/loader.conf: geom_eli_passphrase_prompt="YES" and reboot. You should be prompted for a GELI passphrase before the menu (if enabled), just after loading loader.conf(5). NB: It doesn't matter if you're using GELI or not. However if you are using GELI and a sufficiently new enough release (has SVN r273489) and you entered the proper passphrase to mount your GELI encrypted root device(s), you should notice that the boot process did not stop (you went from loader all the way to login). Reviewers: cperciva, allanjude, scottl, kmoore Subscribers: jkh, imp Differential Revision: https://reviews.freebsd.org/D2105 Notes: svn path=/head/; revision=280938
* Update copyright(s)Devin Teske2015-03-211-2/+2
| | | | | | | | MFC after: 3 days X-MFC-to: stable/10 Notes: svn path=/head/; revision=280311
* Whitespace cleanup(s).Devin Teske2015-03-211-43/+49
| | | | | | | | MFC after: 3 days X-MFC-to: stable/10 Notes: svn path=/head/; revision=280310
* Fix bsdinstall when working with geli boot disksSteven Hartland2015-01-181-0/+3
| | | | | | | | | | | PR: 196790 Differential Revision: https://reviews.freebsd.org/D566 Submitted by: Michael Gmelin <grembo@FreeBSD.org> MFC after: 2 weeks Sponsored by: Multiplay Notes: svn path=/head/; revision=277333
* Switch zfsboot installer force 4K option to use vfs.zfs.min_auto_ashift=12Steven Hartland2014-12-211-46/+19
| | | | | | | | | | | | | Previously we used gnop(8) to fake 4K sector size disks but ZFS now has a sysctl to control this when creating new top level vdev's so use that instead. Differential Revision: D566 MFC after: 1 month Sponsored by: Multiplay Notes: svn path=/head/; revision=276027
* Change the /var dataset in the default ZFS layout to have theAllan Jude2014-09-281-1/+1
| | | | | | | | | | | | | | | ZFS property canmount=off so that /var/db/pkg and other such directories are part of the / dataset, and only /var/mail, /var/log, and /var/crash are excluded from the ZFS boot environment (beadm). PR: 193971 Approved by: jmg MFC after: ASAP Relnotes: yes Sponsored by: ScaleEngine Inc. Notes: svn path=/head/; revision=272274
* Make the root-on-zfs part of the installer warn a user who booted the ↵Allan Jude2014-09-141-0/+58
| | | | | | | | | | | | | installer via UEFI that we do not support booting ZFS via UEFI yet PR: 193595 Approved by: nwhitehorn MFC after: 5 days Sponsored by: ScaleEngine Inc. CR: https://reviews.freebsd.org/D782 Notes: svn path=/head/; revision=271563
* Add ZFS support to the bsdinstall partition editor and sade.Nathan Whitehorn2014-09-131-2/+0
| | | | | | | | Submitted by: Kurt Lidl (original version) MFC after: 6 weeks Notes: svn path=/head/; revision=271539
* Fix syntax error thrown at the point of creating the root pool, caused byDevin Teske2014-05-221-12/+17
| | | | | | | | | | | | | | | | | | | | | | an embedded newline appearing within the options string surrounded by double-quotes. Rework the logic that goes into setting dataset options on the root pool dataset while we're here -- added two new variables (which can be altered via scripting) ZFSBOOT_POOL_CREATE_OPTIONS and also ZFSBOOT_BOOT_POOL_CREATE_OPTIONS for setting pool/dataset attributes at the time of pool creation. The former is for setting options on the root pool (zroot) and the latter is for setting options on the optional separate boot pool (bootpool) implicitly enabled when using either GELI or MBR. The default value for the root pool variable (ZFSBOOT_POOL_CREATE_OPTIONS) is "-O compress=lz4 -O atime=off" and the default value for separate boot pool variable (ZFSBOOT_BOOT_POOL_CREATE_OPTIONS) is NULL (no additional options for the separate boot pool dataset). Reviewed by: allanjude MFC after: 7 days X-MFC-with: r266107-266109 Notes: svn path=/head/; revision=266555
* Fix the "disks" variable reuse.Ollivier Robert2014-05-151-3/+6
| | | | | | | | | | | | | | | | It starts off being used to track the grammar for the number of disks (singular vs plural) and then it is reused as the list of available disks. Replace the variable with disks_grammar and move 'disk' and 'disks' to msg_ vars so they can be translated in the future. Submitted by: Allan Jude <freebsd@allanjude.com> Reviewed by: roberto MFC after: 2 weeks Sponsored by: ScaleEngine Inc. Notes: svn path=/head/; revision=266109
* Updates to the datasets created by zfsboot.Ollivier Robert2014-05-151-8/+9
| | | | | | | | | | | | | | | Set compress=lz4 for the entire pool, removing it from the individual datasets Remove exec=no from /usr/src, breaks the test suite. Submitted by: Allan Jude <freebsd@allanjude.com> Reviewed by: roberto MFC after: 2 weeks Sponsored by: ScaleEngine Inc. Notes: svn path=/head/; revision=266108
* Here is a patch for the bsdinstall root-on-zfs stuff that adds optionalOllivier Robert2014-05-151-16/+93
| | | | | | | | | | | | encryption for swap, and optional gmirror for swap (which can be combined) Submitted by: Allan Jude <freebsd@allanjude.com> Requested By: roberto Sponsored By: ScaleEngine Inc. MFC after: 2 weeks Notes: svn path=/head/; revision=266107
* Update zfsboot to coincide with r264840 to bsdconfig(8) addingDevin Teske2014-04-231-23/+71
| | | | | | | | | | | GEOM support (thereby adding GEOM support to the disk selection menu of bsdinstall(8)'s `zfsboot' module updated herein). MFC after: 1 week X-MFC-with: 264840 Notes: svn path=/head/; revision=264841
* When merging docsinstall and zfsboot updates to stable/9 it was discoveredDevin Teske2014-04-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that the slightly older dialog(1) requires --separate-output when using the --checklist widget to force response to produce unquoted values (whereas in stable/10 --checklist widget without --separate-output will only quote the checklist labels in the response if the label is multi-word (contains any whitespace). Since these enhancements (see revisions 263956 and 264437) were developed originally on 10, the --separate-output option was omitted. When merged to stable/9, we (Allan Jude) and I found during testing that the "always- quoting" of the response was causing things like struct interpolation to fail (`f_struct device_$dev' would produce `f_struct device_\"da0\"' for example -- literal quotes inherited from dialog(1) --checklist response). To see the behavior, execute the following on stable/9 versus stable/10: dialog --checklist disks: 0 0 0 da0 "" off da1 "" off Check both items and hit enter. On stable/10, the response is: da0 da1 On stable/9 the response is: "da0" "da1" If you use the --separate-output option, the response is the same for both: da0 da1 So applying --separate-output on every platform until either one of two things occurs 1) dialog(1,3) gets synchronized between stable/9, higher or 2) we drop support for stable/9. MFC after: 3 days Reviewed by: Allan Jude Notes: svn path=/head/; revision=264488
* Revert r263638 (create /root dataset) for now as it breaks install and needsBryan Drewery2014-03-261-2/+0
| | | | | | | more work in cases such as single-user mode. Notes: svn path=/head/; revision=263768
* Create a root dataset so that /root is outside of the boot environment.Bryan Drewery2014-03-221-0/+2
| | | | | | | | Discussed with: dteske on sysinstall@ MFC after: 1 month Notes: svn path=/head/; revision=263638
* When using a bootpool, set the cachefile property so that it getsDevin Teske2013-12-191-1/+7
| | | | | | | | | imported automatically upon reboot to the newly installed system. MFC after: 1 day Notes: svn path=/head/; revision=259598
* Fix a regression that occurred with SVN revisions 259474 and 259476 whereDevin Teske2013-12-191-2/+4
| | | | | | | | | | | | | | | | | installation to 3-4+ (depending on vdev type) vdevs would result in odd error messages where the zpool `create' command appeared to repeat itself (an artifact of printf when you supply too many arguments -- caused by neglecting to properly quote the multi-word expansion of $*vdevs when creating the pool(s)). Example error below (taken from bsdinstall_log): DEBUG: zfs_create_boot: Creating root pool... DEBUG: zfs_create_boot: zpool create -o altroot=/mnt -m none -f "zroot" \ ada0p3.nop ada1p3.nopzpool create ada2p3.nop "ada3p3.nop" DEBUG: zfs_create_boot: retval=1 <output below> cannot open 'ada1p3.nopzpool': no such GEOM provider Notes: svn path=/head/; revision=259597
* Auto-enable 4k sector alignment when disk encryption is requested (it isDevin Teske2013-12-161-0/+1
| | | | | | | | | | required in such a case). But don't prevent the user from pointing the gun at his/her foot -- you can disable 4k alignment after enabling geli). MFC after: 3 days Notes: svn path=/head/; revision=259481
* Fix a long-standing edge-case that would result in a ghosted `zroot' poolDevin Teske2013-12-161-0/+6
| | | | | | | | | | | | | | and subsequent headaches caused by multiple pools with the same name. Specifically, blast away any labels on the designated swap partition. Problem was when you install to a given layout *with* swap and then turn around and re-install the same layout *without* swap (we weren't doing a labelclear for the swap device, so would end up with an "UNAVAIL" status zroot pool that may only exist in the pool cache). MFC after: 3 days Notes: svn path=/head/; revision=259480
* Add kern.geom.label.disk_ident.enable="0" to loader.conf(5).Devin Teske2013-12-161-0/+3
| | | | | | | | Discussed on: -current, -stable MFC after: 3 days Notes: svn path=/head/; revision=259479
* De-uglify the geli(8)-setup infobox by adding a newline.Devin Teske2013-12-161-1/+1
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=259478
* fletcher4 is currently the default.Devin Teske2013-12-161-1/+1
| | | | | | | | Discussed on: -current MFC after: 3 days Notes: svn path=/head/; revision=259477
* Improve default ZFS disk layout (tested):Devin Teske2013-12-161-200/+195
| | | | | | | | | | | | | | | | | | | | + For GPT, always provision zfs# partition after swap [for resizability] + For MBR, always use a boot pool to relialy place root vdevs at EOD NB: Fixes edge-cases where MBR combination failed boot (e.g. swap-less) + Generalize boot pool logic so it can be used for any scheme (namely MBR) + Update existing comments and some whitespace fixes + Change some variable names to make reading/debugging the code easier in zfs_create_boot() (namely prepend zroot_ or bootpool_ to property) + Because zroot vdevs are at EOD, no longer need to calculate partsize (vdev consumes remaining space after allocating swap) + Optimize processing of disks -- no reason to loop over the disks 3-4 separate times when we can logically use a single loop to do everything Discussed on: -stable MFC after: 3 days Notes: svn path=/head/; revision=259476
* Bug-fixes and debugging improvments:Devin Teske2013-12-161-145/+142
| | | | | | | | | | | | | | | | | | + De-obfuscate debugging to show actual values + Change graid(8) syntax; s/destroy/delete/ [destroy is not invalid syntax] + Log commands that were previously quiet + Added some new comemnts and updated some existing ones + Add missing local for `disk' used in zfs_create_boot() + Use $disks instead of multiply-expanding $* in zfs_create_boot() + Pedantically unset variable holding geli(8) passphrase after use + Pedantically add double-quotes around zpool names and zfs datasets + Fix quotation expansion for zpool_cache entries of loader.conf(5) + Some limited whitespace changes MFC after: 3 days Notes: svn path=/head/; revision=259474