Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/fscrypt: fix 32-bit build #235

Merged
merged 2 commits into from
Jun 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ jobs:
- <<: *build
go: 1.11.x

- name: Build and Unit Tests (32-bit)
before_install:
- sudo apt-get -y install gcc-multilib libpam0g-dev:i386
script:
- GO111MODULE=on go get github.com/google/fscrypt/cmd/fscrypt
- CGO_ENABLED=1 GOARCH=386 make

- name: Integration Tests
sudo: required
before_install: sudo apt-get -y install e2fsprogs
Expand Down
4 changes: 2 additions & 2 deletions cmd/fscrypt/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ func suggestEnablingEncryption(mnt *filesystem.Mount) string {
if err := unix.Statfs(mnt.Path, &statfs); err != nil {
return ""
}
pagesize := int64(os.Getpagesize())
if statfs.Bsize != pagesize && !util.IsKernelVersionAtLeast(5, 5) {
pagesize := os.Getpagesize()
if int64(statfs.Bsize) != int64(pagesize) && !util.IsKernelVersionAtLeast(5, 5) {
return fmt.Sprintf(`This filesystem uses a block size
(%d) other than the system page size (%d). Ext4
encryption didn't support this case until kernel v5.5.
Expand Down