Skip to content

Commit

Permalink
feat: Extract drivers to temporary folder (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
kroese authored Oct 13, 2024
1 parent 9c804b8 commit 2397a3e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 28 deletions.
25 changes: 25 additions & 0 deletions src/define.sh
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,31 @@ validVersion() {
return 1
}

addFolder() {

local src="$1"
local folder="/oem"

[ ! -d "$folder" ] && folder="/OEM"
[ ! -d "$folder" ] && folder="$STORAGE/oem"
[ ! -d "$folder" ] && folder="$STORAGE/OEM"
[ ! -d "$folder" ] && return 0

local msg="Adding OEM folder to image..."
info "$msg" && html "$msg"

local dest="$src/\$OEM\$/\$1/OEM"
mkdir -p "$dest"

! cp -Lr "$folder/." "$dest" && return 1

local file
file=$(find "$dest" -maxdepth 1 -type f -iname install.bat | head -n 1)
[ -f "$file" ] && unix2dos -q "$file"

return 0
}

migrateFiles() {
return 0
}
Expand Down
32 changes: 4 additions & 28 deletions src/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -704,8 +704,9 @@ addDriver() {
esac

local dest="$path/$target/$driver"
mv "$path/$driver/$folder" "$dest"
mkdir -p "$dest"

cp -Lr "$path/$driver/$folder/." "$dest"
return 0
}

Expand Down Expand Up @@ -756,7 +757,7 @@ addDrivers() {
# Workaround Virtio GPU driver bug
local dst="$src/\$OEM\$/\$\$/Drivers"
mkdir -p "$dst"
! cp -a "$dest/." "$dst" && return 1
! cp -Lr "$dest/." "$dst" && return 1
rm -rf "$dest/viogpudo"
;;
esac
Expand All @@ -769,37 +770,12 @@ addDrivers() {
return 0
}

addFolder() {

local src="$1"
local folder="/oem"

[ ! -d "$folder" ] && folder="/OEM"
[ ! -d "$folder" ] && folder="$STORAGE/oem"
[ ! -d "$folder" ] && folder="$STORAGE/OEM"
[ ! -d "$folder" ] && return 0

local msg="Adding OEM folder to image..."
info "$msg" && html "$msg"

local dest="$src/\$OEM\$/\$1/OEM"
mkdir -p "$dest"

! cp -a "$folder/." "$dest" && return 1

local file
file=$(find "$dest" -maxdepth 1 -type f -iname install.bat | head -n 1)
[ -f "$file" ] && unix2dos -q "$file"

return 0
}

updateImage() {

local dir="$1"
local asset="$2"
local language="$3"
local tmp="/run/shm/img"
local tmp="/tmp/install"
local file="autounattend.xml"
local org="${file//.xml/.org}"
local dat="${file//.xml/.dat}"
Expand Down

0 comments on commit 2397a3e

Please sign in to comment.