Skip to content

Commit 634ae89

Browse files
committed
feat: add lshw install script
Signed-off-by: nabil salah <nabil.salah203@gmail.com>
1 parent 23ebebd commit 634ae89

2 files changed

Lines changed: 52 additions & 0 deletions

File tree

initramfs.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,7 @@ main() {
708708
build_rtinfo
709709
build_seektime
710710
build_curl
711+
build_lshw
711712
build_zflist
712713
build_haveged
713714
build_wireguard

packages/lshw.sh

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
LSHW_VERSION="B.02.20"
2+
LSHW_CHECKSUM="5805eba5f31886582fff673c5dccdb3b"
3+
LSHW_LINK="https://github.com/lyonel/lshw/archive/refs/tags/${LSHW_VERSION}.tar.gz"
4+
5+
download_lshw() {
6+
download_file $LSHW_LINK $LSHW_CHECKSUM
7+
}
8+
9+
extract_lshw() {
10+
if [ ! -d "lshw-${LSHW_VERSION}" ]; then
11+
echo "[+] extracting: lshw-${LSHW_VERSION}"
12+
tar -xf ${DISTFILES}/lshw-${LSHW_VERSION}.tar.gz -C .
13+
fi
14+
}
15+
16+
prepare_lshw() {
17+
echo "[+] configuring lshw"
18+
export CC="${CC:-gcc}"
19+
export CXX="${CXX:-g++}"
20+
export CFLAGS="${CFLAGS:--Os -fomit-frame-pointer}"
21+
export CXXFLAGS="${CXXFLAGS:--Os -fomit-frame-pointer}"
22+
}
23+
24+
compile_lshw() {
25+
pushd src
26+
make ${MAKEOPTS}
27+
popd
28+
}
29+
30+
install_lshw() {
31+
pushd src
32+
make install
33+
popd
34+
}
35+
36+
build_lshw() {
37+
pushd "${WORKDIR}/lshw-${LSHW_VERSION}"
38+
39+
prepare_lshw
40+
compile_lshw
41+
install_lshw
42+
43+
popd
44+
}
45+
46+
registrar_lshw() {
47+
DOWNLOADERS+=(download_lshw)
48+
EXTRACTORS+=(extract_lshw)
49+
}
50+
51+
registrar_lshw

0 commit comments

Comments
 (0)