Skip to content

Commit

Permalink
Merge pull request #68 from peng9808/main
Browse files Browse the repository at this point in the history
fix kylin10 can not install problem
  • Loading branch information
peng9808 authored Mar 29, 2024
2 parents 6214215 + 4cf3fd5 commit 914242e
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 9 deletions.
3 changes: 2 additions & 1 deletion docker-drbd9/Dockerfile.kylin10
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ RUN wget --no-check-certificate https://pkg.linbit.com/downloads/drbd/"$([[ $DRB

# these are now the kmod pkgs:
COPY /pkgs /pkgs

COPY /drbdUtils.tar.gz /
COPY /install-drbdutils.sh /
COPY /entry.sh /
RUN chmod +x /entry.sh

Expand Down
Binary file added docker-drbd9/drbdUtils.tar.gz
Binary file not shown.
16 changes: 10 additions & 6 deletions docker-drbd9/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ kos::fromsrc() {
# cd $(ls -1 | head -1) || die "Could not cd"
cd drbd-* || die "Could not cd to drbd src dir"
make $LB_MAKEOPTS

cp /drbdUtils.tar.gz /pkgs_root/drbd-utils.tar.gz
cp /install-drbdutils.sh /pkgs_root/install-drbdutils.sh
nsenter --target 1 --mount --uts --ipc --net --pid chmod +x /root/install-drbdutils.sh
nsenter --target 1 --mount --uts --ipc --net --pid /root/install-drbdutils.sh
}

kos::rpm::extract() {
Expand Down Expand Up @@ -242,17 +247,15 @@ if [ -z "$OS_KERNEL" ]; then
debug "The system parameters are obtained successfully (OS_KERNEL)"
exit 1
fi
result=$(lbdisttool.py --os-release $HOSTRELEASE -l || echo "")
substr="${result:0:3}"

drbd_rpm=$(find "$RPMDIR" -type f -name "*$OS_KERNEL*" -print -quit)
var1="$OS_KERNEL"
matchvar="${var1}.rpm"
drbd_rpm=$(find "$RPMDIR" -type f -name "*${matchvar}" -print -quit)
if [ -n "$drbd_rpm" ]; then
utils_rpm=$(find "$RPMDIR" -type f -name "drbd-utils*" -print -quit)
if [[ -n "$drbd_rpm" && -n "$utils_rpm" ]]; then
cp $drbd_rpm /pkgs_root/drbd.rpm
cp $utils_rpm /pkgs_root/drbd_utils.rpm
nsenter --version
nsenter --target 1 --mount --uts --ipc --net --pid ls /root/
nsenter --target 1 --mount --uts --ipc --net --pid rpm -ivh /root/drbd_utils.rpm
nsenter --target 1 --mount --uts --ipc --net --pid rpm -ivh /root/drbd.rpm
exit_code=$?
Expand All @@ -274,7 +277,8 @@ if [ -n "$drbd_rpm" ]; then
else debug "There is no corresponding kernel version rpm package or drbd-utils rpm package"
fi
else
drbd_deb=$(find "$DEBDIR" -type f -name "*$OS_KERNEL*" -print -quit)
matchvar="${var1}.deb"
drbd_deb=$(find "$DEBDIR" -type f -name "*${matchvar}" -print -quit)
utils_deb=$(find "$DEBDIR" -type f -name "drbd-utils*" -print -quit)
if [[ -n "$drbd_deb" && -n "$utils_deb" ]]; then
cp $drbd_deb /pkgs_root/drbd.deb
Expand Down
16 changes: 16 additions & 0 deletions docker-drbd9/install-drbdutils.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash -x

# 安装所需软件包
yum install -y build-essential wget flex automake

tar xf /root/drbd-utils.tar.gz

cd /root/drbd-utils/

./autogen.sh

./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc

make tools

find ./user -type f -executable -name 'drbd[a-z]*' -exec mv -v {} /usr/local/bin/ \;
11 changes: 9 additions & 2 deletions docker-shipper/entrypoint.adapter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,16 @@ echo "OS_KERNEL:$1"
export DRBD_EXIST='no'
export DRBD_RMP_INSTALL='no'
export OS_KERNEL=$1
if LB_HOW=shipped_modules source /entry.sh ; then
if [[ $host_dist == 'kylin10' ]]; then
LB_HOW=compile
else
LB_HOW=shipped_modules
fi
if [[ $LB_HOW == 'shipped_modules' ]]; then
source /entry.sh
echo "Successfully loaded shipped module"
elif LB_HOW=compile source /entry.sh ; then
elif [[ $LB_HOW == 'compile' ]]; then
source /entry.sh
echo "Successfully loaded compiled module"
fi

Expand Down

0 comments on commit 914242e

Please sign in to comment.