Skip to contentSkip to conversation

Issues with ubi utils Makefile

DISCUSSION Charles Manning 3 participants 5 messages Oct 21, 2010 – Oct 27, 2010 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

Hi All

I'm getting some errors trying to mount a ubinized volume with a more recent kernel and think it might be due to problems in the ubi utils distributed with Ubuntu Meerkat.

I thus thought I'd build from git

When I do a make install from inside the mtd-utils/ubi-utils it tries to place the binaries in /usr/local//usr/sbin.

Same happens if I try make install from mtd-utils/

Is something broken or am I driving it incorrectly?

-- Charles

#1 lore raw
Quoted 6 lines · Charles Manning

Hi All

I'm getting some errors trying to mount a ubinized volume with a more recent kernel and think it might be due to problems in the ubi utils distributed with Ubuntu Meerkat.

Quoted 8 lines

I thus thought I'd build from git

When I do a make install from inside the mtd-utils/ubi-utils it tries to place the binaries in /usr/local//usr/sbin.

Same happens if I try make install from mtd-utils/

Is something broken or am I driving it incorrectly?

Looks like Mike's commit broke it:

commit 96a4f76f2e9dad7fdbd6fd7740de44bc90d5769e
Author: Mike Frysinger <[email protected]>

Unify all common build system parts

I've quickly cooked this fix, does it work for you? Mike, are you ok with this?

Quoted 1 line

From 69148e5bb5b0aa546c097a76e293585b3a839e0c Mon Sep 17 00:00:00 2001

From: Artem Bityutskiy <[email protected]>
Date: Mon, 25 Oct 2010 21:54:47 +0300
Subject: [PATCH] mtd-utils: fix make install

Commit 96a4f76f2e9dad7fdbd6fd7740de44bc90d5769e broke 'make install'. Before that commit, $DESTDIR was undefined, so ${DESTDIR}/${SBINDIR} was /usr/sbin, and after the commit $DESTDIR became /usr/local, so ${DESTDIR}/${SBINDIR} became /usr/local//usr/sbin, which is wrong.

Fix this by making $DESTDIR become the distination directory of installing, i.e. 'DESTDIR ?= /usr' and making SBINDIR become just 'sbin'.

While we are on it, fix $MANDIR similarly, and remove $PREFIX and $EXEC_PREFIX variables, which become unneeded.

---
 common.mk |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
common.mk +3 -6
index a55c548..2e4452f 100644
@@ -20,12 +20,9 @@ ifneq ($(WITHOUT_LARGEFILE), 1)
   CPPFLAGS += -D_FILE_OFFSET_BITS=64
 endif
 
-DESTDIR ?= /usr/local
-PREFIX=/usr
-EXEC_PREFIX=$(PREFIX)
-SBINDIR=$(EXEC_PREFIX)/sbin
-MANDIR=$(PREFIX)/share/man
-INCLUDEDIR=$(PREFIX)/include
+DESTDIR ?= /usr
+SBINDIR=sbin
+MANDIR=share/man
 
 ifndef BUILDDIR
 ifeq ($(origin CROSS),undefined)
Signature · 5 lines
1.7.2.3

-- 
Best Regards,
Artem Bityutskiy (Битюцкий Артём)
#2 lore raw
Quoted 4 lines · Artem Bityutskiy

Commit 96a4f76f2e9dad7fdbd6fd7740de44bc90d5769e broke 'make install'. Before that commit, $DESTDIR was undefined, so  ${DESTDIR}/${SBINDIR} was /usr/sbin, and after the commit $DESTDIR became /usr/local, so ${DESTDIR}/${SBINDIR} became /usr/local//usr/sbin, which is wrong.

that isnt really true. DESTDIR had value in makefiles before my changes.

Quoted 2 lines

Fix this by making $DESTDIR become the distination directory of installing, i.e. 'DESTDIR ?= /usr' and making SBINDIR become just 'sbin'.

i'd rather we change DESTDIR to match the standard -- it's a "root" prefix only. so the default should be:
DESTDIR ?=
-mike

#3 lore raw
Quoted 6 lines · Mike Frysinger
Quoted 4 lines · Artem Bityutskiy

Commit 96a4f76f2e9dad7fdbd6fd7740de44bc90d5769e broke 'make install'. Before that commit, $DESTDIR was undefined, so  ${DESTDIR}/${SBINDIR} was /usr/sbin, and after the commit $DESTDIR became /usr/local, so ${DESTDIR}/${SBINDIR} became /usr/local//usr/sbin, which is wrong.

Quoted 8 lines

that isnt really true.  DESTDIR had value in makefiles before my changes.

Quoted 2 lines

Fix this by making $DESTDIR become the distination directory of installing, i.e. 'DESTDIR ?= /usr' and making SBINDIR become just 'sbin'.

i'd rather we change DESTDIR to match the standard -- it's a "root" prefix only.  so the default should be:
DESTDIR ?=

i guess this is also why i never noticed before. i never do plain make install since i'm not root and i dont want it clobbering things. i always do make install DESTDIR=$PWD/foo when testing and in that regard, it works fine. so i guess we want this simple change:

common.mk +1 -1
@@ -20,7 +20,7 @@ ifneq ($(WITHOUT_LARGEFILE), 1)
   CPPFLAGS += -D_FILE_OFFSET_BITS=64
 endif
 
-DESTDIR ?= /usr/local
+DESTDIR?=
 PREFIX=/usr
 EXEC_PREFIX=$(PREFIX)
 SBINDIR=$(EXEC_PREFIX)/sbin

-mike

#4 lore raw
Quoted 23 lines · Mike Frysinger
Quoted 6 lines · Mike Frysinger
Quoted 4 lines · Artem Bityutskiy

Commit 96a4f76f2e9dad7fdbd6fd7740de44bc90d5769e broke 'make install'. Before that commit, $DESTDIR was undefined, so ${DESTDIR}/${SBINDIR} was /usr/sbin, and after the commit $DESTDIR became /usr/local, so ${DESTDIR}/${SBINDIR} became /usr/local//usr/sbin, which is wrong.

Quoted 8 lines

that isnt really true. DESTDIR had value in makefiles before my changes.

Quoted 2 lines

Fix this by making $DESTDIR become the distination directory of installing, i.e. 'DESTDIR ?= /usr' and making SBINDIR become just 'sbin'.

i'd rather we change DESTDIR to match the standard -- it's a "root" prefix only. so the default should be:
DESTDIR ?=

i guess this is also why i never noticed before. i never do plain make install since i'm not root and i dont want it clobbering things. i always do make install DESTDIR=$PWD/foo when testing and in that regard, it works fine. so i guess we want this simple change:

common.mk ifneq ($(WITHOUT_LARGEFILE), 1) · line 26

Quoted 8 lines
common.mk +1 -1
@@ -20,7 +20,7 @@ ifneq ($(WITHOUT_LARGEFILE), 1)
   CPPFLAGS += -D_FILE_OFFSET_BITS=64
 endif
 
-DESTDIR ?= /usr/local
+DESTDIR?=
 PREFIX=/usr
 EXEC_PREFIX=$(PREFIX)
 SBINDIR=$(EXEC_PREFIX)/sbin

Ok, pushed, made you the author, fabricated your signed-off-by as well. Thanks.

Signature · 2 lines
Best Regards,
Artem Bityutskiy (Битюцкий Артём)