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

Initial support for rootlesskit to replace fakeroot #103

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion builder/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ func (p *Package) BuildYpkg(notif PidNotifier, usr *UserInfo, pman *EopkgManager
ymlFile := filepath.Join(wdir, filepath.Base(p.Path))

// Now build the package
cmd := fmt.Sprintf("/bin/su %s -- fakeroot ypkg-build -D %s %s", BuildUser, wdir, ymlFile)
cmd := fmt.Sprintf("/bin/su %s -- rootlesskit ypkg-build -D %s %s", BuildUser, wdir, ymlFile)
if DisableColors {
cmd += " -n"
}
Expand Down
1 change: 1 addition & 0 deletions builder/eopkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ func (e *EopkgManager) Upgrade() error {
"abi-wizard",
"iproute2",
"sccache",
"rootlesskit",
}

if err := ChrootExec(e.notif, e.root, eopkgCommand("eopkg upgrade -y")); err != nil {
Expand Down
8 changes: 8 additions & 0 deletions builder/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,14 @@ func AddBuildUser(rootfs string) error {
return fmt.Errorf("Failed to add build user to system, reason: %w\n", err)
}

if err := commands.AddUserSubUserRange(rootfs, BuildUser, 100000, 65536); err != nil {
return fmt.Errorf("Failed to write /etc/subuid file, reason: %w\n", err)
}

if err := commands.AddUserSubGroupRange(rootfs, BuildUser, 100000, 65536); err != nil {
return fmt.Errorf("Failed to write /etc/subgid file, reason: %w\n", err)
}

return nil
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/cavaliergopher/grab/v3 v3.0.1
github.com/cheggaaa/pb/v3 v3.1.5
github.com/coreos/go-systemd/v22 v22.5.0
github.com/getsolus/libosdev v0.0.0-20181023041421-9ab0f4b463fd
github.com/getsolus/libosdev v0.0.0-20240528220548-d3601e826637
github.com/go-git/go-billy/v5 v5.5.0
github.com/go-git/go-git/v5 v5.12.0
gitlab.com/slxh/go/powerline v0.1.0
Expand Down
10 changes: 10 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
github.com/getsolus/libosdev v0.0.0-20181023041421-9ab0f4b463fd h1:QZoSqUIKIFeqhImxNk1cdY7M4n8JVZxTzuhP+Y0DaK8=
github.com/getsolus/libosdev v0.0.0-20181023041421-9ab0f4b463fd/go.mod h1:8P4U+IYO8T6nRPLlC6qv1wMFcc0vK0vMVDCuyiFTTLg=
github.com/getsolus/libosdev v0.0.0-20240528214822-149f538ed58e h1:JrNEMklhvmy4K2h4/BQRwBHus8hOlufn/qH9BJi2V94=
github.com/getsolus/libosdev v0.0.0-20240528214822-149f538ed58e/go.mod h1:8P4U+IYO8T6nRPLlC6qv1wMFcc0vK0vMVDCuyiFTTLg=
github.com/getsolus/libosdev v0.0.0-20240528215907-24e15ca78130 h1:g0h6vYDvuSrKPGRn5JT2dCnfYnJfE4MYNrG3CJWKNcE=
github.com/getsolus/libosdev v0.0.0-20240528215907-24e15ca78130/go.mod h1:8P4U+IYO8T6nRPLlC6qv1wMFcc0vK0vMVDCuyiFTTLg=
github.com/getsolus/libosdev v0.0.0-20240528220039-4fcbaac5230a h1:nuFqvm/ULwyboMbjJ9g1W5Oa4MJZx8CM0jglVtVi7FQ=
github.com/getsolus/libosdev v0.0.0-20240528220039-4fcbaac5230a/go.mod h1:8P4U+IYO8T6nRPLlC6qv1wMFcc0vK0vMVDCuyiFTTLg=
github.com/getsolus/libosdev v0.0.0-20240528220436-ab5b63433a1e h1:/eYKDYO0GAgqcCY3llivHcjXf0Sa22YNGy0N/B56YAE=
github.com/getsolus/libosdev v0.0.0-20240528220436-ab5b63433a1e/go.mod h1:8P4U+IYO8T6nRPLlC6qv1wMFcc0vK0vMVDCuyiFTTLg=
github.com/getsolus/libosdev v0.0.0-20240528220548-d3601e826637 h1:suWW+9urtrRHInhn6dRNFEFtmrKrDXh1GbyHGYLMrKU=
github.com/getsolus/libosdev v0.0.0-20240528220548-d3601e826637/go.mod h1:8P4U+IYO8T6nRPLlC6qv1wMFcc0vK0vMVDCuyiFTTLg=
github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY=
github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4=
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI=
Expand Down