comtrya icon indicating copy to clipboard operation
comtrya copied to clipboard

Feature: Bootstrap pkgin on NetBSD

Open yonas opened this issue 1 year ago • 4 comments

Installing pkgin should be as simple as /usr/sbin/pkg_add pkgin.

        let privilege_provider =
            utilities::get_privilege_provider(&contexts).unwrap_or_else(|| "sudo".to_string());
        vec![Step {
            atom: Box::new(Exec {
                command: String::from("pkg_add"),
                arguments: vec![
                    String::from("pkgin"),
                ],
                privileged: true,
                privilege_provider: privilege_provider.clone(),
                ..Default::default()
            }),
            initializers: vec![],
            finalizers: vec![],
        }]

yonas avatar Nov 24 '24 23:11 yonas

Yea, this could be done in the bootstrap method. The only reason I've never gotten around to it was because of some of the configuration before that.

# From https://www.netbsd.org/docs/pkgsrc/using.html
# PATH="/usr/pkg/sbin:/usr/pkg/bin:$PATH"
# PKG_PATH="https://cdn.NetBSD.org/pub/pkgsrc/packages"
# PKG_PATH="$PKG_PATH/OPSYS/ARCH/VERSIONS/All/"
# export PATH PKG_PATH
# pkg_add pkgin

That is how I've always done it when setting up a new NetBSD system.

martintc avatar Nov 25 '24 04:11 martintc

If you want to implement the bootstrap method for the package provider, I can help you with that. Otherwise, I can do it.

martintc avatar Nov 26 '24 03:11 martintc

Thanks @martintc, if you could take the lead, that'd be great.

yonas avatar Nov 26 '24 04:11 yonas

I think to allow setting environment variables during bootstrap, with #515 , we should be able to accomplish it.

martintc avatar Nov 29 '24 17:11 martintc