You are not logged in.

#1 2016-08-24 23:50:44

jcjordyn120
Member
Registered: 2015-05-23
Posts: 40
Website

[SOLVED] PKGBUILD review request: busybox-norootreboot

i'm just created a PKGBUILD and I am about to push it to the aur. So I would like someone to review it for me.

its busybox, but set to allow other users to reboot.

Here is the PKGBUILD.

_pkgname=busybox
pkgname=$_pkgname-norootreboot
pkgver=1.25.0
pkgrel=1
pkgdesc="Utilities for rescue and embedded systems"
arch=("i686" "x86_64")
url="http://www.$_pkgname.net"
license=('GPL')
provides=("$_pkgname")
conflicts=("$_pkgname" "$_pkgname-static")
makedepends=("make" "gcc" "sed" "ncurses")
install=$_pkgname.install
source=(
  "$url/downloads/$_pkgname-$pkgver.tar.bz2"
)
md5sums=(
  'b05af9645076f75429a8683f8afcbdb3'
)

prepare() {
  cd "$_pkgname-$pkgver"
  cp  ../../halt.c init/halt.c
  make clean
  make defconfig
}

build() {
  cd "$_pkgname-$pkgver"
  make
}

package() {
  cd "$srcdir/$_pkgname-$pkgver"
  install -Dm755 $_pkgname $pkgdir/usr/bin/$_pkgname
}

Here is the line I changed in halt.c

//applet:IF_HALT(APPLET(halt, BB_DIR_SBIN, BB_SUID_MAYBE))
//applet:IF_HALT(APPLET_ODDNAME(poweroff, halt, BB_DIR_SBIN, BB_SUID_MAYBE, poweroff))
//applet:IF_HALT(APPLET_ODDNAME(reboot, halt, BB_DIR_SBIN, BB_SUID_MAYBE, reboot))

Last edited by jcjordyn120 (2016-09-27 16:53:18)


jcjordyn120 on irc.freenode.net #archlinux and #thelinuxgeekcommunity

Offline

#2 2016-08-25 00:08:28

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,461

Re: [SOLVED] PKGBUILD review request: busybox-norootreboot

That isn't going to work in the AUR, as your changed source file won't be available.

Offline

#3 2016-08-25 00:08:55

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,866

Re: [SOLVED] PKGBUILD review request: busybox-norootreboot

I'd use a patch for the halt.c file changes (the changes look a bit big for a sed command ).

----------------------------------------

The lines shown below reduce the human readability of the PKGBUILD a lot.
To me that's a bad thing.
It could make automating the writing of multiple PKGBUILDS easier, but i prefer human readability over easy automation.

provides=("$_pkgname")
conflicts=("$_pkgname" "$_pkgname-static")
install -Dm755 $_pkgname $pkgdir/usr/bin/$_pkgname

Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#4 2016-08-25 02:21:58

jcjordyn120
Member
Registered: 2015-05-23
Posts: 40
Website

Re: [SOLVED] PKGBUILD review request: busybox-norootreboot

I fixed the PKGBUILD

pkgname=busybox-norootreboot
pkgver=1.25.0
pkgrel=1
pkgdesc="Utilities for rescue and embedded systems"
arch=("i686" "x86_64")
url="http://www.busybox.net"
license=('GPL')
provides=("busybox")
conflicts=("busybox" "busybox-static")
makedepends=("make" "gcc" "sed" "ncurses")
install=busybox-norootreboot.install
source=(
  "$url/downloads/busybox-$pkgver.tar.bz2"
  "https://raw.githubusercontent.com/jcjordyn130/aur-misc/master/busybox-norootreboot/halt.patch"
  "https://raw.githubusercontent.com/jcjordyn130/aur-misc/master/busybox-norootreboot/halt.c"
)
md5sums=('b05af9645076f75429a8683f8afcbdb3'
         'b5ab29025a588785ec7888d03e87823c'
         '59a2c9ba582c2045630b1f7add482011')

prepare() {
  echo $pkgdir
  cd "busybox-$pkgver"
  patch -p1 -R < ../halt.patch
  make clean
  make defconfig
}

build() {
  cd "busybox-$pkgver"
  make
}

package() {
  cd "$srcdir/busybox-$pkgver"
  install -Dm755 busybox $pkgdir/usr/bin/busybox
}

jcjordyn120 on irc.freenode.net #archlinux and #thelinuxgeekcommunity

Offline

#5 2016-08-25 03:04:21

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,461

Re: [SOLVED] PKGBUILD review request: busybox-norootreboot

Kind of. Why do you have both the patch and the .c file there? And pulling from Master isn't generally a good idea, if it's just the patch, you could just include it with the PKGBUILD.

Offline

#6 2016-08-25 03:07:04

jcjordyn120
Member
Registered: 2015-05-23
Posts: 40
Website

Re: [SOLVED] PKGBUILD review request: busybox-norootreboot

how do you include a patch with the PKGBUILD

Last edited by jcjordyn120 (2016-08-25 03:08:52)


jcjordyn120 on irc.freenode.net #archlinux and #thelinuxgeekcommunity

Offline

#7 2016-08-25 04:16:51

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,461

Re: [SOLVED] PKGBUILD review request: busybox-norootreboot

Just put it in the same dir as the PKGBUILD, add the filename to the source array, and commit it in git when you commit everything else.

Last edited by Scimmia (2016-08-25 04:17:08)

Offline

#8 2016-08-26 17:38:49

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] PKGBUILD review request: busybox-norootreboot

