contributed them to this project, along with several miscellaneous
improvements.
+* Martin Whitaker (other@martin-whitaker.me.uk) added 64-bit support
+ to the ext4fs driver.
+
* Emerson Barcelos (emerson_freitas@yahoo.com.br) wrote the code for
enabling Intel VMX support (the enable_and_lock_vmx token in
refind.conf).
+0.10.4 (?/??/2016):
+-------------------
+
+- Tweaked refind-install to do a better job of detecting disks other
+ than /dev/sd? and /dev/hd? devices.
+
0.10.3 (4/24/2016):
-------------------
Package: refind
Architecture: amd64 i386 arm64
-Depends: debconf, efibootmgr, openssl, sbsigntool, parted, ${misc:Depends}
+Depends: debconf, efibootmgr, openssl, sbsigntool, parted, util-linux, ${misc:Depends}
Description: boot manager for EFI-based computers
A graphical boot manager for EFI- and UEFI-based computers, such as all
Intel-based Macs and recent (most 2011 and later) PCs. rEFInd presents a
boot menu showing all the EFI boot loaders on the EFI-accessible
partitions, and optionally BIOS-bootable partitions on Macs and BIOS boot
- entries on UEFI PCs with CSMs. EFI-compatbile OSes, including Linux,
+ entries on UEFI PCs with CSMs. EFI-compatible OSes, including Linux,
provide boot loaders that rEFInd can detect and launch. rEFInd can launch
Linux EFI boot loaders such as ELILO, GRUB Legacy, GRUB 2, and 3.3.0 and
later kernels with EFI stub support. EFI filesystem drivers for ext2/3/4fs,
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
<p>Originally written: 3/14/2012; last Web page update:
-4/24/2016, referencing rEFInd 0.10.3</p>
+6/24/2016, referencing rEFInd 0.10.3</p>
<p>This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
<p>I know of a small number of pre-packaged versions of rEFInd, either in official OS repositories or in ancillary repositories:</p>
-<p class="sidebar"><b>Warning:</b> Ubuntu 16.04's <tt>sbsigntool</tt> package has a bug that causes the <tt>sbsign</tt> utility to crash randomly. (See <a href="https://bugs.launchpad.net/ubuntu/+source/sbsigntool/+bug/1574372">this bug report</a> for details.) When installing Ubuntu with Secure Boot active from the PPA, this bug will be triggered and is likely to prevent successful installation. Therefore, I recommend you disable Secure Boot or install from the Debian package (with the <tt>sbsigntool</tt> package <i>uninstalled</i>) to avoid this problem. This bug does not exist in Ubuntu 15.10 and earlier.</p>
-
<ul>
-<li><a name="ppa"><b>Ubuntu</b></a>—Although an official Ubuntu package
- isn't available, I've created a <a
- href="https://launchpad.net/~rodsmith/+archive/refind">rEFInd PPA</a> for
- Ubuntu. To use it, open a Terminal window and type <tt
- class="userinput">sudo apt-add-repository ppa:rodsmith/refind</tt>, then <tt
- class="userinput">sudo apt-get update</tt>. You can then type <tt
- class="userinput">sudo apt-get install refind</tt> to install the package.
- You'll be asked to decide whether to install rEFInd to the ESP when you
- first install it. Thereafter, the rEFInd version will update along with your
- other software. This package is built with GNU-EFI and is not signed with a
- Secure Boot key; however, the install script should sign the binary with a
- locally-generated key if it detects that your system uses Secure Boot. Thus,
- if you've previously installed one of my binaries on a Secure Boot system
- and added its key as a MOK, you'll have to add your local key when you
- reboot.</li>
+<li><b>Debian</b>—Debian added rEFInd 0.10.3 to its "sid" (unstable")
+ repository in June of 2016. Because most people don't use this
+ "bleeding-edge" version of the distribution, it is not yet a practical
+ option for most users; but it is on the way. You can download and
+ install it as a separate package <a
+ href="https://packages.debian.org/unstable/admin/refind">here.</a>
+ Debian's inclusion of rEFInd means that derivative distributions, such
+ as Ubuntu and Mint, will eventually receive rEFInd packages, too. Be
+ aware that Debian's package is not signed with a Secure Boot key,
+ although if the <tt>sbsigntool</tt> package is installed, the
+ installation scripts will generate and use their own Secure Boot
+ keys and sign the binary with them.</li>
+
+<li><b>Ubuntu</b>—Two Ubuntu-specific methods of installing rEFInd in
+ this distribution exist:
+
+ <ul>
+
+ <li>Ubuntu 16.10 ("Yakkety Yak") has synced the Debian package. As I
+ write (in late June, 2016), it's not yet available in the
+ repositories, but it should appear there eventually. Note that, like
+ the Debian package, this one is not signed for use with Secure Boot,
+ but if your system includes the <tt>sbsigntool</tt> package, the
+ installer will generate a local key for this purpose.</li>
+
+ <li>I've created a <a
+ href="https://launchpad.net/~rodsmith/+archive/refind">rEFInd
+ PPA</a> for Ubuntu. To use it, open a Terminal window and type <tt
+ class="userinput">sudo apt-add-repository ppa:rodsmith/refind</tt>,
+ then <tt class="userinput">sudo apt-get update</tt>. You can then
+ type <tt class="userinput">sudo apt-get install refind</tt> to
+ install the package. You'll be asked to decide whether to install
+ rEFInd to the ESP when you first install it. Thereafter, the rEFInd
+ version will update along with your other software. This package is
+ built with GNU-EFI and is not signed with a Secure Boot key;
+ however, the install script should sign the binary with a
+ locally-generated key if it detects that your system uses Secure
+ Boot. Thus, if you've previously installed one of my binaries on a
+ Secure Boot system and added its key as a MOK, you'll have to add
+ your local key when you reboot.</li>
+
+ </ul></li>
<li><b>Arch Linux</b>—You can obtain rEFInd from the Arch
repositories, in both a stable version (the <tt>refind-efi</tt> package
<p>Once rEFInd is installed, you can use it to manage SIP features; however, the rEFInd features needed to do this are disabled by default. You must uncomment or add two lines to your <tt>refind.conf</tt> file:</p>
-<p class="sidebar"><b>Note:</b> Apple code samples and technical discussions are filled with the acronym "CSR." I don't know what this acronym means, but as it appears to be used in preference to "SIP" or "rootless" when referring to specific values, I used it in the <tt>refind.conf</tt> files token names.</p>
+<p class="sidebar"><b>Note:</b> Apple code samples and technical discussions are filled with the acronym "CSR." I don't know what this acronym means, but as it appears to be used in preference to "SIP" or "rootless" when referring to specific values, I used it in the <tt>refind.conf</tt> file's token names.</p>
<ul>
}
/* calculate the first block number of the group */
-static __inline fsw_u32
+static __inline fsw_u64
fsw_ext4_group_first_block_no(struct ext4_super_block *sb, fsw_u32 group_no)
{
- return group_no * (fsw_u32)EXT4_BLOCKS_PER_GROUP(sb) +
+ return group_no * (fsw_u64)EXT4_BLOCKS_PER_GROUP(sb) +
sb->s_first_data_block;
}
fsw_status_t status;
void *buffer;
fsw_u32 blocksize;
- fsw_u32 groupcnt, groupno, gdesc_per_block, gdesc_bno, gdesc_index, metabg_of_gdesc;
+ fsw_u32 groupcnt, groupno, gdesc_per_block, gdesc_index, metabg_of_gdesc;
+ fsw_u64 gdesc_bno;
struct ext4_group_desc *gdesc;
int i;
struct fsw_string s;
if (vol->sb->s_rev_level == EXT4_DYNAMIC_REV &&
(vol->sb->s_feature_incompat & ~(EXT4_FEATURE_INCOMPAT_FILETYPE | EXT4_FEATURE_INCOMPAT_RECOVER |
EXT4_FEATURE_INCOMPAT_EXTENTS | EXT4_FEATURE_INCOMPAT_FLEX_BG |
- EXT4_FEATURE_INCOMPAT_META_BG)))
+ EXT4_FEATURE_INCOMPAT_64BIT | EXT4_FEATURE_INCOMPAT_META_BG)))
return FSW_UNSUPPORTED;
if (vol->sb->s_rev_level == EXT4_DYNAMIC_REV &&
gdesc_per_block = EXT4_DESC_PER_BLOCK(vol->sb);
// Read the group descriptors to get inode table offsets
- status = fsw_alloc(sizeof(fsw_u32) * groupcnt, &vol->inotab_bno);
+ status = fsw_alloc(sizeof(fsw_u64) * groupcnt, &vol->inotab_bno);
if (status)
return status;
// Get group descriptor table and block number of inode table...
gdesc = (struct ext4_group_desc *)((char *)buffer + gdesc_index * vol->sb->s_desc_size);
vol->inotab_bno[groupno] = gdesc->bg_inode_table_lo;
+ if (vol->sb->s_desc_size >= EXT4_MIN_DESC_SIZE_64BIT)
+ vol->inotab_bno[groupno] |= (fsw_u64)gdesc->bg_inode_table_hi << 32;
fsw_block_release(vol, gdesc_bno, buffer);
}
static fsw_status_t fsw_ext4_volume_stat(struct fsw_ext4_volume *vol, struct fsw_volume_stat *sb)
{
- sb->total_bytes = (fsw_u64)vol->sb->s_blocks_count_lo * vol->g.log_blocksize;
- sb->free_bytes = (fsw_u64)vol->sb->s_free_blocks_count_lo * vol->g.log_blocksize;
+ fsw_u64 count;
+
+ count = vol->sb->s_blocks_count_lo;
+ if (vol->sb->s_desc_size >= EXT4_MIN_DESC_SIZE_64BIT)
+ count |= (fsw_u64)vol->sb->s_blocks_count_hi << 32;
+ sb->total_bytes = count * vol->g.log_blocksize;
+
+ count = vol->sb->s_free_blocks_count_lo;
+ if (vol->sb->s_desc_size >= EXT4_MIN_DESC_SIZE_64BIT)
+ count |= (fsw_u64)vol->sb->s_free_blocks_count_hi << 32;
+ sb->free_bytes = count * vol->g.log_blocksize;
+
return FSW_SUCCESS;
}
static fsw_status_t fsw_ext4_dnode_fill(struct fsw_ext4_volume *vol, struct fsw_ext4_dnode *dno)
{
fsw_status_t status;
- fsw_u32 groupno, ino_in_group, ino_bno, ino_index;
+ fsw_u32 groupno, ino_in_group, ino_index;
+ fsw_u64 ino_bno;
fsw_u8 *buffer;
if (dno->raw)
// Is the requested block in this extent?
if(bno >= ext4_extent->ee_block && bno < ext4_extent->ee_block + ext4_extent->ee_len)
{
- extent->phys_start = ext4_extent->ee_start_lo + (bno - ext4_extent->ee_block);
+ extent->phys_start = ((fsw_u64)ext4_extent->ee_start_hi << 32) | ext4_extent->ee_start_lo;
+ extent->phys_start += (bno - ext4_extent->ee_block);
extent->log_count = ext4_extent->ee_len - (bno - ext4_extent->ee_block);
return FSW_SUCCESS;
}
if(bno >= ext4_extent_idx->ei_block)
{
// Follow extent tree...
- status = fsw_block_get(vol, ext4_extent_idx->ei_leaf_lo, 1, (void **)&buffer);
+ fsw_u64 phys_bno = ((fsw_u64)ext4_extent_idx->ei_leaf_hi << 32) | ext4_extent_idx->ei_leaf_lo;
+ status = fsw_block_get(vol, phys_bno, 1, (void **)&buffer);
if (status)
return status;
buf_offset = 0;
struct fsw_volume g; //!< Generic volume structure
struct ext4_super_block *sb; //!< Full raw ext2 superblock structure
- fsw_u32 *inotab_bno; //!< Block numbers of the inode tables
+ fsw_u64 *inotab_bno; //!< Block numbers of the inode tables
fsw_u32 ind_bcnt; //!< Number of blocks addressable through an indirect block
fsw_u32 dind_bcnt; //!< Number of blocks addressable through a double-indirect block
fsw_u32 inode_size; //!< Size of inode structure in bytes
# Revision history:
#
+# 0.10.4 -- Improved handling of disks (other than /dev/[sh]d? disks).
# 0.10.2 -- Improved Secure Boot detection in Linux, fixed --usedefault in OS X,
# and fixed bug that could cause mountesp to be installed as a FILE
# called /usr/local/bin in OS X.
# and EspFilesystem the filesystem (always "vfat")
FindLinuxESP() {
echo "The ESP doesn't seem to be mounted! Trying to find it...."
+ local Name
local Drive
local PartNum
local TableType
local DmStatus
local SkipIt
local Dmraid
- for Drive in `ls /dev/[sh]d?` ; do
+ for Name in `lsblk -r | grep disk | cut -f 1 -d " "` ; do
+ Drive="/dev/$Name"
SkipIt=0
Dmraid=`which dmraid 2> /dev/null`
if [ -x "$Dmraid" ] ; then
if [[ $EspFilesystem != 'vfat' ]] ; then
echo "$RootDir/$InstallDir doesn't seem to be on a VFAT filesystem. The ESP must be"
echo "mounted at $RootDir/boot or $RootDir/boot/efi and it must be VFAT! Aborting!"
- exit 1
+ if [[ -d /sys/firmware/efi ]] ; then
+ exit 1
+ else
+ echo "The computer appears to be running in BIOS mode and has no ESP. You should"
+ echo "create an ESP, and ideally boot in EFI mode, before installing rEFInd."
+ exit 0
+ fi
fi
echo "ESP was found at $InstallDir using $EspFilesystem"
} # FindMountedESP
Intel-based Macs and recent (most 2011 and later) PCs. rEFInd presents a
boot menu showing all the EFI boot loaders on the EFI-accessible
partitions, and optionally BIOS-bootable partitions on Macs and BIOS boot
-entries on UEFI PCs with CSMs. EFI-compatbile OSes, including Linux,
+entries on UEFI PCs with CSMs. EFI-compatible OSes, including Linux,
provide boot loaders that rEFInd can detect and launch. rEFInd can launch
Linux EFI boot loaders such as ELILO, GRUB Legacy, GRUB 2, and 3.3.0 and
later kernels with EFI stub support. EFI filesystem drivers for ext2/3/4fs,