-
Notifications
You must be signed in to change notification settings - Fork 3
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
Swap file #4
Conversation
There was a problem hiding this 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") |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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"?
There was a problem hiding this comment.
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:") |
There was a problem hiding this comment.
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.
Enable swap file function with hibernate resume for Ubuntu Server 18.04.