-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable udev rules more eagerly #30
Open
mmalter-at-gandi
wants to merge
1
commit into
Gandi:master
Choose a base branch
from
mmalter-at-gandi:fix-mounting-method
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,55 @@ decompress_lz4_kernel() { | |
done | ||
} | ||
|
||
is_version_number() { | ||
( echo "${1}" | grep -q "^[0-9\.]*$" ) && return 0 || return 1 | ||
} | ||
|
||
debian_version() { | ||
etc_version=`cat /etc/debian_version` | ||
if is_version_number "${etc_version}"; then | ||
echo "${etc_version}" | ||
return 0 | ||
else | ||
echo "Undefined debian version" | ||
return 1 | ||
fi | ||
} | ||
|
||
distro_name() { | ||
if [ -f /etc/os-release ]; then | ||
. /etc/os-release | ||
echo "${ID}" | ||
return 0 | ||
else | ||
# We use head to crop the "No LSB modules are available." message. | ||
lsb_release -is | head -n 1 | ||
return 0 | ||
fi | ||
} | ||
|
||
is_debian() { | ||
name=`distro_name` | ||
if [ "${name}" = 'Debian' ] || [ "${name}" = 'debian' ]; then | ||
return 0 | ||
else | ||
return 1 | ||
fi | ||
} | ||
|
||
is_ubuntu() { | ||
name=`distro_name` | ||
if [ "${name}" = 'Ubuntu' ] || [ "${name}" = 'ubuntu' ]; then | ||
return 0 | ||
else | ||
return 1 | ||
fi | ||
} | ||
|
||
debian_major_version() { | ||
debian_version | cut -d '.' -f 1 | ||
} | ||
|
||
case "$1" in | ||
configure|upgrade) | ||
|
||
|
@@ -151,39 +200,36 @@ case "$1" in | |
# deduce the boot order. | ||
mount_start=20 | ||
|
||
# debian | ||
debversion=$(cat /etc/debian_version) | ||
if is_debian; then | ||
major_version=`debian_major_version` | ||
# etch | ||
if [ ${major_version} -eq 4 ]; then | ||
mount_start=11 | ||
fi | ||
|
||
# LSB | ||
lsb='' | ||
if command -v lsb_release > /dev/null; then | ||
lsb=$(command -v lsb_release) | ||
fi | ||
# lenny | ||
if [ ${major_version} -eq 5 ]; then | ||
mount_start=11 | ||
fi | ||
|
||
lsb_release='' | ||
lsb_distrib='' | ||
if [ ! -z ${lsb} ]; then | ||
lsb_release=$("${lsb}" -rs) | ||
lsb_distrib=$("${lsb}" -is) | ||
fi | ||
# Debian stretch | ||
if [ ${major_version} -ge 9 ]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Debian stretch was identified by |
||
disable_udev_disk_rules | ||
fi | ||
decompress_lz4_kernel | ||
|
||
# lenny | ||
ret=$(expr match "$debversion" '^5.') | ||
if [ $ret -ge 2 ]; then | ||
mount_start=11 | ||
fi | ||
|
||
# etch | ||
ret=$(expr match "$debversion" '^4.') | ||
if [ $ret -ge 2 ]; then | ||
mount_start=11 | ||
if is_ubuntu; then | ||
major_version=`debian_major_version` | ||
if [ ${major_version} -gt 17 ]; then | ||
disable_udev_disk_rules | ||
fi | ||
decompress_lz4_kernel | ||
fi | ||
|
||
# squeeze | ||
# since this version initscripts management use dependancies. | ||
# update-rc.d will use the correct number to start the service | ||
# at the right moment : after checkroot.sh and rw remount | ||
|
||
# mount_start should be configured sothat it start the service after | ||
# checkroot.sh and rw remount | ||
update-rc.d gandi-mount start ${mount_start} S . 2>&1 | \ | ||
egrep -v "warning:.*match LSB" | \ | ||
grep -q "Adding system startup" || true | ||
|
@@ -193,22 +239,6 @@ case "$1" in | |
egrep -v "warning:.*match LSB" | \ | ||
grep -q "Adding system startup" || true | ||
|
||
# Debian stretch | ||
if [ 'Debian' = "${lsb_distrib}" ] || [ 'debian' = "${lsb_distrib}" ]; then | ||
if [ `echo "${lsb_release}" | cut -d'.' -f1` -gt 8 ]; then | ||
disable_udev_disk_rules | ||
fi | ||
decompress_lz4_kernel | ||
fi | ||
|
||
# Ubuntu bionic | ||
if [ 'Ubuntu' = "${lsb_distrib}" ] || [ 'ubuntu' = "${lsb_distrib}" ]; then | ||
if [ `echo "${lsb_release}" | cut -d'.' -f1` -gt 17 ]; then | ||
disable_udev_disk_rules | ||
fi | ||
decompress_lz4_kernel | ||
fi | ||
|
||
# the system uses autofs and customer rules handle /srv | ||
if autofs_installed && autofs_handle_srv; then | ||
disable_udev_disk_rules | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.