Lone_Wolf wrote:

The lines shown below reduce the human readability of the PKGBUILD a lot.
To me that's a bad thing.
It could make automating the writing of multiple PKGBUILDS easier, but i prefer human readability over easy automation.

provides=("$_pkgname")
conflicts=("$_pkgname" "$_pkgname-static")
install -Dm755 $_pkgname $pkgdir/usr/bin/$_pkgname

I consider that perfectly readable...


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#9 2016-08-27 12:55:29

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,866

Re: [SOLVED] PKGBUILD review request: busybox-norootreboot

1. I may have phrased it wrong.
I feel that the lines using the value of $_pkgname are easier to understand for humans then the lines with _pkgname in them.
maybe "human understandable" would be clearer ?

2. It's a personal preference.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#10 2016-08-27 13:38:52

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: [SOLVED] PKGBUILD review request: busybox-norootreboot

This seems like an aweful lot of work to avoid one line in your sudoers file that would allow the same thing.  And perhaps one line in a shellrc file for an alias if you didn't want to have to type 'sudo reboot'.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#11 2016-08-28 04:27:37

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] PKGBUILD review request: busybox-norootreboot

Lone_Wolf wrote:

1. I may have phrased it wrong.
I feel that the lines using the value of $_pkgname are easier to understand for humans then the lines with _pkgname in them.
maybe "human understandable" would be clearer ?

2. It's a personal preference.

No, you phrased it perfectly (in the sense that it correctly described your meaning).
I can assure you I was not nitpicking over the meaning of the word "read".

I just wanted to point out that when you say #1 what you really mean is #2.

Your personal preference is for using the actual value, because you find it awkward to keep track of the variables... other people have no such problem and find $_pkgname to be highly intuitive and easy to follow the meaning of, and therefore prefer to use it.

In fact, I find using the $_pkgname helps keep track of the relationship between the name of the package and the url it is located at (or whatever else it is used for). For the same reason that it helps template the creation of multiple PKGBUILDs.
Using the _pkgname directly instead of the variable, would result in a PKGBUILD which I find more confusing (although still not challenging...).

So I just wanted to express my disinterest in watching you pressure others into following your personal preferences, in a case where neither is objectively preferable.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#12 2016-08-28 13:11:30

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: [SOLVED] PKGBUILD review request: busybox-norootreboot

The use or non-use of such variables is quite tangential to the current questions.  Either is acceptable and functional.  So lets stick to the more relevant topics of how to best patch/sed the source or other concrete issues of viability as a AUR package.

If there is more to be said on the use/non-use of such variables, it'd apply to all PKGBUILDs and might be best directed to aur-general, or the talk page of the PKGBUILD wiki.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#13 2016-08-28 13:20:23

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,866

Re: [SOLVED] PKGBUILD review request: busybox-norootreboot

Clear, Eschwartz.

I'll watch my wording wrt difference between personal preferences and errors more closely.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#14 2016-08-30 09:51:14

jcjordyn120
Member
Registered: 2015-05-23
Posts: 40
Website

Re: [SOLVED] PKGBUILD review request: busybox-norootreboot

Trilby wrote:

This seems like an aweful lot of work to avoid one line in your sudoers file that would allow the same thing.  And perhaps one line in a shellrc file for an alias if you didn't want to have to type 'sudo reboot'.

That's not the point. This is for people who want to reboot without having to be root.


jcjordyn120 on irc.freenode.net #archlinux and #thelinuxgeekcommunity

Offline

#15 2016-08-30 11:48:23

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: [SOLVED] PKGBUILD review request: busybox-norootreboot

No it still needs root access.  You are just giving them root access to that function in the init system rather than a shell alias.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#16 2016-08-31 02:29:32

jcjordyn120
Member
Registered: 2015-05-23
Posts: 40
Website

Re: [SOLVED] PKGBUILD review request: busybox-norootreboot

Trilby wrote:

No it still needs root access.  You are just giving them root access to that function in the init system rather than a shell alias.

Oh okay then, But still some things need to reboot the system and I don't like to run random things as root.


jcjordyn120 on irc.freenode.net #archlinux and #thelinuxgeekcommunity

Offline

#17 2016-08-31 10:36:46

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: [SOLVED] PKGBUILD review request: busybox-norootreboot

Not random things.  ONE thing.  I think you may not understand how sudo works.  You can specify that a anyone can run a specific command with sudo without a password.

The result would be that any user could reboot without needing a password.  They would not be able to run anything else as root though.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#18 2016-09-27 16:52:36

jcjordyn120
Member
Registered: 2015-05-23
Posts: 40
Website

Re: [SOLVED] PKGBUILD review request: busybox-norootreboot

Trilby wrote:

Not random things.  ONE thing.  I think you may not understand how sudo works.  You can specify that a anyone can run a specific command with sudo without a password.

The result would be that any user could reboot without needing a password.  They would not be able to run anything else as root though.

That one thing is busybox to be exact, also I know how sudo works.


jcjordyn120 on irc.freenode.net #archlinux and #thelinuxgeekcommunity

Offline

#19 2016-09-27 16:53:07

jcjordyn120
Member
Registered: 2015-05-23
Posts: 40
Website

Re: [SOLVED] PKGBUILD review request: busybox-norootreboot

Marking as solved


jcjordyn120 on irc.freenode.net #archlinux and #thelinuxgeekcommunity

Offline

Board footer

Powered by FluxBB