[go: nahoru, domu]

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

Swap file #4

Merged
merged 7 commits into from
Oct 16, 2018
Merged

Swap file #4

merged 7 commits into from
Oct 16, 2018

Conversation

darrenwu-git
Copy link
Collaborator

Enable swap file function with hibernate resume for Ubuntu Server 18.04.

Copy link
Collaborator Author
@darrenwu-git darrenwu-git left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some changes required.

src/builder.go Outdated
defer chrootUmountBinded(writableMnt)
}

rplib.Shellexec("chroot", writableMnt, "update-grub")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command should be only in if swapenable is true.

curtinCfg = strings.Replace(curtinCfg, "###SWAP_PART_NUMBER###", strconv.FormatInt(int64(parts.Swap_nr), 10), -1)
curtinCfg = strings.Replace(curtinCfg, "###SWAP_PART_SIZE###", strconv.FormatInt(int64(configs.Configs.SwapSize*1024*1024), 10), -1)
curtinCfg = strings.Replace(curtinCfg, "###SWAP_FILE_SIZE###", "0", -1)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the "SWAP_FILE_SIZE" set to 0 if "configs.Configs.SwapSize > 0"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it must be "0" to disable swapfile in curtin.

src/helpers.go Outdated
}
tmp, _ := os.Create(swaptmp)
c1 := exec.Command("filefrag", "-v", swapFile)
c2 := exec.Command("grep", "0: 0.. 0:")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 0: could change if physical_offset is not 0.

@darrenwu-git darrenwu-git merged commit 85cf164 into Lyoncore:master Oct 16, 2018
@darrenwu-git darrenwu-git deleted the swap-file branch October 18, 2018 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant