This repository has been archived by the owner on Feb 17, 2023. It is now read-only.
forked from camptocamp/build-debian-cloud
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change the UUID of the root volume on first boot. Fixes #40
- Loading branch information
Showing
3 changed files
with
38 additions
and
0 deletions.
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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
### 2012-11-18 Anders Ingemann <[email protected]> ### | ||
|
||
#### Major changes: #### | ||
* Add `change-root-uuid` script | ||
(see [this issue for more info](https://github.com/andsens/ec2debian-build-ami/issues/40)) | ||
* Remove contrib and non-free from apt/sources.list | ||
(thanks to zack for finding this and James for the patch) | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
### BEGIN INIT INFO | ||
# Provides: change-root-uuid | ||
# Required-Start: | ||
# Required-Stop: | ||
# Should-Start: | ||
# Should-Stop: | ||
# Default-Start: 2 3 4 5 | ||
# Default-Stop: | ||
# Description: Changes the UUID of the root volume | ||
### END INIT INFO | ||
|
||
prog=$(basename $0) | ||
logger="logger -t $prog" | ||
|
||
device_path="/dev/xvda1" | ||
|
||
filesystem=`blkid | grep $device_path | sed 's#\(.*\):.*TYPE="\(.*\)".*#\2#'` | ||
|
||
case $filesystem in | ||
ext2) tune2fs -U random $device_path ;; | ||
ext3) tune2fs -U random $device_path ;; | ||
ext4) tune2fs -U random $device_path ;; | ||
*) $logger "The filesystem $filesystem was not recognized. Unable to change its UUID." ;; | ||
esac | ||
|
||
# Disable this script, it may only run once | ||
insserv -r $0 |
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